32 HadronizationManager::HadronizationManager() {
33 SetId(
"HadronizationManager");
34 GetFinalPartonListConnected =
false;
35 GetHadronListConnected =
false;
39 HadronizationManager::~HadronizationManager() {
43 if (GetNumberOfTasks() > 0)
48 JSDEBUG <<
"Hadronization task List ...";
52 int n = GetNumberOfTasks();
53 for (
int i = 1;
i <
n;
i++)
56 JetScapeSignalManager::Instance()->CleanUp();
57 JetScapeTask::ClearTasks();
62 JSINFO <<
"Initialize Hadronization Manager ...";
64 if (GetNumberOfTasks() < 1) {
65 JSWARN <<
" : No valid Hadronization Manager modules found ...";
69 JSINFO <<
"Found " << GetNumberOfTasks()
70 <<
" Hadronization Manager Tasks/Modules Initialize them ... ";
71 JetScapeTask::InitTasks();
73 JSINFO <<
"Connect HadronizationManager Signal to Energy Loss ...";
74 JetScapeSignalManager::Instance()->ConnectGetFinalPartonListSignal(
78 void HadronizationManager::WriteTask(weak_ptr<JetScapeWriter> w) {
80 JetScapeTask::WriteTasks(w);
83 void HadronizationManager::Exec() {
85 VERBOSE(2) <<
"Run Hadronization Manager ...";
86 JSDEBUG <<
"Task Id = " << this_thread::get_id();
88 if (GetNumberOfTasks() < 1) {
89 JSWARN <<
" : No valid Hadronization modules found ...";
95 if (GetGetFinalPartonListConnected()) {
96 GetFinalPartonList(hd);
98 GetHadronList(hadrons);
99 VERBOSE(2) <<
" There are " << hd.size()
100 <<
" partons ready for hadronization";
101 VERBOSE(2) <<
" There are already " << hadrons.size() <<
" hadrons";
103 for (
auto it : GetTaskList()) {
107 JetScapeTask::ExecuteTasks();
109 VERBOSE(2) <<
" There are no partons ready for recombination";
113 void HadronizationManager::CreateSignalSlots() {
114 for (
auto it : GetTaskList()) {
115 for (
auto it2 :
it->GetTaskList()) {
116 if (!dynamic_pointer_cast<Hadronization>(it2)
117 ->GetTransformPartonsConnected()) {
118 JetScapeSignalManager::Instance()->ConnectTransformPartonsSignal(
119 dynamic_pointer_cast<Hadronization>(
it),
120 dynamic_pointer_cast<Hadronization>(it2));
122 if (!dynamic_pointer_cast<Hadronization>(it2)
123 ->GetGetHydroHyperSurfaceConnected()) {
124 JetScapeSignalManager::Instance()->ConnectGetHydroHyperSurfaceSignal(
125 dynamic_pointer_cast<Hadronization>(it2));
127 if (!dynamic_pointer_cast<Hadronization>(it2)
128 ->GetGetHydroCellSignalConnected()) {
129 JetScapeSignalManager::Instance()->ConnectGetHydroCellSignal(
130 dynamic_pointer_cast<Hadronization>(it2));
135 JetScapeSignalManager::Instance()->PrintTransformPartonsSignalMap();
143 vector<shared_ptr<Hadron>> tempHadronList;
147 for(
auto hadron : tempHadronList){
153 void HadronizationManager::DeleteHadrons() {
162 void HadronizationManager::DeleteRealHadrons() {