29 #include "HepMC/GenEvent.h"
30 #include "HepMC/GenVertex.h"
39 produces<edm::SimTrackContainer>();
40 produces<edm::SimVertexContainer>();
41 produces<FSimVertexTypeCollection>(
"VertexTypes");
42 produces<edm::PSimHitContainer>(
"TrackerHits");
43 produces<edm::PCaloHitContainer>(
"EcalHitsEB");
44 produces<edm::PCaloHitContainer>(
"EcalHitsEE");
45 produces<edm::PCaloHitContainer>(
"EcalHitsES");
46 produces<edm::PCaloHitContainer>(
"HcalHits");
49 if ( simulateMuons ) produces<edm::SimTrackContainer>(
"MuonSimTracks");
89 const HepMC::GenEvent* myGenEvent = 0;
106 const HepMC::GenEvent* thePUEvents = 0;
109 bool isPileUpXF = iEvent.
getByLabel(
"mixGenPU",
"generator",theHepMCProductCrossingFrame);
113 bool genPartXF = iEvent.
getByLabel(
"genParticlesFromMixingModule",genEvtXF);
114 if(genPartXF) myGenParticlesXF = &(*genEvtXF);
120 myGenEvent = theHepMCProduct->GetEvent();
122 if ( theVertexGenerator ) {
123 TMatrixD* boost = theVertexGenerator->boost();
124 if ( boost ) theHepMCProduct->boostToLab(boost,
"momentum");
126 myGenEvent = theHepMCProduct->GetEvent();
129 fevt->setBeamSpot(BSPosition_);
132 bool genPart =
false;
137 if ( genPart ) myGenParticles = &(*genEvt);
140 if ( !myGenEvent && !genPart )
141 std::cout <<
"There is no generator input for this event, under "
142 <<
"any form (HepMCProduct, genParticles)" << std::endl
143 <<
"Please check SourceLabel or GenParticleLabel" << std::endl;
148 bool isPileUp = iEvent.
getByLabel(
"famosPileUp",
"PileUpEvents",thePileUpEvents);
149 thePUEvents = isPileUp ? thePileUpEvents->GetEvent() : 0;
154 if (myGenParticlesXF) {
162 if ( theVertexGenerator ) {
163 HepMC::FourVector theVertex(
164 (theVertexGenerator->X()-theVertexGenerator->beamSpot().X()+BSPosition_.X())*10.,
165 (theVertexGenerator->Y()-theVertexGenerator->beamSpot().Y()+BSPosition_.Y())*10.,
166 (theVertexGenerator->Z()-theVertexGenerator->beamSpot().Z()+BSPosition_.Z())*10.,
168 if ( fabs(theVertexGenerator->Z()) > 1E-10 ) theHepMCProduct->applyVtxGen( &theVertex );
195 calo->loadFromEcalBarrel(*p4);
196 calo->loadFromEcalEndcap(*p5);
197 calo->loadFromPreshower(*p6);
198 calo->loadFromHcal(*p7);
200 calo->loadMuonSimTracks(*m1);
207 iEvent.
put(p3,
"TrackerHits");
208 iEvent.
put(v1,
"VertexTypes");
209 iEvent.
put(p4,
"EcalHitsEB");
210 iEvent.
put(p5,
"EcalHitsEE");
211 iEvent.
put(p6,
"EcalHitsES");
212 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)
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
void reconstruct(const HepMC::GenEvent *evt, const reco::GenParticleCollection *particles, const HepMC::GenEvent *pu, const TrackerTopology *tTopo, RandomEngineAndDistribution const *)
The real thing is done here.
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
StreamID streamID() const
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.
static std::string const source