13 #include <calobase/RawTower.h>
14 #include <calobase/RawTowerContainer.h>
16 #include <pdbcalbase/PdbParameterMap.h>
18 #include <phparameter/PHParameters.h>
26 #include <TClonesArray.h>
46 _out_file_name(filename)
49 _tower_zero_sup(-10000000)
55 cout <<
"Prototype2DSTReader::destructor - Clean ups" << endl;
59 _T->ResetBranchAddresses();
67 const static int arr_size = 100;
71 cout <<
"Prototype2DSTReader::Init - zero suppression for calorimeter "
78 const string &nodenam = *
it;
96 const char *class_name = RawTower_type::Class()->GetName();
98 const string &nodenam = *
it;
100 string hname = Form(
"TOWER_%s", nodenam.c_str());
102 cout <<
"Prototype2DSTReader::Init - saving raw tower info from node: "
103 << hname <<
" - " << class_name << endl;
108 rec.
_arr = make_shared<TClonesArray>(class_name, arr_size);
121 const string &nodenam = *
it;
122 string hname = Form(
"TOWER_TEMPERATURE_%s", nodenam.c_str());
124 cout <<
"Prototype2DSTReader::Init - saving average tower temperature info "
140 cout <<
"Prototype2DSTReader::Init - requested " <<
nblocks <<
" nodes"
150 cout <<
"Prototype2DSTReader::build_tree - output to " <<
_out_file_name
158 _T =
new TTree(
"T",
"Prototype2DSTReader");
165 cout <<
"Prototype2DSTReader::build_tree - Add " << rec.
_name << endl;
169 const string name_cnt = rec.
_name;
170 const string name_cnt_desc = name_cnt +
"/D";
171 _T->Branch(name_cnt.c_str(), &(rec.
_dvalue), name_cnt_desc.c_str(),
176 const string name_cnt =
"n_" + rec.
_name;
177 const string name_cnt_desc = name_cnt +
"/I";
178 _T->Branch(name_cnt.c_str(), &(rec.
_cnt), name_cnt_desc.c_str(),
184 const string name_cnt = rec.
_name +
"_AVG";
185 const string name_cnt_desc = name_cnt +
"/D";
186 _T->Branch(name_cnt.c_str(), &(rec.
_dvalue), name_cnt_desc.c_str(),
193 cout <<
"Prototype2DSTReader::build_tree - added " <<
nblocks <<
" nodes"
196 _T->SetAutoSave(16000);
225 cout <<
"Prototype2DSTReader::process_event - processing tower "
226 << rec.
_name << endl;
229 findNode::getClass<RawTowerContainer>(topNode, rec.
_name);
233 cout <<
"Prototype2DSTReader::process_event - Error - can not find "
235 << rec.
_name << endl;
242 cout <<
"Prototype2DSTReader::process_event - processing "
243 << rec.
_name <<
" and received " << hits->
size() <<
" tower hits"
247 hit_iter != hit_range.second; hit_iter++)
249 RawTower *hit_raw = hit_iter->second;
259 cout <<
"Prototype2DSTReader::process_event - suppress low "
265 <<
"), Energy = " << hit->
get_energy() << endl;
273 cout <<
"Prototype2DSTReader::process_event - processing Tower hit "
278 <<
"), Energy = " << hit->
get_energy() <<
" - "
279 << rec.
_arr.get()->At(rec.
_cnt)->ClassName() << endl;
296 cout <<
"Prototype2DSTReader::process_event - processing tower "
298 << rec.
_name << endl;
301 findNode::getClass<RawTowerContainer>(topNode, rec.
_name);
305 cout <<
"Prototype2DSTReader::process_event - Error - can not find "
307 << rec.
_name << endl;
314 cout <<
"Prototype2DSTReader::process_event - processing "
315 << rec.
_name <<
" and received " << hits->
size() <<
" tower hits"
321 hit_iter != hit_range.second; hit_iter++)
323 RawTower *hit_raw = hit_iter->second;
342 findNode::getClass<PdbParameterMap>(topNode,
"RUN_INFO");
373 cout <<
"Prototype2DSTReader::End - Clean ups" << endl;
379 _T->ResetBranchAddresses();