CMS 3D CMS Logo

PSimHit.h
Go to the documentation of this file.
1 #ifndef PSimHit_H
2 #define PSimHit_H
3 
7 
8 class TrackingSlaveSD; // for friend declaration only
9 
15 class PSimHit {
16 public:
18 
20  const Local3DPoint& exit,
21  float pabs,
22  float tof,
23  float eloss,
24  int particleType,
25  unsigned int detId,
26  unsigned int trackId,
27  float theta,
28  float phi,
29  unsigned short processType = 0)
32  thePabs(pabs),
33  theEnergyLoss(eloss),
36  theTof(tof),
39  theDetUnitId(detId),
41 
44 
47 
52  Local3DPoint localPosition() const { return theEntryPoint + 0.5 * theSegment; }
53 
56 
59 
62 
65 
67  float pabs() const { return thePabs; }
68 
73  float timeOfFlight() const { return tof(); }
74 
76  float tof() const { return theTof; }
77 
79  float energyLoss() const { return theEnergyLoss; }
80 
89  int particleType() const { return theParticleType; }
90 
97  unsigned int detUnitId() const { return theDetUnitId; }
98 
106  unsigned int trackId() const { return theTrackId; }
107 
108  EncodedEventId eventId() const { return theEventId; }
109 
111 
120  unsigned short processType() const { return theProcessType; }
121 
122  void setTof(float tof) { theTof = tof; }
123 
124 protected:
125  // properties
126  Local3DPoint theEntryPoint; // position at entry
127  Local3DVector theSegment; // exitPos - entryPos
128  float thePabs; // momentum
129  float theEnergyLoss; // Energy loss
132 
133  float theTof; // Time Of Flight
135  unsigned short theProcessType; // ID of the process which created the track
136  // which created the PSimHit
137 
138  // association
139  unsigned int theDetUnitId;
140  unsigned int theTrackId;
142 
143  friend class TrackingSlaveSD;
144 };
145 
146 std::ostream& operator<<(std::ostream& o, const PSimHit& hit);
147 
148 #endif // PSimHit_H
Local3DVector LocalVector
Definition: LocalVector.h:12
float thePabs
Definition: PSimHit.h:128
unsigned int theTrackId
Definition: PSimHit.h:140
LocalVector localDirection() const
Obsolete. Same as momentumAtEntry().unit(), for backward compatibility.
Definition: PSimHit.h:58
unsigned int detUnitId() const
Definition: PSimHit.h:97
Local3DPoint theEntryPoint
Definition: PSimHit.h:126
unsigned int theDetUnitId
Definition: PSimHit.h:139
Local3DPoint exitPoint() const
Exit point in the local Det frame.
Definition: PSimHit.h:46
PSimHit(const Local3DPoint &entry, const Local3DPoint &exit, float pabs, float tof, float eloss, int particleType, unsigned int detId, unsigned int trackId, float theta, float phi, unsigned short processType=0)
Definition: PSimHit.h:19
float theTof
Definition: PSimHit.h:133
float thePhiAtEntry
Definition: PSimHit.h:131
unsigned short theProcessType
Definition: PSimHit.h:135
float theEnergyLoss
Definition: PSimHit.h:129
unsigned short processType() const
Definition: PSimHit.h:120
Local3DPoint entryPoint() const
Entry point in the local Det frame.
Definition: PSimHit.h:43
double f[11][100]
unsigned int trackId() const
Definition: PSimHit.h:106
EncodedEventId eventId() const
Definition: PSimHit.h:108
void setTof(float tof)
Definition: PSimHit.h:122
Local3DVector theSegment
Definition: PSimHit.h:127
Local3DPoint localPosition() const
Definition: PSimHit.h:52
float tof() const
deprecated name for timeOfFlight()
Definition: PSimHit.h:76
float pabs() const
fast and more accurate access to momentumAtEntry().mag()
Definition: PSimHit.h:67
int theParticleType
Definition: PSimHit.h:134
float theThetaAtEntry
Definition: PSimHit.h:130
float energyLoss() const
The energy deposit in the PSimHit, in ???.
Definition: PSimHit.h:79
void setEventId(EncodedEventId e)
Definition: PSimHit.h:110
Geom::Theta< float > thetaAtEntry() const
fast and more accurate access to momentumAtEntry().theta()
Definition: PSimHit.h:61
EncodedEventId theEventId
Definition: PSimHit.h:141
std::ostream & operator<<(std::ostream &o, const PSimHit &hit)
Definition: PSimHit.cc:4
float timeOfFlight() const
Definition: PSimHit.h:73
int particleType() const
Definition: PSimHit.h:89
PSimHit()
Definition: PSimHit.h:17
LocalVector momentumAtEntry() const
The momentum of the track that produced the hit, at entry point.
Definition: PSimHit.h:55
Geom::Theta< T > theta() const
Geom::Phi< float > phiAtEntry() const
fast and more accurate access to momentumAtEntry().phi()
Definition: PSimHit.h:64
def exit(msg="")