StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StMcHit.hh
1 /***************************************************************************
2  *
3  * $Id: StMcHit.hh,v 2.14 2016/05/16 23:47:09 perev Exp $
4  * $Log: StMcHit.hh,v $
5  * Revision 2.14 2016/05/16 23:47:09 perev
6  * Coverity fix
7  *
8  * Revision 2.13 2012/03/01 16:48:29 perev
9  * method Browse() added
10  *
11  * Revision 2.12 2011/10/17 00:24:00 fisyak
12  * Add time of flight for hits
13  *
14  * Revision 2.10 2005/11/22 21:44:52 fisyak
15  * Add compress Print for McEvent, add Ssd collections
16  *
17  * Revision 2.9 2005/09/28 21:30:14 fisyak
18  * Persistent StMcEvent
19  *
20  * Revision 2.8 2004/01/13 21:02:51 fisyak
21  * Add inheritance from StObject
22  *
23  * Revision 2.7 2003/10/08 20:17:55 calderon
24  * -using <iostream>, std::cout, std::ostream.
25  * -changes in FTPC volume Id.
26  * o Causes changes in decoding of plane().
27  * o sector() is added.
28  * o print volumeId and sector() in the operator<<.
29  *
30  * Revision 2.6 2003/09/02 17:58:41 perev
31  * gcc 3.2 updates + WarnOff
32  *
33  * Revision 2.5 2000/06/06 02:58:41 calderon
34  * Introduction of Calorimeter classes. Modified several classes
35  * accordingly.
36  *
37  * Revision 2.4 2000/05/05 15:25:43 calderon
38  * Reduced dependencies and made constructors more efficient
39  *
40  * Revision 2.3 2000/04/17 23:01:15 calderon
41  * Added local momentum to hits as per Lee's request
42  *
43  * Revision 2.2 1999/12/14 07:04:49 calderon
44  * Numbering scheme as per SVT request.
45  *
46  * Revision 2.1 1999/11/19 19:06:33 calderon
47  * Recommit after redoing the files.
48  *
49  * Revision 2.0 1999/11/17 02:12:16 calderon
50  * Completely revised for new StEvent
51  *
52  * Revision 1.4 1999/09/24 01:23:16 fisyak
53  * Reduced Include Path
54  *
55  * Revision 1.3 1999/09/23 21:25:51 calderon
56  * Added Log & Id
57  * Modified includes according to Yuri
58  *
59  *
60  **************************************************************************/
61 #ifndef StMcHit_hh
62 #define StMcHit_hh
63 
64 #include "StObject.h"
65 #include "Stiostream.h"
66 #include "StThreeVectorF.hh"
67 #include "tables/St_g2t_hits_Table.h"
68 #include "StMcTrack.hh"
69 
70 class StMcHit : public StObject {
71 public:
72  enum EMcHitBits {
73  kMatched = BIT(23) // if hit has matched with reconstructed one
74  };
75  StMcHit() : mPosition(0,0,0), mLocalMomentum(0,0,0), mdE(0),mdS(0),mTof(0),mKey(0),mVolumeId(0),mParentTrack(0) {}
76  StMcHit(const StThreeVectorF& x,const StThreeVectorF& p,
77  Float_t de, Float_t ds, Float_t tof, Long_t k, Long_t volId, StMcTrack* parent=0)
78  : mPosition(x), mLocalMomentum(p), mdE(de), mdS(ds), mTof(tof), mKey(k), mVolumeId(volId), mParentTrack(parent) {}
79  StMcHit(g2t_hits_st* pt) : mPosition(pt->x[0],pt->x[1],pt->x[2]), mLocalMomentum(pt->p[0],pt->p[1],pt->p[2]),
80  mdE(pt->de), mdS(pt->ds), mTof(pt->tof), mKey(pt->id), mVolumeId(0),
81  mParentTrack(0) {}
82  // StMcHit(const StSvtHit&); use default
83  // const StMcHit & operator=(const StMcHit&); use default
84  virtual ~StMcHit() {}
85 
86  Int_t operator==(const StMcHit& h) const;
87  Int_t operator!=(const StMcHit& h) const {return !(*this == h); }
88 
89 
90  // "Get" Methods
91  virtual const StThreeVectorF& position() const { return mPosition;}
92  virtual const StThreeVectorF& localMomentum() const { return mLocalMomentum;}
93  virtual Float_t dE() const { return mdE; }
94  virtual Float_t dS() const { return mdS; }
95  virtual Float_t tof() const { return mTof; }
96  virtual Long_t key() const { return mKey; }
97  virtual Long_t volumeId() const { return mVolumeId; }
98  virtual StMcTrack* parentTrack() const { return mParentTrack; }
99  // "Set" Methods
100 
101  virtual void setPosition(const StThreeVectorF& val) { mPosition = val; }
102  virtual void setLocalMomentum(const StThreeVectorF& val) { mLocalMomentum = val; }
103  virtual void setdE(Float_t val) { mdE = val;}
104  virtual void setdS(Float_t val) { mdS = val;}
105  virtual void setTof(Float_t tof) { mTof = tof;}
106  virtual void setKey(Long_t val) { mKey = val;}
107  virtual void setVolumeId(Long_t val) { mVolumeId = val; }
108  virtual void setParentTrack(StMcTrack* val) { mParentTrack = val; }
109  virtual void Print(Option_t *option="") const; // *MENU*
110 
111 protected:
112  StThreeVectorF mPosition;
113  StThreeVectorF mLocalMomentum;
114  Float_t mdE;
115  Float_t mdS;
116  Float_t mTof;
117  Long_t mKey;
118  Long_t mVolumeId;
119  StMcTrack* mParentTrack;
120  ClassDef(StMcHit,2)
121 };
122 ostream& operator<<(ostream& os, const StMcHit&);
123 #endif
124 
Definition: tof.h:15
Monte Carlo Track class All information on a simulated track is stored in this class: kinematics...
Definition: StMcTrack.hh:144