Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-03 08:19:56

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 // generic jetscape writer base clase
0017 
0018 #ifndef JETSCAPEWRITER_H
0019 #define JETSCAPEWRITER_H
0020 
0021 #include <string>
0022 #include "JetScapeModuleBase.h"
0023 #include "PartonShower.h"
0024 #include "JetClass.h"
0025 #include "JetScapeEventHeader.h"
0026 
0027 using std::to_string;
0028 
0029 namespace Jetscape {
0030 
0031 class JetScapeWriter : public JetScapeModuleBase {
0032 
0033 public:
0034   JetScapeWriter(){ SetId("JetScape writer"); };
0035   JetScapeWriter(string m_file_name_out) { file_name_out = m_file_name_out; }
0036   virtual ~JetScapeWriter(){};
0037 
0038   void SetOutputFileName(string m_file_name_out) {
0039     file_name_out = m_file_name_out;
0040   }
0041   string GetOutputFileName() { return file_name_out; }
0042 
0043   virtual bool GetStatus() = 0;
0044   virtual void Close(){};
0045   virtual void Open(){};
0046 
0047   virtual void WriteInitFileXML(){};
0048   virtual void Write(weak_ptr<Parton> p){};
0049   virtual void Write(weak_ptr<Jet> j){};
0050   virtual void Write(weak_ptr<Vertex> v){};
0051   virtual void Write(weak_ptr<PartonShower> ps){};
0052   virtual void Write(string s){};
0053   virtual void WriteComment(string s){};
0054   virtual void WriteWhiteSpace(string s){};
0055   virtual void Write(ostream *o){};
0056   virtual void Write(weak_ptr<Hadron> h){};
0057 
0058   /// Gets called first, before all tasks write themselves
0059   virtual void WriteHeaderToFile(){};
0060 
0061   /// Gets called last, after all tasks have written themselves
0062   virtual void WriteEvent(){};
0063 
0064   virtual JetScapeEventHeader &GetHeader() { return header; };
0065 
0066 protected:
0067   string file_name_out;
0068   JetScapeEventHeader header;
0069 };
0070 
0071 } // end namespace Jetscape
0072 
0073 #endif