CMS 3D CMS Logo

FSimTrack.h
Go to the documentation of this file.
1 #ifndef FastSimulation_Event_FSimTrack_H
2 #define FastSimulation_Event_FSimTrack_H
3 
4 // HepPDT Headers
6 
7 // CMSSW Headers
10 
11 // FAMOS headers
13 
14 #include <vector>
15 
16 class FSimVertex;
17 class FBaseSimEvent;
18 
19 namespace HepMC {
20  class GenParticle;
21  class GenVertex;
22 }
23 
30 class FSimTrack : public SimTrack {
31 
32  public:
34  FSimTrack();
35 
37  FSimTrack(const RawParticle* p, int iv, int ig, int id, FBaseSimEvent* mom, double dt=-1.);
38 
40  FSimTrack(int ipart, const math::XYZTLorentzVector& p, int iv, int ig, int id, double charge, const math::XYZTLorentzVector& tkp, const math::XYZTLorentzVector& tkm, const SimVertex& tkv);
41 
43  virtual ~FSimTrack();
44 
46  inline const HepPDT::ParticleData* particleInfo() const {
47  return info_;
48  }
49 
51  inline float charge() const {
52  if(particleInfo() == nullptr) return charge_;
53  return particleInfo()->charge();
54  }
55 
56 
58  inline const FSimVertex vertex() const;
59 
61  inline const FSimVertex& endVertex() const;
62 
64  inline const FSimTrack& mother() const;
65 
67  inline const FSimTrack& daughter(int i) const;
68 
70  inline int nDaughters() const;
71 
73  inline const std::vector<int>& daughters() const;
74 
76  inline bool noEndVertex() const;
77 
79  bool notYetToEndVertex(const XYZTLorentzVector& pos) const;
80 
82  inline bool noMother() const;
83 
85  inline bool noDaughter() const;
86 
88  inline const HepMC::GenParticle* genParticle() const;
89 
91  inline int id() const { return id_; }
92 
96  inline int onLayer1() const { return layer1; }
97 
101  inline int onLayer2() const { return layer2; }
102 
106  inline int onEcal() const { return ecal; }
107 
111  inline int onHcal() const { return hcal; }
112 
116  inline int onVFcal() const { return vfcal; }
117 
121  inline int outHcal() const { return hcalexit; }
122 
123  //The particle was propagated to the HO front face
126  inline int onHO() const { return hoentr; }
127 
129  inline bool propagated() const { return prop; }
130 
132  inline const RawParticle& layer1Entrance() const { return Layer1_Entrance; }
133 
135  inline const RawParticle& layer2Entrance() const { return Layer2_Entrance; }
136 
138  inline const RawParticle& ecalEntrance() const { return ECAL_Entrance; }
139 
141  inline const RawParticle& hcalEntrance() const { return HCAL_Entrance; }
142 
144  inline const RawParticle& vfcalEntrance() const { return VFCAL_Entrance; }
145 
147  inline const RawParticle& hcalExit() const { return HCAL_Exit; }
148 
150  inline const RawParticle& hoEntrance() const { return HO_Entrance; }
151 
153  inline void setOriginVertex(const SimVertex& v) { vertex_ = v; }
154 
156  inline void setEndVertex(int endv) { endv_ = endv; }
157 
159  void setPropagate();
160 
162  void setLayer1(const RawParticle& pp, int success);
163 
165  void setLayer2(const RawParticle& pp, int success);
166 
168  void setEcal(const RawParticle& pp,int success);
169 
171  void setHcal(const RawParticle& pp, int success);
172 
174  void setVFcal(const RawParticle& pp, int success);
175 
177  void setHcalExit(const RawParticle& pp, int success);
178 
180  void setHO(const RawParticle& pp, int success);
181 
183  // void addRecHit(const FamosBasicRecHit* hit, unsigned layer);
184 
186  // void addSimHit(const RawParticle& pp, unsigned layer);
187 
189  inline void addDaughter(int i) { daugh_.push_back(i); }
190 
192  inline void setClosestDaughterId(int id) { closestDaughterId_ = id; }
193 
195  inline int closestDaughterId() const { return closestDaughterId_; }
196 
198  const XYZTLorentzVector& momentum() const { return momentum_; }
199 
201  inline void setMomentum(const math::XYZTLorentzVector& newMomentum) {momentum_ = newMomentum; }
202 
204  inline const SimTrack& simTrack() const { return *this; }
205 
207  inline double decayTime() const { return properDecayTime; }
208 
209  private:
210 
211  // HepMC::GenParticle* me_;
213 
215  // int embd_; // The index in the SimTrack vector
216  int id_; // The index in the FSimTrackVector
217  double charge_; // Charge of the particle
218 
219  int endv_; // The index of the end vertex in FSimVertex
220 
221  int layer1;// 1 if the particle was propagated to preshower layer1
222  int layer2;// 1 if the particle was propagated to preshower layer2
223  int ecal; // 1 if the particle was propagated to ECAL/HCAL barrel
224  int hcal; // 2 if the particle was propagated to ECAL/HCAL endcap
225  int vfcal; // 1 if the particle was propagated to VFCAL
226  int hcalexit; // 2 if the particle was propagated to HCAL Exit point
227  int hoentr; // 1 if the particle was propagated to HO
228 
229 
230  bool prop; // true if the propagation to the calorimeters was done
231 
232  RawParticle Layer1_Entrance; // the particle at preshower Layer1
233  RawParticle Layer2_Entrance; // the particle at preshower Layer2
234  RawParticle ECAL_Entrance; // the particle at ECAL entrance
235  RawParticle HCAL_Entrance; // the particle at HCAL entrance
236  RawParticle VFCAL_Entrance; // the particle at VFCAL entrance
237  RawParticle HCAL_Exit; // the particle at HCAL ezit point
238  RawParticle HO_Entrance; // the particle at HO entrance
239 
240 
241  std::vector<int> daugh_; // The indices of the daughters in FSimTrack
242  int closestDaughterId_; // The index of the closest daughter id
243 
244  const HepPDT::ParticleData* info_; // The PDG info
245 
247 
248  double properDecayTime; // The proper decay time (default is -1)
249 
250 };
251 
252 #include<iosfwd>
253 std::ostream& operator <<(std::ostream& o , const FSimTrack& t);
254 
255 #include "FastSimulation/Event/interface/FSimTrack.icc"
256 
257 
258 
259 #endif // FSimTrack_H
260 
261 
262 
263 
264 
SimVertex vertex_
Definition: FSimTrack.h:212
float dt
Definition: AMPTWrapper.h:126
int endv_
Definition: FSimTrack.h:219
float charge() const
charge
Definition: FSimTrack.h:51
const SimTrack & simTrack() const
Simply returns the SimTrack.
Definition: FSimTrack.h:204
const HepPDT::ParticleData * particleInfo() const
particle info...
Definition: FSimTrack.h:46
const RawParticle & vfcalEntrance() const
The particle at VFCAL entrance.
Definition: FSimTrack.h:144
const RawParticle & hoEntrance() const
The particle at HCAL exir.
Definition: FSimTrack.h:150
int onLayer2() const
Definition: FSimTrack.h:101
int layer2
Definition: FSimTrack.h:222
const RawParticle & hcalExit() const
The particle at HCAL exir.
Definition: FSimTrack.h:147
int ecal
Definition: FSimTrack.h:223
RawParticle Layer1_Entrance
Definition: FSimTrack.h:232
double charge_
Definition: FSimTrack.h:217
const HepPDT::ParticleData * info_
Definition: FSimTrack.h:244
RawParticle VFCAL_Entrance
Definition: FSimTrack.h:236
const XYZTLorentzVector & momentum() const
Temporary (until move of SimTrack to Mathcore) - No! Actually very useful.
Definition: FSimTrack.h:198
int hoentr
Definition: FSimTrack.h:227
const RawParticle & layer1Entrance() const
The particle at Preshower Layer 1.
Definition: FSimTrack.h:132
RawParticle HO_Entrance
Definition: FSimTrack.h:238
RawParticle HCAL_Exit
Definition: FSimTrack.h:237
void setClosestDaughterId(int id)
Set the index of the closest charged daughter.
Definition: FSimTrack.h:192
int outHcal() const
Definition: FSimTrack.h:121
int onEcal() const
Definition: FSimTrack.h:106
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
bool propagated() const
The particle was tentatively propagated to calorimeters.
Definition: FSimTrack.h:129
int closestDaughterId_
Definition: FSimTrack.h:242
int closestDaughterId() const
Get the index of the closest charged daughter.
Definition: FSimTrack.h:195
const RawParticle & ecalEntrance() const
The particle at ECAL entrance.
Definition: FSimTrack.h:138
int onHO() const
Definition: FSimTrack.h:126
int onVFcal() const
Definition: FSimTrack.h:116
int vfcal
Definition: FSimTrack.h:225
HepPDT::ParticleData ParticleData
int layer1
Definition: FSimTrack.h:221
FBaseSimEvent * mom_
Definition: FSimTrack.h:214
RawParticle HCAL_Entrance
Definition: FSimTrack.h:235
void setOriginVertex(const SimVertex &v)
Set origin vertex.
Definition: FSimTrack.h:153
std::ostream & operator<<(std::ostream &o, const FSimTrack &t)
Definition: FSimTrack.cc:118
void setEndVertex(int endv)
Set the end vertex.
Definition: FSimTrack.h:156
XYZTLorentzVector momentum_
Definition: FSimTrack.h:246
int id() const
the index in FBaseSimEvent and other vectors
Definition: FSimTrack.h:91
void addDaughter(int i)
Add a RecHit for a track on a layer.
Definition: FSimTrack.h:189
int hcal
Definition: FSimTrack.h:224
const RawParticle & layer2Entrance() const
The particle at Preshower Layer 2.
Definition: FSimTrack.h:135
int onLayer1() const
Definition: FSimTrack.h:96
int onHcal() const
Definition: FSimTrack.h:111
const RawParticle & hcalEntrance() const
The particle at HCAL entrance.
Definition: FSimTrack.h:141
RawParticle Layer2_Entrance
Definition: FSimTrack.h:233
double properDecayTime
Definition: FSimTrack.h:248
int hcalexit
Definition: FSimTrack.h:226
bool prop
Definition: FSimTrack.h:230
RawParticle ECAL_Entrance
Definition: FSimTrack.h:234
void setMomentum(const math::XYZTLorentzVector &newMomentum)
Reset the momentum (to be used with care)
Definition: FSimTrack.h:201
double decayTime() const
Return the pre-defined decay time.
Definition: FSimTrack.h:207
std::vector< int > daugh_
Definition: FSimTrack.h:241
math::XYZTLorentzVector XYZTLorentzVector
Definition: RawParticle.h:15