Skip to content
Snippets Groups Projects
Commit a72bb9a3 authored by Vladimir Lyubushkin's avatar Vladimir Lyubushkin Committed by Graeme Stewart
Browse files

use HepMC::GenEvent() instead of GenEvent(); ATLASSIM-2044; tag as...

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
parent 6239100a
No related branches found
No related tags found
No related merge requests found
...@@ -18,7 +18,9 @@ ...@@ -18,7 +18,9 @@
#include "Pythia8_i/Pythia8_i.h" #include "Pythia8_i/Pythia8_i.h"
class GenEvent; namespace HepMC {
class GenEvent;
}
class MultiPy8Pileup : public Pythia8_i { class MultiPy8Pileup : public Pythia8_i {
...@@ -30,21 +32,21 @@ class MultiPy8Pileup : public Pythia8_i { ...@@ -30,21 +32,21 @@ class MultiPy8Pileup : public Pythia8_i {
virtual StatusCode genFinalize(); virtual StatusCode genFinalize();
virtual StatusCode callGenerator(); virtual StatusCode callGenerator();
virtual StatusCode fillEvt( GenEvent *event ); virtual StatusCode fillEvt( HepMC::GenEvent *event );
private: private:
int nPileupEvents(); // decide how much pileup events will be generated int nPileupEvents(); // decide how much pileup events will be generated
// parameters // parameters
int m_ncollevent; // fixed number of collisions per event int m_ncollevent; // fixed number of collisions per event
std::vector<int> m_pileupProfile; // pileup mu-profile std::vector< int > m_pileupProfile; // pileup mu-profile
std::vector<float> m_multbcid; // mu multipliers per BCID std::vector< float > m_multbcid; // mu multipliers per BCID
std::string m_filename; // filename for histogram output std::string m_filename; // filename for histogram output
int m_ngen; // total number of events generated int m_ngen; // total number of events generated
int m_nbad; // total number of failed events 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; CLHEP::HepRandomEngine *m_randomEngine;
......
...@@ -17,8 +17,12 @@ MultiPy8Pileup::MultiPy8Pileup(const std::string& name, ISvcLocator* pSvcLocator ...@@ -17,8 +17,12 @@ MultiPy8Pileup::MultiPy8Pileup(const std::string& name, ISvcLocator* pSvcLocator
Pythia8_i::Pythia8_i( name, pSvcLocator ), Pythia8_i::Pythia8_i( name, pSvcLocator ),
m_ngen(0), m_ngen(0),
m_nbad(0), m_nbad(0),
m_evnumber(1), // m_evnumber(1),
m_randomEngine(NULL),m_file(NULL) 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("NCollPerEvent",m_ncollevent=20,"Collisons per event (-1 to use profile)");
declareProperty("PileupProfile",m_pileupProfile,"Pileup profile array"); declareProperty("PileupProfile",m_pileupProfile,"Pileup profile array");
...@@ -98,12 +102,12 @@ StatusCode MultiPy8Pileup::callGenerator() { ...@@ -98,12 +102,12 @@ StatusCode MultiPy8Pileup::callGenerator() {
<< " for BCID " << bcid); << " for BCID " << bcid);
StatusCode sc=Pythia8_i::callGenerator(); StatusCode sc=Pythia8_i::callGenerator();
if (sc==StatusCode::SUCCESS) { if (sc==StatusCode::SUCCESS) {
GenEvent* evt=new GenEvent(); HepMC::GenEvent* evt=new HepMC::GenEvent();
if (Pythia8_i::fillEvt(evt)==StatusCode::SUCCESS) { if (Pythia8_i::fillEvt(evt)==StatusCode::SUCCESS) {
// change the process ID to incorporate the BCID * 10000 // change the process ID to incorporate the BCID * 10000
int pid=evt->signal_process_id(); int pid=evt->signal_process_id();
evt->set_signal_process_id(pid+10000*bcid); 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); evt->signal_process_id() << " for BCID " << bcid);
m_evts.push_back(evt); m_evts.push_back(evt);
++m_ngen; ++m_ngen;
...@@ -117,12 +121,12 @@ StatusCode MultiPy8Pileup::callGenerator() { ...@@ -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"); " pileup events in buffer");
return StatusCode::SUCCESS; return StatusCode::SUCCESS;
} }
StatusCode MultiPy8Pileup::fillEvt(GenEvent* evt) { StatusCode MultiPy8Pileup::fillEvt(HepMC::GenEvent* evt) {
int nbuf=m_evts.size(); int nbuf=m_evts.size();
if (nbuf>1) { if (nbuf>1) {
// send extra events into McEventCollection via backdoor // send extra events into McEventCollection via backdoor
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment