From a72bb9a325a81321cfe57ce9279d1d0424cbaafb Mon Sep 17 00:00:00 2001 From: Vladimir Lyubushkin <Vladimir.Lyubushkin@cern.ch> Date: Wed, 24 Jun 2015 12:03:24 +0200 Subject: [PATCH] use HepMC::GenEvent() instead of GenEvent(); ATLASSIM-2044; tag as FastChainPileup-00-00-06 (FastChainPileup-00-00-06) * use HepMC::GenEvent() instead of GenEvent(), ATLASSIM-2044 * Tag as FastChainPileup-00-00-06 2015-05-19 Vladimir Lyubushkin <vladimir.lyubushkin@cern.ch> * add initialization for histogramms pointers in constructor * Tag as FastChainPileup-00-00-05 --- .../FastChainPileup/MultiPy8Pileup.h | 14 ++++++++------ .../FastChainPileup/src/MultiPy8Pileup.cxx | 16 ++++++++++------ 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/Simulation/FastSimulation/FastChainPileup/FastChainPileup/MultiPy8Pileup.h b/Simulation/FastSimulation/FastChainPileup/FastChainPileup/MultiPy8Pileup.h index 8eb6a17f78d..b1f674c029b 100644 --- a/Simulation/FastSimulation/FastChainPileup/FastChainPileup/MultiPy8Pileup.h +++ b/Simulation/FastSimulation/FastChainPileup/FastChainPileup/MultiPy8Pileup.h @@ -18,7 +18,9 @@ #include "Pythia8_i/Pythia8_i.h" -class GenEvent; +namespace HepMC { + class GenEvent; +} class MultiPy8Pileup : public Pythia8_i { @@ -30,21 +32,21 @@ class MultiPy8Pileup : public Pythia8_i { virtual StatusCode genFinalize(); virtual StatusCode callGenerator(); - virtual StatusCode fillEvt( GenEvent *event ); + virtual StatusCode fillEvt( HepMC::GenEvent *event ); private: int nPileupEvents(); // decide how much pileup events will be generated // parameters int m_ncollevent; // fixed number of collisions per event - std::vector<int> m_pileupProfile; // pileup mu-profile - std::vector<float> m_multbcid; // mu multipliers per BCID + std::vector< int > m_pileupProfile; // pileup mu-profile + std::vector< float > m_multbcid; // mu multipliers per BCID std::string m_filename; // filename for histogram output int m_ngen; // total number of events generated int m_nbad; // total number of failed events - int m_evnumber; // event sequence number + // int m_evnumber; // event sequence number - std::vector<GenEvent*> m_evts; // vector of generated minbias events + std::vector< HepMC::GenEvent * > m_evts; // vector of generated minbias events CLHEP::HepRandomEngine *m_randomEngine; diff --git a/Simulation/FastSimulation/FastChainPileup/src/MultiPy8Pileup.cxx b/Simulation/FastSimulation/FastChainPileup/src/MultiPy8Pileup.cxx index 551d0c8f4ff..1185a996454 100644 --- a/Simulation/FastSimulation/FastChainPileup/src/MultiPy8Pileup.cxx +++ b/Simulation/FastSimulation/FastChainPileup/src/MultiPy8Pileup.cxx @@ -17,8 +17,12 @@ MultiPy8Pileup::MultiPy8Pileup(const std::string& name, ISvcLocator* pSvcLocator Pythia8_i::Pythia8_i( name, pSvcLocator ), m_ngen(0), m_nbad(0), - m_evnumber(1), - m_randomEngine(NULL),m_file(NULL) + // m_evnumber(1), + m_randomEngine(NULL), + m_file(NULL), + m_htgPileupProfile(NULL), + m_htgPileupMu(NULL), + m_htgPileupEvents(NULL) { declareProperty("NCollPerEvent",m_ncollevent=20,"Collisons per event (-1 to use profile)"); declareProperty("PileupProfile",m_pileupProfile,"Pileup profile array"); @@ -98,12 +102,12 @@ StatusCode MultiPy8Pileup::callGenerator() { << " for BCID " << bcid); StatusCode sc=Pythia8_i::callGenerator(); if (sc==StatusCode::SUCCESS) { - GenEvent* evt=new GenEvent(); + HepMC::GenEvent* evt=new HepMC::GenEvent(); if (Pythia8_i::fillEvt(evt)==StatusCode::SUCCESS) { // change the process ID to incorporate the BCID * 10000 int pid=evt->signal_process_id(); evt->set_signal_process_id(pid+10000*bcid); - ATH_MSG_DEBUG("Signal process ID " << pid << " set to " << + ATH_MSG_DEBUG("Signal process ID " << pid << " set to " << evt->signal_process_id() << " for BCID " << bcid); m_evts.push_back(evt); ++m_ngen; @@ -117,12 +121,12 @@ StatusCode MultiPy8Pileup::callGenerator() { } } } - ATH_MSG_DEBUG("callGenerator finished with " << m_evts.size() << + ATH_MSG_DEBUG("callGenerator finished with " << m_evts.size() << " pileup events in buffer"); return StatusCode::SUCCESS; } -StatusCode MultiPy8Pileup::fillEvt(GenEvent* evt) { +StatusCode MultiPy8Pileup::fillEvt(HepMC::GenEvent* evt) { int nbuf=m_evts.size(); if (nbuf>1) { // send extra events into McEventCollection via backdoor -- GitLab