Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DCCALTruthShower.h
Go to the documentation of this file.
1 // $Id$
2 //
3 // File: DCCALTruthShower.h
4 // Created: Tue Nov 30 15:02:26 EST 2010
5 // Creator: davidl (on Linux ifarml6 2.6.18-128.el5 x86_64)
6 //
7 
8 #ifndef _DCCALTruthShower_
9 #define _DCCALTruthShower_
10 
11 #include <JANA/JObject.h>
12 #include <JANA/JFactory.h>
13 
14 class DCCALTruthShower:public jana::JObject{
15  public:
17 
19 
20  DCCALTruthShower( oid_t id,
21  float x, float y, float z,
22  float px, float py, float pz,
23  float E, float t,
24  bool primary, int track, int type,
25  int itrack=0) :
26  JObject( id ),
27  m_x( x ),
28  m_y( y ),
29  m_z( z ),
30  m_px( px ),
31  m_py( py ),
32  m_pz( pz ),
33  m_E( E ),
34  m_t( t ),
35  m_primary(primary),
36  m_track(track),
37  m_type(type),
38  m_itrack(itrack){}
39 
40  float x() const { return m_x; }
41  float y() const { return m_y; }
42  float z() const { return m_z; }
43  float t() const { return m_t; }
44  float px() const { return m_px; }
45  float py() const { return m_py; }
46  float pz() const { return m_pz; }
47  float E() const { return m_E; }
48  bool primary() const { return m_primary; }
49  int track() const { return m_track; }
50  int type() const { return m_type; }
51  int itrack() const { return m_itrack; }
52 
53  void toStrings(vector<pair<string,string> > &items)const{
54  AddString(items, "x(cm)", "%3.1f", x());
55  AddString(items, "y(cm)", "%3.1f", y());
56  AddString(items, "z(cm)", "%3.1f", z());
57  AddString(items, "px(MeV/c)", "%3.1f", px()*1000);
58  AddString(items, "py(MeV/c)", "%3.1f", py()*1000);
59  AddString(items, "pz(MeV/c)", "%3.1f", pz()*1000);
60  AddString(items, "E(MeV)", "%3.3f", E()*1000.0);
61  AddString(items, "t(ns)", "%3.1f", t());
62  AddString(items, "primary", "%d", primary());
63  AddString(items, "track", "%d", track());
64  AddString(items, "type", "%d", type());
65  AddString(items, "itrack", "%d", itrack());
66  }
67 
68  private:
69 
70  float m_x;
71  float m_y;
72  float m_z;
73  float m_px;
74  float m_py;
75  float m_pz;
76  float m_E;
77  float m_t;
78  bool m_primary;
79  int m_track;
80  int m_type;
81  int m_itrack;
82 };
83 
84 #endif // _DCCALTruthShower_
85 
Definition: track.h:16
float py() const
float t() const
float px() const
float pz() const
JOBJECT_PUBLIC(DCCALTruthShower)
int itrack() const
int type() const
float x() const
int track() const
void toStrings(vector< pair< string, string > > &items) const
float y() const
float z() const
bool primary() const
DCCALTruthShower(oid_t id, float x, float y, float z, float px, float py, float pz, float E, float t, bool primary, int track, int type, int itrack=0)
float E() const