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.) );
163 if (northern ==
DetId(0))
return;
173 current_v.push_back( std::pair<DetId, float>(northern, 1.));
185 if (southern ==
DetId(0))
return;
194 current_v.push_back( std::pair<DetId, float>(southern, 1.));
207 if (western ==
DetId(0))
return;
220 current_v.push_back( std::pair<DetId, float>(western, 1.));
232 if (eastern ==
DetId(0))
return;
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
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_
T west() const
move the navigator west
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 >())
T south() const
move the navigator south
T pos() const
get the current position
std::vector< EcalRecHit > seeds
const_iterator end() const
T east() const
move the navigator east
void home() const
move the navigator back to the starting point
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)
static int position[264][3]
std::vector< std::pair< DetId, float > > current_v
T north() const
move the navigator north
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)