File indexing completed on 2024-04-06 12:11:15
0001 #ifndef FastSimulation_Event_FSimTrack_H
0002 #define FastSimulation_Event_FSimTrack_H
0003
0004
0005 #include "SimGeneral/HepPDTRecord/interface/ParticleDataTable.h"
0006
0007
0008 #include "SimDataFormats/Track/interface/SimTrack.h"
0009 #include "SimDataFormats/Vertex/interface/SimVertex.h"
0010
0011
0012 #include "CommonTools/BaseParticlePropagator/interface/RawParticle.h"
0013
0014 #include <vector>
0015
0016 class FSimVertex;
0017 class FBaseSimEvent;
0018
0019 namespace HepMC {
0020 class GenParticle;
0021 class GenVertex;
0022 }
0023
0024
0025
0026
0027
0028
0029
0030 class FSimTrack : public SimTrack {
0031 public:
0032
0033 FSimTrack();
0034
0035
0036 FSimTrack(const RawParticle* p, int iv, int ig, int id, FBaseSimEvent* mom, double dt = -1.);
0037
0038
0039 FSimTrack(int ipart,
0040 const math::XYZTLorentzVector& p,
0041 int iv,
0042 int ig,
0043 int id,
0044 double charge,
0045 const math::XYZTLorentzVector& tkp,
0046 const math::XYZTLorentzVector& tkm,
0047 const SimVertex& tkv);
0048
0049
0050 virtual ~FSimTrack();
0051
0052
0053 inline const HepPDT::ParticleData* particleInfo() const { return info_; }
0054
0055
0056 inline float charge() const {
0057 if (particleInfo() == nullptr)
0058 return charge_;
0059 return particleInfo()->charge();
0060 }
0061
0062
0063 inline const FSimVertex vertex() const;
0064
0065
0066 inline const FSimVertex& endVertex() const;
0067
0068
0069 inline const FSimTrack& mother() const;
0070
0071
0072 inline const FSimTrack& daughter(int i) const;
0073
0074
0075 inline int nDaughters() const;
0076
0077
0078 inline const std::vector<int>& daughters() const;
0079
0080
0081 inline bool noEndVertex() const;
0082
0083
0084 bool notYetToEndVertex(const XYZTLorentzVector& pos) const;
0085
0086
0087 inline bool noMother() const;
0088
0089
0090 inline bool noDaughter() const;
0091
0092
0093 inline const HepMC::GenParticle* genParticle() const;
0094
0095
0096 inline int id() const { return id_; }
0097
0098
0099
0100
0101 inline int onLayer1() const { return layer1; }
0102
0103
0104
0105
0106 inline int onLayer2() const { return layer2; }
0107
0108
0109
0110
0111 inline int onEcal() const { return ecal; }
0112
0113
0114
0115
0116 inline int onHcal() const { return hcal; }
0117
0118
0119
0120
0121 inline int onVFcal() const { return vfcal; }
0122
0123
0124
0125
0126 inline int outHcal() const { return hcalexit; }
0127
0128
0129
0130
0131 inline int onHO() const { return hoentr; }
0132
0133
0134 inline bool propagated() const { return prop; }
0135
0136
0137 inline const RawParticle& layer1Entrance() const { return Layer1_Entrance; }
0138
0139
0140 inline const RawParticle& layer2Entrance() const { return Layer2_Entrance; }
0141
0142
0143 inline const RawParticle& ecalEntrance() const { return ECAL_Entrance; }
0144
0145
0146 inline const RawParticle& hcalEntrance() const { return HCAL_Entrance; }
0147
0148
0149 inline const RawParticle& vfcalEntrance() const { return VFCAL_Entrance; }
0150
0151
0152 inline const RawParticle& hcalExit() const { return HCAL_Exit; }
0153
0154
0155 inline const RawParticle& hoEntrance() const { return HO_Entrance; }
0156
0157
0158 inline bool isGlobal() const { return isGlobal_; }
0159
0160
0161 inline void setGlobal() { isGlobal_ = true; }
0162
0163
0164 inline void setOriginVertex(const SimVertex& v) { vertex_ = v; }
0165
0166
0167 inline void setEndVertex(int endv) { endv_ = endv; }
0168
0169
0170 void setPropagate();
0171
0172
0173 void setLayer1(const RawParticle& pp, int success);
0174
0175
0176 void setLayer2(const RawParticle& pp, int success);
0177
0178
0179 void setEcal(const RawParticle& pp, int success);
0180
0181
0182 void setHcal(const RawParticle& pp, int success);
0183
0184
0185 void setVFcal(const RawParticle& pp, int success);
0186
0187
0188 void setHcalExit(const RawParticle& pp, int success);
0189
0190
0191 void setHO(const RawParticle& pp, int success);
0192
0193
0194
0195
0196
0197
0198
0199
0200 inline void addDaughter(int i) { daugh_.push_back(i); }
0201
0202
0203 inline void setClosestDaughterId(int id) { closestDaughterId_ = id; }
0204
0205
0206 inline int closestDaughterId() const { return closestDaughterId_; }
0207
0208
0209 const XYZTLorentzVector& momentum() const { return momentum_; }
0210
0211
0212 inline void setMomentum(const math::XYZTLorentzVector& newMomentum) { momentum_ = newMomentum; }
0213
0214
0215 inline const SimTrack& simTrack() const { return *this; }
0216
0217
0218 inline double decayTime() const { return properDecayTime; }
0219
0220 private:
0221
0222 SimVertex vertex_;
0223
0224 FBaseSimEvent* mom_;
0225
0226 int id_;
0227 double charge_;
0228
0229 int endv_;
0230
0231 int layer1;
0232 int layer2;
0233 int ecal;
0234 int hcal;
0235 int vfcal;
0236 int hcalexit;
0237 int hoentr;
0238
0239 bool prop;
0240
0241 RawParticle Layer1_Entrance;
0242 RawParticle Layer2_Entrance;
0243 RawParticle ECAL_Entrance;
0244 RawParticle HCAL_Entrance;
0245 RawParticle VFCAL_Entrance;
0246 RawParticle HCAL_Exit;
0247 RawParticle HO_Entrance;
0248
0249 std::vector<int> daugh_;
0250 int closestDaughterId_;
0251
0252 const HepPDT::ParticleData* info_;
0253
0254 XYZTLorentzVector momentum_;
0255
0256 double properDecayTime;
0257
0258 bool isGlobal_;
0259 };
0260
0261 #include <iosfwd>
0262 std::ostream& operator<<(std::ostream& o, const FSimTrack& t);
0263
0264 #include "FastSimulation/Event/interface/FSimTrack.icc"
0265
0266 #endif