26 #include "HepMC/GenVertex.h"
27 #include "HepMC/GenEvent.h"
36 produces<edm::SimTrackContainer>();
37 produces<edm::SimVertexContainer>();
38 produces<FSimVertexTypeCollection>(
"VertexTypes");
39 produces<edm::PSimHitContainer>(
"TrackerHits");
40 produces<edm::PCaloHitContainer>(
"EcalHitsEB");
41 produces<edm::PCaloHitContainer>(
"EcalHitsEE");
42 produces<edm::PCaloHitContainer>(
"EcalHitsES");
43 produces<edm::PCaloHitContainer>(
"HcalHits");
46 if ( simulateMuons ) produces<edm::SimTrackContainer>(
"MuonSimTracks");
59 puToken = consumes<edm::HepMCProduct>(_label);
62 mixSourceToken = consumes<CrossingFrame<edm::HepMCProduct> >(_label);
100 const HepMC::GenEvent* myGenEvent = 0;
117 const HepMC::GenEvent* thePUEvents = 0;
125 if(genPartXF) myGenParticlesXF = &(*genEvtXF);
133 myGenEvent = theHepMCProduct->GetEvent();
135 if ( theVertexGenerator ) {
136 TMatrixD* boost = theVertexGenerator->boost();
137 if ( boost ) theHepMCProduct->boostToLab(boost,
"momentum");
139 myGenEvent = theHepMCProduct->GetEvent();
142 fevt->setBeamSpot(BSPosition_);
145 bool genPart =
false;
151 if ( genPart ) myGenParticles = &(*genEvt);
154 if ( !myGenEvent && !genPart )
155 std::cout <<
"There is no generator input for this event, under "
156 <<
"any form (HepMCProduct, genParticles)" << std::endl
157 <<
"Please check SourceLabel or GenParticleLabel" << std::endl;
164 thePUEvents = isPileUp ? thePileUpEvents->GetEvent() : 0;
170 if (myGenParticlesXF) {
179 if ( theVertexGenerator ) {
180 HepMC::FourVector theVertex(
181 (theVertexGenerator->X()-theVertexGenerator->beamSpot().X()+BSPosition_.X())*10.,
182 (theVertexGenerator->Y()-theVertexGenerator->beamSpot().Y()+BSPosition_.Y())*10.,
183 (theVertexGenerator->Z()-theVertexGenerator->beamSpot().Z()+BSPosition_.Z())*10.,
185 if ( fabs(theVertexGenerator->Z()) > 1E-10 ) theHepMCProduct->applyVtxGen( &theVertex );
213 calo->loadFromEcalBarrel(*p4);
214 calo->loadFromEcalEndcap(*p5);
215 calo->loadFromPreshower(*p6);
216 calo->loadFromHcal(*p7);
218 calo->loadMuonSimTracks(*m1);
225 iEvent.
put(p3,
"TrackerHits");
226 iEvent.
put(v1,
"VertexTypes");
227 iEvent.
put(p4,
"EcalHitsEB");
228 iEvent.
put(p5,
"EcalHitsEE");
229 iEvent.
put(p6,
"EcalHitsES");
230 iEvent.
put(p7,
"HcalHits");
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
T getParameter(std::string const &) const
edm::EDGetTokenT< reco::BeamSpot > beamSpotToken
std::vector< PCaloHit > PCaloHitContainer
bool getByToken(EDGetToken token, Handle< PROD > &result) const
virtual void endJob() override
#define DEFINE_FWK_MODULE(type)
const HepPDT::ParticleDataTable * theTable() const
Get the pointer to the particle data table.
edm::InputTag sourceLabel
edm::EDGetTokenT< reco::GenParticleCollection > genParticleToken
FamosManager * famosManager_
edm::InputTag genParticleLabel
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.
std::vector< FSimVertexType > FSimVertexTypeCollection
collection of FSimVertexType objects
edm::EDGetTokenT< edm::HepMCProduct > puToken
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.
CalorimetryManager * calorimetryManager() const
The calorimeter.
edm::EDGetTokenT< edm::HepMCProduct > sourceToken
edm::EDGetTokenT< reco::GenParticleCollection > mixGenParticleToken
edm::InputTag beamSpotLabel
XYZPointD XYZPoint
point in space with cartesian internal representation
std::vector< SimVertex > SimVertexContainer
edm::EDGetTokenT< CrossingFrame< edm::HepMCProduct > > mixSourceToken
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