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 NCOLLLISTFROMFILE_H
0017 #define NCOLLLISTFROMFILE_H
0018 
0019 #include <iostream>
0020 #include <vector>
0021 #include <string>
0022 #include <sstream>
0023 #include <cmath>
0024 #include "JetScapeModuleBase.h"
0025 #include "InitialState.h"
0026 #include "JetScapeLogger.h"
0027 
0028 using namespace Jetscape;
0029 
0030 class NcollListFromFile : public Jetscape::InitialState {
0031   // this is wrapper class to read external files that
0032   // stores initial number of binary collisions and corresponding
0033   // configurations
0034 public:
0035   NcollListFromFile();
0036   ~NcollListFromFile();
0037 
0038   //void Init();
0039 
0040   /** Default Exec() function. It can be overridden by other tasks.
0041    */
0042   void Exec();
0043 
0044   /** Default Clear() function. It can be overridden by other tasks.
0045    */
0046   void Clear();
0047 
0048   /** Generated number of binary collisions. */
0049   double GetNcoll() { return(ncoll_); };
0050 
0051   //! Load saved number of binary collisions
0052   void ReadNbcList(std::string filename);
0053 
0054   void SampleABinaryCollisionPoint(double &x, double &y);
0055 
0056 private:
0057   std::vector<double> binary_collision_x_;
0058   std::vector<double> binary_collision_y_;
0059   std::shared_ptr<std::uniform_int_distribution<int>> rand_int_ptr_;
0060 
0061   double ncoll_ = -1;
0062 
0063   // Allows the registration of the module so that it is available to be used
0064   // by the Jetscape framework.
0065   static RegisterJetScapeModule<NcollListFromFile> reg;
0066 };
0067 
0068 #endif  // NCOLLLISTFROMFILE_H