24 JetScapeSignalManager *JetScapeSignalManager::m_pInstance = NULL;
28 JSINFO <<
"Created JetScapeSignalManager Instance";
35 void JetScapeSignalManager::ConnectGetHardPartonListSignal(
36 shared_ptr<JetEnergyLossManager> jm) {
37 if (!jm->GetGetHardPartonListConnected()) {
38 auto hpp = GetHardProcessPointer().lock();
40 jm->GetHardPartonList.connect(hpp.get(), &HardProcess::GetHardPartonList);
41 jm->SetGetHardPartonListConnected(
true);
46 void JetScapeSignalManager::ConnectGetFinalPartonListSignal(
47 shared_ptr<HadronizationManager> hm) {
48 if (!hm->GetGetFinalPartonListConnected()) {
50 auto elp = GetEnergyLossPointer().lock();
52 hm->GetFinalPartonList.connect(elp.get(),
53 &JetEnergyLoss::SendFinalStatePartons);
54 hm->SetGetFinalPartonListConnected(
true);
58 if (!hm->GetGetHadronListConnected()) {
59 auto hpp = GetHardProcessPointer().lock();
61 hm->GetHadronList.connect(hpp.get(), &HardProcess::GetHadronList);
62 hm->SetGetHadronListConnected(
true);
67 void JetScapeSignalManager::ConnectJetSignal(shared_ptr<JetEnergyLoss>
j) {
68 if (!j->GetJetSignalConnected()) {
69 auto hp = GetHydroPointer().lock();
71 j->jetSignal.connect(hp.get(), &FluidDynamics::UpdateEnergyDeposit);
72 j->SetJetSignalConnected(
true);
73 jet_signal_map.emplace(num_jet_signals, (weak_ptr<JetEnergyLoss>)j);
79 void JetScapeSignalManager::ConnectEdensitySignal(shared_ptr<JetEnergyLoss>
j) {
80 if (!j->GetEdensitySignalConnected()) {
81 auto hp = GetHydroPointer().lock();
83 j->edensitySignal.connect(hp.get(), &FluidDynamics::GetEnergyDensity);
84 j->SetEdensitySignalConnected(
true);
85 edensity_signal_map.emplace(num_edensity_signals,
86 (weak_ptr<JetEnergyLoss>)j);
87 num_edensity_signals++;
92 void JetScapeSignalManager::ConnectGetHydroTau0Signal(
93 shared_ptr<JetEnergyLoss>
j) {
94 if (!j->GetGetHydroTau0SignalConnected()) {
95 auto hp = GetHydroPointer().lock();
97 j->GetHydroTau0Signal.connect(hp.get(), &FluidDynamics::GetHydroStartTime);
98 j->SetGetHydroTau0SignalConnected(
true);
103 void JetScapeSignalManager::ConnectGetHydroCellSignal(
104 shared_ptr<JetEnergyLoss>
j) {
105 if (!j->GetGetHydroCellSignalConnected()) {
106 auto hp = GetHydroPointer().lock();
108 j->GetHydroCellSignal.connect(hp.get(), &FluidDynamics::GetHydroCell);
109 j->SetGetHydroCellSignalConnected(
true);
110 GetHydroCellSignal_map.emplace(num_GetHydroCellSignals,
111 (weak_ptr<JetEnergyLoss>)j);
112 num_GetHydroCellSignals++;
117 void JetScapeSignalManager::ConnectGetHydroCellSignal(
118 shared_ptr<LiquefierBase> l) {
119 if (!l->get_GetHydroCellSignalConnected()) {
120 auto hp = GetHydroPointer().lock();
122 l->GetHydroCellSignal.connect(hp.get(), &FluidDynamics::GetHydroCell);
123 l->set_GetHydroCellSignalConnected(
true);
128 void JetScapeSignalManager::ConnectGetHydroCellSignal(
129 shared_ptr<Hadronization>
h) {
130 if (!h->GetGetHydroCellSignalConnected()) {
131 auto hp = GetHydroPointer().lock();
133 h->GetHydroCellSignal.connect(hp.get(), &FluidDynamics::GetHydroCell);
134 h->SetGetHydroCellSignalConnected(
true);
139 void JetScapeSignalManager::ConnectSentInPartonsSignal(
140 shared_ptr<JetEnergyLoss>
j, shared_ptr<JetEnergyLoss> j2) {
141 if (!j2->GetSentInPartonsConnected()) {
142 j->SentInPartons.connect(j2.get(), &JetEnergyLoss::DoEnergyLoss);
143 j2->SetSentInPartonsConnected(
true);
144 SentInPartons_map.emplace(num_SentInPartons, (weak_ptr<JetEnergyLoss>)j2);
150 void JetScapeSignalManager::ConnectTransformPartonsSignal(
151 shared_ptr<Hadronization>
h, shared_ptr<Hadronization>
h2) {
152 if (!h2->GetTransformPartonsConnected()) {
153 h->TransformPartons.connect(h2.get(), &Hadronization::DoHadronization);
154 h2->SetTransformPartonsConnected(
true);
155 TransformPartons_map.emplace(num_TransformPartons,
156 (weak_ptr<Hadronization>)h2);
158 num_TransformPartons++;
163 void JetScapeSignalManager::ConnectGetFinalHadronListSignal(
164 shared_ptr<HadronPrinter>
h){
165 auto hadroMgrShared = GetHadronizationManagerPointer().lock();
167 h->GetFinalHadronList.connect(hadroMgrShared.get(),
168 &HadronizationManager::GetHadrons);
172 void JetScapeSignalManager::ConnectGetHydroHyperSurfaceSignal(
173 shared_ptr<Hadronization>
h) {
174 if (!h->GetGetHydroHyperSurfaceConnected()) {
175 auto hp = GetHydroPointer().lock();
177 h->GetHydroHyperSurface.connect(
178 hp.get(), &FluidDynamics::FindAConstantTemperatureSurface);
179 h->SetGetHydroHyperSurfaceConnected(
true);
189 auto loss = jloss.lock();
191 int nEnd = SentInPartons_map.size();
192 int nStart = loss->GetTaskAt(0)->GetNumberOfTasks();
194 for (
int i = nStart;
i < nEnd;
i++) {
195 jet_signal_map.erase(
i);
198 edensity_signal_map.erase(
i);
199 num_edensity_signals--;
201 GetHydroCellSignal_map.erase(
i);
202 num_GetHydroCellSignals--;
204 SentInPartons_map.erase(
i);
207 TransformPartons_map.erase(
i);
208 num_TransformPartons--;
211 jet_signal_map.clear();
212 edensity_signal_map.clear();
213 GetHydroCellSignal_map.clear(), SentInPartons_map.clear();
214 TransformPartons_map.clear();
218 PrintGetHydroCellSignalMap();
219 PrintSentInPartonsSignalMap();
220 PrintTransformPartonsSignalMap();
225 void JetScapeSignalManager::PrintJetSignalMap() {
226 for (
auto &
x : jet_signal_map) {
227 auto xs =
x.second.lock();
229 VERBOSE(8) <<
"[" <<
x.first <<
':' << xs.get() <<
']' <<
" "
235 void JetScapeSignalManager::PrintEdensitySignalMap() {
236 for (
auto &
x : edensity_signal_map) {
237 auto xs =
x.second.lock();
239 VERBOSE(8) <<
"[" <<
x.first <<
':' << xs.get() <<
']' <<
" "
245 void JetScapeSignalManager::PrintGetHydroCellSignalMap() {
246 for (
auto &
x : GetHydroCellSignal_map) {
247 auto xs =
x.second.lock();
249 VERBOSE(8) <<
"[" <<
x.first <<
':' << xs.get() <<
']' <<
" "
255 void JetScapeSignalManager::PrintSentInPartonsSignalMap() {
256 for (
auto &
x : SentInPartons_map) {
257 auto xs =
x.second.lock();
259 VERBOSE(8) <<
"[" <<
x.first <<
':' << xs.get() <<
']' <<
" "
265 void JetScapeSignalManager::PrintTransformPartonsSignalMap() {
266 for (
auto &
x : TransformPartons_map) {
267 auto xs =
x.second.lock();
269 VERBOSE(8) <<
"[" <<
x.first <<
':' << xs.get() <<
']' <<
" "