78 const HepMC::GenEvent* myGenEvent = 0;
95 const HepMC::GenEvent* thePUEvents = 0;
98 bool isPileUpXF =
iEvent.getByLabel(
"mixGenPU",
"generator",theHepMCProductCrossingFrame);
102 bool genPartXF =
iEvent.getByLabel(
"genParticlesFromMixingModule",genEvtXF);
103 if(genPartXF) myGenParticlesXF = &(*genEvtXF);
109 myGenEvent = theHepMCProduct->GetEvent();
111 if ( theVertexGenerator ) {
112 TMatrixD* boost = theVertexGenerator->boost();
113 if ( boost ) theHepMCProduct->boostToLab(boost,
"momentum");
115 myGenEvent = theHepMCProduct->GetEvent();
118 fevt->setBeamSpot(BSPosition_);
121 bool genPart =
false;
126 if ( genPart ) myGenParticles = &(*genEvt);
129 if ( !myGenEvent && !genPart )
130 std::cout <<
"There is no generator input for this event, under "
131 <<
"any form (HepMCProduct, genParticles)" << std::endl
132 <<
"Please check SourceLabel or GenParticleLabel" << std::endl;
137 bool isPileUp =
iEvent.getByLabel(
"famosPileUp",
"PileUpEvents",thePileUpEvents);
138 thePUEvents = isPileUp ? thePileUpEvents->GetEvent() : 0;
143 if (myGenParticlesXF) {
151 if ( theVertexGenerator ) {
152 HepMC::FourVector theVertex(
153 (theVertexGenerator->X()-theVertexGenerator->beamSpot().X()+BSPosition_.X())*10.,
154 (theVertexGenerator->Y()-theVertexGenerator->beamSpot().Y()+BSPosition_.Y())*10.,
155 (theVertexGenerator->Z()-theVertexGenerator->beamSpot().Z()+BSPosition_.Z())*10.,
157 if ( fabs(theVertexGenerator->Z()) > 1E-10 ) theHepMCProduct->applyVtxGen( &theVertex );
184 calo->loadFromEcalBarrel(*
p4);
185 calo->loadFromEcalEndcap(*p5);
186 calo->loadFromPreshower(*p6);
187 calo->loadFromHcal(*p7);
189 calo->loadMuonSimTracks(*m1);
197 iEvent.put(v1,
"VertexTypes");
199 iEvent.put(p5,
"EcalHitsEE");
200 iEvent.put(p6,
"EcalHitsES");
201 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
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