26 #include "HepMC/IO_HEPEVT.h" 27 #include "HepMC/PythiaWrapper.h" 41 abeamtarget_(pset.getParameter<double>(
"aBeamTarget")),
42 angularspecselector_(pset.getParameter<
int>(
"angularSpectrumSelector")),
43 bmin_(pset.getParameter<double>(
"bMin")),
44 bmax_(pset.getParameter<double>(
"bMax")),
45 bfixed_(pset.getParameter<double>(
"bFixed")),
46 cflag_(pset.getParameter<
int>(
"cFlag")),
47 comenergy(pset.getParameter<double>(
"comEnergy")),
48 doquench_(pset.getParameter<
bool>(
"doQuench")),
49 doradiativeenloss_(pset.getParameter<
bool>(
"doRadiativeEnLoss")),
50 docollisionalenloss_(pset.getParameter<
bool>(
"doCollisionalEnLoss")),
51 doIsospin_(pset.getParameter<
bool>(
"doIsospin")),
52 protonSide_(pset.getUntrackedParameter<
int>(
"protonSide",0)),
53 embedding_(pset.getParameter<
bool>(
"embeddingMode")),
55 nquarkflavor_(pset.getParameter<
int>(
"qgpNumQuarkFlavor")),
56 qgpt0_(pset.getParameter<double>(
"qgpInitialTemperature")),
57 qgptau0_(pset.getParameter<double>(
"qgpProperTimeFormation")),
58 maxEventsToPrint_(pset.getUntrackedParameter<
int>(
"maxEventsToPrint",1)),
59 pythiaHepMCVerbosity_(pset.getUntrackedParameter<
bool>(
"pythiaHepMCVerbosity",
false)),
60 pythiaPylistVerbosity_(pset.getUntrackedParameter<
int>(
"pythiaPylistVerbosity",0)),
62 filterType_(pset.getUntrackedParameter<
string>(
"filterType",
"None"))
108 HepMC::HeavyIon *
hi =
new HepMC::HeavyIon(
124 evt->set_heavy_ion(*hi);
144 const HepMC::HeavyIon*
hi = inev->heavy_ion();
146 bfixed_ = hi->impact_parameter();
149 LogWarning(
"EventEmbedding")<<
"Background event does not have heavy ion record!";
162 call_pyinit(
"CMS", projN.data(), targN.data(),
comenergy);
172 edm::LogInfo(
"PYQUENinAction") <<
"##### Calling PYQUEN: QUENCHING OFF!! This is just PYTHIA !!!! ####";
184 evt->set_signal_process_id(
pypars.msti[0]);
185 evt->set_event_scale(
pypars.pari[16]);
190 HepMC::HEPEVT_Wrapper::check_hepevt_consistency();
236 string sHadOff(
"MSTP(111)=0");
253 edm::LogInfo(
"PYQUENinEnLoss") <<
"##### PYQUEN: Radiative AND Collisional partonic energy loss ON ####";
256 edm::LogInfo(
"PYQUENinRad") <<
"##### PYQUEN: Only RADIATIVE partonic energy loss ON ####";
259 edm::LogInfo(
"PYQUENinColl") <<
"##### PYQUEN: Only COLLISIONAL partonic energy loss ON ####";
262 edm::LogInfo(
"PYQUENinEnLoss") <<
"##### PYQUEN: Radiative AND Collisional partonic energy loss ON ####";
277 int*
dummy =
nullptr;
279 const char* nuc =
nullptr;
280 if(random >
pfrac_) nuc =
"n";
288 double sinphi0 =
sin(angle);
289 double cosphi0 =
cos(angle);
292 vt!=evt->vertices_end(); ++vt )
295 double x0 = (*vt)->position().x();
296 double y0 = (*vt)->position().y();
297 double z = (*vt)->position().z();
298 double t = (*vt)->position().t();
300 double x = x0*cosphi0-y0*sinphi0;
301 double y = y0*cosphi0+x0*sinphi0;
303 (*vt)->set_position( HepMC::FourVector(x,y,z,t) ) ;
306 for ( HepMC::GenEvent::particle_iterator vt=evt->particles_begin();
307 vt!=evt->particles_end(); ++vt )
310 double x0 = (*vt)->momentum().x();
311 double y0 = (*vt)->momentum().y();
312 double z = (*vt)->momentum().z();
313 double t = (*vt)->momentum().t();
315 double x = x0*cosphi0-y0*sinphi0;
316 double y = y0*cosphi0+x0*sinphi0;
318 (*vt)->set_momentum( HepMC::FourVector(x,y,z,t) ) ;
324 std::vector<int>
pdg = _pdg;
325 for (
size_t i=0;
i < pdg.size();
i++ )
328 std::ostringstream pyCard ;
329 pyCard <<
"MDCY(" << pyCode <<
",1)=0";
366 return "gen::PyquenHadronizer";
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
unsigned int maxEventsToPrint_
bool pyquen_init(const edm::ParameterSet &pset)
PyquenHadronizer(const edm::ParameterSet &)
bool declareStableParticles(const std::vector< int > &)
Sin< T >::type sin(const T &t)
bool call_pygive(const std::string &line)
bool doradiativeenloss_
if true perform quenching (default = true)
bool docollisionalenloss_
DEFAULT = true.
void rotateEvtPlane(HepMC::GenEvent *evt, double angle)
bool initializeForInternalPartons()
static std::string const input
double bmax_
min impact param (fm); valid only if cflag_!=0
static const std::string kPythia6
int cflag_
fixed impact param (fm); valid only if cflag_=0
unsigned int pythiaPylistVerbosity_
HepMC verbosity flag.
bool doIsospin_
DEFAULT = true.
static BaseHiGenEvtSelector * get(std::string, const edm::ParameterSet &)
unsigned int angularspecselector_
beam/target atomic mass number
bool generatePartonsAndHadronize()
Cos< T >::type cos(const T &t)
edm::InputTag src_
Pythia PYLIST Verbosity flag.
void add_heavy_ion_rec(HepMC::GenEvent *evt)
Pythia6Service * pythia6Service_
std::unique_ptr< HepMC::GenEvent > & event()
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
HepMC::IO_HEPEVT hepevtio
static const std::string kFortranInstance
const HepMC::GenEvent * GetEvent() const
bool pyqpythia_init(const edm::ParameterSet &pset)
unsigned int nquarkflavor_
Proton fraction in the nucleus.
bool doquench_
collision energy
const char * classname() const
double comenergy
centrality flag =0 fixed impact param, <>0 minbias
bool pythiaHepMCVerbosity_
Events to print if verbosity.
void setRandomEngine(CLHEP::HepRandomEngine *v)
static const std::vector< std::string > theSharedResources
BaseHiGenEvtSelector * selector_
VertexRefVector::iterator vertex_iterator
iterator over a vector of references to Vertex objects in the same collection
double bfixed_
max impact param (fm); valid only if cflag_!=0
void doSetRandomEngine(CLHEP::HepRandomEngine *v) override
int protonSide_
Run n&p with proper ratios; if false, only p+p collisions.
Power< A, B >::type pow(const A &a, const B &b)
edm::Event & getEDMEvent() const
~PyquenHadronizer() override
T angle(T x1, T y1, T z1, T x2, T y2, T z2)