Back to home page

sPhenix code displayed by LXR

 
 

    


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

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 #ifndef TRENTOINITIAL_H
0017 #define TRENTOINITIAL_H
0018 
0019 #include <tuple>
0020 #include <memory>
0021 #include <iostream>
0022 #include <boost/filesystem.hpp>
0023 #include <boost/filesystem/fstream.hpp>
0024 #include <boost/program_options.hpp>
0025 
0026 #include "fwd_decl.h"
0027 #include "JetScapeModuleBase.h"
0028 #include "collider.h"
0029 #include "InitialState.h"
0030 #include "JetScapeLogger.h"
0031 
0032 using OptDesc = po::options_description;
0033 using VarMap = po::variables_map;
0034 using namespace trento;
0035 
0036 namespace Jetscape {
0037 
0038 typedef struct {
0039   double impact_parameter;
0040   double num_participant;
0041   double num_binary_collisions;
0042   double total_entropy;
0043   std::map<int, double> ecc; // order, eccentricity
0044   std::map<int, double> psi; // order, participant_plane
0045   double xmid, ymid;
0046 } EventInfo;
0047 
0048 /**The output data format (from http://qcd.phy.duke.edu/trento/usage.html#output-options):
0049  * The grid will always be a square N × N array, with N = ceil(2*max/step).
0050  * So e.g. the default settings (max = 10 fm, step = 0.2 fm) imply a 100 × 100 grid.
0051  * The ceiling function ensures that the number of steps is always rounded up,
0052  * so e.g. given max = 10 fm and step 0.3 fm, the grid will be 67 × 67.
0053  * In this case, the actual grid max will be marginally increased (max = nsteps*step/2).
0054 **/
0055 
0056 ////////////////////////// Trento Initial Condition Wrapper //////////////////////
0057 class TrentoInitial : public InitialState {
0058 public:
0059   // Initialize from XML configuration
0060   TrentoInitial();
0061   ~TrentoInitial();
0062 
0063   //void Init();
0064   void Exec();
0065   void Clear();
0066   void InitTask();
0067 
0068   struct RangeFailure : public std::runtime_error {
0069     using std::runtime_error::runtime_error;
0070   };
0071   EventInfo info_;
0072 
0073 private:
0074   std::shared_ptr<trento::Collider> TrentoGen_;
0075   std::pair<double, double> GenCenTab(std::string proj, std::string targ,
0076                                       VarMap var_map, int cL, int cH);
0077   /// The output instance.
0078   // Output output_;
0079 
0080   // Allows the registration of the module so that it is available to be used by the Jetscape framework.
0081   static RegisterJetScapeModule<TrentoInitial> reg;
0082 };
0083 
0084 } // end namespace Jetscape
0085 
0086 #endif // TRENTOINITIAL_H