1 #ifndef HI_MixEvtVtxGenerator_H
2 #define HI_MixEvtVtxGenerator_H
45 virtual HepMC::FourVector* getVertex(
edm::Event&);
46 virtual HepMC::FourVector* getRecVertex(
edm::Event&);
63 : fVertex(0), boost_(0),
64 signalLabel(pset.getParameter<edm::
InputTag>(
"signalLabel")),
65 hiLabel(pset.getParameter<edm::
InputTag>(
"heavyIonLabel")),
66 useRecVertex(pset.exists(
"useRecVertex")?pset.getParameter<bool>(
"useRecVertex"):
false)
69 produces<bool>(
"matchedVertex");
87 const HepMC::GenEvent* inev = input->GetEvent();
88 HepMC::GenVertex* genvtx = inev->signal_process_vertex();
90 cout<<
"No Signal Process Vertex!"<<endl;
91 HepMC::GenEvent::particle_const_iterator pt=inev->particles_begin();
92 HepMC::GenEvent::particle_const_iterator ptend=inev->particles_end();
93 while(!genvtx || ( genvtx->particles_in_size() == 1 && pt != ptend ) ){
94 if(!genvtx)
cout<<
"No Gen Vertex!"<<endl;
95 if(pt == ptend)
cout<<
"End reached!"<<endl;
96 genvtx = (*pt)->production_vertex();
102 aX = genvtx->position().x();
103 aY = genvtx->position().y();
104 aZ = genvtx->position().z();
105 aT = genvtx->position().t();
122 aX = input->begin()->position().x() +
vtxOffset[0];
123 aY = input->begin()->position().y() +
vtxOffset[1];
124 aZ = input->begin()->position().z() +
vtxOffset[2];
142 fVertex->set(10.0*aX,10.0*aY,10.0*aZ,0.0);
166 auto_ptr<bool> NewProduct(
new bool(
true)) ;
167 evt.
put( NewProduct ,
"matchedVertex") ;
T getParameter(std::string const &) const
virtual HepMC::FourVector * getRecVertex(edm::Event &)
std::vector< double > vtxOffset
#define DEFINE_FWK_MODULE(type)
bool exists(std::string const ¶meterName) const
checks if a parameter exists
MixEvtVtxGenerator(const edm::ParameterSet &)
virtual HepMC::FourVector * getVertex(edm::Event &)
edm::InputTag signalLabel
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
HepMC::FourVector * fVertex
virtual void produce(edm::Event &, const edm::EventSetup &)
virtual ~MixEvtVtxGenerator()