CMS 3D CMS Logo

FBaseSimEvent.h

Go to the documentation of this file.
00001 #ifndef FastSimulation_Event_FBaseSimEvent_H
00002 #define FastSimulation_Event_FBaseSimEvent_H
00003 
00004 // Data Formats
00005 #include "DataFormats/HepMCCandidate/interface/GenParticleFwd.h"
00006 #include "DataFormats/Math/interface/Point3D.h"
00007 
00008 // HepPDT Headers
00009 #include "SimGeneral/HepPDTRecord/interface/ParticleDataTable.h"
00010 
00011 // Famos Headers
00012 #include "FastSimulation/Particle/interface/RawParticle.h"
00013 
00014 #include <vector>
00015 
00022 //class FSimEvent;
00023 class FSimTrack;
00024 class FSimVertex;
00025 class KineParticleFilter;
00026 
00027 class SimTrack;
00028 class SimVertex;
00029 class PrimaryVertexGenerator;
00030 class RandomEngine;
00031 //class Histos;
00032 
00033 namespace edm {
00034   class ParameterSet;
00035 }
00036 
00037 namespace HepMC {
00038   class GenEvent;
00039   class GenParticle;
00040   class GenVertex;
00041 }
00042 
00043 class FBaseSimEvent  
00044 {
00045 
00046 public:
00047 
00049   FBaseSimEvent(const edm::ParameterSet& kine);
00050 
00051   FBaseSimEvent(const edm::ParameterSet& vtx,
00052                 const edm::ParameterSet& kine,
00053                 const RandomEngine* engine);
00054 
00056   ~FBaseSimEvent();
00057 
00059   void initializePdt(const HepPDT::ParticleDataTable* aPdt);
00060 
00062   inline const HepPDT::ParticleDataTable* theTable() const { 
00063     return pdt;
00064   }
00065 
00067   void fill(const HepMC::GenEvent& hev);
00068 
00070   void fill(const reco::GenParticleCollection& hev);
00071 
00073   void fill(const std::vector<SimTrack>&, const std::vector<SimVertex>&);
00074   
00076   void printMCTruth(const HepMC::GenEvent& hev);
00077 
00079   void addParticles(const HepMC::GenEvent& hev);
00080   void addParticles(const reco::GenParticleCollection& myGenParticles);
00081 
00083   void print() const;
00084 
00086   void clear();
00087 
00088 
00090   void addChargedTrack(int id);
00091 
00093   inline unsigned int nTracks() const {
00094     return nSimTracks;
00095   }
00096 
00098   inline unsigned int nVertices() const { 
00099     return nSimVertices;
00100   }
00101 
00103   inline unsigned int nGenParts() const {
00104     return nGenParticles;
00105   }
00106 
00108   inline unsigned int nChargedTracks() const {
00109     return nChargedParticleTracks;
00110   }
00111 
00113   inline FSimTrack& track(int id) const;
00114 
00116   inline FSimVertex& vertex(int id) const;
00117 
00119   int chargedTrack(int id) const;
00120 
00122   inline const SimTrack & embdTrack(int i) const;
00123 
00125   inline const SimVertex & embdVertex(int i) const;
00126 
00128   const HepMC::GenParticle* embdGenpart(int i) const;
00129 
00131   int addSimTrack(const RawParticle* p, int iv, int ig=-1, 
00132                   const HepMC::GenVertex* ev=0);
00133 
00135   int addSimVertex(const XYZTLorentzVector& decayVertex,int im=-1);
00136 
00137   const KineParticleFilter& filter() const { return *myFilter; } 
00138 
00139   PrimaryVertexGenerator* thePrimaryVertexGenerator() const { return theVertexGenerator; }
00140 
00142   inline void setBeamSpot(const math::XYZPoint& aBeamSpot) { 
00143     theBeamSpot = aBeamSpot;
00144   }
00145 
00146  protected:
00147 
00149   inline std::vector<FSimTrack>* tracks() const { 
00150     return theSimTracks; 
00151   }
00152 
00154   inline std::vector<FSimVertex>* vertices() const { 
00155     return theSimVertices; 
00156   }
00157 
00159   inline std::vector<HepMC::GenParticle*>* genparts() const { 
00160     return theGenParticles; 
00161   }
00162 
00163 
00164 
00165  private:
00166 
00167   std::vector<FSimTrack>* theSimTracks;
00168   std::vector<FSimVertex>* theSimVertices;
00169   std::vector<HepMC::GenParticle*>* theGenParticles;
00170 
00171   std::vector<unsigned>* theChargedTracks;
00172 
00173   unsigned int nSimTracks;
00174   unsigned int nSimVertices;
00175   unsigned int nGenParticles;
00176   unsigned int nChargedParticleTracks;
00177 
00178   unsigned int theTrackSize;
00179   unsigned int theVertexSize;
00180   unsigned int theGenSize;
00181   unsigned int theChargedSize;
00182   unsigned int initialSize;
00183 
00185   KineParticleFilter* myFilter;
00186 
00187   double sigmaVerteX;
00188   double sigmaVerteY;
00189   double sigmaVerteZ;
00190 
00191   const ParticleDataTable * pdt;
00192 
00193   PrimaryVertexGenerator* theVertexGenerator;
00194   math::XYZPoint theBeamSpot;
00195   double lateVertexPosition;
00196 
00197   const RandomEngine* random;
00198 
00199   //  Histos* myHistos;
00200 
00201 };
00202 
00203 #include "FastSimulation/Event/interface/FBaseSimEvent.icc"
00204 
00205 #endif // FBaseSimEvent_H

Generated on Tue Jun 9 17:35:07 2009 for CMSSW by  doxygen 1.5.4