16 #include <calobase/RawTower.h>
17 #include <calobase/RawTowerContainer.h>
18 #include <calobase/RawTowerv1.h>
38 #include <TClonesArray.h>
62 _out_file_name(filename)
66 , _load_all_particle(
false)
67 , _load_active_particle(
79 cout <<
"PHG4DSTReader::destructor - Clean ups" << endl;
83 _T->ResetBranchAddresses();
91 const int arr_size = 100;
97 const char *class_name = hit_type::Class()->GetName();
99 const string &nodenam = *
it;
101 string hname = Form(
"G4HIT_%s", nodenam.c_str());
105 cout <<
"PHG4DSTReader::Init - saving hits from node: " << hname <<
" - "
106 << class_name << endl;
112 rec.
_arr = boost::make_shared<TClonesArray>(class_name, arr_size);
123 cout <<
"PHG4DSTReader::Init - zero suppression for calorimeter towers = "
129 const char *class_name = RawTower_type::Class()->GetName();
131 const string &nodenam = *
it;
133 string hname = Form(
"TOWER_%s", nodenam.c_str());
137 cout <<
"PHG4DSTReader::Init - saving raw tower info from node: " << hname
138 <<
" - " << class_name << endl;
143 rec.
_arr = boost::make_shared<TClonesArray>(class_name, arr_size);
155 const char *class_name = PHPyJet_type::Class()->GetName();
157 const string &hname = *
it;
160 cout <<
"PHG4DSTReader::Init - saving jets from node: " << hname <<
" - "
161 << class_name << endl;
166 rec.
_arr = boost::make_shared<TClonesArray>(class_name, arr_size);
179 const char *class_name = part_type::Class()->GetName();
183 cout <<
"PHG4DSTReader::Init - saving Particles node:" << class_name
188 rec.
_name =
"PHG4Particle";
189 rec.
_arr = boost::make_shared<TClonesArray>(class_name, arr_size);
202 const char *class_name = vertex_type::Class()->GetName();
206 cout <<
"PHG4DSTReader::Init - saving vertex for particles under node:"
207 << class_name << endl;
211 rec.
_name =
"PHG4VtxPoint";
212 rec.
_arr = boost::make_shared<TClonesArray>(class_name, arr_size);
222 cout <<
"PHG4DSTReader::Init - requested " <<
nblocks <<
" nodes" << endl;
233 cout <<
"PHG4DSTReader::build_tree - output to " <<
_out_file_name << endl;
240 _T =
new TTree(
"T",
"PHG4DSTReader");
249 cout <<
"PHG4DSTReader::build_tree - Add " << rec.
_name << endl;
251 const string name_cnt =
"n_" + rec.
_name;
252 const string name_cnt_desc = name_cnt +
"/I";
253 _T->Branch(name_cnt.c_str(), &(rec.
_cnt), name_cnt_desc.c_str(),
262 cout <<
"PHG4DSTReader::build_tree - added " <<
nblocks <<
" nodes" << endl;
264 _T->SetAutoSave(16000);
285 <<
"PHG4DSTReader::process_event - Error - can not find node G4TruthInfo. Quit processing!"
302 cout <<
"PHG4DSTReader::process_event - processing " << rec.
_name
311 <<
"PHG4DSTReader::process_event - Error - can not find node "
312 << rec.
_name << endl;
319 cout <<
"PHG4DSTReader::process_event - processing "
320 << rec.
_name <<
" and received " << hits->
size() <<
" hits"
324 hit_iter != hit_range.second; hit_iter++)
326 PHG4Hit *hit = hit_iter->second;
356 cout <<
"PHG4DSTReader::process_event - processing "
358 <<
" with track id " << hit->
get_trkid() << endl;
367 cout <<
"PHG4DSTReader::process_event - processing tower "
368 << rec.
_name << endl;
376 <<
"PHG4DSTReader::process_event - Error - can not find node "
377 << rec.
_name << endl;
384 cout <<
"PHG4DSTReader::process_event - processing "
385 << rec.
_name <<
" and received " << hits->
size()
386 <<
" tower hits" << endl;
389 hit_iter != hit_range.second; hit_iter++)
391 RawTower *hit_raw = hit_iter->second;
402 <<
"PHG4DSTReader::process_event - suppress low energy tower hit "
403 << rec.
_name <<
" @ ("
406 <<
"), Energy = " << hit->
get_energy() << endl;
415 <<
"PHG4DSTReader::process_event - processing Tower hit "
416 << rec.
_name <<
" @ ("
419 <<
"), Energy = " << hit->
get_energy() <<
" - "
420 << rec.
_arr.
get()->At(rec.
_cnt)->ClassName() << endl;
453 cout <<
"PHG4DSTReader::process_event - processing jets "
454 << rec.
_name << endl;
461 <<
"PHG4DSTReader::process_event - Error - can not find node "
462 << rec.
_name << endl;
467 cout <<
"PHG4DSTReader::process_event - processing "
468 << rec.
_name <<
" and received " << hits->
size() <<
" jets"
475 Jet *hit_raw = iter->second;
478 cout <<
"PHG4DSTReader::process_event - processing jet "
481 <<
" - with raw type " << hit_raw->ClassName() << endl;
503 static bool once =
true;
507 <<
"PHG4DSTReader::process_event - will load all particle from G4TruthInfo"
513 for (
auto particle_iter = truthInfoList->
GetMap().begin();
514 particle_iter != truthInfoList->
GetMap().end();
523 static bool once =
true;
528 cout <<
"PHG4DSTReader::process_event - will load primary particle from G4TruthInfo" << endl;
538 particle_iter != primary_range.second;
552 <<
"PHG4DSTReader::process_event - ERROR - can not find particle/track ID "
553 << *i <<
" in G4TruthInfo" << endl;
564 static bool once =
true;
569 cout <<
"PHG4DSTReader::process_event - will load vertex from G4TruthInfo" << endl;
574 for (PartSet_t::const_iterator i =
_vertex_set.begin();
581 <<
"PHG4DSTReader::process_event - ERROR - can not find vertex ID "
582 << *i <<
" in G4TruthInfo" << endl;
590 cout <<
"PHG4DSTReader::process_event - saving vertex id "
654 cout <<
"PHG4DSTReader::End - Clean ups" << endl;
661 _T->ResetBranchAddresses();