14#include "CLHEP/Random/RandPoisson.h"
44 m_htgPileupProfile =
new TH1D(
"pileupProfile",
"input pileupProfile", 100, 0., 100. );
45 m_htgPileupMu =
new TH1D(
"generatedMu",
"generated pileup mu", 100, 0., 100. );
46 m_htgPileupEvents =
new TH1D(
"generatedEvents",
"generated pileup events", 100, 0., 100. );
61 ATH_MSG_INFO(
"Generate varying minbias collisions per event according to given pileup profile");
67 for (std::vector<float>::const_iterator itr=
m_multbcid.begin();
69 ATH_MSG_INFO(
"Bunch crossing BCID " << ibc <<
" mu multiplier " << *itr);
78 const EventContext& ctx = Gaudi::Hive::currentContext();
79 CLHEP::HepRandomEngine* rndmEngine = this->
getRandomEngine(
"MultiPy8Pileup", ctx);
88 for (std::vector<float>::const_iterator bcitr=
m_multbcid.begin();
92 const int nevtraw=CLHEP::RandPoisson::shoot(muval);
94 const int nevt=(float)nevtraw*(*bcitr);
96 for (
int ievt=0;ievt<nevt;++ievt) {
97 ATH_MSG_DEBUG(
"Request generation of event " << ievt <<
" of " << nevt
98 <<
" for BCID " << bcid);
100 if (
sc==StatusCode::SUCCESS) {
101 HepMC::GenEvent* evt=
new HepMC::GenEvent();
122 " pileup events in buffer");
123 return StatusCode::SUCCESS;
130 for (
int i=1;i<nbuf;++i) {
131 events()->push_back(
m_evts[i]);
140 return StatusCode::SUCCESS;
#define ATH_MSG_WARNING(x)
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
CLHEP::HepRandomEngine * getRandomEngine(const std::string &streamName, const EventContext &ctx) const
std::vector< int > m_pileupProfile
virtual StatusCode callGenerator()
For calling the generator on each iteration of the event loop.
std::vector< float > m_multbcid
MultiPy8Pileup(const std::string &name, ISvcLocator *pSvcLocator)
std::vector< double > m_pileupProfileIntegral
virtual StatusCode genFinalize()
For finalising the generator, if required.
virtual StatusCode fillEvt(HepMC::GenEvent *event)
For filling the HepMC event object.
int nPileupEvents(CLHEP::HepRandomEngine *rndmEngine)
TH1D * m_htgPileupProfile
std::vector< HepMC::GenEvent * > m_evts
virtual StatusCode genInitialize()
For initializing the generator, if required.
virtual StatusCode genInitialize()
For initializing the generator, if required.
virtual StatusCode fillEvt(HepMC::GenEvent *evt)
For filling the HepMC event object.
virtual StatusCode callGenerator()
For calling the generator on each iteration of the event loop.
virtual StatusCode genFinalize()
For finalising the generator, if required.
Pythia8_i(const std::string &name, ISvcLocator *pSvcLocator)
int signal_process_id(const GenEvent &e)
void set_signal_process_id(GenEvent *e, const int i)
void fillBarcodesAttribute(GenEvent *)