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) {
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 }
mps_fire.i
i
Definition: mps_fire.py:428
FSimTrack::mother
const FSimTrack & mother() const
mother
FBaseSimEvent::fill
void fill(const HepMC::GenEvent &hev)
fill the FBaseSimEvent from the current HepMC::GenEvent
Definition: FBaseSimEvent.cc:82
edm
HLT enums.
Definition: AlignableModifier.h:19
FBaseSimEvent::nVertices
unsigned int nVertices() const
Number of vertices.
Definition: FBaseSimEvent.h:81
TrackCandidateProducer_cfi.simTracks
simTracks
Definition: TrackCandidateProducer_cfi.py:15
FSimEvent::nTracks
unsigned int nTracks() const
Number of tracks.
Definition: FSimEvent.cc:24
HepMC::GenEvent
Definition: hepmc_rootio.cc:9
FBaseSimEvent::embdVertex
const SimVertex & embdVertex(int i) const
return embedded vertex with given id
FSimEvent.h
FSimTrack::closestDaughterId
int closestDaughterId() const
Get the index of the closest charged daughter.
Definition: FSimTrack.h:206
FBaseSimEvent::track
FSimTrack & track(int id) const
Return track with given Id.
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:72
FSimEvent::id
edm::EventID id() const
Method to return the EventId.
Definition: FSimEvent.cc:20
edm::ParameterSet
Definition: ParameterSet.h:47
FSimEvent::weight_
double weight_
Definition: FSimEvent.h:63
FBaseSimEvent::nGenParts
unsigned int nGenParts() const
Number of generator particles.
Definition: FBaseSimEvent.h:84
createfilelist.int
int
Definition: createfilelist.py:10
FSimEvent::fill
void fill(const HepMC::GenEvent &hev, edm::EventID &Id)
fill the FBaseSimEvent from the current HepMC::GenEvent
Definition: FSimEvent.cc:10
FSimEvent::id_
edm::EventID id_
Definition: FSimEvent.h:62
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
FSimEvent::load
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
FSimTrack::noEndVertex
bool noEndVertex() const
no end vertex
FSimEvent::weight
float weight() const
Method to return the event weight.
Definition: FSimEvent.cc:22
FBaseSimEvent::embdVertexType
const FSimVertexType & embdVertexType(int i) const
return embedded vertex type with given id
edm::SimTrackContainer
std::vector< SimTrack > SimTrackContainer
Definition: SimTrackContainer.h:12
SimTrack
Definition: SimTrack.h:6
T
long double T
Definition: Basic3DVectorLD.h:48
FSimEvent::nVertices
unsigned int nVertices() const
Number of vertices.
Definition: FSimEvent.cc:26
FBaseSimEvent::nTracks
unsigned int nTracks() const
Number of tracks.
Definition: FBaseSimEvent.h:78
FSimVertexTypeCollection
std::vector< FSimVertexType > FSimVertexTypeCollection
collection of FSimVertexType objects
Definition: FSimVertexTypeFwd.h:7
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
HGCalValidator_cfi.simVertices
simVertices
Definition: HGCalValidator_cfi.py:43
FSimTrack::noMother
bool noMother() const
no mother particle
FSimEvent::nGenParts
unsigned int nGenParts() const
Number of MC particles.
Definition: FSimEvent.cc:28
edm::EventID
Definition: EventID.h:31
FBaseSimEvent::embdTrack
const SimTrack & embdTrack(int i) const
return embedded track with given id
FSimEvent::~FSimEvent
virtual ~FSimEvent()
usual virtual destructor
Definition: FSimEvent.cc:8
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644
edm::SimVertexContainer
std::vector< SimVertex > SimVertexContainer
Definition: SimVertexContainer.h:12
FBaseSimEvent
Definition: FBaseSimEvent.h:42
FSimEvent::FSimEvent
FSimEvent(const edm::ParameterSet &kine)
Default constructor.
Definition: FSimEvent.cc:6