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  const edm::ParameterSet& kine,
12  const RandomEngine* engine)
13  : FBaseSimEvent(vtx,kine,engine), id_(edm::EventID(0,0,0)), weight_(0)
14 {}
15 
17 {}
18 
19 void
21  FBaseSimEvent::fill(parts);
22  id_ = Id;
23 }
24 
25 void
26 FSimEvent::fill(const HepMC::GenEvent& hev, edm::EventID& Id) {
27  FBaseSimEvent::fill(hev);
28  id_ = Id;
29 }
30 
31 void
32 FSimEvent::fill(const std::vector<SimTrack>& simTracks,
33  const std::vector<SimVertex>& simVertices) {
34  FBaseSimEvent::fill(simTracks,simVertices);
35  id_ = edm::EventID();
36 }
37 
39 FSimEvent::id() const {
40  return id_;
41 }
42 
43 float FSimEvent::weight() const {
44  return weight_;
45 }
46 
47 unsigned int
49  return FBaseSimEvent::nTracks();
50 }
51 
52 unsigned int
54  return FBaseSimEvent::nVertices();
55 }
56 
57 unsigned int
59  return FBaseSimEvent::nGenParts();
60 }
61 
62 void
64 {
65  for (unsigned int i=0; i<nTracks(); ++i) {
66  // SimTrack t = SimTrack(ip,p,iv,ig);
67  const SimTrack& t = embdTrack(i);
68  // Save all tracks
69  c.push_back(t);
70  // Save also some muons for later parameterization
71  if ( abs(t.type()) == 13 &&
72  t.momentum().perp2() > 1.0 &&
73  fabs(t.momentum().eta()) < 3.0 &&
74  track(i).noEndVertex() ) {
75  // Actually save the muon mother (and the attached muon) in case
76  if ( track(i).mother().closestDaughterId() == (int)i ) {
77  const SimTrack& T = embdTrack(track(i).mother().id());
78  m.push_back(T);
79  }
80  m.push_back(t);
81  }
82  }
83 }
84 
85 void
87 {
88  for (unsigned int i=0; i<nVertices(); ++i) {
89  // SimTrack t = SimTrack(ip,p,iv,ig);
90  c.push_back(embdVertex(i));
91  }
92 }
93 
94 
95 void
97 {
98 
99  for (unsigned int i=0; i<nVertices(); ++i) {
100  c.push_back(embdVertexType(i));
101  }
102 }
103 
104 
105 
106 
107 
108 
109 
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:63
void fill(const HepMC::GenEvent &hev, edm::EventID &Id)
fill the FBaseSimEvent from the current HepMC::GenEvent
Definition: FSimEvent.cc:26
FSimEvent(const edm::ParameterSet &kine)
Default constructor.
Definition: FSimEvent.cc:6
#define abs(x)
Definition: mlp_lapack.h:159
double weight_
Definition: FSimEvent.h:76
unsigned int nVertices() const
Number of vertices.
const FSimVertexType & embdVertexType(int i) const
return embedded vertex type with given id
unsigned int nTracks() const
Number of tracks.
Definition: FBaseSimEvent.h:95
int closestDaughterId() const
Get the index of the closest charged daughter.
Definition: FSimTrack.h:187
std::vector< FSimVertexType > FSimVertexTypeCollection
collection of FSimVertexType objects
unsigned int nTracks() const
Number of tracks.
Definition: FSimEvent.cc:48
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:39
unsigned int nGenParts() const
Number of MC particles.
Definition: FSimEvent.cc:58
const SimVertex & embdVertex(int i) const
return embedded vertex with given id
virtual ~FSimEvent()
usual virtual destructor
Definition: FSimEvent.cc:16
unsigned int nVertices() const
Number of vertices.
Definition: FSimEvent.cc:53
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:43
int type() const
particle type (HEP PDT convension)
Definition: CoreSimTrack.h:40
unsigned int nGenParts() const
Number of generator particles.
const math::XYZTLorentzVectorD & momentum() const
particle info...
Definition: CoreSimTrack.h:36
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:75