CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/FastSimulation/Event/interface/FSimTrack.h

Go to the documentation of this file.
00001 #ifndef FastSimulation_Event_FSimTrack_H
00002 #define FastSimulation_Event_FSimTrack_H
00003 
00004 // HepPDT Headers
00005 #include "SimGeneral/HepPDTRecord/interface/ParticleDataTable.h"
00006 
00007 // CMSSW Headers
00008 #include "SimDataFormats/Track/interface/SimTrack.h"
00009 
00010 // FAMOS headers
00011 #include "FastSimulation/Particle/interface/RawParticle.h"
00012 
00013 #include <vector>
00014 
00015 class FSimVertex;
00016 class FBaseSimEvent;
00017 
00018 namespace HepMC {
00019   class GenParticle;
00020   class GenVertex;
00021 }
00022 
00029 class FSimTrack : public SimTrack {
00030 
00031  public:
00033   FSimTrack();
00034   
00036   FSimTrack(const RawParticle* p, int iv, int ig, int id, FBaseSimEvent* mom, double dt=-1.);
00037   
00039   virtual ~FSimTrack();
00040 
00042   inline const HepPDT::ParticleData* particleInfo() const {
00043     return info_;
00044   }
00045   
00047   inline float charge() const { 
00048     return particleInfo()->charge();
00049   }
00050   
00051 
00053   inline const FSimVertex& vertex() const;
00054 
00056   inline const FSimVertex& endVertex() const;
00057 
00059   inline const FSimTrack& mother() const;
00060 
00062   inline const FSimTrack& daughter(int i) const;
00063 
00065   inline int nDaughters() const;
00066 
00068   inline const std::vector<int>& daughters() const;
00069 
00071   inline bool  noEndVertex() const;
00072 
00074   bool notYetToEndVertex(const XYZTLorentzVector& pos) const;
00075 
00077   inline bool  noMother() const; 
00078 
00080   inline bool  noDaughter() const;
00081 
00083   inline const HepMC::GenParticle* genParticle() const;
00084    
00086   inline int id() const { return id_; }
00087 
00091   inline int onLayer1() const { return layer1; }
00092 
00096   inline int onLayer2() const { return layer2; }
00097 
00101   inline int onEcal() const { return ecal; }
00102 
00106   inline int onHcal() const { return hcal; }
00107 
00111   inline int onVFcal() const { return vfcal; }
00112 
00114   inline bool propagated() const { return prop; }
00115 
00117   inline const RawParticle& layer1Entrance() const { return Layer1_Entrance; }
00118 
00120   inline const RawParticle& layer2Entrance() const { return Layer2_Entrance; }
00121 
00123   inline const RawParticle& ecalEntrance() const { return ECAL_Entrance; }
00124 
00126   inline const RawParticle& hcalEntrance() const { return HCAL_Entrance; }
00127 
00129   inline const RawParticle& vfcalEntrance() const { return VFCAL_Entrance; }
00130 
00132   inline void setEndVertex(int endv) { endv_ = endv; } 
00133 
00135   void setPropagate();
00136 
00138   void setLayer1(const RawParticle& pp, int success);
00139 
00141   void setLayer2(const RawParticle& pp, int success);
00142 
00144   void setEcal(const RawParticle& pp,int success);
00145 
00147   void setHcal(const RawParticle& pp, int success);
00148 
00150   void setVFcal(const RawParticle& pp, int success);
00151 
00153   //  void addRecHit(const FamosBasicRecHit* hit, unsigned layer);
00154 
00156   //  void addSimHit(const RawParticle& pp, unsigned layer);
00157 
00159   inline void addDaughter(int i) { daugh_.push_back(i); }
00160 
00162   inline void setClosestDaughterId(int id) { closestDaughterId_ = id; }
00163 
00165   inline int closestDaughterId() const { return closestDaughterId_; }
00166 
00168   const XYZTLorentzVector& momentum() const { return momentum_; }
00169 
00171   inline void setMomentum(const math::XYZTLorentzVector& newMomentum) {momentum_ = newMomentum; }
00172 
00174   inline const SimTrack& simTrack() const { return *this; }
00175 
00177   inline double decayTime() const { return properDecayTime; }
00178 
00179  private:
00180 
00181   //  HepMC::GenParticle* me_;
00182 
00183   FBaseSimEvent* mom_;
00184   //  int embd_;   // The index in the SimTrack vector
00185   int id_; // The index in the FSimTrackVector
00186   
00187   int endv_; // The index of the end vertex in FSimVertex
00188 
00189   int layer1;// 1 if the particle was propagated to preshower layer1
00190   int layer2;// 1 if the particle was propagated to preshower layer2
00191   int ecal;  // 1 if the particle was propagated to ECAL/HCAL barrel
00192   int hcal;  // 2 if the particle was propagated to ECAL/HCAL endcap 
00193   int vfcal; // 1 if the particle was propagated to VFCAL 
00194 
00195   bool prop;     // true if the propagation to the calorimeters was done
00196 
00197   RawParticle Layer1_Entrance; // the particle at preshower Layer1
00198   RawParticle Layer2_Entrance; // the particle at preshower Layer2
00199   RawParticle ECAL_Entrance;   // the particle at ECAL entrance
00200   RawParticle HCAL_Entrance;   // the particle at HCAL entrance
00201   RawParticle VFCAL_Entrance;  // the particle at VFCAL entrance
00202 
00203   std::vector<int> daugh_; // The indices of the daughters in FSimTrack
00204   int closestDaughterId_; // The index of the closest daughter id
00205 
00206   const HepPDT::ParticleData* info_; // The PDG info
00207 
00208   XYZTLorentzVector momentum_;
00209 
00210   double properDecayTime; // The proper decay time  (default is -1)
00211 
00212 };
00213 
00214 #include<iosfwd>
00215 std::ostream& operator <<(std::ostream& o , const FSimTrack& t);
00216 
00217 #include "FastSimulation/Event/interface/FSimTrack.icc"
00218 
00219 
00220 
00221 #endif // FSimTrack_H
00222 
00223 
00224 
00225 
00226