28 #include "HepMC/GenEvent.h"
29 #include "HepMC/GenVertex.h"
38 produces<edm::SimTrackContainer>();
39 produces<edm::SimVertexContainer>();
40 produces<FSimVertexTypeCollection>(
"VertexTypes");
41 produces<edm::PSimHitContainer>(
"TrackerHits");
42 produces<edm::PCaloHitContainer>(
"EcalHitsEB");
43 produces<edm::PCaloHitContainer>(
"EcalHitsEE");
44 produces<edm::PCaloHitContainer>(
"EcalHitsES");
45 produces<edm::PCaloHitContainer>(
"HcalHits");
48 if ( simulateMuons ) produces<edm::SimTrackContainer>(
"MuonSimTracks");
86 const HepMC::GenEvent* myGenEvent = 0;
103 const HepMC::GenEvent* thePUEvents = 0;
106 bool isPileUpXF = iEvent.
getByLabel(
"mixGenPU",
"generator",theHepMCProductCrossingFrame);
110 bool genPartXF = iEvent.
getByLabel(
"genParticlesFromMixingModule",genEvtXF);
111 if(genPartXF) myGenParticlesXF = &(*genEvtXF);
117 myGenEvent = theHepMCProduct->GetEvent();
119 if ( theVertexGenerator ) {
120 TMatrixD* boost = theVertexGenerator->boost();
121 if ( boost ) theHepMCProduct->boostToLab(boost,
"momentum");
123 myGenEvent = theHepMCProduct->GetEvent();
126 fevt->setBeamSpot(BSPosition_);
129 bool genPart =
false;
134 if ( genPart ) myGenParticles = &(*genEvt);
137 if ( !myGenEvent && !genPart )
138 std::cout <<
"There is no generator input for this event, under "
139 <<
"any form (HepMCProduct, genParticles)" << std::endl
140 <<
"Please check SourceLabel or GenParticleLabel" << std::endl;
145 bool isPileUp = iEvent.
getByLabel(
"famosPileUp",
"PileUpEvents",thePileUpEvents);
146 thePUEvents = isPileUp ? thePileUpEvents->GetEvent() : 0;
151 if (myGenParticlesXF) {
159 if ( theVertexGenerator ) {
160 HepMC::FourVector theVertex(
161 (theVertexGenerator->X()-theVertexGenerator->beamSpot().X()+BSPosition_.X())*10.,
162 (theVertexGenerator->Y()-theVertexGenerator->beamSpot().Y()+BSPosition_.Y())*10.,
163 (theVertexGenerator->Z()-theVertexGenerator->beamSpot().Z()+BSPosition_.Z())*10.,
165 if ( fabs(theVertexGenerator->Z()) > 1E-10 ) theHepMCProduct->applyVtxGen( &theVertex );
192 calo->loadFromEcalBarrel(*p4);
193 calo->loadFromEcalEndcap(*p5);
194 calo->loadFromPreshower(*p6);
195 calo->loadFromHcal(*p7);
197 calo->loadMuonSimTracks(*m1);
204 iEvent.
put(p3,
"TrackerHits");
205 iEvent.
put(v1,
"VertexTypes");
206 iEvent.
put(p4,
"EcalHitsEB");
207 iEvent.
put(p5,
"EcalHitsEE");
208 iEvent.
put(p6,
"EcalHitsES");
209 iEvent.
put(p7,
"HcalHits");
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
T getParameter(std::string const &) const
std::vector< PCaloHit > PCaloHitContainer
virtual void endJob() override
#define DEFINE_FWK_MODULE(type)
void reconstruct(const HepMC::GenEvent *evt, const reco::GenParticleCollection *particles, const HepMC::GenEvent *pu, const TrackerTopology *tTopo)
The real thing is done here.
edm::InputTag theBeamSpotLabel
FamosManager * famosManager_
virtual void beginRun(edm::Run const &run, const edm::EventSetup &es) override
FamosProducer(edm::ParameterSet const &p)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
edm::InputTag theSourceLabel
std::vector< FSimVertexType > FSimVertexTypeCollection
collection of FSimVertexType objects
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
edm::InputTag theGenParticleLabel
CalorimetryManager * calorimetryManager() const
The calorimeter.
XYZPointD XYZPoint
point in space with cartesian internal representation
std::vector< SimVertex > SimVertexContainer
virtual void produce(edm::Event &e, const edm::EventSetup &c) override
std::vector< PSimHit > PSimHitContainer
TrajectoryManager * trackerManager() const
The tracker.
FSimEvent * simEvent() const
The generated event.
std::vector< SimTrack > SimTrackContainer
void setupGeometryAndField(edm::Run const &run, const edm::EventSetup &es)
Get information from the Event Setup.