23 const std::vector<RectangularEtaPhiRegion> &
regions) {
34 ecalPart_string =
"EndCap";
40 ecalPart_string =
"Barrel";
46 std::cout <<
"-------------------------------------------------------------" << std::endl;
47 std::cout <<
"Island algorithm invoked for ECAL" << ecalPart_string << std::endl;
48 std::cout <<
"Looking for seeds, energy threshold used = " <<
threshold <<
" GeV" << std::endl;
55 if (!regional || nregions) {
57 for (it =
hits->begin(); it !=
hits->end(); it++) {
58 double energy = it->energy();
70 auto const &
position = thisCell->getPosition();
74 bool withinRegion =
false;
76 std::vector<RectangularEtaPhiRegion>::const_iterator
region;
78 if (
region->inRegion(thisCell->etaPos(), thisCell->phiPos())) {
85 if (!regional || withinRegion) {
86 float ET = it->energy() *
position.basicVector().unit().perp();
93 sort(
seeds.begin(),
seeds.end(), [](
auto const &
x,
auto const &
y) {
return x.energy() >
y.energy(); });
96 std::cout <<
"Total number of seeds found in event = " <<
seeds.size() << std::endl;
103 std::cout <<
"---------- end of main search. clusters have been sorted ----" << std::endl;
115 std::cout <<
"Building clusters............" << std::endl;
119 std::vector<EcalRecHit>::iterator it;
120 for (it =
seeds.begin(); it !=
seeds.end(); it++) {
123 if (it ==
seeds.begin()) {
125 std::cout <<
"##############################################################" << std::endl;
126 std::cout <<
"DEBUG ALERT: Highest energy seed already belongs to a cluster!" << std::endl;
127 std::cout <<
"##############################################################" << std::endl;
136 current_v.push_back(std::pair<DetId, float>(it->id(), 1.));
158 if (northern ==
DetId(0))
168 current_v.push_back(std::pair<DetId, float>(northern, 1.));
178 if (southern ==
DetId(0))
187 current_v.push_back(std::pair<DetId, float>(southern, 1.));
198 if (western ==
DetId(0))
211 current_v.push_back(std::pair<DetId, float>(western, 1.));
221 if (eastern ==
DetId(0))
234 current_v.push_back(std::pair<DetId, float>(eastern, 1.));
245 (candidate_it->energy() <= 0) ||
246 (candidate_it->energy() > previous_it->energy()) ||
262 std::vector<std::pair<DetId, float> >::iterator it;
282 std::cout <<
"******** NEW CLUSTER ********" << std::endl;
287 std::cout <<
"*****************************" << std::endl;