@@ -34,13 +34,12 @@ MCGlauberWrapper::MCGlauberWrapper() {
3434
3535
3636void MCGlauberWrapper::InitTask () {
37- parameter_list_.read_in_parameters_from_file (" mcglauber.input" );
38- // int ran_seed = parameter_list_.get_seed();
3937 auto ran_seed = (*GetMt19937Generator ())();
40- auto gamma_beta = parameter_list_.get_tau_form_fluct_gamma_beta ();
4138
39+ int argc = 0 ;
40+ char * argv[1 ];
4241 mc_gen_ = std::shared_ptr<MCGlb::EventGenerator>(
43- new MCGlb::EventGenerator (" mcglauber.input" , ran_seed));
42+ new MCGlb::EventGenerator (" mcglauber.input" , argc, argv , ran_seed));
4443
4544 // overwrite input options
4645 double para_temp;
@@ -65,21 +64,19 @@ void MCGlauberWrapper::InitTask() {
6564 para_temp = (
6665 GetXMLElementDouble ({" IS" , " MCGlauber" , " ylossParam4var" }));
6766 mc_gen_->set_parameter (" ylossParam4var" , para_temp);
68- para_temp = (
69- GetXMLElementDouble ({ " IS " , " MCGlauber " , " remnant_energy_loss_fraction" }));
67+ para_temp = (GetXMLElementDouble ({ " IS " , " MCGlauber " ,
68+ " remnant_energy_loss_fraction" }));
7069 mc_gen_->set_parameter (" remnant_energy_loss_fraction" , para_temp);
71-
72- // re-generate mc pointer
73- mc_gen_->New_Para_pointer (ran_seed);
7470}
7571
72+
7673void MCGlauberWrapper::ClearTask () {
7774 VERBOSE (1 ) << " clear initial condition vectors" ;
7875 binary_collision_t_.clear ();
7976 binary_collision_x_.clear ();
8077 binary_collision_y_.clear ();
8178 binary_collision_z_.clear ();
82-
79+ QCDStringList_. clear ();
8380}
8481
8582
@@ -115,7 +112,7 @@ void MCGlauberWrapper::ExecuteTask() {
115112
116113void MCGlauberWrapper::SampleABinaryCollisionPoint (
117114 double &t, double &x, double &y, double &z) {
118- int rand_idx = (*rand_int_ptr_)(*GetMt19937Generator ());
115+ const int rand_idx = (*rand_int_ptr_)(*GetMt19937Generator ());
119116 t = binary_collision_t_[rand_idx];
120117 x = binary_collision_x_[rand_idx];
121118 y = binary_collision_y_[rand_idx];
@@ -206,54 +203,74 @@ void MCGlauberWrapper::OutputHardPartonMomentum(double E, double px, double py,
206203 << " targ_parton_e_ " << targ_parton_e_
207204 << " targ_parton_pz_ " << targ_parton_pz_;
208205
209- if (targ_parton_e_ >= 0.95 * P_A || proj_parton_e_ >= 0.95 * P_A ){
210- throw std::runtime_error (" Energy to subtract from 3DMCGlauber >= 0.95 * P_A " +std::to_string (0.95 * P_A)+" . Turn on Verbose for more info." );
206+ if (targ_parton_e_ >= 0.95 * P_A || proj_parton_e_ >= 0.95 * P_A ) {
207+ throw std::runtime_error (
208+ " Energy to subtract from 3DMCGlauber >= 0.95 * P_A "
209+ + std::to_string (0.95 * P_A)+" . Turn on Verbose for more info." );
211210 }
212211
213212}
214213
214+
215215std::vector<double > MCGlauberWrapper::Get_quarks_pos_proj_lab () {
216216 // get the x, y, z of the three valence quarks of colliding projectile
217217 // The fourth parton is the soft ball
218- // 3DGlauber attributes the remaining energy and momentum carried by the sea quarks and gluons to a soft gluon cloud
218+ // 3DGlauber attributes the remaining energy and momentum carried by the
219+ // sea quarks and gluons to a soft gluon cloud
219220 // Output formulation is (x,y,z, x,y,z, x,y,z, x,y,z)
220- mc_gen_->GetHardPos (hard_parton_t_, hard_parton_x_, hard_parton_y_,
221+ mc_gen_->GetHardPos (hard_parton_t_, hard_parton_x_, hard_parton_y_,
221222 hard_parton_z_);
222223 return (mc_gen_->GetQuarkPosProj ());
223224}
224225
226+
225227std::vector<double > MCGlauberWrapper::Get_quarks_pos_targ_lab () {
226228 // get the x, y, z of the three valence quarks of colliding target
227229 // The fourth parton is the soft ball
228- // 3DGlauber attributes the remaining energy and momentum carried by the sea quarks and gluons to a soft gluon cloud
230+ // 3DGlauber attributes the remaining energy and momentum carried by the
231+ // sea quarks and gluons to a soft gluon cloud
229232 // Output formulation is (x,y,z, x,y,z, x,y,z, x,y,z)
230- mc_gen_->GetHardPos (hard_parton_t_, hard_parton_x_, hard_parton_y_,
233+ mc_gen_->GetHardPos (hard_parton_t_, hard_parton_x_, hard_parton_y_,
231234 hard_parton_z_);
232235 return (mc_gen_->GetQuarkPosTarg ());
233236}
234237
238+
235239std::vector<double > MCGlauberWrapper::Get_remnant_proj () {
236240 // get the fout-momentum (E, px, py, pz) of the remnant in projectile
237241 return (mc_gen_->GetRemMom_Proj ());
238242}
239243
244+
240245std::vector<double > MCGlauberWrapper::Get_remnant_targ () {
241- // get the fout-momentum (E, px, py, pz) of the remnant in target
246+ // get the fout-momentum (E, px, py, pz) of the remnant in target
242247 return (mc_gen_->GetRemMom_Targ ());
243248}
244249
250+
245251void MCGlauberWrapper::GetHardPartonPosAndMomentumProj () {
246- mc_gen_->GetMomandPos_Proj (hard_parton_t_, hard_parton_x_, hard_parton_y_,
247- hard_parton_z_, proj_parton_e_, proj_parton_px_,
252+ mc_gen_->GetMomandPos_Proj (hard_parton_t_, hard_parton_x_, hard_parton_y_,
253+ hard_parton_z_, proj_parton_e_, proj_parton_px_,
248254 proj_parton_py_, proj_parton_pz_);
249255}
250256
257+
251258void MCGlauberWrapper::GetHardPartonPosAndMomentumTarg () {
252- mc_gen_->GetMomandPos_Targ (hard_parton_t_, hard_parton_x_, hard_parton_y_,
253- hard_parton_z_, targ_parton_e_, targ_parton_px_,
259+ mc_gen_->GetMomandPos_Targ (hard_parton_t_, hard_parton_x_, hard_parton_y_,
260+ hard_parton_z_, targ_parton_e_, targ_parton_px_,
254261 targ_parton_py_, targ_parton_pz_);
255262}
256263
257264void MCGlauberWrapper::GenerateStrings () {
258- mc_gen_->generate_strings (); // generate 3D Glauber for MUSIC
265+ // generate strings from 3D Glauber for MUSIC
266+ QCDStringList_.clear ();
267+ auto stringList = mc_gen_->generate_strings ();
268+ for (auto string_i: stringList) {
269+ std::vector<double > string_temp;
270+ for (auto ii: string_i) {
271+ string_temp.push_back (static_cast <double >(ii));
272+ }
273+ QCDStringList_.push_back (string_temp);
274+ }
275+ JSINFO << " Produced " << QCDStringList_.size () << " strings." ;
259276}
0 commit comments