24 const std::vector<RectangularEtaPhiRegion>&
regions)
37 ecalPart_string =
"EndCap";
44 ecalPart_string =
"Barrel";
51 std::cout <<
"-------------------------------------------------------------" << std::endl;
52 std::cout <<
"Island algorithm invoked for ECAL" << ecalPart_string << std::endl;
53 std::cout <<
"Looking for seeds, energy threshold used = " << threshold <<
" GeV" <<std::endl;
57 if(regional) nregions=regions.size();
59 if(!regional || nregions) {
62 for(it = hits->
begin(); it != hits->
end(); it++)
64 double energy = it->energy();
65 if (energy < threshold)
continue;
75 auto const &
position = thisCell->getPosition();
79 bool withinRegion =
false;
81 std::vector<RectangularEtaPhiRegion>::const_iterator region;
82 for (region=regions.begin(); region!=regions.end(); region++) {
83 if (region->inRegion(thisCell->etaPos(),thisCell->phiPos())) {
90 if (!regional || withinRegion) {
91 float ET = it->energy() *
position.basicVector().unit().perp();
92 if (ET > threshold)
seeds.push_back(*it);
98 sort(
seeds.begin(),
seeds.end(), [](
auto const&
x,
auto const&
y){
return x.energy() >
y.energy();});
102 std::cout <<
"Total number of seeds found in event = " <<
seeds.size() << std::endl;
105 mainSearch(hits,geometry_p,topology_p,geometryES_p,ecalPart);
110 std::cout <<
"---------- end of main search. clusters have been sorted ----" << std::endl;
125 std::cout <<
"Building clusters............" << std::endl;
129 std::vector<EcalRecHit>::iterator it;
130 for (it =
seeds.begin(); it !=
seeds.end(); it++)
135 if (it ==
seeds.begin())
139 std::cout <<
"##############################################################" << std::endl;
140 std::cout <<
"DEBUG ALERT: Highest energy seed already belongs to a cluster!" << std::endl;
141 std::cout <<
"##############################################################" << std::endl;
150 current_v.push_back( std::pair<DetId, float>(it->id(), 1.) );
174 if (northern ==
DetId(0))
return;
184 current_v.push_back( std::pair<DetId, float>(northern, 1.));
196 if (southern ==
DetId(0))
return;
205 current_v.push_back( std::pair<DetId, float>(southern, 1.));
218 if (western ==
DetId(0))
return;
231 current_v.push_back( std::pair<DetId, float>(western, 1.));
243 if (eastern ==
DetId(0))
return;
256 current_v.push_back( std::pair<DetId, float>(eastern, 1.));
268 (candidate_it->energy() <= 0) ||
269 (candidate_it->energy() > previous_it->energy()) ||
288 std::vector< std::pair<DetId, float> >::iterator it;
310 std::cout <<
"******** NEW CLUSTER ********" << std::endl;
312 std::cout <<
" Energy = " << energy << std::endl;
313 std::cout <<
" Phi = " << position.phi() << std::endl;
314 std::cout <<
" Eta = " << position.eta() << std::endl;
315 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
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]
std::vector< std::pair< DetId, float > > current_v
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)