4 #include <calobase/RawCluster.h>
5 #include <calobase/RawClusterContainer.h>
6 #include <calobase/RawClusterDefs.h>
7 #include <calobase/RawClusterv1.h>
8 #include <calobase/RawTower.h>
9 #include <calobase/RawTowerContainer.h>
10 #include <calobase/RawTowerDefs.h>
11 #include <calobase/RawTowerGeom.h>
12 #include <calobase/RawTowerGeomContainer.h>
39 std::sort(input_towers.begin(), input_towers.end(), &
towerECompare);
40 std::vector<towersStrct> cluster_towers;
41 while (!input_towers.empty())
43 cluster_towers.clear();
46 if (input_towers.at(0).tower_E >
_seed_e)
50 cluster_towers.push_back(input_towers.at(0));
53 cluster->
addTower(input_towers.at(0).twr->get_id(), input_towers.at(0).tower_E);
56 input_towers.erase(input_towers.begin());
57 for (
int tit = 0; tit < (
int) cluster_towers.size(); tit++)
61 int iEtaTwr = cluster_towers.at(tit).tower_iEta;
62 int iPhiTwr = cluster_towers.at(tit).tower_iPhi;
63 int iLTwr = cluster_towers.at(tit).tower_iL;
65 for (
int ait = 0; ait < (
int) input_towers.size(); ait++)
67 int iEtaTwrAgg = input_towers.at(ait).tower_iEta;
68 int iPhiTwrAgg = input_towers.at(ait).tower_iPhi;
69 int iLTwrAgg = input_towers.at(ait).tower_iL;
83 int deltaL = TMath::Abs(iLTwrAgg - iLTwr);
84 int deltaPhi = TMath::Abs(iPhiTwrAgg - iPhiTwr);
85 int deltaEta = TMath::Abs(iEtaTwrAgg - iEtaTwr);
89 bool neighbor = (deltaL + deltaPhi + deltaEta == 1);
90 bool corner2D = (deltaL == 0 && deltaPhi == 1 && deltaEta == 1) || (deltaL == 1 && deltaPhi == 0 && deltaEta == 1) || (deltaL == 1 && deltaPhi == 1 && deltaEta == 0);
92 if (neighbor || corner2D)
96 if (input_towers.at(ait).tower_E >= (cluster_towers.at(tit).tower_E +
_agg_e))
continue;
98 cluster_towers.push_back(input_towers.at(ait));
100 cluster->
addTower(input_towers.at(ait).twr->get_id(), input_towers.at(ait).tower_E);
101 input_towers.erase(input_towers.begin() + ait);
102 if (
Verbosity() > 2) std::cout <<
"aggregated: " << iEtaTwrAgg <<
"\t" << iPhiTwrAgg <<
"\t" << iLTwrAgg <<
"\t E:" << input_towers.at(ait).tower_E <<
"\t reference: " << refC <<
"\t" << iEtaTwr <<
"\t" << iPhiTwr <<
"\t" << iLTwr <<
"\t cond.: \t" << neighbor <<
"\t" << corner2D <<
"\t diffs: " << deltaEta <<
"\t" << deltaPhi <<
"\t" << deltaL << std::endl;
111 input_towers.clear();