CMS 3D CMS Logo

edm::PyquenProducer Class Reference

#include <GeneratorInterface/PyquenInterface/interface/PyquenProducer.h>

Inheritance diagram for edm::PyquenProducer:

edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

 PyquenProducer (const ParameterSet &)
 Constructor.
virtual ~PyquenProducer ()
 Destructor.

Private Member Functions

void add_heavy_ion_rec (HepMC::GenEvent *evt)
bool call_pygive (const std::string &iParm)
void clear ()
virtual void produce (Event &e, const EventSetup &es)
bool pyqpythia_init (const ParameterSet &pset)
bool pyquen_init (const ParameterSet &pset)

Private Attributes

double abeamtarget_
unsigned int angularspecselector_
 beam/target atomic mass number
double bfixed_
 angular emitted gluon spectrum selection DEFAULT= 0 -- small angular emitted gluon spectrum = 1 -- broad angular emitted gluon spectrum = 2 -- collinear angular emitted gluon spectrum
int cflag_
 fixed impact param (fm); valid only if cflag_=0
double comenergy
 centrality flag =0 fixed impact param, <>0 minbias
bool docollisionalenloss_
 DEFAULT = true.
bool doquench_
 collision energy
bool doradiativeenloss_
 if true perform quenching (default = true)
int eventNumber_
 Pythia PYLIST Verbosity flag.
HepMC::GenEvent * evt
CLHEP::HepRandomEngine * fRandomEngine
unsigned int maxEventsToPrint_
 proper time of QGP formation DEFAULT = 0.1 fm/c; allowed range [0.01,10.0]fm/c;
unsigned int nquarkflavor_
 DEFAULT = true.
bool pythiaHepMCVerbosity_
 Events to print if verbosity.
unsigned int pythiaPylistVerbosity_
 HepMC verbosity flag.
double qgpt0_
 number of active quark flavors in qgp DEFAULT=0; allowed values: 0,1,2,3.
double qgptau0_
 initial temperature of QGP DEFAULT = 1GeV; allowed range [0.2,2.0]GeV;


Detailed Description

Definition at line 27 of file PyquenProducer.h.


Constructor & Destructor Documentation

PyquenProducer::PyquenProducer ( const ParameterSet pset  ) 

Constructor.

Definition at line 34 of file PyquenProducer.cc.

References comenergy, GenMuonPlsPt100GeV_cfg::cout, lat::endl(), edm::ParameterSet::getUntrackedParameter(), LogDebug, maxEventsToPrint_, pyqpythia_init(), pyquen_init(), pythiaHepMCVerbosity_, and pythiaPylistVerbosity_.

00034                                                          :
00035 EDProducer(), evt(0), 
00036 abeamtarget_(pset.getParameter<double>("aBeamTarget")),
00037 angularspecselector_(pset.getParameter<int>("angularSpectrumSelector")),
00038 bfixed_(pset.getParameter<double>("bFixed")),
00039 cflag_(pset.getParameter<int>("cFlag")),
00040 comenergy(pset.getParameter<double>("comEnergy")),
00041 doquench_(pset.getParameter<bool>("doQuench")),
00042 doradiativeenloss_(pset.getParameter<bool>("doRadiativeEnLoss")),
00043 docollisionalenloss_(pset.getParameter<bool>("doCollisionalEnLoss")),
00044 nquarkflavor_(pset.getParameter<int>("numQuarkFlavor")),
00045 qgpt0_(pset.getParameter<double>("qgpInitialTemperature")),
00046 qgptau0_(pset.getParameter<double>("qgpProperTimeFormation")),
00047 maxEventsToPrint_(pset.getUntrackedParameter<int>("maxEventsToPrint",1)),
00048 pythiaHepMCVerbosity_(pset.getUntrackedParameter<bool>("pythiaHepMCVerbosity",false)),
00049 pythiaPylistVerbosity_(pset.getUntrackedParameter<int>("pythiaPylistVerbosity",0)),
00050 eventNumber_(0)
00051 {
00052   // Default constructor
00053 
00054   // Verbosity Level
00055   // Valid PYLIST arguments are: 1, 2, 3, 5, 7, 11, 12, 13
00056   pythiaPylistVerbosity_ = pset.getUntrackedParameter<int>("pythiaPylistVerbosity",0);
00057   LogDebug("PYLISTverbosity") << "Pythia PYLIST verbosity level = " << pythiaPylistVerbosity_ << endl;
00058   
00059   // HepMC event verbosity Level
00060   pythiaHepMCVerbosity_ = pset.getUntrackedParameter<bool>("pythiaHepMCVerbosity",false);
00061   LogDebug("HepMCverbosity")  << "Pythia HepMC verbosity = " << pythiaHepMCVerbosity_ << endl; 
00062 
00063   //Max number of events printed on verbosity level 
00064   maxEventsToPrint_ = pset.getUntrackedParameter<int>("maxEventsToPrint",0);
00065   LogDebug("Events2Print") << "Number of events to be printed = " << maxEventsToPrint_ << endl;
00066 
00067   //initialize pythia
00068   pyqpythia_init(pset);
00069 
00070   //initilize pyquen
00071   pyquen_init(pset);
00072 
00073   // Call PYTHIA
00074   call_pyinit("CMS", "p", "p", comenergy);  
00075   
00076   cout<<endl;
00077 
00078   produces<HepMCProduct>();
00079   produces<GenInfoProduct, edm::InRun>();
00080 }

PyquenProducer::~PyquenProducer (  )  [virtual]

Destructor.

Definition at line 84 of file PyquenProducer.cc.

References clear().

00085 {
00086   // distructor
00087 
00088   call_pystat(1);
00089 
00090   clear();
00091 }


Member Function Documentation

void PyquenProducer::add_heavy_ion_rec ( HepMC::GenEvent *  evt  )  [private]

Definition at line 95 of file PyquenProducer.cc.

References plfpar.

Referenced by produce().

00096 {
00097   HepMC::HeavyIon *hi = new HepMC::HeavyIon(
00098     -1,                                 // Ncoll_hard
00099     -1,                                 // Npart_proj
00100     -1,                                 // Npart_targ
00101     -1,                                 // Ncoll
00102     -1,                                 // spectator_neutrons
00103     -1,                                 // spectator_protons
00104     -1,                                 // N_Nwounded_collisions
00105     -1,                                 // Nwounded_N_collisions
00106     -1,                                 // Nwounded_Nwounded_collisions
00107     plfpar.bgen,                        // impact_parameter in [fm]
00108     0,                                  // event_plane_angle
00109     0,                                  // eccentricity
00110     -1                                  // sigma_inel_NN
00111   );
00112 
00113   evt->set_heavy_ion(*hi);
00114   delete hi;
00115 }

bool PyquenProducer::call_pygive ( const std::string &  iParm  )  [private]

Definition at line 119 of file PyquenProducer.cc.

References pydat1, and PYGIVE.

Referenced by pyqpythia_init().

00120 {
00121   // Set Pythia parameters
00122 
00123   int numWarn = pydat1.mstu[26];//# warnings
00124   int numErr = pydat1.mstu[22]; //# errors
00125   // call the fortran routine pygive with a fortran string
00126   PYGIVE( iParm.c_str(), iParm.length() );  
00127 
00128   // if an error or warning happens it is problem
00129   return pydat1.mstu[26] == numWarn && pydat1.mstu[22] == numErr;   
00130 }

void PyquenProducer::clear ( void   )  [private]

Definition at line 134 of file PyquenProducer.cc.

Referenced by ~PyquenProducer().

00135 {
00136 }

void PyquenProducer::produce ( Event e,
const EventSetup es 
) [private, virtual]

Implements edm::EDProducer.

Definition at line 140 of file PyquenProducer.cc.

References abeamtarget_, add_heavy_ion_rec(), bfixed_, call_pylist(), cflag_, GenMuonPlsPt100GeV_cfg::cout, doquench_, lat::endl(), edm::EventID::event(), eventNumber_, evt, hepevtio2, edm::Event::id(), maxEventsToPrint_, edm::Event::put(), PYEXEC, pypars, pyqpar, PYQUEN, pythiaHepMCVerbosity_, and pythiaPylistVerbosity_.

00141 {
00142   edm::LogInfo("PYQUENabeamtarget") << "##### PYQUEN: beam/target A = "                     << abeamtarget_;
00143   edm::LogInfo("PYQUENcflag")       << "##### PYQUEN: centrality flag cflag_ = "            << cflag_;
00144   edm::LogInfo("PYQUENbfixed")      << "##### PYQUEN: fixed impact parameter bFixed = "     << bfixed_;
00145   edm::LogInfo("PYQUENinNFlav")     << "##### PYQUEN: No active quark flavor nf = "         << pyqpar.nfu;
00146   edm::LogInfo("PYQUENinTemp")      << "##### PYQUEN: Initial temperature of QGP, T0 = "    << pyqpar.T0u;
00147   edm::LogInfo("PYQUENinTau")       << "##### PYQUEN: Proper formation time of QGP, tau0 =" << pyqpar.tau0u;
00148 
00149   // Generate PYQUEN event
00150   // generate single partonic PYTHIA jet event
00151   call_pyevnt();
00152 
00153   // call PYQUEN to apply parton rescattering and energy loss 
00154   // if doQuench=FALSE, it is pure PYTHIA
00155   if( doquench_ ){
00156     PYQUEN(abeamtarget_,cflag_,bfixed_);
00157     edm::LogInfo("PYQUENinAction") << "##### Calling PYQUEN("<<abeamtarget_<<","<<cflag_<<","<<bfixed_<<") ####";
00158   } else {
00159     edm::LogInfo("PYQUENinAction") << "##### Calling PYQUEN: QUENCHING OFF!! This is just PYTHIA !!!! ####";
00160   }
00161 
00162   // call PYTHIA to finish the hadronization
00163   PYEXEC();
00164 
00165   // fill the HEPEVT with the PYJETS event record
00166   call_pyhepc(1);
00167 
00168   // event information
00169   HepMC::GenEvent* evt = hepevtio2.read_next_event();
00170   evt->set_signal_process_id(pypars.msti[0]);      // type of the process
00171   evt->set_event_scale(pypars.pari[16]);           // Q^2
00172   ++eventNumber_;
00173   evt->set_event_number(eventNumber_);
00174 
00175   add_heavy_ion_rec(evt);
00176 
00177   auto_ptr<HepMCProduct> bare_product(new HepMCProduct());
00178   bare_product->addHepMCData(evt );
00179   e.put(bare_product); 
00180 
00181   // verbosity
00182   if( e.id().event() <= maxEventsToPrint_ && ( pythiaPylistVerbosity_ || pythiaHepMCVerbosity_ )) { 
00183     // Prints PYLIST info
00184      if( pythiaPylistVerbosity_ ){
00185        call_pylist(pythiaPylistVerbosity_);
00186      }
00187       
00188      // Prints HepMC event
00189      if( pythiaHepMCVerbosity_ ){
00190         cout << "Event process = " << pypars.msti[0] << endl; 
00191         evt->print(); 
00192      }
00193   }
00194     
00195   return;
00196 }

bool PyquenProducer::pyqpythia_init ( const ParameterSet pset  )  [private]

Definition at line 200 of file PyquenProducer.cc.

References call_pygive(), edm::errors::Configuration, GenMuonPlsPt100GeV_cfg::cout, doquench_, lat::endl(), fRandomEngine, edm::ParameterSet::getParameter(), i, pars, and randomEngine.

Referenced by PyquenProducer().

00201 {
00202   //initialize PYTHIA
00203 
00204   //random number seed
00205   edm::Service<RandomNumberGenerator> rng;
00206   randomEngine = fRandomEngine = &(rng->getEngine());
00207   uint32_t seed = rng->mySeed();
00208   ostringstream sRandomSet;
00209   sRandomSet << "MRPY(1)=" << seed;
00210   call_pygive(sRandomSet.str());
00211 
00212   //Turn Hadronization Off if there is quenching
00213   if(doquench_){
00214      string sHadOff("MSTP(111)=0");
00215      call_pygive(sHadOff);
00216   }
00217 
00218     // Set PYTHIA parameters in a single ParameterSet  
00219   ParameterSet pythia_params = pset.getParameter<ParameterSet>("PythiaParameters") ;
00220   
00221   // The parameter sets to be read
00222   vector<string> setNames = pythia_params.getParameter<vector<string> >("parameterSets");
00223 
00224     // Loop over the sets
00225   for ( unsigned i=0; i<setNames.size(); ++i ) {
00226     string mySet = setNames[i];
00227     
00228     // Read the PYTHIA parameters for each set of parameters
00229     vector<string> pars = pythia_params.getParameter<vector<string> >(mySet);
00230     
00231     cout << "----------------------------------------------" << endl;
00232     cout << "Read PYTHIA parameter set " << mySet << endl;
00233     cout << "----------------------------------------------" << endl;
00234     
00235     // Loop over all parameters and stop in case of mistake
00236     for( vector<string>::const_iterator itPar = pars.begin(); itPar != pars.end(); ++itPar ) {
00237       static string sRandomValueSetting("MRPY(1)");
00238       if( 0 == itPar->compare(0,sRandomValueSetting.size(),sRandomValueSetting) ) {
00239          throw edm::Exception(edm::errors::Configuration,"PythiaError")
00240            << " Attempted to set random number using 'MRPY(1)'. NOT ALLOWED!\n"
00241               " Use RandomNumberGeneratorService to set the random number seed.";
00242       }
00243       if( !call_pygive(*itPar) ) {
00244         throw edm::Exception(edm::errors::Configuration,"PythiaError") 
00245            << "PYTHIA did not accept \""<<*itPar<<"\"";
00246       }
00247     }
00248   }
00249 
00250   return true;
00251 }

bool PyquenProducer::pyquen_init ( const ParameterSet pset  )  [private]

Definition at line 255 of file PyquenProducer.cc.

References angularspecselector_, docollisionalenloss_, doradiativeenloss_, nquarkflavor_, pyqpar, qgpt0_, and qgptau0_.

Referenced by PyquenProducer().

00256 {
00257   // PYQUEN initialization
00258 
00259   // angular emitted gluon  spectrum selection 
00260   pyqpar.ianglu = angularspecselector_;
00261 
00262   // type of medium induced partonic energy loss
00263   if( doradiativeenloss_ && docollisionalenloss_ ){
00264     edm::LogInfo("PYQUENinEnLoss") << "##### PYQUEN: Radiative AND Collisional partonic energy loss ON ####";
00265     pyqpar.ienglu = 0; 
00266   } else if ( doradiativeenloss_ ) {
00267     edm::LogInfo("PYQUENinRad") << "##### PYQUEN: Only RADIATIVE partonic energy loss ON ####";
00268     pyqpar.ienglu = 1; 
00269   } else if ( docollisionalenloss_ ) {
00270     edm::LogInfo("PYQUENinColl") << "##### PYQUEN: Only COLLISIONAL partonic energy loss ON ####";
00271     pyqpar.ienglu = 2; 
00272   } else {
00273     edm::LogInfo("PYQUENinEnLoss") << "##### PYQUEN: Radiative AND Collisional partonic energy loss ON ####";
00274     pyqpar.ienglu = 0; 
00275   }
00276 
00277   // number of active quark flavors in qgp
00278   pyqpar.nfu    = nquarkflavor_;
00279 
00280   // initial temperature of QGP
00281   pyqpar.T0u    = qgpt0_;
00282 
00283   // proper time of QGP formation
00284   pyqpar.tau0u  = qgptau0_;
00285 
00286   return true;
00287 }


Member Data Documentation

double edm::PyquenProducer::abeamtarget_ [private]

Definition at line 44 of file PyquenProducer.h.

Referenced by produce().

unsigned int edm::PyquenProducer::angularspecselector_ [private]

beam/target atomic mass number

Definition at line 45 of file PyquenProducer.h.

Referenced by pyquen_init().

double edm::PyquenProducer::bfixed_ [private]

angular emitted gluon spectrum selection DEFAULT= 0 -- small angular emitted gluon spectrum = 1 -- broad angular emitted gluon spectrum = 2 -- collinear angular emitted gluon spectrum

Definition at line 49 of file PyquenProducer.h.

Referenced by produce().

int edm::PyquenProducer::cflag_ [private]

fixed impact param (fm); valid only if cflag_=0

Definition at line 50 of file PyquenProducer.h.

Referenced by produce().

double edm::PyquenProducer::comenergy [private]

centrality flag =0 fixed impact param, <>0 minbias

Definition at line 51 of file PyquenProducer.h.

Referenced by PyquenProducer().

bool edm::PyquenProducer::docollisionalenloss_ [private]

DEFAULT = true.

Definition at line 54 of file PyquenProducer.h.

Referenced by pyquen_init().

bool edm::PyquenProducer::doquench_ [private]

collision energy

Definition at line 52 of file PyquenProducer.h.

Referenced by produce(), and pyqpythia_init().

bool edm::PyquenProducer::doradiativeenloss_ [private]

if true perform quenching (default = true)

Definition at line 53 of file PyquenProducer.h.

Referenced by pyquen_init().

int edm::PyquenProducer::eventNumber_ [private]

Pythia PYLIST Verbosity flag.

Definition at line 64 of file PyquenProducer.h.

Referenced by produce().

HepMC::GenEvent* edm::PyquenProducer::evt [private]

Definition at line 43 of file PyquenProducer.h.

Referenced by produce().

CLHEP::HepRandomEngine* edm::PyquenProducer::fRandomEngine [private]

Definition at line 66 of file PyquenProducer.h.

Referenced by pyqpythia_init().

unsigned int edm::PyquenProducer::maxEventsToPrint_ [private]

proper time of QGP formation DEFAULT = 0.1 fm/c; allowed range [0.01,10.0]fm/c;

Definition at line 61 of file PyquenProducer.h.

Referenced by produce(), and PyquenProducer().

unsigned int edm::PyquenProducer::nquarkflavor_ [private]

DEFAULT = true.

Definition at line 55 of file PyquenProducer.h.

Referenced by pyquen_init().

bool edm::PyquenProducer::pythiaHepMCVerbosity_ [private]

Events to print if verbosity.

Definition at line 62 of file PyquenProducer.h.

Referenced by produce(), and PyquenProducer().

unsigned int edm::PyquenProducer::pythiaPylistVerbosity_ [private]

HepMC verbosity flag.

Definition at line 63 of file PyquenProducer.h.

Referenced by produce(), and PyquenProducer().

double edm::PyquenProducer::qgpt0_ [private]

number of active quark flavors in qgp DEFAULT=0; allowed values: 0,1,2,3.

Definition at line 57 of file PyquenProducer.h.

Referenced by pyquen_init().

double edm::PyquenProducer::qgptau0_ [private]

initial temperature of QGP DEFAULT = 1GeV; allowed range [0.2,2.0]GeV;

Definition at line 59 of file PyquenProducer.h.

Referenced by pyquen_init().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:43:14 2009 for CMSSW by  doxygen 1.5.4