13 #include <calobase/RawTower.h>
14 #include <calobase/RawTowerContainer.h>
16 #include <pdbcalbase/PdbParameterMap.h>
18 #include <phparameter/PHParameters.h>
26 #include <TClonesArray.h>
45 _out_file_name(filename)
48 _tower_zero_sup(-10000000)
54 cout <<
"Prototype3DSTReader::destructor - Clean ups" << endl;
58 _T->ResetBranchAddresses();
66 const static int arr_size = 100;
70 cout <<
"Prototype3DSTReader::Init - zero suppression for calorimeter "
77 const string &nodenam = *
it;
94 const string &nodenam = *
it;
112 const char *class_name = RawTower_type::Class()->GetName();
114 const string &nodenam = *
it;
116 string hname = Form(
"TOWER_%s", nodenam.c_str());
118 cout <<
"Prototype3DSTReader::Init - saving raw tower info from node: "
119 << hname <<
" - " << class_name << endl;
124 rec.
_arr = make_shared<TClonesArray>(class_name, arr_size);
137 const string &nodenam = *
it;
138 string hname = Form(
"TOWER_TEMPERATURE_%s", nodenam.c_str());
140 cout <<
"Prototype3DSTReader::Init - saving average tower temperature info "
156 cout <<
"Prototype3DSTReader::Init - requested " <<
nblocks <<
" nodes"
166 cout <<
"Prototype3DSTReader::build_tree - output to " <<
_out_file_name
174 _T =
new TTree(
"T",
"Prototype3DSTReader");
181 cout <<
"Prototype3DSTReader::build_tree - Add " << rec.
_name << endl;
185 const string name_cnt = rec.
_name;
186 const string name_cnt_desc = name_cnt +
"/D";
187 _T->Branch(name_cnt.c_str(), &(rec.
_dvalue), name_cnt_desc.c_str(),
192 const string name_cnt = rec.
_name;
193 const string name_cnt_desc = name_cnt +
"/D";
194 _T->Branch(name_cnt.c_str(), &(rec.
_dvalue), name_cnt_desc.c_str(),
199 const string name_cnt =
"n_" + rec.
_name;
200 const string name_cnt_desc = name_cnt +
"/I";
201 _T->Branch(name_cnt.c_str(), &(rec.
_cnt), name_cnt_desc.c_str(),
207 const string name_cnt = rec.
_name +
"_AVG";
208 const string name_cnt_desc = name_cnt +
"/D";
209 _T->Branch(name_cnt.c_str(), &(rec.
_dvalue), name_cnt_desc.c_str(),
216 cout <<
"Prototype3DSTReader::build_tree - added " <<
nblocks <<
" nodes"
219 _T->SetAutoSave(16000);
248 cout <<
"Prototype3DSTReader::process_event - processing tower "
249 << rec.
_name << endl;
252 findNode::getClass<RawTowerContainer>(topNode, rec.
_name);
256 cout <<
"Prototype3DSTReader::process_event - Error - can not find "
258 << rec.
_name << endl;
265 cout <<
"Prototype3DSTReader::process_event - processing "
266 << rec.
_name <<
" and received " << hits->
size() <<
" tower hits"
270 hit_iter != hit_range.second; hit_iter++)
272 RawTower *hit_raw = hit_iter->second;
282 cout <<
"Prototype3DSTReader::process_event - suppress low "
288 <<
"), Energy = " << hit->
get_energy() << endl;
296 cout <<
"Prototype3DSTReader::process_event - processing Tower hit "
301 <<
"), Energy = " << hit->
get_energy() <<
" - "
302 << rec.
_arr.get()->At(rec.
_cnt)->ClassName() << endl;
319 cout <<
"Prototype3DSTReader::process_event - processing tower "
321 << rec.
_name << endl;
324 findNode::getClass<RawTowerContainer>(topNode, rec.
_name);
328 cout <<
"Prototype3DSTReader::process_event - Error - can not find "
330 << rec.
_name << endl;
337 cout <<
"Prototype3DSTReader::process_event - processing "
338 << rec.
_name <<
" and received " << hits->
size() <<
" tower hits"
344 hit_iter != hit_range.second; hit_iter++)
346 RawTower *hit_raw = hit_iter->second;
365 findNode::getClass<PdbParameterMap>(topNode,
"RUN_INFO");
378 findNode::getClass<PdbParameterMap>(topNode,
"EVENT_INFO");
409 cout <<
"Prototype3DSTReader::End - Clean ups" << endl;
415 _T->ResetBranchAddresses();