3 #include <calobase/RawCluster.h>
4 #include <calobase/RawClusterContainer.h>
5 #include <calobase/RawTower.h>
6 #include <calobase/RawTowerContainer.h>
7 #include <calobase/TowerInfo.h>
8 #include <calobase/TowerInfoContainer.h>
9 #include <calobase/TowerInfoDefs.h>
10 #include <calobase/RawTowerDeadMap.h>
11 #include <calobase/RawTowerGeomContainer.h>
12 #include <calobase/RawTowerGeom.h>
37 , m_deadTowerMaskHalfWidth(1.6)
38 , m_rawClusters(nullptr)
39 , m_towerinfoClusters(nullptr)
41 , m_calibTowers(nullptr)
42 , m_calibTowerInfos(nullptr)
58 std::cout <<
Name() <<
"::" <<
m_detector <<
"::process_event - Entry" << std::endl;
79 for (iter = begin_end.first; iter != begin_end.second;)
84 std::vector<float> toweretas;
85 std::vector<float> towerphis;
86 std::vector<float> towerenergies;
92 for (toweriter = towers.first; toweriter != towers.second; ++toweriter)
105 toweretas.push_back(towereta);
106 towerphis.push_back(towerphi);
107 towerenergies.push_back(towerenergy);
120 toweretas.push_back(towereta);
121 towerphis.push_back(towerphi);
122 towerenergies.push_back(towerenergy);
126 int ntowers = toweretas.size();
137 for (
int j = 0;
j < ntowers;
j++)
139 float energymult = towerenergies.at(
j) * toweretas.at(
j);
140 etamult += energymult;
141 etasum += towerenergies.at(
j);
143 int phibin = towerphis.at(
j);
145 if (phibin - towerphis.at(0) < -phi_bins / 2.0)
149 else if (phibin - towerphis.at(0) > +phi_bins / 2.0)
153 assert(std::abs(phibin - towerphis.at(0)) <= phi_bins / 2.0);
155 energymult = towerenergies.at(
j) * phibin;
156 phimult += energymult;
157 phisum += towerenergies.at(
j);
160 float avgphi = phimult / phisum;
161 float avgeta = etamult / etasum;
165 std::cout <<
Name() <<
"::" <<
m_detector <<
"::process_event - process cluster at average location " << avgeta <<
"," << avgphi <<
" : ";
170 bool rejecCluster =
false;
176 int ieta = search_eta;
177 int iphi = search_phi;
179 if (ieta >= eta_bins)
188 if (iphi >= phi_bins)
205 << (isDead ?
": is dead." :
"OK")
227 std::cout <<
Name() <<
"::" <<
m_detector <<
"::process_event - " <<
"reject cluster " << cluster->
get_id() << std::endl;
245 std::cout <<
Name() <<
"::" <<
m_detector <<
"::process_event - " <<
"keep cluster " << cluster->
get_id() << std::endl;
254 unsigned int clus_size;
263 std::cout <<
Name() <<
"::" <<
m_detector <<
"::process_event - masked "
264 << nMasked <<
" clusters. Final cluster containers has "
265 << clus_size <<
" clusters"
281 std::cout <<
"DST Node missing, quitting" << std::endl;
282 throw std::runtime_error(
"failed to find DST node in RawClusterDeadHotMask::CreateNodeTree");
291 <<
m_detector <<
" Cluster Container found while in RawClusterDeadHotMask, can't proceed!!!" << std::endl;
293 throw std::runtime_error(
"failed to find CLUSTER node in RawClusterDeadHotMask::CreateNodeTree");
302 <<
m_detector <<
" Cluster Container found while in RawClusterDeadHotMask, can't proceed!!!" << std::endl;
304 throw std::runtime_error(
"failed to find CLUSTERINFO node in RawClusterDeadHotMask::CreateNodeTree");
312 <<
"No calibrated " <<
m_detector <<
" tower info found while in RawClusterDeadHotMask, can't proceed!!!" << std::endl;
313 throw std::runtime_error(
"failed to find TOWER_CALIB node in RawClusterDeadHotMask::CreateNodeTree");
321 <<
"No calibrated " <<
m_detector <<
" tower info found while in RawClusterDeadHotMask, can't proceed!!!" << std::endl;
322 throw std::runtime_error(
"failed to find TOWERINFO_CALIB node in RawClusterDeadHotMask::CreateNodeTree");
326 m_geometry = findNode::getClass<RawTowerGeomContainer>(topNode, towergeomnodename);
331 <<
": Could not find node " << towergeomnodename << std::endl;
332 throw std::runtime_error(
"failed to find TOWERGEOM node in RawClusterDeadHotMask::CreateNodeTree");
336 m_deadMap = findNode::getClass<RawTowerDeadMap>(topNode, deadMapName);
341 <<
" use dead map: ";