Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-03 08:20:04

0001 /*******************************************************************************
0002  * Copyright (c) The JETSCAPE Collaboration, 2020
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 
0017 #ifndef HADRONPRINTER_H
0018 #define HADRONPRINTER_H
0019 
0020 #include "JetClass.h"
0021 //#include <vector>
0022 #include <string>
0023 #include<fstream>
0024 #include "JetScapeModuleBase.h"
0025 //#include "PartonShower.h"
0026 //#include "sigslot.h"
0027 
0028 namespace Jetscape {
0029 
0030 class HadronPrinter : public JetScapeModuleBase,
0031       public std::enable_shared_from_this<HadronPrinter> 
0032 {
0033 
0034  public:
0035  
0036   HadronPrinter();
0037   virtual ~HadronPrinter();
0038   
0039   virtual void Init();
0040   virtual void Exec() final;
0041   virtual void Clear();
0042   virtual void WriteTask(weak_ptr<JetScapeWriter> w);
0043 
0044   sigslot::signal1<vector<shared_ptr<Hadron>>& > GetFinalHadronList;
0045 
0046   void SetFinalHadrons(vector<shared_ptr<Hadron>>& hadrons){
0047     finalHadrons = hadrons;
0048     PrintFinalHadron();
0049   }
0050   
0051   void PrintFinalHadron();
0052  
0053  private:
0054 
0055   vector<shared_ptr<Hadron>> finalHadrons;
0056      std::ofstream fHadronOutfile;  ///< the output stream where events are saved to file
0057 
0058   // Allows the registration of the module so that it is available to be used by the Jetscape framework.
0059   static RegisterJetScapeModule<HadronPrinter> reg;
0060 };
0061 
0062 } // end namespace Jetscape
0063 
0064 
0065 #endif