5 #include <calobase/RawCluster.h>
6 #include <calobase/RawClusterContainer.h>
7 #include <calobase/RawClusterDefs.h>
8 #include <calobase/RawClusterv1.h>
9 #include <calobase/RawTower.h>
10 #include <calobase/RawTowerContainer.h>
11 #include <calobase/RawTowerDefs.h>
12 #include <calobase/RawTowerGeom.h>
13 #include <calobase/RawTowerGeomContainer.h>
44 virtual ~twrs() =
default;
118 , chkenergyconservation(0)
129 catch (std::exception &
e)
131 std::cout <<
PHWHERE <<
": " << e.what() << std::endl;
142 RawTowerContainer *towers = findNode::getClass<RawTowerContainer>(topNode, towernodename);
145 std::cout <<
PHWHERE <<
": Could not find node " << towernodename << std::endl;
149 RawTowerGeomContainer *towergeom = findNode::getClass<RawTowerGeomContainer>(topNode, towergeomnodename);
152 std::cout <<
PHWHERE <<
": Could not find node " << towergeomnodename << std::endl;
156 std::vector<twrs> towerVector;
159 for (; itr != begin_end.second; ++itr)
168 towerVector.push_back(twr);
173 std::multimap<int, twrs> clusteredTowers;
178 std::multimap<int, twrs>::iterator ctitr = clusteredTowers.begin();
179 std::multimap<int, twrs>::iterator lastct = clusteredTowers.end();
180 for (; ctitr != lastct; ++ctitr)
182 int clusterid = ctitr->first;
184 if (last_id != clusterid)
194 const twrs &tmptower = ctitr->second;
241 clusterA->
set_r(sqrt(sum_y * sum_y + sum_x * sum_x));
242 clusterA->
set_phi(atan2(sum_y, sum_x));
243 clusterA->
set_z(sum_z);
248 std::cout <<
"RawClusterBuilderGraph constucted ";
259 if (fabs(etower - ecluster) / ecluster > 1
e-9)
261 std::cout <<
"energy conservation violation: ETower: " << etower
262 <<
" ECluster: " << ecluster
263 <<
" diff: " << etower - ecluster << std::endl;
270 std::cout <<
"energy conservation violation: ETower: " << etower
271 <<
" ECluster: " << ecluster << std::endl;
291 std::cerr <<
PHWHERE <<
"DST Node missing, doing nothing." << std::endl;
292 throw std::runtime_error(
"Failed to find DST node in EmcRawTowerBuilder::CreateNodes");