Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
JetScape.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file JetScape.h
1 /*******************************************************************************
2  * Copyright (c) The JETSCAPE Collaboration, 2018
3  *
4  * Modular, task-based framework for simulating all aspects of heavy-ion collisions
5  *
6  * For the list of contributors see AUTHORS.
7  *
8  * Report issues at https://github.com/JETSCAPE/JETSCAPE/issues
9  *
10  * or via email to bugs.jetscape@gmail.com
11  *
12  * Distributed under the GNU General Public License 3.0 (GPLv3 or later).
13  * See COPYING for details.
14  ******************************************************************************/
15 
16 #ifndef JETSCAPE_H
17 #define JETSCAPE_H
18 
19 #include "JetScapeLogger.h"
20 #include "JetScapeTaskSupport.h"
21 #include "JetScapeModuleBase.h"
22 #include "CausalLiquefier.h"
23 
24 namespace Jetscape {
25 
26 class JetScape : public JetScapeModuleBase {
27 
28 public:
31  JetScape();
32 
35  virtual ~JetScape();
36 
39  void Init();
40 
43  void Exec();
44 
45  void Finish();
46 
49  void SetNumberOfEvents(int m_n_events) { n_events = m_n_events; }
50 
53  int GetNumberOfEvents() { return n_events; }
54 
58  inline void SetReuseHydro(const bool reuse_hydro) {
59  reuse_hydro_ = reuse_hydro;
60  }
63  inline bool GetReuseHydro() const { return reuse_hydro_; }
64 
69  inline void SetNReuseHydro(const unsigned int n_reuse_hydro) {
70  if (!GetReuseHydro()) {
71  JSWARN << "Number of hydro reusals set, but reusal not turned on.";
72  JSWARN << "Try jetscape->SetReuseHydro (true);";
73  }
74  n_reuse_hydro_ = n_reuse_hydro;
75  }
76  inline unsigned int GetNReuseHydro() const { return n_reuse_hydro_; }
77 
78 protected:
80  void recurseToBuild(std::vector<std::string> &elems, tinyxml2::XMLElement *mElement);
81  void recurseToSearch(std::vector<std::string> &elems, tinyxml2::XMLElement *uElement);
85  void CheckForWriterFromXML(const char *writerName,
86  std::string outputFilename);
87  void SetModuleId(tinyxml2::XMLElement *moduleElement,
88  shared_ptr<JetScapeModuleBase> module);
89 
90  void SetPointers();
91 
92  void Show();
93  int n_events;
95 
97  unsigned int n_reuse_hydro_;
98 
99  std::shared_ptr<CausalLiquefier> liquefier;
100 
101  bool
102  fEnableAutomaticTaskListDetermination; // Option to automatically determine the task list from the XML file,
103  // rather than manually calling JetScapeTask::Add() in the run macro.
104 };
105 
106 } // end namespace Jetscape
107 
108 #endif