|
ATLAS Offline Software
|
Go to the documentation of this file.
14 #include "CLHEP/Random/RandPoisson.h"
23 m_htgPileupProfile(NULL),
25 m_htgPileupEvents(NULL)
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) {
140 return StatusCode::SUCCESS;
JetConstituentVector::iterator iterator
std::vector< double > m_pileupProfileIntegral
std::vector< float > m_multbcid
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
int signal_process_id(const GenEvent &e)
bool accumulate(AccumulateMap &map, std::vector< module_t > const &modules, FPGATrackSimMatrixAccumulator const &acc)
Accumulates an accumulator (e.g.
std::vector< HepMC::GenEvent * > m_evts
virtual StatusCode genFinalize()
For finalising the generator, if required.
void fillBarcodesAttribute(GenEvent *)
virtual StatusCode genInitialize()
For initializing the generator, if required.
TH1D * m_htgPileupProfile
CLHEP::HepRandomEngine * getRandomEngine(const std::string &streamName, const EventContext &ctx) const
std::unique_ptr< TFile > m_file
description: this is a custom writer for the old-school drivers that don't use an actual writer
virtual StatusCode callGenerator()
For calling the generator on each iteration of the event loop.
MultiPy8Pileup(const std::string &name, ISvcLocator *pSvcLocator)
virtual StatusCode fillEvt(HepMC::GenEvent *evt)
For filling the HepMC event object.
::StatusCode StatusCode
StatusCode definition for legacy code.
virtual StatusCode callGenerator()
For calling the generator on each iteration of the event loop.
virtual StatusCode genFinalize()
For finalising the generator, if required.
virtual StatusCode fillEvt(HepMC::GenEvent *event)
For filling the HepMC event object.
std::vector< int > m_pileupProfile
setEventNumber setTimeStamp bcid
int nPileupEvents(CLHEP::HepRandomEngine *rndmEngine)
#define ATH_MSG_WARNING(x)
void set_signal_process_id(GenEvent *e, const int i)
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
virtual StatusCode genInitialize()
For initializing the generator, if required.