16 #ifndef HYBRIDHADRONIZATION_H
17 #define HYBRIDHADRONIZATION_H
21 #include "Pythia8/Pythia.h"
27 using namespace Jetscape;
38 void WriteTask(weak_ptr<JetScapeWriter> w);
44 double SigM2_calc(
double R2chg,
double qm1,
double qm2,
double qq1,
double qq2);
45 double SigBR2_calc(
double R2chg,
double qm1,
double qm2,
double qm3,
double qq1,
double qq2,
double qq3);
46 double SigBL2_calc(
double SigBR2,
double qm1,
double qm2,
double qm3);
49 double maxM_level, maxB_level,
gmax, xmq,
xms, xmc, xmb,
hbarc, dist2cut, sh_recofactor, th_recofactor, p_fake, had_prop, part_prop, delta_t, hydro_Tc, eta_max_boost_inv;
51 double SigNucR2,SigNucL2,SigOmgR2,SigOmgL2,
SigXiR2,SigXiL2,SigSigR2,SigSigL2,
52 SigOcccR2,SigOcccL2,SigOccR2,SigOccL2,SigXiccR2,SigXiccL2,SigOcR2,SigOcL2,SigXicR2,SigXicL2,SigSigcR2,SigSigcL2,
53 SigObbbR2,SigObbbL2,SigObbcR2,SigObbcL2,SigObbR2,SigObbL2,SigXibbR2,SigXibbL2,
54 SigObccR2,SigObccL2,SigObcR2,SigObcL2,SigXibcR2,SigXibcL2,SigObR2,SigObL2,SigXibR2,SigXibL2,SigSigbR2,SigSigbL2;
55 double SigPi2, SigPhi2, SigK2, SigJpi2, SigDs2, SigD2,
SigUps2, SigBc2, SigB2;
56 bool inbrick, inhydro;
int nreusehydro;
double brickL, brickT;
57 const double pi = 3.1415926535897932384626433832795;
64 bool afterburner_frag_hadrons =
false;
70 vector<int> IdColInfo1; vector<int> IdColInfo2; vector<int> IdColInfo3; vector<int>
IdColInfo4;
77 double xlam[4][4], beta2;
78 beta2 = B.
x()*B.
x() + B.
y()*B.
y() + B.
z()*B.
z();
79 B.
Set(B.
x(),B.
y(),B.
z(),1./(sqrt(1. - beta2)));
82 if(beta2 > 0.){beta2inv = 1./beta2;}
86 xlam[0][1] = -B.
t()*B.
x();
87 xlam[0][2] = -B.
t()* B.
y();
88 xlam[0][3] = -B.
t()*B.
z();
89 xlam[1][0] = xlam[0][1];
90 xlam[1][1] = 1.+(B.
t() - 1.)*(B.
x()*B.
x())*beta2inv;
91 xlam[1][2] = (B.
t()-1.)*B.
x()*B.
y()*beta2inv;
92 xlam[1][3] = (B.
t()-1.)*B.
x()*B.
z()*beta2inv;
93 xlam[2][0] = xlam[0][2];
94 xlam[2][1] = xlam[1][2];
95 xlam[2][2] = 1.+(B.
t()-1.)*(B.
y()*B.
y())*beta2inv;
96 xlam[2][3] = (B.
t()-1.)*B.
y()*B.
z()*beta2inv;
97 xlam[3][0] = xlam[0][3];
98 xlam[3][1] = xlam[1][3];
99 xlam[3][2] = xlam[2][3];
100 xlam[3][3] = 1.+(B.
t()-1.)*(B.
z()*B.
z())*beta2inv;
102 double t_out = vec_in.
t()*xlam[0][0] + vec_in.
x()*xlam[0][1] + vec_in.
y()*xlam[0][2] + vec_in.
z()*xlam[0][3];
103 double x_out = vec_in.
t()*xlam[1][0] + vec_in.
x()*xlam[1][1] + vec_in.
y()*xlam[1][2] + vec_in.
z()*xlam[1][3];
104 double y_out = vec_in.
t()*xlam[2][0] + vec_in.
x()*xlam[2][1] + vec_in.
y()*xlam[2][2] + vec_in.
z()*xlam[2][3];
105 double z_out = vec_in.
t()*xlam[3][0] + vec_in.
x()*xlam[3][1] + vec_in.
y()*xlam[3][2] + vec_in.
z()*xlam[3][3];
119 bool is_shower_, is_thermal_, is_used_, is_decayedglu_, is_remnant_, used_reco_,
used_str_, is_strendpt_, used_junction_, is_fakep_;
122 int alt_id_, orig_, par_,
string_id_, pos_str_, endpt_id_, sibling_, PY_par1_, PY_par2_, PY_dau1_, PY_dau2_, PY_stat_, PY_origid_, PY_tag1_, PY_tag2_, PY_tag3_;
129 is_shower_ =
false; is_thermal_ =
false; is_used_ =
false; is_decayedglu_ =
false; is_remnant_ =
false; used_reco_ =
false; used_str_ =
false; is_strendpt_ =
false; used_junction_ =
false; is_fakep_ =
false;
130 alt_id_ = 0; orig_ = 0; par_ = -1; string_id_ = 0; pos_str_ = 0; endpt_id_ = 0; sibling_ = 0; alt_mass_ = 0.;
131 PY_origid_ = 0; PY_par1_ = -1; PY_par2_ = -1; PY_dau1_ = -1; PY_dau2_ = -1; PY_stat_ = 23; PY_tag1_ = 0; PY_tag2_ = 0; PY_tag3_ = 0;
132 set_color(0); set_anti_color(0); set_stat(0);
136 double x() {
return x_in().x();}
double y() {
return x_in().y();}
double z() {
return x_in().z();}
double x_t() {
return x_in().t();}
137 double px() {
return p_in().x();}
double py() {
return p_in().y();}
double pz() {
return p_in().z();}
double e() {
return p_in().t();}
138 bool is_shower() {
return is_shower_;}
bool is_thermal() {
return is_thermal_;}
bool is_used() {
return is_used_;}
bool is_decayedglu() {
return is_decayedglu_;}
139 bool is_remnant() {
return is_remnant_;}
bool used_reco() {
return used_reco_;}
bool used_str() {
return used_str_;}
bool is_strendpt() {
return is_strendpt_;}
140 bool used_junction() {
return used_junction_;}
bool is_fakeparton() {
return is_fakep_;}
141 int id() {
return alt_id_;}
int orig() {
return orig_;}
int par() {
return par_;}
int string_id()
const {
return string_id_;}
int pos_str()
const {
return pos_str_;}
142 int endpt_id() {
return endpt_id_;}
int sibling() {
return sibling_;}
int PY_par1() {
return PY_par1_;}
int PY_par2() {
return PY_par2_;}
143 int PY_dau1() {
return PY_dau1_;}
int PY_dau2() {
return PY_dau2_;}
int PY_stat() {
return PY_stat_;}
int PY_origid() {
return PY_origid_;}
144 int PY_tag1() {
return PY_tag1_;}
int PY_tag2() {
return PY_tag2_;}
int PY_tag3() {
return PY_tag3_;}
145 double mass() {
return alt_mass_;}
148 int status() {
return pstat();}
int col() {
return color();}
int acol() {
return anti_color();}
151 void x(
double val) {x_in_.Set(val,x_in().
y(),x_in().
z(),x_in().
t());}
152 void y(
double val) {x_in_.Set(x_in().
x(),val,x_in().
z(),x_in().
t());}
153 void z(
double val) {x_in_.Set(x_in().
x(),x_in().
y(),val,x_in().
t());}
154 void x_t(
double val){x_in_.Set(x_in().
x(),x_in().
y(),x_in().
z(),val);}
156 void px(
double val) {reset_momentum(val,py(),pz(),
e());}
157 void py(
double val) {reset_momentum(px(),val,pz(),
e());}
158 void pz(
double val) {reset_momentum(px(),py(),val,
e());}
159 void e(
double val) {reset_momentum(px(),py(),pz(),val);}
162 void is_shower(
bool val) {is_shower_ = val;}
void is_thermal(
bool val) {is_thermal_ = val;}
void is_used(
bool val) {is_used_ = val;}
void is_decayedglu(
bool val) {is_decayedglu_ = val;}
163 void is_remnant(
bool val) {is_remnant_ = val;}
void used_reco(
bool val) {used_reco_ = val;}
void used_str(
bool val) {used_str_ = val;}
void is_strendpt(
bool val) {is_strendpt_ = val;}
164 void used_junction(
bool val) {used_junction_ = val;}
void is_fakeparton(
bool val) {is_fakep_ = val;}
165 void id(
int val) {alt_id_ = val;}
void orig(
int val) {orig_ = val;}
void par(
int val) {par_ = val;}
166 void string_id(
int val) {string_id_ = val;}
void pos_str(
int val) {pos_str_ = val;}
void endpt_id(
int val) {endpt_id_ = val;}
void sibling(
int val) {sibling_ = val;}
167 void PY_par1(
int val) {PY_par1_ = val;}
void PY_par2(
int val) {PY_par2_ = val;}
void PY_dau1(
int val) {PY_dau1_ = val;}
void PY_dau2(
int val) {PY_dau2_ = val;}
168 void PY_stat(
int val) {PY_stat_ = val;}
void PY_origid(
int val) {PY_origid_ = val;}
169 void PY_tag1(
int val) {PY_tag1_ = val;}
void PY_tag2(
int val) {PY_tag2_ = val;}
void PY_tag3(
int val) {PY_tag3_ = val;}
170 void mass(
double val) {alt_mass_ = val;}
171 void status(
int val) {set_stat(val);}
void col(
int val) {set_color(val);}
void acol(
int val) {set_anti_color(val);}
187 bool is_excited_, is_shsh_, is_shth_,
is_thth_, is_recohad_, is_strhad_, is_final_;
199 is_excited_ =
false; is_shsh_ =
false; is_shth_ =
false; is_thth_ =
false; is_recohad_ =
false; is_strhad_ =
false; is_final_ =
false;
200 orig_ = 0; parstr_ = 0; parh_ = -1; alt_mass_ = 0.; set_stat(0);
207 int par(
int i){
if((i>=0) && (i<parents.size())){
return parents[
i];}
else{
return 999999;}}
214 int col(
int i){
if((i>=0) && (i<cols.size())){
return cols[
i];}
else{
return -1;}}
218 double x() {
return x_in().x();}
double y() {
return x_in().y();}
double z() {
return x_in().z();}
double x_t() {
return x_in().t();}
219 double px() {
return p_in().x();}
double py() {
return p_in().y();}
double pz() {
return p_in().z();}
double e() {
return p_in().t();}
220 bool is_excited() {
return is_excited_;}
bool is_shsh() {
return is_shsh_;}
bool is_shth() {
return is_shth_;}
bool is_thth() {
return is_thth_;}
221 bool is_recohad() {
return is_recohad_;}
bool is_strhad() {
return is_strhad_;}
bool is_final() {
return is_final_;}
222 int orig() {
return orig_;}
int parstr() {
return parstr_;}
int parh() {
return parh_;}
223 double mass() {
return alt_mass_;}
229 void x(
double val) {x_in_.Set(val,x_in().
y(),x_in().
z(),x_in().
t());}
230 void y(
double val) {x_in_.Set(x_in().
x(),val,x_in().
z(),x_in().
t());}
231 void z(
double val) {x_in_.Set(x_in().
x(),x_in().
y(),val,x_in().
t());}
232 void x_t(
double val){x_in_.Set(x_in().
x(),x_in().
y(),x_in().
z(),val);}
234 void px(
double val) {reset_momentum(val,py(),pz(),
e());}
235 void py(
double val) {reset_momentum(px(),val,pz(),
e());}
236 void pz(
double val) {reset_momentum(px(),py(),val,
e());}
237 void e(
double val) {reset_momentum(px(),py(),pz(),val);}
240 void is_excited(
bool val) {is_excited_ = val;}
void is_shsh(
bool val) {is_shsh_ = val;}
void is_shth(
bool val) {is_shth_ = val;}
void is_thth(
bool val) {is_thth_ = val;}
241 void is_recohad(
bool val) {is_recohad_ = val;}
void is_strhad(
bool val) {is_strhad_ = val;}
void is_final(
bool val) {is_final_ = val;}
242 void orig(
int val) {orig_ = val;}
void parstr(
int val) {parstr_ = val;}
void parh(
int val) {parh_ = val;}
243 void mass(
double val) {alt_mass_ = val;}
244 void id(
int val) {set_id(val);}
void status(
int val) {set_stat(val);}
267 int num() {
return partons.size();}
273 void remove(
int i) {partons.erase(partons.begin()+
i);}
275 void swap(
int i,
int j) {
if((i >= 0) && (i < partons.size()) && (j >= 0) && (j < partons.size())) {
std::swap(partons[i],partons[j]);}}
277 std::vector<HHparton>::iterator
begin() {
return partons.begin();}
279 std::vector<HHparton>::iterator
end() {
return partons.end();}
313 int num() {
return hadrons.size();}
367 void set_spacetime_for_pythia_hadrons(Pythia8::Event &
event,
int &size_input, std::vector<int> &eve_to_had,
int pythia_attempt,
bool find_positions,
bool is_recohadron,
bool recohadron_shsh);
377 void scale_kinematics_negative_hadrons(
hadron_collection& HH_hadrons,
double shower_energy,
double positive_hadrons_energy);
385 #endif // HYBRIDHADRONIZATION_H