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;
53 nregions = regions.size();
55 if (!regional || nregions) {
57 for (it = hits->
begin(); it != hits->
end(); it++) {
58 double energy = it->energy();
59 if (energy < threshold)
70 auto const &
position = thisCell->getPosition();
74 bool withinRegion =
false;
76 std::vector<RectangularEtaPhiRegion>::const_iterator
region;
77 for (region = regions.begin(); region != regions.end(); 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;
99 mainSearch(hits, geometry_p, topology_p, geometryES_p, ecalPart);
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;
284 std::cout <<
" Energy = " << energy << std::endl;
285 std::cout <<
" Phi = " << position.phi() << std::endl;
286 std::cout <<
" Eta = " << position.eta() << std::endl;
287 std::cout <<
"*****************************" << std::endl;
void searchEast(const CaloNavigator< DetId > &navigator, const CaloSubdetectorTopology *topology)
double ecalBarrelSeedThreshold
CaloTopology const * topology(0)
void searchWest(const CaloNavigator< DetId > &navigator, const CaloSubdetectorTopology *topology)
std::vector< EcalRecHit >::const_iterator const_iterator
std::vector< int > v_chstatusSeed_Endcap_
double ecalEndcapSeedThreshold
PositionCalc posCalculator_
T west() const
move the navigator west
T south() const
move the navigator south
std::vector< std::pair< DetId, float > > current_v
bool isClusterEtLess(const reco::CaloCluster &x, const reco::CaloCluster &y)
T pos() const
get the current position
std::vector< EcalRecHit > seeds
const_iterator end() const
std::vector< int > v_chstatus_Endcap_
T east() const
move the navigator east
void home() const
move the navigator back to the starting point
std::vector< reco::BasicCluster > makeClusters(const EcalRecHitCollection *hits, const CaloSubdetectorGeometry *geometry, const CaloSubdetectorTopology *topology_p, const CaloSubdetectorGeometry *geometryES_p, EcalPart ecalPart, bool regional=false, const std::vector< RectangularEtaPhiRegion > ®ions=std::vector< RectangularEtaPhiRegion >())
void searchNorth(const CaloNavigator< DetId > &navigator)
bool shouldBeAdded(EcalRecHitCollection::const_iterator candidate_it, EcalRecHitCollection::const_iterator previous_it)
std::vector< int > v_chstatusSeed_
virtual std::shared_ptr< const CaloCellGeometry > getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
std::vector< reco::BasicCluster > clusters_v
void makeCluster(const EcalRecHitCollection *hits, const CaloSubdetectorGeometry *geometry_p, const CaloSubdetectorGeometry *geometryES_p)
iterator find(key_type k)
math::XYZPoint Calculate_Location(const HitsAndFractions &iDetIds, const edm::SortedCollection< HitType > *iRecHits, const CaloSubdetectorGeometry *iSubGeom, const CaloSubdetectorGeometry *iESGeom=0)
Structure Point Contains parameters of Gaussian fits to DMRs.
static int position[264][3]
T north() const
move the navigator north
std::vector< int > v_chstatusSeed_Barrel_
const EcalRecHitCollection * recHits_
std::vector< int > v_chstatus_
void searchSouth(const CaloNavigator< DetId > &navigator)
const_iterator begin() const
std::vector< int > v_chstatus_Barrel_
void mainSearch(const EcalRecHitCollection *hits, const CaloSubdetectorGeometry *geometry_p, const CaloSubdetectorTopology *topology_p, const CaloSubdetectorGeometry *geometryES_p, EcalPart ecalPart)