Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
JetScapeSignalManager.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file JetScapeSignalManager.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 // SignalManager instance class (meant as singelton)
17 
18 #ifndef JETSCAPESIGNALMANAGER_H
19 #define JETSCAPESIGNALMANAGER_H
20 
21 #include "Afterburner.h"
22 #include "InitialState.h"
23 #include "JetEnergyLoss.h"
24 #include "JetEnergyLossManager.h"
25 #include "HadronizationManager.h"
26 #include "Hadronization.h"
27 #include "FluidDynamics.h"
28 #include "HardProcess.h"
29 #include "JetScapeWriter.h"
30 #include "PreequilibriumDynamics.h"
31 #include "PartonPrinter.h"
32 #include "HadronPrinter.h"
33 
34 #include <iostream>
35 #include <string>
36 #include <map>
37 #include "sigslot.h"
38 
39 using namespace sigslot;
40 
41 namespace Jetscape {
42 
43 class
44  JetScapeSignalManager //: public sigslot::has_slots<sigslot::multi_threaded_local>
45 {
46 
47 public:
48  static JetScapeSignalManager *Instance();
49 
50  void SetInitialStatePointer(shared_ptr<InitialState> m_initial) {
51  initial_state = m_initial;
52  }
53  weak_ptr<InitialState> GetInitialStatePointer() { return initial_state; }
54 
55  void SetPreEquilibriumPointer(shared_ptr<PreequilibriumDynamics> m_pre_eq) {
56  pre_equilibrium = m_pre_eq;
57  }
58  weak_ptr<PreequilibriumDynamics> GetPreEquilibriumPointer() {
59  return pre_equilibrium;
60  }
61 
62  void SetHydroPointer(shared_ptr<FluidDynamics> m_hydro) { hydro = m_hydro; }
63  weak_ptr<FluidDynamics> GetHydroPointer() { return hydro; }
64 
65  void SetSoftParticlizationPointer(shared_ptr<SoftParticlization> m_soft) {
66  softparticlization = m_soft;
67  }
68  weak_ptr<SoftParticlization> GetSoftParticlizationPointer() {
69  return softparticlization;
70  }
71 
72  void
73  SetJetEnergyLossManagerPointer(shared_ptr<JetEnergyLossManager> m_jloss) {
74  jloss = m_jloss;
75  }
76  weak_ptr<JetEnergyLossManager> GetJetEnergyLossManagerPointer() {
77  return jloss;
78  }
79 
80  void SetHardProcessPointer(shared_ptr<HardProcess> m_hardp) {
81  hardp = m_hardp;
82  }
83  weak_ptr<HardProcess> GetHardProcessPointer() { return hardp; }
84 
85  void SetWriterPointer(shared_ptr<JetScapeWriter> m_writer) {
86  writer = m_writer;
87  }
88  weak_ptr<JetScapeWriter> GetWriterPointer() { return writer; }
89 
90  void
91  SetHadronizationManagerPointer(shared_ptr<HadronizationManager> m_hadro) {
92  hadro = m_hadro;
93  }
94  weak_ptr<HadronizationManager> GetHadronizationManagerPointer() {
95  return hadro;
96  }
97 
98  void SetPartonPrinterPointer(shared_ptr<PartonPrinter> m_pprinter) {
99  pprinter = m_pprinter;
100  }
101  weak_ptr<PartonPrinter> GetPartonPrinterPointer() { return pprinter; }
102 
103  void SetHadronPrinterPointer(shared_ptr<HadronPrinter> m_hprinter) {
104  hprinter = m_hprinter;
105  }
106  weak_ptr<HadronPrinter> GetHadronPrinterPointer() { return hprinter; }
107 
108 
109  void SetEnergyLossPointer(shared_ptr<JetEnergyLoss> m_eloss) {
110  eloss = m_eloss;
111  }
112 
113  weak_ptr<JetEnergyLoss> GetEnergyLossPointer() { return eloss; }
114 
115  void ConnectJetSignal(shared_ptr<JetEnergyLoss> j);
116  void ConnectEdensitySignal(shared_ptr<JetEnergyLoss> j);
117  void ConnectGetHydroTau0Signal(shared_ptr<JetEnergyLoss> j);
118  void ConnectGetHydroCellSignal(shared_ptr<JetEnergyLoss> j);
119  void ConnectGetHydroCellSignal(shared_ptr<LiquefierBase> l);
120  void ConnectGetHydroCellSignal(shared_ptr<Hadronization> h);
121  void ConnectGetHardPartonListSignal(shared_ptr<JetEnergyLossManager> jm);
122  void ConnectSentInPartonsSignal(shared_ptr<JetEnergyLoss> j,
123  shared_ptr<JetEnergyLoss> j2);
124  void ConnectGetFinalPartonListSignal(shared_ptr<HadronizationManager> hm);
125  void ConnectTransformPartonsSignal(shared_ptr<Hadronization> h,
126  shared_ptr<Hadronization> h2);
127  void ConnectGetFinalHadronListSignal(shared_ptr<HadronPrinter> h);
128 
129  void ConnectGetHydroHyperSurfaceSignal(shared_ptr<Hadronization> h);
130 
131  void
132  DisconnectSignal(){}; // to be implememted if needed maybe for Eloss ...!???
133 
134  void CleanUp();
135 
136  int GetNumberOfJetSignals() { return num_jet_signals; }
137  int GetNumberOfEdensitySignals() { return num_edensity_signals; }
138  int GetNumberOfGetHydroCellSignals() { return num_GetHydroCellSignals; }
139 
140  void PrintJetSignalMap();
141  void PrintEdensitySignalMap();
142  void PrintGetHydroCellSignalMap();
143  void PrintSentInPartonsSignalMap();
144  void PrintTransformPartonsSignalMap();
145 
146 private:
149  static JetScapeSignalManager *m_pInstance;
150 
151  weak_ptr<InitialState> initial_state;
152  weak_ptr<PreequilibriumDynamics> pre_equilibrium;
153  weak_ptr<FluidDynamics> hydro;
154  weak_ptr<JetEnergyLossManager> jloss;
155  weak_ptr<HardProcess> hardp;
156  weak_ptr<JetScapeWriter> writer;
157  weak_ptr<HadronizationManager> hadro;
158  weak_ptr<Afterburner> afterburner;
159  weak_ptr<PartonPrinter> pprinter;
160  weak_ptr<HadronPrinter> hprinter;
161  weak_ptr<JetEnergyLoss> eloss;
162  weak_ptr<SoftParticlization> softparticlization;
163 
164  int num_jet_signals = 0;
165  int num_edensity_signals = 0;
166  int num_GetHydroCellSignals = 0;
167  int num_SentInPartons = 0;
168  int num_TransformPartons = 0;
169 
170  map<int, weak_ptr<JetEnergyLoss>> jet_signal_map;
171  map<int, weak_ptr<JetEnergyLoss>> edensity_signal_map;
172  map<int, weak_ptr<JetEnergyLoss>> GetHydroCellSignal_map;
173 
174  map<int, weak_ptr<JetEnergyLoss>> SentInPartons_map;
175  map<int, weak_ptr<Hadronization>> TransformPartons_map;
176 };
177 
178 } // end namespace Jetscape
179 
180 #endif