24 const std::vector<EcalEtaPhiRegion>& regions)
37 ecalPart_string =
"EndCap";
42 ecalPart_string =
"Barrel";
47 std::cout <<
"-------------------------------------------------------------" << std::endl;
48 std::cout <<
"Island algorithm invoked for ECAL" << ecalPart_string << std::endl;
49 std::cout <<
"Looking for seeds, energy threshold used = " << threshold <<
" GeV" <<std::endl;
53 if(regional) nregions=regions.size();
55 if(!regional || nregions) {
58 for(it = hits->
begin(); it != hits->
end(); it++)
60 double energy = it->energy();
61 if (energy < threshold)
continue;
68 bool withinRegion =
false;
70 std::vector<EcalEtaPhiRegion>::const_iterator region;
71 for (region=regions.begin(); region!=regions.end(); region++) {
72 if (region->inRegion(position)) {
79 if (!regional || withinRegion) {
80 float ET = it->energy() *
sin(position.
theta());
81 if (ET > threshold)
seeds.push_back(*it);
91 std::cout <<
"Total number of seeds found in event = " <<
seeds.size() << std::endl;
94 mainSearch(hits,geometry_p,topology_p,geometryES_p,ecalPart);
99 std::cout <<
"---------- end of main search. clusters have been sorted ----" << std::endl;
114 std::cout <<
"Building clusters............" << std::endl;
118 std::vector<EcalRecHit>::iterator it;
119 for (it =
seeds.begin(); it !=
seeds.end(); it++)
124 if (it ==
seeds.begin())
128 std::cout <<
"##############################################################" << std::endl;
129 std::cout <<
"DEBUG ALERT: Highest energy seed already belongs to a cluster!" << std::endl;
130 std::cout <<
"##############################################################" << std::endl;
139 current_v.push_back( std::pair<DetId, float>(it->id(), 1.) );
143 CaloNavigator<DetId> navigator(it->id(), topology_p);
160 DetId southern = navigator.pos();
162 DetId northern = navigator.north();
163 if (northern ==
DetId(0))
return;
173 current_v.push_back( std::pair<DetId, float>(northern, 1.));
182 DetId northern = navigator.pos();
184 DetId southern = navigator.south();
185 if (southern ==
DetId(0))
return;
194 current_v.push_back( std::pair<DetId, float>(southern, 1.));
203 DetId eastern = navigator.pos();
206 DetId western = navigator.west();
207 if (western ==
DetId(0))
return;
212 CaloNavigator<DetId> nsNavigator(western, topology);
220 current_v.push_back( std::pair<DetId, float>(western, 1.));
228 DetId western = navigator.pos();
231 DetId eastern = navigator.east();
232 if (eastern ==
DetId(0))
return;
237 CaloNavigator<DetId> nsNavigator(eastern, topology);
245 current_v.push_back( std::pair<DetId, float>(eastern, 1.));
257 (candidate_it->energy() <= 0) ||
258 (candidate_it->energy() > previous_it->energy()))
276 std::vector< std::pair<DetId, float> >::iterator it;
298 std::cout <<
"******** NEW CLUSTER ********" << std::endl;
300 std::cout <<
" Energy = " << energy << std::endl;
301 std::cout <<
" Phi = " << position.phi() << std::endl;
302 std::cout <<
" Eta = " << position.eta() << std::endl;
303 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)
Sin< T >::type sin(const T &t)
std::vector< EcalRecHit >::const_iterator const_iterator
double ecalEndcapSeedThreshold
math::XYZPoint Point
point in the space
static int position[TOTALCHAMBERS][3]
virtual const CaloCellGeometry * getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
Geom::Theta< T > theta() const
PositionCalc posCalculator_
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< EcalEtaPhiRegion > ®ions=std::vector< EcalEtaPhiRegion >())
std::vector< EcalRecHit > seeds
const_iterator end() const
void searchNorth(const CaloNavigator< DetId > &navigator)
bool shouldBeAdded(EcalRecHitCollection::const_iterator candidate_it, EcalRecHitCollection::const_iterator previous_it)
std::vector< reco::BasicCluster > clusters_v
void makeCluster(const EcalRecHitCollection *hits, const CaloSubdetectorGeometry *geometry_p, const CaloSubdetectorGeometry *geometryES_p)
ESHandle< TrackerGeometry > geometry
iterator find(key_type k)
math::XYZPoint Calculate_Location(const HitsAndFractions &iDetIds, const edm::SortedCollection< HitType > *iRecHits, const CaloSubdetectorGeometry *iSubGeom, const CaloSubdetectorGeometry *iESGeom=0)
std::vector< std::pair< DetId, float > > current_v
const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
const EcalRecHitCollection * recHits_
void searchSouth(const CaloNavigator< DetId > &navigator)
const_iterator begin() const
void mainSearch(const EcalRecHitCollection *hits, const CaloSubdetectorGeometry *geometry_p, const CaloSubdetectorTopology *topology_p, const CaloSubdetectorGeometry *geometryES_p, EcalPart ecalPart)