23 const std::vector<EcalEtaPhiRegion>& regions
34 std::string ecalPart_string;
40 ecalPart_string =
"EndCap";
46 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;
72 bool withinRegion =
false;
74 std::vector<EcalEtaPhiRegion>::const_iterator region;
75 for (region=regions.begin(); region!=regions.end(); region++) {
76 if (region->inRegion(position)) {
83 if (!regional || withinRegion) {
84 float ET = it->energy() *
sin(position.
theta());
85 if (ET > threshold)
seeds.push_back(*it);
95 std::cout <<
"Total number of seeds found in event = " <<
seeds.size() << std::endl;
98 mainSearch(hits, geometry_p, topology_p, geometryES_p);
103 std::cout <<
"---------- end of main search. clusters have been sorted ----" << std::endl;
121 std::cout <<
"Building clusters............" << std::endl;
125 std::vector<EcalRecHit>::iterator it;
126 for (it =
seeds.begin(); it !=
seeds.end(); it++)
131 bool usedButCanSeed =
false;
135 uint32_t rhFlag = (*it).recoFlag();
140 if ((
used_s.find(it->id()) !=
used_s.end()) && (usedButCanSeed ==
false))
142 if (it ==
seeds.begin())
146 std::cout <<
"##############################################################" << std::endl;
147 std::cout <<
"DEBUG ALERT: Highest energy seed already belongs to a cluster!" << std::endl;
148 std::cout <<
"##############################################################" << std::endl;
163 DetId seedId = navigator.pos();
165 navigator.setHome(seedId);
181 makeCluster(hits, geometry_p, geometryES_p, seedIt);
200 std::vector<std::pair<DetId, float> >::iterator it;
218 std::cout <<
"******** NEW CLUSTER ********" << std::endl;
220 std::cout <<
" Energy = " << energy << std::endl;
221 std::cout <<
" Phi = " << position.phi() << std::endl;
222 std::cout <<
" Eta = " << position.eta() << std::endl;
223 std::cout <<
"*****************************" << std::endl;
228 double seedEnergy = seedIt->energy();
229 if (energy >= seedEnergy)
244 double seedEnergy = seedHit->energy();
246 std::vector<DetId> swissCrossVec;
247 swissCrossVec.clear();
249 swissCrossVec.push_back(navigator.
west());
251 swissCrossVec.push_back(navigator.
east());
253 swissCrossVec.push_back(navigator.
north());
255 swissCrossVec.push_back(navigator.
south());
258 std::vector<DetId>::const_iterator detItr;
259 for (
unsigned int i = 0;
i < swissCrossVec.size(); ++
i)
270 uint32_t rhFlag = thisHit->recoFlag();
276 if (thisHit->energy() > seedEnergy)
293 std::set<DetId>::iterator setItr;
300 for (
int dx = -2; dx < 3; ++dx)
302 for (
int dy = -2; dy < 3; ++ dy)
307 thisDet = navigator.
offsetBy(dx, dy);
316 if ((
abs(dx) > 1) || (
abs(dy) > 1))
355 current_v.push_back( std::pair<DetId, float>(det, 1.) );
std::vector< reco::BasicCluster > makeClusters(const EcalRecHitCollection *hits, const CaloSubdetectorGeometry *geometry, const CaloSubdetectorTopology *topology_p, const CaloSubdetectorGeometry *geometryES_p, reco::CaloID::Detectors detector, bool regional=false, const std::vector< EcalEtaPhiRegion > ®ions=std::vector< EcalEtaPhiRegion >())
void home() const
move the navigator back to the starting point
std::set< DetId > canSeed_s
double ecalEndcapSeedThreshold
const EcalRecHitCollection * recHits_
Sin< T >::type sin(const T &t)
virtual T west() const
move the navigator west
std::vector< T >::const_iterator const_iterator
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
virtual T north() const
move the navigator north
T pos() const
get the current position
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
double ecalBarrelSeedThreshold
void mainSearch(const EcalRecHitCollection *hits, const CaloSubdetectorGeometry *geometry_p, const CaloSubdetectorTopology *topology_p, const CaloSubdetectorGeometry *geometryES_p)
std::vector< int > v_chstatus_
virtual T east() const
move the navigator east
void prepareCluster(CaloNavigator< DetId > &navigator, const EcalRecHitCollection *hits, const CaloSubdetectorGeometry *geometry)
void addCrystal(const DetId &det)
virtual T offsetBy(int deltaX, int deltaY) const
Free movement of arbitray steps.
std::vector< std::pair< DetId, float > > current_v
const_iterator end() const
std::vector< EcalRecHit > seeds
bool checkMaxima(CaloNavigator< DetId > &navigator, const EcalRecHitCollection *hits)
void makeCluster(const EcalRecHitCollection *hits, const CaloSubdetectorGeometry *geometry_p, const CaloSubdetectorGeometry *geometryES_p, const EcalRecHitCollection::const_iterator &seedIt)
ESHandle< TrackerGeometry > geometry
math::XYZPoint Calculate_Location(const std::vector< std::pair< DetId, float > > &iDetIds, const EcalRecHitCollection *iRecHits, const CaloSubdetectorGeometry *iSubGeom, const CaloSubdetectorGeometry *iESGeom=0)
math::XYZPoint Point
point in the space
iterator find(key_type k)
reco::CaloID::Detectors detector_
The ecal region used.
std::vector< reco::BasicCluster > clusters_v
virtual T south() const
move the navigator south
const GlobalPoint & getPosition() const
PositionCalc posCalculator_
const_iterator begin() const