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 bool isGlobal() const { return isGlobal_; }
154 
156  inline void setGlobal() { isGlobal_ = true; }
157 
159  inline void setOriginVertex(const SimVertex& v) { vertex_ = v; }
160 
162  inline void setEndVertex(int endv) { endv_ = endv; }
163 
165  void setPropagate();
166 
168  void setLayer1(const RawParticle& pp, int success);
169 
171  void setLayer2(const RawParticle& pp, int success);
172 
174  void setEcal(const RawParticle& pp,int success);
175 
177  void setHcal(const RawParticle& pp, int success);
178 
180  void setVFcal(const RawParticle& pp, int success);
181 
183  void setHcalExit(const RawParticle& pp, int success);
184 
186  void setHO(const RawParticle& pp, int success);
187 
189  // void addRecHit(const FamosBasicRecHit* hit, unsigned layer);
190 
192  // void addSimHit(const RawParticle& pp, unsigned layer);
193 
195  inline void addDaughter(int i) { daugh_.push_back(i); }
196 
198  inline void setClosestDaughterId(int id) { closestDaughterId_ = id; }
199 
201  inline int closestDaughterId() const { return closestDaughterId_; }
202 
204  const XYZTLorentzVector& momentum() const { return momentum_; }
205 
207  inline void setMomentum(const math::XYZTLorentzVector& newMomentum) {momentum_ = newMomentum; }
208 
210  inline const SimTrack& simTrack() const { return *this; }
211 
213  inline double decayTime() const { return properDecayTime; }
214 
215  private:
216 
217  // HepMC::GenParticle* me_;
219 
221  // int embd_; // The index in the SimTrack vector
222  int id_; // The index in the FSimTrackVector
223  double charge_; // Charge of the particle
224 
225  int endv_; // The index of the end vertex in FSimVertex
226 
227  int layer1;// 1 if the particle was propagated to preshower layer1
228  int layer2;// 1 if the particle was propagated to preshower layer2
229  int ecal; // 1 if the particle was propagated to ECAL/HCAL barrel
230  int hcal; // 2 if the particle was propagated to ECAL/HCAL endcap
231  int vfcal; // 1 if the particle was propagated to VFCAL
232  int hcalexit; // 2 if the particle was propagated to HCAL Exit point
233  int hoentr; // 1 if the particle was propagated to HO
234 
235 
236  bool prop; // true if the propagation to the calorimeters was done
237 
238  RawParticle Layer1_Entrance; // the particle at preshower Layer1
239  RawParticle Layer2_Entrance; // the particle at preshower Layer2
240  RawParticle ECAL_Entrance; // the particle at ECAL entrance
241  RawParticle HCAL_Entrance; // the particle at HCAL entrance
242  RawParticle VFCAL_Entrance; // the particle at VFCAL entrance
243  RawParticle HCAL_Exit; // the particle at HCAL ezit point
244  RawParticle HO_Entrance; // the particle at HO entrance
245 
246 
247  std::vector<int> daugh_; // The indices of the daughters in FSimTrack
248  int closestDaughterId_; // The index of the closest daughter id
249 
250  const HepPDT::ParticleData* info_; // The PDG info
251 
253 
254  double properDecayTime; // The proper decay time (default is -1)
255 
256  bool isGlobal_; // needed for interfacing the new particle propagator with the old muon sim hit code
257 
258 };
259 
260 #include<iosfwd>
261 std::ostream& operator <<(std::ostream& o , const FSimTrack& t);
262 
263 #include "FastSimulation/Event/interface/FSimTrack.icc"
264 
265 
266 
267 #endif // FSimTrack_H
268 
269 
270 
271 
272 
SimVertex vertex_
Definition: FSimTrack.h:218
float dt
Definition: AMPTWrapper.h:126
int endv_
Definition: FSimTrack.h:225
float charge() const
charge
Definition: FSimTrack.h:51
const SimTrack & simTrack() const
Simply returns the SimTrack.
Definition: FSimTrack.h:210
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:228
const RawParticle & hcalExit() const
The particle at HCAL exir.
Definition: FSimTrack.h:147
int ecal
Definition: FSimTrack.h:229
RawParticle Layer1_Entrance
Definition: FSimTrack.h:238
double charge_
Definition: FSimTrack.h:223
const HepPDT::ParticleData * info_
Definition: FSimTrack.h:250
RawParticle VFCAL_Entrance
Definition: FSimTrack.h:242
const XYZTLorentzVector & momentum() const
Temporary (until move of SimTrack to Mathcore) - No! Actually very useful.
Definition: FSimTrack.h:204
int hoentr
Definition: FSimTrack.h:233
const RawParticle & layer1Entrance() const
The particle at Preshower Layer 1.
Definition: FSimTrack.h:132
void setGlobal()
particle did not decay before more detectors (useful for newProducer)
Definition: FSimTrack.h:156
RawParticle HO_Entrance
Definition: FSimTrack.h:244
RawParticle HCAL_Exit
Definition: FSimTrack.h:243
void setClosestDaughterId(int id)
Set the index of the closest charged daughter.
Definition: FSimTrack.h:198
int outHcal() const
Definition: FSimTrack.h:121
bool isGlobal() const
particle did not decay before more detectors (useful for newProducer)
Definition: FSimTrack.h:153
int onEcal() const
Definition: FSimTrack.h:106
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
bool isGlobal_
Definition: FSimTrack.h:256
bool propagated() const
The particle was tentatively propagated to calorimeters.
Definition: FSimTrack.h:129
int closestDaughterId_
Definition: FSimTrack.h:248
int closestDaughterId() const
Get the index of the closest charged daughter.
Definition: FSimTrack.h:201
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:231
HepPDT::ParticleData ParticleData
int layer1
Definition: FSimTrack.h:227
FBaseSimEvent * mom_
Definition: FSimTrack.h:220
RawParticle HCAL_Entrance
Definition: FSimTrack.h:241
void setOriginVertex(const SimVertex &v)
Set origin vertex.
Definition: FSimTrack.h:159
std::ostream & operator<<(std::ostream &o, const FSimTrack &t)
Definition: FSimTrack.cc:118
void setEndVertex(int endv)
Set the end vertex.
Definition: FSimTrack.h:162
XYZTLorentzVector momentum_
Definition: FSimTrack.h:252
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:195
int hcal
Definition: FSimTrack.h:230
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:239
double properDecayTime
Definition: FSimTrack.h:254
int hcalexit
Definition: FSimTrack.h:232
bool prop
Definition: FSimTrack.h:236
RawParticle ECAL_Entrance
Definition: FSimTrack.h:240
void setMomentum(const math::XYZTLorentzVector &newMomentum)
Reset the momentum (to be used with care)
Definition: FSimTrack.h:207
double decayTime() const
Return the pre-defined decay time.
Definition: FSimTrack.h:213
std::vector< int > daugh_
Definition: FSimTrack.h:247
math::XYZTLorentzVector XYZTLorentzVector
Definition: RawParticle.h:15