20 #include "HepMC/IO_HEPEVT.h" 21 #include "HepMC/PythiaWrapper.h" 35 abeamtarget_(
pset.getParameter<double>(
"aBeamTarget")),
36 angularspecselector_(
pset.getParameter<
int>(
"angularSpectrumSelector")),
37 bmin_(
pset.getParameter<double>(
"bMin")),
38 bmax_(
pset.getParameter<double>(
"bMax")),
39 bfixed_(
pset.getParameter<double>(
"bFixed")),
40 cflag_(
pset.getParameter<
int>(
"cFlag")),
41 comenergy(
pset.getParameter<double>(
"comEnergy")),
42 doquench_(
pset.getParameter<
bool>(
"doQuench")),
43 doradiativeenloss_(
pset.getParameter<
bool>(
"doRadiativeEnLoss")),
44 docollisionalenloss_(
pset.getParameter<
bool>(
"doCollisionalEnLoss")),
45 doIsospin_(
pset.getParameter<
bool>(
"doIsospin")),
46 protonSide_(
pset.getUntrackedParameter<
int>(
"protonSide", 0)),
47 embedding_(
pset.getParameter<
int>(
"embeddingMode")),
49 nquarkflavor_(
pset.getParameter<
int>(
"qgpNumQuarkFlavor")),
50 qgpt0_(
pset.getParameter<double>(
"qgpInitialTemperature")),
51 qgptau0_(
pset.getParameter<double>(
"qgpProperTimeFormation")),
52 maxEventsToPrint_(
pset.getUntrackedParameter<
int>(
"maxEventsToPrint", 1)),
54 pythiaHepMCVerbosity_(
pset.getUntrackedParameter<
bool>(
"pythiaHepMCVerbosity",
false)),
55 pythiaPylistVerbosity_(
pset.getUntrackedParameter<
int>(
"pythiaPylistVerbosity", 0)),
57 filterType_(
pset.getUntrackedParameter<
string>(
"filterType",
"None")) {
58 if (
pset.exists(
"signalVtx"))
59 signalVtx_ =
pset.getUntrackedParameter<std::vector<double> >(
"signalVtx");
64 LogDebug(
"EventSignalVertex") <<
"Setting event signal vertex " 88 int cm = 1, va, vb, vc;
106 HepMC::HeavyIon*
hi =
new HepMC::HeavyIon(1,
121 evt->set_heavy_ion(*
hi);
136 HepMC::GenVertex* genvtx =
nullptr;
139 e.getByToken(
src_, cf);
141 if (
mix.size() < 1) {
142 throw cms::Exception(
"MatchVtx") <<
"Mixing has " <<
mix.size() <<
" sub-events, should have been at least 1" 147 throw cms::Exception(
"MatchVtx") <<
"Input background does not have smeared vertex!" << endl;
152 genvtx = inev->signal_process_vertex();
155 throw cms::Exception(
"MatchVtx") <<
"Input background does not have signal process vertex!" << endl;
157 double aX, aY, aZ, aT;
159 aX = genvtx->position().x();
160 aY = genvtx->position().y();
161 aZ = genvtx->position().z();
162 aT = genvtx->position().t();
170 <<
" aX " << aX <<
" aY " << aY <<
" aZ " << aZ <<
" aT " << aT << endl;
173 const HepMC::HeavyIon*
hi = inev->heavy_ion();
179 LogWarning(
"EventEmbedding") <<
"Background event does not have heavy ion record!";
194 call_pyinit(
"CMS", projN.data(), targN.data(),
comenergy);
205 edm::LogInfo(
"PYQUENinAction") <<
"##### Calling PYQUEN: QUENCHING OFF!! This is just PYTHIA !!!! ####";
219 HepMC::GenVertex* sub_vertices =
new HepMC::GenVertex(HepMC::FourVector(0, 0, 0, 0), 0);
220 if (!evt->signal_process_vertex())
221 evt->set_signal_process_vertex(sub_vertices);
224 evt->set_signal_process_id(
pypars.msti[0]);
225 evt->set_event_scale(
pypars.pari[16]);
276 string sHadOff(
"MSTP(111)=0");
291 edm::LogInfo(
"PYQUENinEnLoss") <<
"##### PYQUEN: Radiative AND Collisional partonic energy loss ON ####";
294 edm::LogInfo(
"PYQUENinRad") <<
"##### PYQUEN: Only RADIATIVE partonic energy loss ON ####";
297 edm::LogInfo(
"PYQUENinColl") <<
"##### PYQUEN: Only COLLISIONAL partonic energy loss ON ####";
300 edm::LogInfo(
"PYQUENinEnLoss") <<
"##### PYQUEN: Radiative AND Collisional partonic energy loss ON ####";
315 int*
dummy =
nullptr;
317 const char* nuc =
nullptr;
331 double x0 = (*vt)->position().x();
332 double y0 = (*vt)->position().y();
333 double z = (*vt)->position().z();
334 double t = (*vt)->position().t();
336 double x = x0 * cosphi0 - y0 * sinphi0;
337 double y = y0 * cosphi0 + x0 * sinphi0;
339 (*vt)->set_position(HepMC::FourVector(
x, y, z,
t));
342 for (HepMC::GenEvent::particle_iterator vt = evt->particles_begin(); vt != evt->particles_end(); ++vt) {
343 double x0 = (*vt)->momentum().x();
344 double y0 = (*vt)->momentum().y();
345 double z = (*vt)->momentum().z();
346 double t = (*vt)->momentum().t();
348 double x = x0 * cosphi0 - y0 * sinphi0;
349 double y = y0 * cosphi0 + x0 * sinphi0;
351 (*vt)->set_momentum(HepMC::FourVector(
x, y, z,
t));
356 std::vector<int>
pdg = _pdg;
357 for (
size_t i = 0;
i <
pdg.size();
i++) {
359 std::ostringstream pyCard;
360 pyCard <<
"MDCY(" << pyCode <<
",1)=0";
const char * classname() const
unsigned int maxEventsToPrint_
Events to print if verbosity.
bool pyquen_init(const edm::ParameterSet &pset)
bool declareStableParticles(const std::vector< int > &)
bool isVtxGenApplied() const
Sin< T >::type sin(const T &t)
T const * product() const
bool call_pygive(const std::string &line)
bool doradiativeenloss_
DEFAULT = true.
bool docollisionalenloss_
DEFAULT = true.
void rotateEvtPlane(HepMC::GenEvent *evt, double angle)
bool initializeForInternalPartons()
double bmax_
max impact param (fm); valid only if cflag_!=0
double abeamtarget_
beam/target atomic mass number
static const std::string kPythia6
int cflag_
centrality flag =0 fixed impact param, <>0 minbias
edm::Event & getEDMEvent() const
unsigned int pythiaPylistVerbosity_
Pythia PYLIST Verbosity flag.
bool doIsospin_
Run n&p with proper ratios; if false, only p+p collisions.
static BaseHiGenEvtSelector * get(std::string, const edm::ParameterSet &)
unsigned int angularspecselector_
bool generatePartonsAndHadronize()
Cos< T >::type cos(const T &t)
edm::EDGetTokenT< CrossingFrame< edm::HepMCProduct > > src_
HepMC::FourVector * fVertex_
Event signal vertex.
void add_heavy_ion_rec(HepMC::GenEvent *evt)
Pythia6Service * pythia6Service_
std::unique_ptr< HepMC::GenEvent > & event()
PyquenHadronizer(const edm::ParameterSet &, edm::ConsumesCollector &&)
const HepMC::GenEvent * GetEvent() const
Log< level::Info, false > LogInfo
static const std::string kFortranInstance
bool pyqpythia_init(const edm::ParameterSet &pset)
unsigned int nquarkflavor_
bool doquench_
if true perform quenching (default = true)
std::vector< double > signalVtx_
Pset double vector to set event signal vertex.
double comenergy
collision energy
bool pythiaHepMCVerbosity_
HepMC verbosity flag.
void setRandomEngine(CLHEP::HepRandomEngine *v)
static const std::vector< std::string > theSharedResources
BaseHiGenEvtSelector * selector_
double bmin_
min impact param (fm); valid only if cflag_!=0
VertexRefVector::iterator vertex_iterator
iterator over a vector of references to Vertex objects in the same collection
double bfixed_
fixed impact param (fm); valid only if cflag_=0
Log< level::Warning, false > LogWarning
void doSetRandomEngine(CLHEP::HepRandomEngine *v) override
double pfrac_
Proton fraction in the nucleus.
Power< A, B >::type pow(const A &a, const B &b)
HepMC::IO_HEPEVT pyquen_hepevtio
~PyquenHadronizer() override
T angle(T x1, T y1, T z1, T x2, T y2, T z2)