CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public 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 ()
 
virtual ~ReggeGribovPartonMCHadronizer ()
 
virtual ~ReggeGribovPartonMCHadronizer ()
 
- Public Member Functions inherited from gen::BaseHadronizer
 BaseHadronizer (edm::ParameterSet const &ps)
 
edm::EventgetEDMEvent () const
 
HepMC::GenEvent * getGenEvent ()
 
GenEventInfoProductgetGenEventInfo ()
 
GenRunInfoProductgetGenRunInfo ()
 
const boost::shared_ptr
< lhef::LHERunInfo > & 
getLHERunInfo () const
 
void resetEvent (HepMC::GenEvent *event)
 
void resetEventInfo (GenEventInfoProduct *eventInfo)
 
virtual bool select (HepMC::GenEvent *) const
 
void setEDMEvent (edm::Event &event)
 
void setLHEEvent (lhef::LHEEvent *event)
 
void setLHERunInfo (lhef::LHERunInfo *runInfo)
 
 ~BaseHadronizer ()
 

Private Attributes

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

Additional Inherited Members

- Protected Member Functions inherited from gen::BaseHadronizer
std::auto_ptr< HepMC::GenEvent > & event ()
 
std::auto_ptr
< GenEventInfoProduct > & 
eventInfo ()
 
lhef::LHEEventlheEvent ()
 
lhef::LHERunInfolheRunInfo ()
 
GenRunInfoProductrunInfo ()
 

Detailed Description

Definition at line 22 of file ReggeGribovPartonMC.h.

Constructor & Destructor Documentation

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

Definition at line 62 of file ReggeGribovPartonMCHadronizer.cc.

References crmc_init_f_(), crmc_set_f_(), edm::hlt::Exception, edm::FileInPath::fullPath(), edm::RandomNumberGenerator::getEngine(), gFlatDistribution_, initializeTablePaths(), edm::Service< T >::isAvailable(), m_BeamID, m_BeamMomentum, m_bMax, m_bMin, m_HEModel, m_ParamFileName, m_TargetID, m_TargetMomentum, and nucl2_.

62  :
63  BaseHadronizer(pset),
64  pset_(pset),
65  m_BeamMomentum(pset.getParameter<double>("beammomentum")),
66  m_TargetMomentum(pset.getParameter<double>("targetmomentum")),
67  m_BeamID(pset.getParameter<int>("beamid")),
68  m_TargetID(pset.getParameter<int>("targetid")),
69  m_HEModel(pset.getParameter<int>("model")),
70  m_bMin(pset.getParameter<double>("bmin")),
71  m_bMax(pset.getParameter<double>("bmax")),
72  m_ParamFileName(pset.getUntrackedParameter<string>("paramFileName")),
73  m_SkipNuclFrag(pset.getParameter<bool>("skipNuclFrag")),
74  m_NEvent(0),
75  m_NParticles(0),
77 {
79  if ( ! rng.isAvailable())
80  {
81  throw cms::Exception("Configuration")
82  << "ReggeGribovPartonMCHadronizer requires the RandomNumberGeneratorService\n"
83  "which is not present in the configuration file. You must add the service\n"
84  "in the configuration file or remove the modules that require it.";
85  }
86 
87  gFlatDistribution_.reset(new CLHEP::RandFlat(rng->getEngine(), 0., 1.));
88 
89  int nevet = 1; //needed for CS
90  int noTables = 0; //don't calculate tables
91  int LHEoutput = 0; //no lhe
92  int dummySeed = 123;
93  char dummyName[] = "dummy";
95  m_TargetID,m_HEModel,noTables,LHEoutput,dummyName,
96  m_ParamFileName.fullPath().c_str());
97 
98  //additionally initialise tables
100 
101  //change impact paramter
102  nucl2_.bminim = float(m_bMin);
103  nucl2_.bmaxim = float(m_bMax);
104 
105  //use set parameters to init models
106  crmc_init_f_();
107 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
BaseHadronizer(edm::ParameterSet const &ps)
struct @396 nucl2_
bool isAvailable() const
Definition: Service.h:47
boost::scoped_ptr< CLHEP::RandFlat > gFlatDistribution_
void crmc_init_f_()
virtual CLHEP::HepRandomEngine & getEngine() const =0
Use this to get the random number engine, this is the only function most users should call...
std::string fullPath() const
Definition: FileInPath.cc:171
void crmc_set_f_(int &, int &, double &, double &, int &, int &, int &, int &, int &, const char *, const char *)
ReggeGribovPartonMCHadronizer::~ReggeGribovPartonMCHadronizer ( )
virtual

Definition at line 111 of file ReggeGribovPartonMCHadronizer.cc.

References gFlatDistribution_.

112 {
113  // destructor
114  gFlatDistribution_.reset();
115 }
boost::scoped_ptr< CLHEP::RandFlat > gFlatDistribution_
gen::ReggeGribovPartonMCHadronizer::ReggeGribovPartonMCHadronizer ( const edm::ParameterSet )
virtual gen::ReggeGribovPartonMCHadronizer::~ReggeGribovPartonMCHadronizer ( )
virtual

Member Function Documentation

const char * ReggeGribovPartonMCHadronizer::classname ( ) const

Definition at line 209 of file ReggeGribovPartonMCHadronizer.cc.

210 {
211  return "gen::ReggeGribovPartonMCHadronizer";
212 }
bool ReggeGribovPartonMCHadronizer::decay ( )

Definition at line 191 of file ReggeGribovPartonMCHadronizer.cc.

192 {
193  return true;
194 }
bool gen::ReggeGribovPartonMCHadronizer::declareSpecialSettings ( const std::vector< std::string >  )
inline

Definition at line 216 of file ReggeGribovPartonMCHadronizer.h.

216 { return true; }
bool ReggeGribovPartonMCHadronizer::declareStableParticles ( const std::vector< int >  )

Definition at line 214 of file ReggeGribovPartonMCHadronizer.cc.

215 {
216  return true;
217  }
void ReggeGribovPartonMCHadronizer::finalizeEvent ( )

Definition at line 201 of file ReggeGribovPartonMCHadronizer.cc.

201  {
202  return;
203 }
bool ReggeGribovPartonMCHadronizer::generatePartonsAndHadronize ( )

Definition at line 118 of file ReggeGribovPartonMCHadronizer.cc.

References c2evt_, cevt_, conv, crmc_f_(), gen::BaseHadronizer::event(), hadr5_, 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, and m_TargetID.

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

Definition at line 186 of file ReggeGribovPartonMCHadronizer.cc.

187 {
188  return false;
189 }
bool gen::ReggeGribovPartonMCHadronizer::initializeForExternalPartons ( )
inline

Definition at line 213 of file ReggeGribovPartonMCHadronizer.h.

213 { return true; }
bool ReggeGribovPartonMCHadronizer::initializeForInternalPartons ( )

Definition at line 219 of file ReggeGribovPartonMCHadronizer.cc.

220 {
221  return true;
222  }
bool ReggeGribovPartonMCHadronizer::initializeTablePaths ( )

Definition at line 224 of file ReggeGribovPartonMCHadronizer.cc.

References fname_, nfname_, qgsfname_, qgsiifname_, qgsiinfname_, and qgsnfname_.

Referenced by ReggeGribovPartonMCHadronizer().

225 {
226  //epos
227  string path_fnii(FileInPath("GeneratorInterface/ReggeGribovPartonMCInterface/data/epos.initl").fullPath());
228  string path_fnie(FileInPath("GeneratorInterface/ReggeGribovPartonMCInterface/data/epos.iniev").fullPath());
229  string path_fnrj(FileInPath("GeneratorInterface/ReggeGribovPartonMCInterface/data/epos.inirj").fullPath());
230  string path_fncs(FileInPath("GeneratorInterface/ReggeGribovPartonMCInterface/data/epos.inics").fullPath());
231 
232  if (path_fnii.length() >= 500) LogError("ReggeGribovPartonMCInterface") << "table path too long" << endl;
233  else nfname_.nfnii = path_fnii.length();
234  if (path_fnie.length() >= 500) LogError("ReggeGribovPartonMCInterface") << "table path too long" << endl;
235  else nfname_.nfnie = path_fnie.length();
236  if (path_fnrj.length() >= 500) LogError("ReggeGribovPartonMCInterface") << "table path too long" << endl;
237  else nfname_.nfnrj = path_fnrj.length();
238  if (path_fncs.length() >= 500) LogError("ReggeGribovPartonMCInterface") << "table path too long" << endl;
239  else nfname_.nfncs = path_fncs.length();
240 
241  strcpy(fname_.fnii, path_fnii.c_str());
242  strcpy(fname_.fnie, path_fnie.c_str());
243  strcpy(fname_.fnrj, path_fnrj.c_str());
244  strcpy(fname_.fncs, path_fncs.c_str());
245 
246  //qgsjet
247  string path_fndat(FileInPath("GeneratorInterface/ReggeGribovPartonMCInterface/data/qgsjet.dat").fullPath());
248  string path_fnncs(FileInPath("GeneratorInterface/ReggeGribovPartonMCInterface/data/qgsjet.ncs").fullPath());
249 
250  if (path_fndat.length() >= 500) LogError("ReggeGribovPartonMCInterface") << "table path too long" << endl;
251  else qgsnfname_.nfndat = path_fndat.length();
252  if (path_fnncs.length() >= 500) LogError("ReggeGribovPartonMCInterface") << "table path too long" << endl;
253  else qgsnfname_.nfnncs = path_fnncs.length();
254 
255  strcpy(qgsfname_.fndat, path_fndat.c_str());
256  strcpy(qgsfname_.fnncs, path_fnncs.c_str());
257 
258  qgsfname_.ifdat=1; //option to overwrite the normal path
259  qgsfname_.ifncs=2;
260 
261  //qgsjetII
262  string path_fniidat(FileInPath("GeneratorInterface/ReggeGribovPartonMCInterface/data/qgsdat-II-04.lzma").fullPath());
263  string path_fniincs(FileInPath("GeneratorInterface/ReggeGribovPartonMCInterface/data/sectnu-II-04").fullPath());
264 
265  if (path_fniidat.length() >= 500) LogError("ReggeGribovPartonMCInterface") << "table path too long" << endl;
266  else qgsiinfname_.nfniidat = path_fniidat.length();
267  if (path_fniincs.length() >= 500) LogError("ReggeGribovPartonMCInterface") << "table path too long" << endl;
268  else qgsiinfname_.nfniincs = path_fniincs.length();
269 
270  strcpy(qgsiifname_.fniidat, path_fniidat.c_str());
271  strcpy(qgsiifname_.fniincs, path_fniincs.c_str());
272 
273  qgsiifname_.ifiidat=1; //option to overwrite the normal path
274  qgsiifname_.ifiincs=2;
275 
276  return true;
277 }
struct @402 qgsiinfname_
struct @401 qgsiifname_
struct @397 fname_
struct @400 qgsnfname_
struct @398 nfname_
struct @399 qgsfname_
bool gen::ReggeGribovPartonMCHadronizer::readSettings ( int  )
inline

Definition at line 212 of file ReggeGribovPartonMCHadronizer.h.

212 { return true; }
bool ReggeGribovPartonMCHadronizer::residualDecay ( )

Definition at line 196 of file ReggeGribovPartonMCHadronizer.cc.

197 {
198  return true;
199 }
void ReggeGribovPartonMCHadronizer::statistics ( )

Definition at line 205 of file ReggeGribovPartonMCHadronizer.cc.

205  {
206  return;
207 }

Member Data Documentation

int gen::ReggeGribovPartonMCHadronizer::m_BeamID
private
double gen::ReggeGribovPartonMCHadronizer::m_BeamMomentum
private

Definition at line 225 of file ReggeGribovPartonMCHadronizer.h.

Referenced by ReggeGribovPartonMCHadronizer().

double gen::ReggeGribovPartonMCHadronizer::m_bMax
private

Definition at line 231 of file ReggeGribovPartonMCHadronizer.h.

Referenced by ReggeGribovPartonMCHadronizer().

double gen::ReggeGribovPartonMCHadronizer::m_bMin
private

Definition at line 230 of file ReggeGribovPartonMCHadronizer.h.

Referenced by ReggeGribovPartonMCHadronizer().

int gen::ReggeGribovPartonMCHadronizer::m_HEModel
private

Definition at line 229 of file ReggeGribovPartonMCHadronizer.h.

Referenced by ReggeGribovPartonMCHadronizer().

double gen::ReggeGribovPartonMCHadronizer::m_ImpactParameter
private

Definition at line 237 of file ReggeGribovPartonMCHadronizer.h.

Referenced by generatePartonsAndHadronize().

int gen::ReggeGribovPartonMCHadronizer::m_NEvent
private

Definition at line 234 of file ReggeGribovPartonMCHadronizer.h.

Referenced by generatePartonsAndHadronize().

int gen::ReggeGribovPartonMCHadronizer::m_NParticles
private

Definition at line 236 of file ReggeGribovPartonMCHadronizer.h.

Referenced by generatePartonsAndHadronize().

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

Definition at line 232 of file ReggeGribovPartonMCHadronizer.h.

Referenced by ReggeGribovPartonMCHadronizer().

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

Definition at line 242 of file ReggeGribovPartonMCHadronizer.h.

Referenced by generatePartonsAndHadronize().

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

Definition at line 238 of file ReggeGribovPartonMCHadronizer.h.

Referenced by generatePartonsAndHadronize().

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

Definition at line 243 of file ReggeGribovPartonMCHadronizer.h.

Referenced by generatePartonsAndHadronize().

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

Definition at line 239 of file ReggeGribovPartonMCHadronizer.h.

Referenced by generatePartonsAndHadronize().

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

Definition at line 240 of file ReggeGribovPartonMCHadronizer.h.

Referenced by generatePartonsAndHadronize().

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

Definition at line 241 of file ReggeGribovPartonMCHadronizer.h.

Referenced by generatePartonsAndHadronize().

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

Definition at line 244 of file ReggeGribovPartonMCHadronizer.h.

Referenced by generatePartonsAndHadronize().

bool gen::ReggeGribovPartonMCHadronizer::m_SkipNuclFrag
private

Definition at line 233 of file ReggeGribovPartonMCHadronizer.h.

Referenced by generatePartonsAndHadronize().

int gen::ReggeGribovPartonMCHadronizer::m_TargetID
private
double gen::ReggeGribovPartonMCHadronizer::m_TargetMomentum
private

Definition at line 226 of file ReggeGribovPartonMCHadronizer.h.

Referenced by ReggeGribovPartonMCHadronizer().

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

Definition at line 224 of file ReggeGribovPartonMCHadronizer.h.