5 #include <calobase/RawTower.h>
6 #include <calobase/RawTowerContainer.h>
8 #include <phparameter/PHParameters.h>
10 #include <pdbcalbase/PdbParameterMap.h>
21 #include <Event/Event.h>
22 #include <Event/EventTypes.h>
23 #include <Event/packet.h>
25 #include <boost/accumulators/accumulators.hpp>
26 #include <boost/accumulators/statistics.hpp>
42 , eventinfo_node_name(
"EVENT_INFO")
56 Event *
event = findNode::getClass<Event>(topNode,
"PRDF");
60 cout <<
"EventInfoSummary::Process_Event - Event not found" << endl;
71 cout <<
"EventInfoSummary::process_event - with DATAEVENT events ";
75 map<int, Packet *> packet_list;
82 findNode::getClass<RawTowerContainer>(topNode,
83 "TOWER_RAW_SPILL_WARBLER");
84 assert(TOWER_RAW_SPILL_WARBLER);
87 TOWER_RAW_SPILL_WARBLER->
getTower(0));
90 boost::accumulators::accumulator_set<double, boost::accumulators::features<boost::accumulators::tag::variance>> acc;
97 const double warbler_rms = boost::accumulators::variance(acc);
98 const bool is_in_spill = warbler_rms > (1000 * 1000);
107 findNode::getClass<RawTowerContainer>(topNode,
"TOWER_CALIB_CEMC");
111 findNode::getClass<RawTowerContainer>(topNode,
112 "TOWER_CALIB_LG_HCALIN");
115 findNode::getClass<RawTowerContainer>(topNode,
116 "TOWER_CALIB_LG_HCALOUT");
119 if (TOWER_CALIB_CEMC)
121 double sum_energy_calib = 0;
123 auto range = TOWER_CALIB_CEMC->
getTowers();
124 for (
auto it = range.first;
it != range.second; ++
it)
132 if (col < 0 or col >= 8)
134 if (row < 0 or row >= 8)
137 const double energy_calib = tower->
get_energy();
138 sum_energy_calib += energy_calib;
145 if (TOWER_CALIB_LG_HCALIN)
147 double sum_energy_calib = 0;
149 auto range = TOWER_CALIB_LG_HCALIN->
getTowers();
150 for (
auto it = range.first;
it != range.second; ++
it)
158 if (col < 0 or col >= 4)
160 if (row < 0 or row >= 4)
163 const double energy_calib = tower->
get_energy();
164 sum_energy_calib += energy_calib;
171 if (TOWER_CALIB_LG_HCALOUT)
173 double sum_energy_calib = 0;
175 auto range = TOWER_CALIB_LG_HCALOUT->getTowers();
176 for (
auto it = range.first;
it != range.second; ++
it)
184 if (col < 0 or col >= 4)
186 if (row < 0 or row >= 4)
189 const double energy_calib = tower->
get_energy();
190 sum_energy_calib += energy_calib;
199 for (typ_channel_map::const_iterator
it =
channel_map.begin();
202 const string &
name =
it->first;
205 if (packet_list.find(info.
packet_id) == packet_list.end())
215 cout <<
"EventInfoSummary::process_event - failed to locate packet "
229 cout <<
"EventInfoSummary::process_event - " << name <<
" = " << dvalue
230 <<
", raw = " << ivalue <<
" @ packet " << info.
packet_id
231 <<
", offset " << info.
offset << endl;
237 for (map<int, Packet *>::iterator
it = packet_list.begin();
238 it != packet_list.end(); ++
it)
264 cout <<
"PHComposite node created: DST" << endl;
281 const unsigned int offset,
282 const double calibration_const
287 make_pair(name,
channel_info(packet_id, offset, calibration_const)));