CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FSimEvent.cc
Go to the documentation of this file.
1 //FAMOS Headers
3 
4 //C++ Headers
5 
7  : FBaseSimEvent(kine), id_(edm::EventID(0,0,0)), weight_(0)
8 {}
9 
11 {}
12 
13 void
15  FBaseSimEvent::fill(parts);
16  id_ = Id;
17 }
18 
19 void
20 FSimEvent::fill(const HepMC::GenEvent& hev, edm::EventID& Id) {
22  id_ = Id;
23 }
24 
25 void
26 FSimEvent::fill(const std::vector<SimTrack>& simTracks,
27  const std::vector<SimVertex>& simVertices) {
28  FBaseSimEvent::fill(simTracks,simVertices);
29  id_ = edm::EventID();
30 }
31 
33 FSimEvent::id() const {
34  return id_;
35 }
36 
37 float FSimEvent::weight() const {
38  return weight_;
39 }
40 
41 unsigned int
43  return FBaseSimEvent::nTracks();
44 }
45 
46 unsigned int
48  return FBaseSimEvent::nVertices();
49 }
50 
51 unsigned int
53  return FBaseSimEvent::nGenParts();
54 }
55 
56 void
58 {
59  for (unsigned int i=0; i<nTracks(); ++i) {
60  // SimTrack t = SimTrack(ip,p,iv,ig);
61  const SimTrack& t = embdTrack(i);
62  // Save all tracks
63  c.push_back(t);
64  // Save also some muons for later parameterization
65  if ( abs(t.type()) == 13 &&
66  t.momentum().perp2() > 1.0 &&
67  fabs(t.momentum().eta()) < 3.0 &&
68  track(i).noEndVertex() ) {
69  // Actually save the muon mother (and the attached muon) in case
70  if ( !track(i).noMother() && track(i).mother().closestDaughterId() == (int)i ) {
71  const SimTrack& T = embdTrack(track(i).mother().id());
72  m.push_back(T);
73  }
74  m.push_back(t);
75  }
76  }
77 }
78 
79 void
81 {
82  for (unsigned int i=0; i<nVertices(); ++i) {
83  // SimTrack t = SimTrack(ip,p,iv,ig);
84  c.push_back(embdVertex(i));
85  }
86 }
87 
88 
89 void
91 {
92 
93  for (unsigned int i=0; i<nVertices(); ++i) {
94  c.push_back(embdVertexType(i));
95  }
96 }
97 
98 
99 
100 
101 
102 
103 
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
int i
Definition: DBlmapReader.cc:9
bool noEndVertex() const
no end vertex
void load(edm::SimTrackContainer &c, edm::SimTrackContainer &m) const
Load containers of tracks (and muons) and vertices for the edm::Event.
Definition: FSimEvent.cc:57
void fill(const HepMC::GenEvent &hev, edm::EventID &Id)
fill the FBaseSimEvent from the current HepMC::GenEvent
Definition: FSimEvent.cc:20
FSimEvent(const edm::ParameterSet &kine)
Default constructor.
Definition: FSimEvent.cc:6
const reco::GenParticle * mother(const reco::GenParticle &p, unsigned int imoth=0)
double weight_
Definition: FSimEvent.h:70
unsigned int nVertices() const
Number of vertices.
Definition: FBaseSimEvent.h:93
const FSimVertexType & embdVertexType(int i) const
return embedded vertex type with given id
unsigned int nTracks() const
Number of tracks.
Definition: FBaseSimEvent.h:88
int closestDaughterId() const
Get the index of the closest charged daughter.
Definition: FSimTrack.h:187
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::vector< FSimVertexType > FSimVertexTypeCollection
collection of FSimVertexType objects
unsigned int nTracks() const
Number of tracks.
Definition: FSimEvent.cc:42
void fill(const HepMC::GenEvent &hev)
fill the FBaseSimEvent from the current HepMC::GenEvent
edm::EventID id() const
Method to return the EventId.
Definition: FSimEvent.cc:33
unsigned int nGenParts() const
Number of MC particles.
Definition: FSimEvent.cc:52
const SimVertex & embdVertex(int i) const
return embedded vertex with given id
virtual ~FSimEvent()
usual virtual destructor
Definition: FSimEvent.cc:10
unsigned int nVertices() const
Number of vertices.
Definition: FSimEvent.cc:47
std::vector< SimVertex > SimVertexContainer
const SimTrack & embdTrack(int i) const
return embedded track with given id
float weight() const
Method to return the event weight.
Definition: FSimEvent.cc:37
int type() const
particle type (HEP PDT convension)
Definition: CoreSimTrack.h:25
unsigned int nGenParts() const
Number of generator particles.
Definition: FBaseSimEvent.h:98
const math::XYZTLorentzVectorD & momentum() const
Definition: CoreSimTrack.h:22
bool noMother() const
no mother particle
long double T
std::vector< SimTrack > SimTrackContainer
const FSimTrack & mother() const
mother
FSimTrack & track(int id) const
Return track with given Id.
edm::EventID id_
Definition: FSimEvent.h:69