Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:19:20

0001 /*******************************************************************************
0002  * Copyright (c) The JETSCAPE Collaboration, 2018
0003  *
0004  * Modular, task-based framework for simulating all aspects of heavy-ion collisions
0005  * 
0006  * For the list of contributors see AUTHORS.
0007  *
0008  * Report issues at https://github.com/JETSCAPE/JETSCAPE/issues
0009  *
0010  * or via email to bugs.jetscape@gmail.com
0011  *
0012  * Distributed under the GNU General Public License 3.0 (GPLv3 or later).
0013  * See COPYING for details.
0014  ******************************************************************************/
0015 // -----------------------------------------
0016 // JETSCPAE module for soft particlization
0017 // This module will generate Monte-Carlo samples for soft hadrons
0018 // -----------------------------------------
0019 
0020 #include "SoftParticlization.h"
0021 
0022 namespace Jetscape {
0023 
0024 SoftParticlization::SoftParticlization() { boost_invariance = false; }
0025 
0026 SoftParticlization::~SoftParticlization() {
0027   for (unsigned i = 0; i < Hadron_list_.size(); i++) {
0028     Hadron_list_.at(i).clear();
0029   }
0030   Hadron_list_.clear();
0031 }
0032 
0033 void SoftParticlization::Init() {
0034   JetScapeModuleBase::Init();
0035   JSINFO << "Initialize Soft particlization module ... " << GetId() << " ...";
0036 
0037   boost_invariance = check_boost_invariance();
0038 
0039   JSINFO << "boost invariance: " << boost_invariance;
0040 
0041   InitTask();
0042 }
0043 
0044 void SoftParticlization::Exec() {}
0045 
0046 void SoftParticlization::Clear() {
0047   for (unsigned i = 0; i < Hadron_list_.size(); i++) {
0048     Hadron_list_.at(i).clear();
0049   }
0050   Hadron_list_.clear();
0051 }
0052 
0053 bool SoftParticlization::check_boost_invariance() {
0054   bool boost_invariance_flag = false;
0055   double grid_max_z = GetXMLElementDouble({"IS", "grid_max_z"});
0056   double grid_step_z = GetXMLElementDouble({"IS", "grid_step_z"});
0057   int nz = static_cast<int>(2. * grid_max_z / grid_step_z);
0058   if (nz <= 1) {
0059     boost_invariance_flag = true;
0060   }
0061   return (boost_invariance_flag);
0062 }
0063 
0064 } // end namespace Jetscape