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