CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
gen::ReggeGribovPartonMCHadronizer Class Reference

#include <ReggeGribovPartonMC.h>

Inheritance diagram for gen::ReggeGribovPartonMCHadronizer:
gen::BaseHadronizer gen::BaseHadronizer

Public Member Functions

const char * classname () const
 
bool decay ()
 
bool declareSpecialSettings (const std::vector< std::string > &)
 
bool declareStableParticles (const std::vector< int > &)
 
void finalizeEvent ()
 
bool generatePartonsAndHadronize ()
 
bool hadronize ()
 
bool initializeForExternalPartons ()
 
bool initializeForInternalPartons ()
 
bool initializeTablePaths ()
 
bool readSettings (int)
 
 ReggeGribovPartonMCHadronizer (const edm::ParameterSet &)
 
 ReggeGribovPartonMCHadronizer (const edm::ParameterSet &)
 
bool residualDecay ()
 
void statistics ()
 
 ~ReggeGribovPartonMCHadronizer () override
 
 ~ReggeGribovPartonMCHadronizer () override
 
- Public Member Functions inherited from gen::BaseHadronizer
 BaseHadronizer (edm::ParameterSet const &ps)
 
void cleanLHE ()
 
void generateLHE (edm::LuminosityBlock const &lumi, CLHEP::HepRandomEngine *rengine, unsigned int ncpu)
 
edm::EventgetEDMEvent () const
 
std::unique_ptr< HepMC::GenEventgetGenEvent ()
 
std::unique_ptr< HepMC3::GenEvent > getGenEvent3 ()
 
std::unique_ptr< GenEventInfoProductgetGenEventInfo ()
 
std::unique_ptr< GenEventInfoProduct3getGenEventInfo3 ()
 
virtual std::unique_ptr< GenLumiInfoHeadergetGenLumiInfoHeader () const
 
GenRunInfoProductgetGenRunInfo ()
 
std::unique_ptr< lhef::LHEEventgetLHEEvent ()
 
const std::shared_ptr< lhef::LHERunInfo > & getLHERunInfo () const
 
unsigned int getVHepMC ()
 
const std::string & gridpackPath () const
 
int randomIndex () const
 
const std::string & randomInitConfigDescription () const
 
void randomizeIndex (edm::LuminosityBlock const &lumi, CLHEP::HepRandomEngine *rengine)
 
void resetEvent (std::unique_ptr< HepMC::GenEvent > event)
 
void resetEvent3 (std::unique_ptr< HepMC3::GenEvent > event3)
 
void resetEventInfo (std::unique_ptr< GenEventInfoProduct > eventInfo)
 
void resetEventInfo3 (std::unique_ptr< GenEventInfoProduct3 > eventInfo)
 
virtual bool select (HepMC::GenEvent *) const
 
void setEDMEvent (edm::Event &event)
 
void setLHEEvent (std::unique_ptr< lhef::LHEEvent > event)
 
void setLHERunInfo (std::unique_ptr< lhef::LHERunInfo > runInfo)
 
void setRandomEngine (CLHEP::HepRandomEngine *v)
 
std::vector< std::string > const & sharedResources () const
 
virtual ~BaseHadronizer () noexcept(false)
 

Private Member Functions

void doSetRandomEngine (CLHEP::HepRandomEngine *v) override
 

Private Attributes

int m_BeamID
 
double m_BeamMomentum
 
double m_bMax
 
double m_bMin
 
int m_HEModel
 
double m_ImpactParameter
 
bool m_IsInitialized
 
int m_NEvent
 
int m_NParticles
 
edm::FileInPath m_ParamFileName
 
double m_PartEnergy [99990]
 
int m_PartID [99990]
 
double m_PartMass [99990]
 
double m_PartPx [99990]
 
double m_PartPy [99990]
 
double m_PartPz [99990]
 
int m_PartStatus [99990]
 
bool m_SkipNuclFrag
 
int m_TargetID
 
double m_TargetMomentum
 
edm::ParameterSet pset_
 

Additional Inherited Members

- Protected Member Functions inherited from gen::BaseHadronizer
std::unique_ptr< HepMC::GenEvent > & event ()
 
std::unique_ptr< HepMC3::GenEvent > & event3 ()
 
std::unique_ptr< GenEventInfoProduct > & eventInfo ()
 
std::unique_ptr< GenEventInfoProduct3 > & eventInfo3 ()
 
lhef::LHEEventlheEvent ()
 
lhef::LHERunInfolheRunInfo ()
 
GenRunInfoProductrunInfo ()
 
- Protected Attributes inherited from gen::BaseHadronizer
unsigned int ivhepmc = 2
 
std::string lheFile_
 
int randomIndex_
 

Detailed Description

Definition at line 20 of file ReggeGribovPartonMC.h.

Constructor & Destructor Documentation

◆ ReggeGribovPartonMCHadronizer() [1/2]

ReggeGribovPartonMCHadronizer::ReggeGribovPartonMCHadronizer ( const edm::ParameterSet pset)

Definition at line 56 of file ReggeGribovPartonMCHadronizer.cc.

References crmc_set_f_(), nano_mu_digi_cff::float, edm::FileInPath::fullPath(), initializeTablePaths(), m_BeamID, m_BeamMomentum, m_bMax, m_bMin, m_HEModel, m_ParamFileName, m_TargetID, m_TargetMomentum, and nucl2_.

58  pset_(pset),
59  m_BeamMomentum(pset.getParameter<double>("beammomentum")),
60  m_TargetMomentum(pset.getParameter<double>("targetmomentum")),
61  m_BeamID(pset.getParameter<int>("beamid")),
62  m_TargetID(pset.getParameter<int>("targetid")),
63  m_HEModel(pset.getParameter<int>("model")),
64  m_bMin(pset.getParameter<double>("bmin")),
65  m_bMax(pset.getParameter<double>("bmax")),
66  m_ParamFileName(pset.getUntrackedParameter<string>("paramFileName")),
67  m_SkipNuclFrag(pset.getParameter<bool>("skipNuclFrag")),
68  m_NEvent(0),
69  m_NParticles(0),
71  m_IsInitialized(false) {
72  int nevet = 1; //needed for CS
73  int noTables = 0; //don't calculate tables
74  int LHEoutput = 0; //no lhe
75  int dummySeed = 123;
76  char dummyName[] = "dummy";
77  crmc_set_f_(nevet,
78  dummySeed,
81  m_BeamID,
82  m_TargetID,
83  m_HEModel,
84  noTables,
85  LHEoutput,
86  dummyName,
87  m_ParamFileName.fullPath().c_str());
88 
89  //additionally initialise tables
91 
92  //change impact paramter
93  nucl2_.bminim = float(m_bMin);
94  nucl2_.bmaxim = float(m_bMax);
95 }
struct @763 nucl2_
std::string fullPath() const
Definition: FileInPath.cc:161
BaseHadronizer(edm::ParameterSet const &ps)
void crmc_set_f_(int &, int &, double &, double &, int &, int &, int &, int &, int &, const char *, const char *)

◆ ~ReggeGribovPartonMCHadronizer() [1/2]

ReggeGribovPartonMCHadronizer::~ReggeGribovPartonMCHadronizer ( )
override

Definition at line 98 of file ReggeGribovPartonMCHadronizer.cc.

98  {
99  // destructor
100 }

◆ ReggeGribovPartonMCHadronizer() [2/2]

gen::ReggeGribovPartonMCHadronizer::ReggeGribovPartonMCHadronizer ( const edm::ParameterSet )

◆ ~ReggeGribovPartonMCHadronizer() [2/2]

gen::ReggeGribovPartonMCHadronizer::~ReggeGribovPartonMCHadronizer ( )
override

Member Function Documentation

◆ classname()

const char * ReggeGribovPartonMCHadronizer::classname ( ) const

Definition at line 208 of file ReggeGribovPartonMCHadronizer.cc.

208 { return "gen::ReggeGribovPartonMCHadronizer"; }

◆ decay()

bool ReggeGribovPartonMCHadronizer::decay ( )

Definition at line 200 of file ReggeGribovPartonMCHadronizer.cc.

200 { return true; }

◆ declareSpecialSettings()

bool gen::ReggeGribovPartonMCHadronizer::declareSpecialSettings ( const std::vector< std::string > &  )
inline

Definition at line 193 of file ReggeGribovPartonMCHadronizer.h.

193 { return true; }

◆ declareStableParticles()

bool ReggeGribovPartonMCHadronizer::declareStableParticles ( const std::vector< int > &  )

Definition at line 210 of file ReggeGribovPartonMCHadronizer.cc.

210 { return true; }

◆ doSetRandomEngine()

void ReggeGribovPartonMCHadronizer::doSetRandomEngine ( CLHEP::HepRandomEngine *  v)
overrideprivatevirtual

Reimplemented from gen::BaseHadronizer.

Definition at line 103 of file ReggeGribovPartonMCHadronizer.cc.

References reggeGribovRandomEngine, and gen::v.

double v[5][pyjets_maxn]
static CLHEP::HepRandomEngine * reggeGribovRandomEngine

◆ finalizeEvent()

void ReggeGribovPartonMCHadronizer::finalizeEvent ( )

Definition at line 204 of file ReggeGribovPartonMCHadronizer.cc.

204 { return; }

◆ generatePartonsAndHadronize()

bool ReggeGribovPartonMCHadronizer::generatePartonsAndHadronize ( )

Definition at line 106 of file ReggeGribovPartonMCHadronizer.cc.

References c2evt_, cevt_, conv, crmc_f_(), gen::BaseHadronizer::event(), hadr5_, hcal_dqm_sourceclient-live_cfg::isHeavyIon, LogDebug, m_BeamID, m_ImpactParameter, m_NEvent, m_NParticles, m_PartEnergy, m_PartID, m_PartMass, m_PartPx, m_PartPy, m_PartPz, m_PartStatus, m_SkipNuclFrag, m_TargetID, EPOS::IO_EPOS::set_skip_nuclear_fragments(), and EPOS::IO_EPOS::set_trust_beam_particles().

106  {
107  int iout = 0, ievent = 0;
108  crmc_f_(iout,
109  ievent,
110  m_NParticles,
112  m_PartID[0],
113  m_PartPx[0],
114  m_PartPy[0],
115  m_PartPz[0],
116  m_PartEnergy[0],
117  m_PartMass[0],
118  m_PartStatus[0]);
119  LogDebug("ReggeGribovPartonMCInterface") << "event generated" << endl;
120 
121  const bool isHeavyIon = (m_TargetID + m_BeamID > 2);
122 
123  if (isHeavyIon)
125 
127 
128  HepMC::GenEvent* evt = conv.read_next_event();
129 
130  evt->set_event_number(m_NEvent++);
131  int sig_id = -1;
132  switch (int(c2evt_.typevt)) // if negative typevt mini plasma was created by event (except -4)
133  {
134  case 0:
135  break; //unknown for qgsjetII
136  case 1:
137  sig_id = 101;
138  break;
139  case -1:
140  sig_id = 101;
141  break;
142  case 2:
143  sig_id = 105;
144  break;
145  case -2:
146  sig_id = 105;
147  break;
148  case 3:
149  sig_id = 102;
150  break;
151  case -3:
152  sig_id = 102;
153  break;
154  case 4:
155  sig_id = 103;
156  break;
157  case -4:
158  sig_id = 104;
159  break;
160  default:
161  LogDebug("ReggeGribovPartonMCInterface") << "Signal ID not recognised for setting HEPEVT" << endl;
162  }
163  evt->set_signal_process_id(sig_id); //an integer ID uniquely specifying the signal process (i.e. MSUB in Pythia)
164 
165 #ifdef HEPMC_HAS_CROSS_SECTION
166  // set cross section information for this event
167  HepMC::GenCrossSection theCrossSection;
168  theCrossSection.set_cross_section(double(hadr5_.sigineaa) * 1e9); //required in pB
169  evt->set_cross_section(theCrossSection);
170 #endif
171 
172  if (isHeavyIon) //other than pp
173  {
174  HepMC::HeavyIon ion(cevt_.kohevt, // Number of hard scatterings
175  cevt_.npjevt, // Number of projectile participants
176  cevt_.ntgevt, // Number of target participants
177  cevt_.kolevt, // Number of NN (nucleon-nucleon) collisions
178  cevt_.npnevt + cevt_.ntnevt, // Number of spectator neutrons
179  cevt_.nppevt + cevt_.ntpevt, // Number of spectator protons
180  -1, // Number of N-Nwounded collisions
181  -1, // Number of Nwounded-N collisons
182  -1, // Number of Nwounded-Nwounded collisions
183  cevt_.bimevt, // Impact Parameter(fm) of collision
184  cevt_.phievt, // Azimuthal angle of event plane
185  c2evt_.fglevt, // eccentricity of participating nucleons
186  hadr5_.sigine * 1e9); // nucleon-nucleon inelastic (in pB)
187  evt->set_heavy_ion(ion);
188  }
189 
190  event().reset(evt);
191  //evt->print();
192  //EPOS::EPOS_Wrapper::print_hepcom();
193 
194  return true;
195 }
void set_skip_nuclear_fragments(bool b=true)
!!MODIFICATION
Definition: IO_EPOS.h:74
struct @760 hadr5_
struct @762 c2evt_
void crmc_f_(int &, int &, int &, double &, int &, double &, double &, double &, double &, double &, int &)
struct @761 cevt_
std::unique_ptr< HepMC::GenEvent > & event()
void set_trust_beam_particles(bool b=true)
Definition: IO_EPOS.h:71
EPOS::IO_EPOS conv
#define LogDebug(id)

◆ hadronize()

bool ReggeGribovPartonMCHadronizer::hadronize ( )

Definition at line 198 of file ReggeGribovPartonMCHadronizer.cc.

198 { return false; }

◆ initializeForExternalPartons()

bool gen::ReggeGribovPartonMCHadronizer::initializeForExternalPartons ( )
inline

Definition at line 190 of file ReggeGribovPartonMCHadronizer.h.

190 { return true; }

◆ initializeForInternalPartons()

bool ReggeGribovPartonMCHadronizer::initializeForInternalPartons ( )

Definition at line 212 of file ReggeGribovPartonMCHadronizer.cc.

References crmc_init_f_(), and m_IsInitialized.

212  {
213  if (!m_IsInitialized) {
214  //use set parameters to init models
215  crmc_init_f_();
216  m_IsInitialized = true;
217  }
218  return true;
219 }
void crmc_init_f_()

◆ initializeTablePaths()

bool ReggeGribovPartonMCHadronizer::initializeTablePaths ( )

Definition at line 221 of file ReggeGribovPartonMCHadronizer.cc.

References fname_, contentValuesFiles::fullPath, nfname_, qgsfname_, qgsiifname_, qgsiinfname_, and qgsnfname_.

Referenced by ReggeGribovPartonMCHadronizer().

221  {
222  //epos
223  string path_fnii(FileInPath("GeneratorInterface/ReggeGribovPartonMCInterface/data/epos.initl").fullPath());
224  string path_fnie(FileInPath("GeneratorInterface/ReggeGribovPartonMCInterface/data/epos.iniev").fullPath());
225  string path_fnrj(FileInPath("GeneratorInterface/ReggeGribovPartonMCInterface/data/epos.inirj").fullPath());
226  string path_fncs(FileInPath("GeneratorInterface/ReggeGribovPartonMCInterface/data/epos.inics").fullPath());
227 
228  if (path_fnii.length() >= 500)
229  LogError("ReggeGribovPartonMCInterface") << "table path too long" << endl;
230  else
231  nfname_.nfnii = path_fnii.length();
232  if (path_fnie.length() >= 500)
233  LogError("ReggeGribovPartonMCInterface") << "table path too long" << endl;
234  else
235  nfname_.nfnie = path_fnie.length();
236  if (path_fnrj.length() >= 500)
237  LogError("ReggeGribovPartonMCInterface") << "table path too long" << endl;
238  else
239  nfname_.nfnrj = path_fnrj.length();
240  if (path_fncs.length() >= 500)
241  LogError("ReggeGribovPartonMCInterface") << "table path too long" << endl;
242  else
243  nfname_.nfncs = path_fncs.length();
244 
245  strcpy(fname_.fnii, path_fnii.c_str());
246  strcpy(fname_.fnie, path_fnie.c_str());
247  strcpy(fname_.fnrj, path_fnrj.c_str());
248  strcpy(fname_.fncs, path_fncs.c_str());
249 
250  //qgsjet
251  string path_fndat(FileInPath("GeneratorInterface/ReggeGribovPartonMCInterface/data/qgsjet.dat").fullPath());
252  string path_fnncs(FileInPath("GeneratorInterface/ReggeGribovPartonMCInterface/data/qgsjet.ncs").fullPath());
253 
254  if (path_fndat.length() >= 500)
255  LogError("ReggeGribovPartonMCInterface") << "table path too long" << endl;
256  else
257  qgsnfname_.nfndat = path_fndat.length();
258  if (path_fnncs.length() >= 500)
259  LogError("ReggeGribovPartonMCInterface") << "table path too long" << endl;
260  else
261  qgsnfname_.nfnncs = path_fnncs.length();
262 
263  strcpy(qgsfname_.fndat, path_fndat.c_str());
264  strcpy(qgsfname_.fnncs, path_fnncs.c_str());
265 
266  qgsfname_.ifdat = 1; //option to overwrite the normal path
267  qgsfname_.ifncs = 2;
268 
269  //qgsjetII
270  string path_fniidat(FileInPath("GeneratorInterface/ReggeGribovPartonMCInterface/data/qgsdat-II-04.lzma").fullPath());
271  string path_fniincs(FileInPath("GeneratorInterface/ReggeGribovPartonMCInterface/data/sectnu-II-04").fullPath());
272 
273  if (path_fniidat.length() >= 500)
274  LogError("ReggeGribovPartonMCInterface") << "table path too long" << endl;
275  else
276  qgsiinfname_.nfniidat = path_fniidat.length();
277  if (path_fniincs.length() >= 500)
278  LogError("ReggeGribovPartonMCInterface") << "table path too long" << endl;
279  else
280  qgsiinfname_.nfniincs = path_fniincs.length();
281 
282  strcpy(qgsiifname_.fniidat, path_fniidat.c_str());
283  strcpy(qgsiifname_.fniincs, path_fniincs.c_str());
284 
285  qgsiifname_.ifiidat = 1; //option to overwrite the normal path
286  qgsiifname_.ifiincs = 2;
287 
288  return true;
289 }
struct @765 nfname_
struct @767 qgsnfname_
struct @768 qgsiifname_
struct @769 qgsiinfname_
Log< level::Error, false > LogError
struct @764 fname_
struct @766 qgsfname_

◆ readSettings()

bool gen::ReggeGribovPartonMCHadronizer::readSettings ( int  )
inline

Definition at line 189 of file ReggeGribovPartonMCHadronizer.h.

189 { return true; }

◆ residualDecay()

bool ReggeGribovPartonMCHadronizer::residualDecay ( )

Definition at line 202 of file ReggeGribovPartonMCHadronizer.cc.

202 { return true; }

◆ statistics()

void ReggeGribovPartonMCHadronizer::statistics ( )

Definition at line 206 of file ReggeGribovPartonMCHadronizer.cc.

206 { return; }

Member Data Documentation

◆ m_BeamID

int gen::ReggeGribovPartonMCHadronizer::m_BeamID
private

◆ m_BeamMomentum

double gen::ReggeGribovPartonMCHadronizer::m_BeamMomentum
private

Definition at line 204 of file ReggeGribovPartonMCHadronizer.h.

Referenced by ReggeGribovPartonMCHadronizer().

◆ m_bMax

double gen::ReggeGribovPartonMCHadronizer::m_bMax
private

Definition at line 210 of file ReggeGribovPartonMCHadronizer.h.

Referenced by ReggeGribovPartonMCHadronizer().

◆ m_bMin

double gen::ReggeGribovPartonMCHadronizer::m_bMin
private

Definition at line 209 of file ReggeGribovPartonMCHadronizer.h.

Referenced by ReggeGribovPartonMCHadronizer().

◆ m_HEModel

int gen::ReggeGribovPartonMCHadronizer::m_HEModel
private

Definition at line 208 of file ReggeGribovPartonMCHadronizer.h.

Referenced by ReggeGribovPartonMCHadronizer().

◆ m_ImpactParameter

double gen::ReggeGribovPartonMCHadronizer::m_ImpactParameter
private

Definition at line 216 of file ReggeGribovPartonMCHadronizer.h.

Referenced by generatePartonsAndHadronize().

◆ m_IsInitialized

bool gen::ReggeGribovPartonMCHadronizer::m_IsInitialized
private

Definition at line 225 of file ReggeGribovPartonMCHadronizer.h.

Referenced by initializeForInternalPartons().

◆ m_NEvent

int gen::ReggeGribovPartonMCHadronizer::m_NEvent
private

Definition at line 213 of file ReggeGribovPartonMCHadronizer.h.

Referenced by generatePartonsAndHadronize().

◆ m_NParticles

int gen::ReggeGribovPartonMCHadronizer::m_NParticles
private

Definition at line 215 of file ReggeGribovPartonMCHadronizer.h.

Referenced by generatePartonsAndHadronize().

◆ m_ParamFileName

edm::FileInPath gen::ReggeGribovPartonMCHadronizer::m_ParamFileName
private

Definition at line 211 of file ReggeGribovPartonMCHadronizer.h.

Referenced by ReggeGribovPartonMCHadronizer().

◆ m_PartEnergy

double gen::ReggeGribovPartonMCHadronizer::m_PartEnergy[99990]
private

Definition at line 221 of file ReggeGribovPartonMCHadronizer.h.

Referenced by generatePartonsAndHadronize().

◆ m_PartID

int gen::ReggeGribovPartonMCHadronizer::m_PartID[99990]
private

Definition at line 217 of file ReggeGribovPartonMCHadronizer.h.

Referenced by generatePartonsAndHadronize().

◆ m_PartMass

double gen::ReggeGribovPartonMCHadronizer::m_PartMass[99990]
private

Definition at line 222 of file ReggeGribovPartonMCHadronizer.h.

Referenced by generatePartonsAndHadronize().

◆ m_PartPx

double gen::ReggeGribovPartonMCHadronizer::m_PartPx[99990]
private

Definition at line 218 of file ReggeGribovPartonMCHadronizer.h.

Referenced by generatePartonsAndHadronize().

◆ m_PartPy

double gen::ReggeGribovPartonMCHadronizer::m_PartPy[99990]
private

Definition at line 219 of file ReggeGribovPartonMCHadronizer.h.

Referenced by generatePartonsAndHadronize().

◆ m_PartPz

double gen::ReggeGribovPartonMCHadronizer::m_PartPz[99990]
private

Definition at line 220 of file ReggeGribovPartonMCHadronizer.h.

Referenced by generatePartonsAndHadronize().

◆ m_PartStatus

int gen::ReggeGribovPartonMCHadronizer::m_PartStatus[99990]
private

Definition at line 223 of file ReggeGribovPartonMCHadronizer.h.

Referenced by generatePartonsAndHadronize().

◆ m_SkipNuclFrag

bool gen::ReggeGribovPartonMCHadronizer::m_SkipNuclFrag
private

Definition at line 212 of file ReggeGribovPartonMCHadronizer.h.

Referenced by generatePartonsAndHadronize().

◆ m_TargetID

int gen::ReggeGribovPartonMCHadronizer::m_TargetID
private

◆ m_TargetMomentum

double gen::ReggeGribovPartonMCHadronizer::m_TargetMomentum
private

Definition at line 205 of file ReggeGribovPartonMCHadronizer.h.

Referenced by ReggeGribovPartonMCHadronizer().

◆ pset_

edm::ParameterSet gen::ReggeGribovPartonMCHadronizer::pset_
private

Definition at line 203 of file ReggeGribovPartonMCHadronizer.h.