CMS 3D CMS Logo

Public Member Functions | Private Attributes

gen::ReggeGribovPartonMCHadronizer Class Reference

#include <ReggeGribovPartonMC.h>

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

List of all members.

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 ()

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_

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_(), Exception, edm::FileInPath::fullPath(), gFlatDistribution_, initializeTablePaths(), edm::Service< T >::isAvailable(), m_BeamID, m_BeamMomentum, m_bMax, m_bMin, m_HEModel, m_ParamFileName, m_TargetID, m_TargetMomentum, and nucl2_.

                                                                                     :
  BaseHadronizer(pset),
  pset_(pset),
  m_BeamMomentum(pset.getParameter<double>("beammomentum")),
  m_TargetMomentum(pset.getParameter<double>("targetmomentum")),
  m_BeamID(pset.getParameter<int>("beamid")),
  m_TargetID(pset.getParameter<int>("targetid")),
  m_HEModel(pset.getParameter<int>("model")),
  m_bMin(pset.getParameter<double>("bmin")),
  m_bMax(pset.getParameter<double>("bmax")),
  m_ParamFileName(pset.getUntrackedParameter<string>("paramFileName")),
  m_SkipNuclFrag(pset.getParameter<bool>("skipNuclFrag")),
  m_NEvent(0),
  m_NParticles(0),
  m_ImpactParameter(0.)
{
  Service<RandomNumberGenerator> rng;
  if ( ! rng.isAvailable())
    {
      throw cms::Exception("Configuration")
        << "ReggeGribovPartonMCHadronizer requires the RandomNumberGeneratorService\n"
        "which is not present in the configuration file.  You must add the service\n"
        "in the configuration file or remove the modules that require it.";
    }

  gFlatDistribution_.reset(new CLHEP::RandFlat(rng->getEngine(), 0., 1.));

  int  nevet       = 1; //needed for CS
  int  noTables    = 0; //don't calculate tables
  int  LHEoutput   = 0; //no lhe
  int  dummySeed   = 123;
  char dummyName[] = "dummy";
  crmc_set_f_(nevet,dummySeed,m_BeamMomentum,m_TargetMomentum,m_BeamID,
              m_TargetID,m_HEModel,noTables,LHEoutput,dummyName,
              m_ParamFileName.fullPath().c_str());

  //additionally initialise tables
  initializeTablePaths();

  //change impact paramter
  nucl2_.bminim = float(m_bMin);
  nucl2_.bmaxim = float(m_bMax);

  //use set parameters to init models
  crmc_init_f_();
}
ReggeGribovPartonMCHadronizer::~ReggeGribovPartonMCHadronizer ( ) [virtual]

Definition at line 111 of file ReggeGribovPartonMCHadronizer.cc.

References gFlatDistribution_.

{
  // destructor
  gFlatDistribution_.reset();
}
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.

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

Definition at line 191 of file ReggeGribovPartonMCHadronizer.cc.

{
   return true;
}
bool gen::ReggeGribovPartonMCHadronizer::declareSpecialSettings ( const std::vector< std::string >  ) [inline]

Definition at line 216 of file ReggeGribovPartonMCHadronizer.h.

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

Definition at line 214 of file ReggeGribovPartonMCHadronizer.cc.

{
 return true;
 }
void ReggeGribovPartonMCHadronizer::finalizeEvent ( )

Definition at line 201 of file ReggeGribovPartonMCHadronizer.cc.

                                                 {
    return;
}
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.

{
  int iout=0,ievent=0;
  crmc_f_(iout,ievent,m_NParticles,m_ImpactParameter,
         m_PartID[0],m_PartPx[0],m_PartPy[0],m_PartPz[0],
          m_PartEnergy[0],m_PartMass[0],m_PartStatus[0]);
  LogDebug("ReggeGribovPartonMCInterface") << "event generated" << endl;

  const bool isHeavyIon =  (m_TargetID + m_BeamID > 2);

  if(isHeavyIon)
    conv.set_trust_beam_particles(false);

  conv.set_skip_nuclear_fragments(m_SkipNuclFrag);

  HepMC::GenEvent* evt = conv.read_next_event();

  evt->set_event_number(m_NEvent++);
  int sig_id = -1;
  switch (int(c2evt_.typevt)) // if negative typevt mini plasma was created by event (except -4)
    {
    case  0: break; //unknown for qgsjetII
    case  1: sig_id = 101; break;
    case -1: sig_id = 101; break;
    case  2: sig_id = 105; break;
    case -2: sig_id = 105; break;
    case  3: sig_id = 102; break;
    case -3: sig_id = 102; break;
    case  4: sig_id = 103; break;
    case -4: sig_id = 104; break;
    default: LogDebug("ReggeGribovPartonMCInterface") << "Signal ID not recognised for setting HEPEVT" << endl;
    }
  evt->set_signal_process_id(sig_id); //an integer ID uniquely specifying the signal process (i.e. MSUB in Pythia)

#ifdef HEPMC_HAS_CROSS_SECTION
  // set cross section information for this event
  HepMC::GenCrossSection theCrossSection;
  theCrossSection.set_cross_section(double(hadr5_.sigineaa)*1e9); //required in pB
  evt->set_cross_section(theCrossSection);
#endif

  if (isHeavyIon) //other than pp
    {
      HepMC::HeavyIon ion(cevt_.kohevt,                // Number of hard scatterings
                          cevt_.npjevt,                // Number of projectile participants
                          cevt_.ntgevt,                // Number of target participants
                          cevt_.kolevt,                // Number of NN (nucleon-nucleon) collisions
                          cevt_.npnevt + cevt_.ntnevt, // Number of spectator neutrons
                          cevt_.nppevt + cevt_.ntpevt, // Number of spectator protons
                          -1,                          // Number of N-Nwounded collisions
                          -1,                          // Number of Nwounded-N collisons
                          -1,                          // Number of Nwounded-Nwounded collisions
                          cevt_.bimevt,                // Impact Parameter(fm) of collision
                          cevt_.phievt,                // Azimuthal angle of event plane
                          c2evt_.fglevt,               // eccentricity of participating nucleons
                          hadr5_.sigine*1e9);        // nucleon-nucleon inelastic (in pB)
      evt->set_heavy_ion(ion);
    }


  event().reset(evt);
  //evt->print();
  //EPOS::EPOS_Wrapper::print_hepcom();

  return true;
}
bool ReggeGribovPartonMCHadronizer::hadronize ( )

Definition at line 186 of file ReggeGribovPartonMCHadronizer.cc.

{
   return false;
}
bool gen::ReggeGribovPartonMCHadronizer::initializeForExternalPartons ( ) [inline]

Definition at line 213 of file ReggeGribovPartonMCHadronizer.h.

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

Definition at line 219 of file ReggeGribovPartonMCHadronizer.cc.

{
 return true;
 }
bool ReggeGribovPartonMCHadronizer::initializeTablePaths ( )

Definition at line 224 of file ReggeGribovPartonMCHadronizer.cc.

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

Referenced by ReggeGribovPartonMCHadronizer().

{
  //epos
  string path_fnii(FileInPath("GeneratorInterface/ReggeGribovPartonMCInterface/data/epos.initl").fullPath());
  string path_fnie(FileInPath("GeneratorInterface/ReggeGribovPartonMCInterface/data/epos.iniev").fullPath());
  string path_fnrj(FileInPath("GeneratorInterface/ReggeGribovPartonMCInterface/data/epos.inirj").fullPath());
  string path_fncs(FileInPath("GeneratorInterface/ReggeGribovPartonMCInterface/data/epos.inics").fullPath());

  if (path_fnii.length() >= 500) LogError("ReggeGribovPartonMCInterface") << "table path too long" << endl;
  else nfname_.nfnii = path_fnii.length();
  if (path_fnie.length() >= 500) LogError("ReggeGribovPartonMCInterface") << "table path too long" << endl;
  else nfname_.nfnie = path_fnie.length();
  if (path_fnrj.length() >= 500) LogError("ReggeGribovPartonMCInterface") << "table path too long" << endl;
  else nfname_.nfnrj = path_fnrj.length();
  if (path_fncs.length() >= 500) LogError("ReggeGribovPartonMCInterface") << "table path too long" << endl;
  else nfname_.nfncs = path_fncs.length();

  strcpy(fname_.fnii, path_fnii.c_str());
  strcpy(fname_.fnie, path_fnie.c_str());
  strcpy(fname_.fnrj, path_fnrj.c_str());
  strcpy(fname_.fncs, path_fncs.c_str());

  //qgsjet
  string path_fndat(FileInPath("GeneratorInterface/ReggeGribovPartonMCInterface/data/qgsjet.dat").fullPath());
  string path_fnncs(FileInPath("GeneratorInterface/ReggeGribovPartonMCInterface/data/qgsjet.ncs").fullPath());

  if (path_fndat.length() >= 500) LogError("ReggeGribovPartonMCInterface") << "table path too long" << endl;
  else qgsnfname_.nfndat = path_fndat.length();
  if (path_fnncs.length() >= 500) LogError("ReggeGribovPartonMCInterface") << "table path too long" << endl;
  else qgsnfname_.nfnncs = path_fnncs.length();

  strcpy(qgsfname_.fndat, path_fndat.c_str());
  strcpy(qgsfname_.fnncs, path_fnncs.c_str());

  qgsfname_.ifdat=1; //option to overwrite the normal path
  qgsfname_.ifncs=2;

  //qgsjetII
  string path_fniidat(FileInPath("GeneratorInterface/ReggeGribovPartonMCInterface/data/qgsdat-II-04.lzma").fullPath());
  string path_fniincs(FileInPath("GeneratorInterface/ReggeGribovPartonMCInterface/data/sectnu-II-04").fullPath());

  if (path_fniidat.length() >= 500) LogError("ReggeGribovPartonMCInterface") << "table path too long" << endl;
  else qgsiinfname_.nfniidat = path_fniidat.length();
  if (path_fniincs.length() >= 500) LogError("ReggeGribovPartonMCInterface") << "table path too long" << endl;
  else qgsiinfname_.nfniincs = path_fniincs.length();

  strcpy(qgsiifname_.fniidat, path_fniidat.c_str());
  strcpy(qgsiifname_.fniincs, path_fniincs.c_str());

  qgsiifname_.ifiidat=1; //option to overwrite the normal path
  qgsiifname_.ifiincs=2;

 return true;
}
bool gen::ReggeGribovPartonMCHadronizer::readSettings ( int  ) [inline]

Definition at line 212 of file ReggeGribovPartonMCHadronizer.h.

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

Definition at line 196 of file ReggeGribovPartonMCHadronizer.cc.

{
   return true;
}
void ReggeGribovPartonMCHadronizer::statistics ( )

Definition at line 205 of file ReggeGribovPartonMCHadronizer.cc.

                                              {
    return;
}

Member Data Documentation

Definition at line 225 of file ReggeGribovPartonMCHadronizer.h.

Referenced by ReggeGribovPartonMCHadronizer().

Definition at line 231 of file ReggeGribovPartonMCHadronizer.h.

Referenced by ReggeGribovPartonMCHadronizer().

Definition at line 230 of file ReggeGribovPartonMCHadronizer.h.

Referenced by ReggeGribovPartonMCHadronizer().

Definition at line 229 of file ReggeGribovPartonMCHadronizer.h.

Referenced by ReggeGribovPartonMCHadronizer().

Definition at line 237 of file ReggeGribovPartonMCHadronizer.h.

Referenced by generatePartonsAndHadronize().

Definition at line 234 of file ReggeGribovPartonMCHadronizer.h.

Referenced by generatePartonsAndHadronize().

Definition at line 236 of file ReggeGribovPartonMCHadronizer.h.

Referenced by generatePartonsAndHadronize().

Definition at line 232 of file ReggeGribovPartonMCHadronizer.h.

Referenced by ReggeGribovPartonMCHadronizer().

Definition at line 242 of file ReggeGribovPartonMCHadronizer.h.

Referenced by generatePartonsAndHadronize().

Definition at line 238 of file ReggeGribovPartonMCHadronizer.h.

Referenced by generatePartonsAndHadronize().

Definition at line 243 of file ReggeGribovPartonMCHadronizer.h.

Referenced by generatePartonsAndHadronize().

Definition at line 239 of file ReggeGribovPartonMCHadronizer.h.

Referenced by generatePartonsAndHadronize().

Definition at line 240 of file ReggeGribovPartonMCHadronizer.h.

Referenced by generatePartonsAndHadronize().

Definition at line 241 of file ReggeGribovPartonMCHadronizer.h.

Referenced by generatePartonsAndHadronize().

Definition at line 244 of file ReggeGribovPartonMCHadronizer.h.

Referenced by generatePartonsAndHadronize().

Definition at line 233 of file ReggeGribovPartonMCHadronizer.h.

Referenced by generatePartonsAndHadronize().

Definition at line 226 of file ReggeGribovPartonMCHadronizer.h.

Referenced by ReggeGribovPartonMCHadronizer().

Definition at line 224 of file ReggeGribovPartonMCHadronizer.h.