CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_0/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   
00116   inline int outHcal() const { return hcalexit; }
00117 
00118   //The particle was propagated to the HO front face
00121   inline int onHO() const { return hoentr; }
00122 
00124   inline bool propagated() const { return prop; }
00125 
00127   inline const RawParticle& layer1Entrance() const { return Layer1_Entrance; }
00128 
00130   inline const RawParticle& layer2Entrance() const { return Layer2_Entrance; }
00131 
00133   inline const RawParticle& ecalEntrance() const { return ECAL_Entrance; }
00134 
00136   inline const RawParticle& hcalEntrance() const { return HCAL_Entrance; }
00137 
00139   inline const RawParticle& vfcalEntrance() const { return VFCAL_Entrance; }
00140 
00142   inline const RawParticle& hcalExit() const { return HCAL_Exit; }
00143 
00145   inline const RawParticle& hoEntrance() const { return HO_Entrance; }
00146 
00148   inline void setEndVertex(int endv) { endv_ = endv; } 
00149 
00151   void setPropagate();
00152 
00154   void setLayer1(const RawParticle& pp, int success);
00155 
00157   void setLayer2(const RawParticle& pp, int success);
00158 
00160   void setEcal(const RawParticle& pp,int success);
00161 
00163   void setHcal(const RawParticle& pp, int success);
00164 
00166   void setVFcal(const RawParticle& pp, int success);
00167 
00169   void setHcalExit(const RawParticle& pp, int success);
00170 
00172   void setHO(const RawParticle& pp, int success);
00173 
00175   //  void addRecHit(const FamosBasicRecHit* hit, unsigned layer);
00176 
00178   //  void addSimHit(const RawParticle& pp, unsigned layer);
00179 
00181   inline void addDaughter(int i) { daugh_.push_back(i); }
00182 
00184   inline void setClosestDaughterId(int id) { closestDaughterId_ = id; }
00185 
00187   inline int closestDaughterId() const { return closestDaughterId_; }
00188 
00190   const XYZTLorentzVector& momentum() const { return momentum_; }
00191 
00193   inline void setMomentum(const math::XYZTLorentzVector& newMomentum) {momentum_ = newMomentum; }
00194 
00196   inline const SimTrack& simTrack() const { return *this; }
00197 
00199   inline double decayTime() const { return properDecayTime; }
00200 
00201  private:
00202 
00203   //  HepMC::GenParticle* me_;
00204 
00205   FBaseSimEvent* mom_;
00206   //  int embd_;   // The index in the SimTrack vector
00207   int id_; // The index in the FSimTrackVector
00208   
00209   int endv_; // The index of the end vertex in FSimVertex
00210 
00211   int layer1;// 1 if the particle was propagated to preshower layer1
00212   int layer2;// 1 if the particle was propagated to preshower layer2
00213   int ecal;  // 1 if the particle was propagated to ECAL/HCAL barrel
00214   int hcal;  // 2 if the particle was propagated to ECAL/HCAL endcap 
00215   int vfcal; // 1 if the particle was propagated to VFCAL 
00216   int hcalexit;  // 2 if the particle was propagated to HCAL Exit point
00217   int hoentr; // 1 if the particle was propagated to HO 
00218 
00219 
00220   bool prop;     // true if the propagation to the calorimeters was done
00221 
00222   RawParticle Layer1_Entrance; // the particle at preshower Layer1
00223   RawParticle Layer2_Entrance; // the particle at preshower Layer2
00224   RawParticle ECAL_Entrance;   // the particle at ECAL entrance
00225   RawParticle HCAL_Entrance;   // the particle at HCAL entrance
00226   RawParticle VFCAL_Entrance;  // the particle at VFCAL entrance
00227   RawParticle HCAL_Exit;       // the particle at HCAL ezit point
00228   RawParticle HO_Entrance;     // the particle at HO entrance
00229 
00230 
00231   std::vector<int> daugh_; // The indices of the daughters in FSimTrack
00232   int closestDaughterId_; // The index of the closest daughter id
00233 
00234   const HepPDT::ParticleData* info_; // The PDG info
00235 
00236   XYZTLorentzVector momentum_;
00237 
00238   double properDecayTime; // The proper decay time  (default is -1)
00239 
00240 };
00241 
00242 #include<iosfwd>
00243 std::ostream& operator <<(std::ostream& o , const FSimTrack& t);
00244 
00245 #include "FastSimulation/Event/interface/FSimTrack.icc"
00246 
00247 
00248 
00249 #endif // FSimTrack_H
00250 
00251 
00252 
00253 
00254