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 } // namespace HepMC
23 
30 class FSimTrack : public SimTrack {
31 public:
33  FSimTrack();
34 
36  FSimTrack(const RawParticle* p, int iv, int ig, int id, FBaseSimEvent* mom, double dt = -1.);
37 
39  FSimTrack(int ipart,
41  int iv,
42  int ig,
43  int id,
44  double charge,
45  const math::XYZTLorentzVector& tkp,
46  const math::XYZTLorentzVector& tkm,
47  const SimVertex& tkv);
48 
50  virtual ~FSimTrack();
51 
53  inline const HepPDT::ParticleData* particleInfo() const { return info_; }
54 
56  inline float charge() const {
57  if (particleInfo() == nullptr)
58  return charge_;
59  return particleInfo()->charge();
60  }
61 
63  inline const FSimVertex vertex() const;
64 
66  inline const FSimVertex& endVertex() const;
67 
69  inline const FSimTrack& mother() const;
70 
72  inline const FSimTrack& daughter(int i) const;
73 
75  inline int nDaughters() const;
76 
78  inline const std::vector<int>& daughters() const;
79 
81  inline bool noEndVertex() const;
82 
84  bool notYetToEndVertex(const XYZTLorentzVector& pos) const;
85 
87  inline bool noMother() const;
88 
90  inline bool noDaughter() const;
91 
93  inline const HepMC::GenParticle* genParticle() const;
94 
96  inline int id() const { return id_; }
97 
101  inline int onLayer1() const { return layer1; }
102 
106  inline int onLayer2() const { return layer2; }
107 
111  inline int onEcal() const { return ecal; }
112 
116  inline int onHcal() const { return hcal; }
117 
121  inline int onVFcal() const { return vfcal; }
122 
126  inline int outHcal() const { return hcalexit; }
127 
128  //The particle was propagated to the HO front face
131  inline int onHO() const { return hoentr; }
132 
134  inline bool propagated() const { return prop; }
135 
137  inline const RawParticle& layer1Entrance() const { return Layer1_Entrance; }
138 
140  inline const RawParticle& layer2Entrance() const { return Layer2_Entrance; }
141 
143  inline const RawParticle& ecalEntrance() const { return ECAL_Entrance; }
144 
146  inline const RawParticle& hcalEntrance() const { return HCAL_Entrance; }
147 
149  inline const RawParticle& vfcalEntrance() const { return VFCAL_Entrance; }
150 
152  inline const RawParticle& hcalExit() const { return HCAL_Exit; }
153 
155  inline const RawParticle& hoEntrance() const { return HO_Entrance; }
156 
158  inline bool isGlobal() const { return isGlobal_; }
159 
161  inline void setGlobal() { isGlobal_ = true; }
162 
164  inline void setOriginVertex(const SimVertex& v) { vertex_ = v; }
165 
167  inline void setEndVertex(int endv) { endv_ = endv; }
168 
170  void setPropagate();
171 
173  void setLayer1(const RawParticle& pp, int success);
174 
176  void setLayer2(const RawParticle& pp, int success);
177 
179  void setEcal(const RawParticle& pp, int success);
180 
182  void setHcal(const RawParticle& pp, int success);
183 
185  void setVFcal(const RawParticle& pp, int success);
186 
188  void setHcalExit(const RawParticle& pp, int success);
189 
191  void setHO(const RawParticle& pp, int success);
192 
194  // void addRecHit(const FamosBasicRecHit* hit, unsigned layer);
195 
197  // void addSimHit(const RawParticle& pp, unsigned layer);
198 
200  inline void addDaughter(int i) { daugh_.push_back(i); }
201 
203  inline void setClosestDaughterId(int id) { closestDaughterId_ = id; }
204 
206  inline int closestDaughterId() const { return closestDaughterId_; }
207 
209  const XYZTLorentzVector& momentum() const { return momentum_; }
210 
212  inline void setMomentum(const math::XYZTLorentzVector& newMomentum) { momentum_ = newMomentum; }
213 
215  inline const SimTrack& simTrack() const { return *this; }
216 
218  inline double decayTime() const { return properDecayTime; }
219 
220 private:
221  // HepMC::GenParticle* me_;
223 
225  // int embd_; // The index in the SimTrack vector
226  int id_; // The index in the FSimTrackVector
227  double charge_; // Charge of the particle
228 
229  int endv_; // The index of the end vertex in FSimVertex
230 
231  int layer1; // 1 if the particle was propagated to preshower layer1
232  int layer2; // 1 if the particle was propagated to preshower layer2
233  int ecal; // 1 if the particle was propagated to ECAL/HCAL barrel
234  int hcal; // 2 if the particle was propagated to ECAL/HCAL endcap
235  int vfcal; // 1 if the particle was propagated to VFCAL
236  int hcalexit; // 2 if the particle was propagated to HCAL Exit point
237  int hoentr; // 1 if the particle was propagated to HO
238 
239  bool prop; // true if the propagation to the calorimeters was done
240 
241  RawParticle Layer1_Entrance; // the particle at preshower Layer1
242  RawParticle Layer2_Entrance; // the particle at preshower Layer2
243  RawParticle ECAL_Entrance; // the particle at ECAL entrance
244  RawParticle HCAL_Entrance; // the particle at HCAL entrance
245  RawParticle VFCAL_Entrance; // the particle at VFCAL entrance
246  RawParticle HCAL_Exit; // the particle at HCAL ezit point
247  RawParticle HO_Entrance; // the particle at HO entrance
248 
249  std::vector<int> daugh_; // The indices of the daughters in FSimTrack
250  int closestDaughterId_; // The index of the closest daughter id
251 
252  const HepPDT::ParticleData* info_; // The PDG info
253 
255 
256  double properDecayTime; // The proper decay time (default is -1)
257 
258  bool isGlobal_; // needed for interfacing the new particle propagator with the old muon sim hit code
259 };
260 
261 #include <iosfwd>
262 std::ostream& operator<<(std::ostream& o, const FSimTrack& t);
263 
264 #include "FastSimulation/Event/interface/FSimTrack.icc"
265 
266 #endif // FSimTrack_H
FSimTrack::Layer1_Entrance
RawParticle Layer1_Entrance
Definition: FSimTrack.h:241
FSimTrack::charge_
double charge_
Definition: FSimTrack.h:227
FSimTrack::setMomentum
void setMomentum(const math::XYZTLorentzVector &newMomentum)
Reset the momentum (to be used with care)
Definition: FSimTrack.h:212
FSimTrack::charge
float charge() const
charge
Definition: FSimTrack.h:56
RawParticle
Definition: RawParticle.h:37
mps_fire.i
i
Definition: mps_fire.py:428
FSimTrack::nDaughters
int nDaughters() const
Number of daughters.
SimVertex
Definition: SimVertex.h:5
FSimTrack::hcal
int hcal
Definition: FSimTrack.h:234
FSimTrack::onLayer2
int onLayer2() const
Definition: FSimTrack.h:106
FSimTrack::mother
const FSimTrack & mother() const
mother
FSimTrack::simTrack
const SimTrack & simTrack() const
Simply returns the SimTrack.
Definition: FSimTrack.h:215
FSimTrack::setLayer1
void setLayer1(const RawParticle &pp, int success)
Set the preshower layer1 variables.
Definition: FSimTrack.cc:106
FSimTrack::setEcal
void setEcal(const RawParticle &pp, int success)
Set the ecal variables.
Definition: FSimTrack.cc:118
FSimTrack::onLayer1
int onLayer1() const
Definition: FSimTrack.h:101
FSimTrack::setEndVertex
void setEndVertex(int endv)
Set the end vertex.
Definition: FSimTrack.h:167
FSimTrack::isGlobal
bool isGlobal() const
particle did not decay before more detectors (useful for newProducer)
Definition: FSimTrack.h:158
FSimTrack::vfcal
int vfcal
Definition: FSimTrack.h:235
FSimTrack::onHO
int onHO() const
Definition: FSimTrack.h:131
FSimTrack::genParticle
const HepMC::GenParticle * genParticle() const
The original GenParticle.
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
FSimTrack::hoEntrance
const RawParticle & hoEntrance() const
The particle at HCAL exir.
Definition: FSimTrack.h:155
FSimTrack::propagated
bool propagated() const
The particle was tentatively propagated to calorimeters.
Definition: FSimTrack.h:134
FSimTrack::layer1Entrance
const RawParticle & layer1Entrance() const
The particle at Preshower Layer 1.
Definition: FSimTrack.h:137
pos
Definition: PixelAliasList.h:18
FSimTrack::setOriginVertex
void setOriginVertex(const SimVertex &v)
Set origin vertex.
Definition: FSimTrack.h:164
FSimTrack::decayTime
double decayTime() const
Return the pre-defined decay time.
Definition: FSimTrack.h:218
FSimTrack::mom_
FBaseSimEvent * mom_
Definition: FSimTrack.h:224
FSimTrack::endVertex
const FSimVertex & endVertex() const
end vertex
FSimTrack::ECAL_Entrance
RawParticle ECAL_Entrance
Definition: FSimTrack.h:243
FSimTrack::daughters
const std::vector< int > & daughters() const
Vector of daughter indices.
FSimTrack::layer2Entrance
const RawParticle & layer2Entrance() const
The particle at Preshower Layer 2.
Definition: FSimTrack.h:140
XYZTLorentzVector
math::XYZTLorentzVector XYZTLorentzVector
Definition: RawParticle.h:25
findQualityFiles.v
v
Definition: findQualityFiles.py:179
FSimVertex
Definition: FSimVertex.h:19
GenParticle
Definition: GenParticle.py:1
FSimTrack::vertex_
SimVertex vertex_
Definition: FSimTrack.h:222
FSimTrack::setVFcal
void setVFcal(const RawParticle &pp, int success)
Set the hcal variables.
Definition: FSimTrack.cc:130
EcalTangentSkim_cfg.o
o
Definition: EcalTangentSkim_cfg.py:36
ParticleData
HepPDT::ParticleData ParticleData
Definition: ParticleDataTable.h:9
dt
float dt
Definition: AMPTWrapper.h:136
FSimTrack::closestDaughterId
int closestDaughterId() const
Get the index of the closest charged daughter.
Definition: FSimTrack.h:206
FSimTrack::setGlobal
void setGlobal()
particle did not decay before more detectors (useful for newProducer)
Definition: FSimTrack.h:161
FSimTrack::vfcalEntrance
const RawParticle & vfcalEntrance() const
The particle at VFCAL entrance.
Definition: FSimTrack.h:149
FSimTrack::onHcal
int onHcal() const
Definition: FSimTrack.h:116
FSimTrack::particleInfo
const HepPDT::ParticleData * particleInfo() const
particle info...
Definition: FSimTrack.h:53
FSimTrack::hcalEntrance
const RawParticle & hcalEntrance() const
The particle at HCAL entrance.
Definition: FSimTrack.h:146
SimVertex.h
summarizeEdmComparisonLogfiles.success
success
Definition: summarizeEdmComparisonLogfiles.py:115
FSimTrack::info_
const HepPDT::ParticleData * info_
Definition: FSimTrack.h:252
FSimTrack::ecalEntrance
const RawParticle & ecalEntrance() const
The particle at ECAL entrance.
Definition: FSimTrack.h:143
FSimTrack::onVFcal
int onVFcal() const
Definition: FSimTrack.h:121
operator<<
std::ostream & operator<<(std::ostream &o, const FSimTrack &t)
Definition: FSimTrack.cc:146
FSimTrack::addDaughter
void addDaughter(int i)
Add a RecHit for a track on a layer.
Definition: FSimTrack.h:200
FSimTrack::id
int id() const
the index in FBaseSimEvent and other vectors
Definition: FSimTrack.h:96
FSimTrack::isGlobal_
bool isGlobal_
Definition: FSimTrack.h:258
FSimTrack::momentum_
XYZTLorentzVector momentum_
Definition: FSimTrack.h:254
ParticleDataTable.h
FSimTrack::vertex
const FSimVertex vertex() const
Origin vertex.
FSimTrack::Layer2_Entrance
RawParticle Layer2_Entrance
Definition: FSimTrack.h:242
FSimTrack::noDaughter
bool noDaughter() const
no daughters
FSimTrack::daugh_
std::vector< int > daugh_
Definition: FSimTrack.h:249
FSimTrack::~FSimTrack
virtual ~FSimTrack()
Destructor.
Definition: FSimTrack.cc:83
FSimTrack::prop
bool prop
Definition: FSimTrack.h:239
FSimTrack::daughter
const FSimTrack & daughter(int i) const
Ith daughter.
FSimTrack::HO_Entrance
RawParticle HO_Entrance
Definition: FSimTrack.h:247
FSimTrack::HCAL_Exit
RawParticle HCAL_Exit
Definition: FSimTrack.h:246
FSimTrack::momentum
const XYZTLorentzVector & momentum() const
Temporary (until move of SimTrack to Mathcore) - No! Actually very useful.
Definition: FSimTrack.h:209
FSimTrack::FSimTrack
FSimTrack()
Default constructor.
Definition: FSimTrack.cc:9
FSimTrack::VFCAL_Entrance
RawParticle VFCAL_Entrance
Definition: FSimTrack.h:245
FSimTrack::hcalExit
const RawParticle & hcalExit() const
The particle at HCAL exir.
Definition: FSimTrack.h:152
FSimTrack::setHO
void setHO(const RawParticle &pp, int success)
Set the ho variables.
Definition: FSimTrack.cc:141
FSimTrack::endv_
int endv_
Definition: FSimTrack.h:229
FSimTrack::noEndVertex
bool noEndVertex() const
no end vertex
GenParticle.GenParticle
GenParticle
Definition: GenParticle.py:18
FSimTrack::setHcal
void setHcal(const RawParticle &pp, int success)
Set the hcal variables.
Definition: FSimTrack.cc:124
FSimTrack::closestDaughterId_
int closestDaughterId_
Definition: FSimTrack.h:250
FSimTrack::hcalexit
int hcalexit
Definition: FSimTrack.h:236
SimTrack
Definition: SimTrack.h:6
math::XYZTLorentzVector
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
FSimTrack::layer2
int layer2
Definition: FSimTrack.h:232
RawParticle.h
HepMC
Definition: GenParticle.h:15
FSimTrack::setClosestDaughterId
void setClosestDaughterId(int id)
Set the index of the closest charged daughter.
Definition: FSimTrack.h:203
FSimTrack::setHcalExit
void setHcalExit(const RawParticle &pp, int success)
Set the hcal exit variables.
Definition: FSimTrack.cc:136
FSimTrack::layer1
int layer1
Definition: FSimTrack.h:231
FSimTrack::ecal
int ecal
Definition: FSimTrack.h:233
FSimTrack::notYetToEndVertex
bool notYetToEndVertex(const XYZTLorentzVector &pos) const
Compare the end vertex position with another position.
Definition: FSimTrack.cc:85
FSimTrack
Definition: FSimTrack.h:30
FSimTrack::noMother
bool noMother() const
no mother particle
SimTrack.h
createTree.pp
pp
Definition: createTree.py:17
FSimTrack::onEcal
int onEcal() const
Definition: FSimTrack.h:111
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644
FSimTrack::id_
int id_
Definition: FSimTrack.h:226
FSimTrack::hoentr
int hoentr
Definition: FSimTrack.h:237
FBaseSimEvent
Definition: FBaseSimEvent.h:42
FSimTrack::setPropagate
void setPropagate()
The particle has been propgated through the tracker.
Definition: FSimTrack.cc:103
FSimTrack::outHcal
int outHcal() const
Definition: FSimTrack.h:126
FSimTrack::setLayer2
void setLayer2(const RawParticle &pp, int success)
Set the preshower layer2 variables.
Definition: FSimTrack.cc:112
FSimTrack::HCAL_Entrance
RawParticle HCAL_Entrance
Definition: FSimTrack.h:244
FSimTrack::properDecayTime
double properDecayTime
Definition: FSimTrack.h:256