85 const HepMC::GenEvent* myGenEvent = 0;
93 myGenEvent = theHepMCProduct->GetEvent();
95 if ( theVertexGenerator ) {
96 TMatrixD* boost = theVertexGenerator->boost();
97 if ( boost ) theHepMCProduct->boostToLab(boost,
"momentum");
99 myGenEvent = theHepMCProduct->GetEvent();
103 bool genPart =
false;
109 if ( genPart ) myGenParticles = &(*genEvt);
112 if ( !myGenEvent && !genPart )
113 std::cout <<
"There is no generator input for this event, under "
114 <<
"any form (HepMCProduct, genParticles)" << std::endl
115 <<
"Please check SourceLabel or GenParticleLabel" << std::endl;
121 bool isPileUp =
iEvent.getByLabel(
"famosPileUp",
"PileUpEvents",thePileUpEvents);
122 const HepMC::GenEvent* thePUEvents = isPileUp ? thePileUpEvents->GetEvent() : 0;
125 if ( myGenEvent || myGenParticles )
130 if ( theVertexGenerator ) {
131 HepMC::FourVector theVertex(
132 (theVertexGenerator->X()-theVertexGenerator->beamSpot().X()+BSPosition_.X())*10.,
133 (theVertexGenerator->Y()-theVertexGenerator->beamSpot().Y()+BSPosition_.Y())*10.,
134 (theVertexGenerator->Z()-theVertexGenerator->beamSpot().Z()+BSPosition_.Z())*10.,
136 if ( fabs(theVertexGenerator->Z()) > 1E-10 ) theHepMCProduct->applyVtxGen( &theVertex );
163 calo->loadFromEcalBarrel(*
p4);
164 calo->loadFromEcalEndcap(*p5);
165 calo->loadFromPreshower(*p6);
166 calo->loadFromHcal(*p7);
168 calo->loadMuonSimTracks(*m1);
176 iEvent.put(v1,
"VertexTypes");
178 iEvent.put(p5,
"EcalHitsEE");
179 iEvent.put(p6,
"EcalHitsES");
180 iEvent.put(p7,
"HcalHits");
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
std::vector< PCaloHit > PCaloHitContainer
void reconstruct(const HepMC::GenEvent *evt, const reco::GenParticleCollection *particles, const HepMC::GenEvent *pu)
The real thing is done here.
edm::InputTag theBeamSpotLabel
FamosManager * famosManager_
edm::InputTag theSourceLabel
std::vector< FSimVertexType > FSimVertexTypeCollection
collection of FSimVertexType objects
void setBeamSpot(const math::XYZPoint &aBeamSpot)
Set the beam spot position.
edm::InputTag theGenParticleLabel
CalorimetryManager * calorimetryManager() const
The calorimeter.
XYZPointD XYZPoint
point in space with cartesian internal representation
std::vector< SimVertex > SimVertexContainer
std::vector< PSimHit > PSimHitContainer
TrajectoryManager * trackerManager() const
The tracker.
FSimEvent * simEvent() const
The generated event.
std::vector< SimTrack > SimTrackContainer