5 #include <calobase/RawClusterContainer.h>
6 #include <calobase/RawCluster.h>
7 #include <calobase/RawClusterv1.h>
8 #include <calobase/RawClusterDefs.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>
46 bool is_adjacent(
twrs &);
47 void set_id(
const int i)
55 void set_maxphibin(
const int i)
59 int get_maxphibin()
const
63 int get_bineta()
const
67 int get_binphi()
const
119 , chkenergyconservation(0)
130 catch (std::exception &
e)
132 std::cout <<
PHWHERE <<
": " << e.what() << std::endl;
141 string towernodename =
"TOWER_CALIB_" +
detector;
143 RawTowerContainer *towers = findNode::getClass<RawTowerContainer>(topNode, towernodename);
146 std::cout <<
PHWHERE <<
": Could not find node " << towernodename << std::endl;
149 string towergeomnodename =
"TOWERGEOM_" +
detector;
150 RawTowerGeomContainer *towergeom = findNode::getClass<RawTowerGeomContainer>(topNode, towergeomnodename);
153 cout <<
PHWHERE <<
": Could not find node " << towergeomnodename << endl;
157 std::vector<twrs> towerVector;
160 for (; itr != begin_end.second; ++itr)
169 towerVector.push_back(twr);
174 std::multimap<int, twrs> clusteredTowers;
179 std::multimap<int, twrs>::iterator ctitr = clusteredTowers.begin();
180 std::multimap<int, twrs>::iterator lastct = clusteredTowers.end();
181 for (; ctitr != lastct; ++ctitr)
183 int clusterid = ctitr->first;
185 if (last_id != clusterid)
195 const twrs &tmptower = ctitr->second;
208 assert(cluster->
get_id() == clusterid);
221 assert(rawtowergeom);
242 cluster->
set_r(sqrt(sum_y * sum_y + sum_x * sum_x));
243 cluster->
set_phi(atan2(sum_y, sum_x));
244 cluster->
set_z(sum_z);
249 cout <<
"RawClusterBuilderGraph constucted ";
260 if (fabs(etower - ecluster) / ecluster > 1
e-9)
262 cout <<
"energy conservation violation: ETower: " << etower
263 <<
" ECluster: " << ecluster
264 <<
" diff: " << etower - ecluster << endl;
271 cout <<
"energy conservation violation: ETower: " << etower
272 <<
" ECluster: " << ecluster << endl;
292 std::cerr <<
PHWHERE <<
"DST Node missing, doing nothing." << std::endl;
293 throw std::runtime_error(
"Failed to find DST node in EmcRawTowerBuilder::CreateNodes");