9 #include "Pythia8/HIUserHooks.h"
10 #include "Pythia8Plugins/HepMC2.h"
11 #include "HepMC/GenEvent.h"
12 #include "HepMC/IO_GenEvent.h"
16 #include "Rivet/Rivet.hh"
42 : pythia(&pytin), filename(fname), rivet(0) {}
71 rivet =
new Rivet::AnalysisHandler(rname);
72 Rivet::addAnalysisLibPath(
".");
73 vector<string> anals(analyses.begin(), analyses.end());
74 rivet->addAnalyses(anals);
83 this->operator()(pythia->event, -1, &pythia->info, &pythia->settings);
93 converter.fill_next_event(event, &geneve, ievnum, pyinfo, pyset,
94 append, rootParticle, iBarcode);
95 if ( pyinfo && pyinfo->hiinfo ) {
98 ion.
set_Ncoll(pyinfo->hiinfo->nAbsProj() +
99 pyinfo->hiinfo->nDiffProj() +
100 pyinfo->hiinfo->nAbsTarg() +
101 pyinfo->hiinfo->nDiffTarg() -
102 pyinfo->hiinfo->nCollND() -
103 pyinfo->hiinfo->nCollDD());
105 pyinfo->hiinfo->nDiffProj());
107 pyinfo->hiinfo->nDiffTarg());
111 if ( !rivet ) init(geneve);
112 rivet->analyze(geneve);
120 if ( !rivet )
return;
122 rivet->writeData(filename);
142 set<string> analyses;
147 Rivet::AnalysisHandler * rivet;
void addRunName(const string runname)
void operator()(Event &event, int ievnum=-1, Pythia8::Info *pyinfo=0, Pythia8::Settings *pyset=0, bool append=false, HepMC::GenParticle *rootParticle=0, int iBarcode=-1)
void set_impact_parameter(const float &f)
set Impact Parameter in fm
void set_Npart_proj(const int &i)
set number of projectile participants
void init(const HepMC::GenEvent &gev)
void set_Npart_targ(const int &i)
set number of target participants
Pythia8Rivet(Pythia &pytin, string fname)
void set_Ncoll(const int &i)
set number of NN (nucleon-nucleon) collisions
The GenEvent class is the core of HepMC.
void addAnalysis(string ana)
void set_heavy_ion(const HeavyIon &ion)
provide a pointer to the HeavyIon container
void set_Ncoll_hard(const int &i)
set number of hard scatterings
The HeavyIon class stores information about heavy ions.
The GenParticle class contains information about generated particles.