CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch9/src/FastSimulation/Event/interface/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 #include "FastSimDataFormats/NuclearInteractions/interface/FSimVertexType.h"
00014 #include "FastSimDataFormats/NuclearInteractions/interface/FSimVertexTypeFwd.h"
00015 
00016 #include <vector>
00017 
00024 //class FSimEvent;
00025 class FSimTrack;
00026 class FSimVertex;
00027 class KineParticleFilter;
00028 
00029 class SimTrack;
00030 class SimVertex;
00031 class PrimaryVertexGenerator;
00032 class RandomEngine;
00033 //class Histos;
00034 
00035 namespace edm {
00036   class ParameterSet;
00037 }
00038 
00039 namespace HepMC {
00040   class GenEvent;
00041   class GenParticle;
00042   class GenVertex;
00043 }
00044 
00045 class FBaseSimEvent  
00046 {
00047 
00048 public:
00049 
00051   FBaseSimEvent(const edm::ParameterSet& kine);
00052 
00053   FBaseSimEvent(const edm::ParameterSet& vtx,
00054                 const edm::ParameterSet& kine,
00055                 const RandomEngine* engine);
00056 
00058   ~FBaseSimEvent();
00059 
00061   void initializePdt(const HepPDT::ParticleDataTable* aPdt);
00062 
00064   inline const HepPDT::ParticleDataTable* theTable() const { 
00065     return pdt;
00066   }
00067 
00069   void fill(const HepMC::GenEvent& hev);
00070 
00072   void fill(const reco::GenParticleCollection& hev);
00073 
00075   void fill(const std::vector<SimTrack>&, const std::vector<SimVertex>&);
00076   
00078   void printMCTruth(const HepMC::GenEvent& hev);
00079 
00081   void addParticles(const HepMC::GenEvent& hev);
00082   void addParticles(const reco::GenParticleCollection& myGenParticles);
00083 
00085   void print() const;
00086 
00088   void clear();
00089 
00090 
00092   void addChargedTrack(int id);
00093 
00095   inline unsigned int nTracks() const {
00096     return nSimTracks;
00097   }
00098 
00100   inline unsigned int nVertices() const { 
00101     return nSimVertices;
00102   }
00103 
00105   inline unsigned int nGenParts() const {
00106     return nGenParticles;
00107   }
00108 
00110   inline unsigned int nChargedTracks() const {
00111     return nChargedParticleTracks;
00112   }
00113 
00115   inline FSimTrack& track(int id) const;
00116 
00118   inline FSimVertex& vertex(int id) const;
00119 
00121   inline FSimVertexType& vertexType(int id) const;
00122 
00124   int chargedTrack(int id) const;
00125 
00127   inline const SimTrack & embdTrack(int i) const;
00128 
00130   inline const SimVertex & embdVertex(int i) const;
00131 
00133   inline const FSimVertexType & embdVertexType(int i) const;
00134 
00136   const HepMC::GenParticle* embdGenpart(int i) const;
00137 
00139   int addSimTrack(const RawParticle* p, int iv, int ig=-1, 
00140                   const HepMC::GenVertex* ev=0);
00141 
00143   int addSimVertex(const XYZTLorentzVector& decayVertex,int im=-1, 
00144                    FSimVertexType::VertexType type = FSimVertexType::ANY);
00145 
00146   const KineParticleFilter& filter() const { return *myFilter; } 
00147 
00148   PrimaryVertexGenerator* thePrimaryVertexGenerator() const { return theVertexGenerator; }
00149 
00151   inline void setBeamSpot(const math::XYZPoint& aBeamSpot) { 
00152     theBeamSpot = aBeamSpot;
00153   }
00154 
00155  protected:
00156 
00158   inline std::vector<FSimTrack>* tracks() const { 
00159     return theSimTracks; 
00160   }
00161 
00163   inline std::vector<FSimVertex>* vertices() const { 
00164     return theSimVertices; 
00165   }
00166 
00168   inline std::vector<HepMC::GenParticle*>* genparts() const { 
00169     return theGenParticles; 
00170   }
00171 
00172 
00173 
00174  private:
00175 
00176   std::vector<FSimTrack>* theSimTracks;
00177   std::vector<FSimVertex>* theSimVertices;
00178   FSimVertexTypeCollection* theFSimVerticesType;
00179   std::vector<HepMC::GenParticle*>* theGenParticles;
00180 
00181   std::vector<unsigned>* theChargedTracks;
00182 
00183   unsigned int nSimTracks;
00184   unsigned int nSimVertices;
00185   unsigned int nGenParticles;
00186   unsigned int nChargedParticleTracks;
00187 
00188   unsigned int theTrackSize;
00189   unsigned int theVertexSize;
00190   unsigned int theGenSize;
00191   unsigned int theChargedSize;
00192   unsigned int initialSize;
00193 
00195   KineParticleFilter* myFilter;
00196 
00197   double sigmaVerteX;
00198   double sigmaVerteY;
00199   double sigmaVerteZ;
00200 
00201   const ParticleDataTable * pdt;
00202 
00203   PrimaryVertexGenerator* theVertexGenerator;
00204   math::XYZPoint theBeamSpot;
00205   double lateVertexPosition;
00206 
00207   const RandomEngine* random;
00208 
00209   //  Histos* myHistos;
00210 
00211 };
00212 
00213 #include "FastSimulation/Event/interface/FBaseSimEvent.icc"
00214 
00215 #endif // FBaseSimEvent_H