CMS 3D CMS Logo

FSimEvent.cc
Go to the documentation of this file.
1 //FAMOS Headers
3 
4 //C++ Headers
5 
6 FSimEvent::FSimEvent(const edm::ParameterSet& kine) : FBaseSimEvent(kine), id_(edm::EventID(0, 0, 0)), weight_(0) {}
7 
9 
12  id_ = Id;
13 }
14 
15 void FSimEvent::fill(const std::vector<SimTrack>& simTracks, const std::vector<SimVertex>& simVertices) {
16  FBaseSimEvent::fill(simTracks, simVertices);
17  id_ = edm::EventID();
18 }
19 
20 edm::EventID FSimEvent::id() const { return id_; }
21 
22 float FSimEvent::weight() const { return weight_; }
23 
24 unsigned int FSimEvent::nTracks() const { return FBaseSimEvent::nTracks(); }
25 
26 unsigned int FSimEvent::nVertices() const { return FBaseSimEvent::nVertices(); }
27 
28 unsigned int FSimEvent::nGenParts() const { return FBaseSimEvent::nGenParts(); }
29 
31  for (unsigned int i = 0; i < nTracks(); ++i) {
32  // SimTrack t = SimTrack(ip,p,iv,ig);
33  const SimTrack& t = embdTrack(i);
34  // Save all tracks
35  c.push_back(t);
36  // Save also some muons for later parameterization
37  if (abs(t.type()) == 13 && t.momentum().perp2() > 1.0 && fabs(t.momentum().eta()) < 3.0 && track(i).noEndVertex()) {
38  // Actually save the muon mother (and the attached muon) in case
39  if (!track(i).noMother() && track(i).mother().closestDaughterId() == (int)i) {
40  const SimTrack& T = embdTrack(track(i).mother().id());
41  m.push_back(T);
42  }
43  m.push_back(t);
44  }
45  }
46 }
47 
49  for (unsigned int i = 0; i < nVertices(); ++i) {
50  // SimTrack t = SimTrack(ip,p,iv,ig);
51  c.push_back(embdVertex(i));
52  }
53 }
54 
56  for (unsigned int i = 0; i < nVertices(); ++i) {
57  c.push_back(embdVertexType(i));
58  }
59 }
bool noMother() const
no mother particle
FSimTrack & track(int id) const
Return track with given Id.
const FSimVertexType & embdVertexType(int i) const
return embedded vertex type with given id
void fill(const HepMC::GenEvent &hev, edm::EventID &Id)
fill the FBaseSimEvent from the current HepMC::GenEvent
Definition: FSimEvent.cc:10
FSimEvent(const edm::ParameterSet &kine)
Default constructor.
Definition: FSimEvent.cc:6
float weight() const
Method to return the event weight.
Definition: FSimEvent.cc:22
unsigned int nGenParts() const
Number of generator particles.
Definition: FBaseSimEvent.h:84
unsigned int nTracks() const
Number of tracks.
Definition: FSimEvent.cc:24
bool noEndVertex() const
no end vertex
unsigned int nVertices() const
Number of vertices.
Definition: FBaseSimEvent.h:81
unsigned int nTracks() const
Number of tracks.
Definition: FBaseSimEvent.h:78
double weight_
Definition: FSimEvent.h:63
unsigned int nVertices() const
Number of vertices.
Definition: FSimEvent.cc:26
const SimVertex & embdVertex(int i) const
return embedded vertex with given id
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::vector< FSimVertexType > FSimVertexTypeCollection
collection of FSimVertexType objects
void fill(const HepMC::GenEvent &hev)
fill the FBaseSimEvent from the current HepMC::GenEvent
int closestDaughterId() const
Get the index of the closest charged daughter.
Definition: FSimTrack.h:206
edm::EventID id() const
Method to return the EventId.
Definition: FSimEvent.cc:20
virtual ~FSimEvent()
usual virtual destructor
Definition: FSimEvent.cc:8
std::vector< SimVertex > SimVertexContainer
void load(edm::SimTrackContainer &c, edm::SimTrackContainer &m) const
Load containers of tracks (and muons) and vertices for the edm::Event.
Definition: FSimEvent.cc:30
HLT enums.
unsigned int nGenParts() const
Number of MC particles.
Definition: FSimEvent.cc:28
long double T
std::vector< SimTrack > SimTrackContainer
const SimTrack & embdTrack(int i) const
return embedded track with given id
const FSimTrack & mother() const
mother
edm::EventID id_
Definition: FSimEvent.h:62