CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_4_5_patch3/src/FastSimulation/Event/src/FSimEvent.cc

Go to the documentation of this file.
00001 //FAMOS Headers
00002 #include "FastSimulation/Event/interface/FSimEvent.h"
00003 
00004 //C++ Headers
00005 
00006 FSimEvent::FSimEvent(const edm::ParameterSet& kine) 
00007     : FBaseSimEvent(kine), id_(edm::EventID(0,0,0)), weight_(0)
00008 {}
00009  
00010 FSimEvent::FSimEvent(const edm::ParameterSet& vtx,
00011                      const edm::ParameterSet& kine,
00012                      const RandomEngine* engine) 
00013     : FBaseSimEvent(vtx,kine,engine), id_(edm::EventID(0,0,0)), weight_(0)
00014 {}
00015  
00016 FSimEvent::~FSimEvent()
00017 {}
00018 
00019 void 
00020 FSimEvent::fill(const reco::GenParticleCollection& parts, edm::EventID& Id) { 
00021   FBaseSimEvent::fill(parts); 
00022   id_ = Id;
00023 }
00024     
00025 void 
00026 FSimEvent::fill(const HepMC::GenEvent& hev, edm::EventID& Id) { 
00027   FBaseSimEvent::fill(hev); 
00028   id_ = Id;
00029 }
00030     
00031 void
00032 FSimEvent::fill(const std::vector<SimTrack>& simTracks, 
00033                 const std::vector<SimVertex>& simVertices) {
00034   FBaseSimEvent::fill(simTracks,simVertices);
00035   id_ = edm::EventID();
00036 } 
00037 
00038 edm::EventID 
00039 FSimEvent::id() const { 
00040   return id_; 
00041 }
00042    
00043 float FSimEvent::weight() const { 
00044   return weight_; 
00045 }
00046 
00047 unsigned int 
00048 FSimEvent::nTracks() const {
00049   return FBaseSimEvent::nTracks();
00050 }
00051 
00052 unsigned int 
00053 FSimEvent::nVertices() const { 
00054   return FBaseSimEvent::nVertices();
00055 }
00056 
00057 unsigned int 
00058 FSimEvent::nGenParts() const {
00059   return FBaseSimEvent::nGenParts();
00060 }
00061 
00062 void 
00063 FSimEvent::load(edm::SimTrackContainer & c, edm::SimTrackContainer & m) const
00064 {
00065   for (unsigned int i=0; i<nTracks(); ++i) {
00066     //    SimTrack t = SimTrack(ip,p,iv,ig);
00067     const SimTrack& t = embdTrack(i);
00068     // Save all tracks
00069     c.push_back(t);
00070     // Save also some muons for later parameterization
00071     if ( abs(t.type()) == 13 && 
00072          t.momentum().perp2() > 1.0 &&
00073          fabs(t.momentum().eta()) < 3.0 &&
00074          track(i).noEndVertex() ) {
00075       // Actually save the muon mother (and the attached muon) in case
00076       if ( track(i).mother().closestDaughterId() == (int)i ) {
00077         const SimTrack& T = embdTrack(track(i).mother().id());
00078         m.push_back(T);
00079       } 
00080       m.push_back(t);
00081     }
00082   }
00083 }
00084 
00085 void 
00086 FSimEvent::load(edm::SimVertexContainer & c) const
00087 {
00088   for (unsigned int i=0; i<nVertices(); ++i) {
00089     //    SimTrack t = SimTrack(ip,p,iv,ig);
00090     c.push_back(embdVertex(i));
00091   }
00092 }
00093 
00094 
00095 void 
00096 FSimEvent::load(FSimVertexTypeCollection & c) const
00097 {
00098 
00099   for (unsigned int i=0; i<nVertices(); ++i) {
00100     c.push_back(embdVertexType(i));
00101   }
00102 }
00103 
00104 
00105 
00106 
00107 
00108 
00109