26 const std::vector<RectangularEtaPhiRegion>&
regions)
42 ecalPart_string =
"EndCap";
48 ecalPart_string =
"Barrel";
54 std::cout <<
"-------------------------------------------------------------" << std::endl;
55 std::cout <<
"Island algorithm invoked for ECAL" << ecalPart_string << std::endl;
56 std::cout <<
"Looking for seeds, threshold used = " << threshold <<
" ADC" <<std::endl;
60 if(regional) nregions=regions.size();
62 if(!regional || nregions) {
71 std::cout <<
"-------------------------------------------------------------" << std::endl;
72 std::cout <<
"No Uncalibrated RecHits no Uncalibrated rec hit collection available" << std::endl;
79 uint32_t rhFlag = (*it).recoFlag();
92 std::cout <<
"-------------------------------------------------------------" << std::endl;
93 std::cout <<
"No Uncalibrated RecHit associated with the RecHit Probably no Uncalibrated rec hit collection available" << std::endl;
107 bool withinRegion =
false;
109 std::vector<RectangularEtaPhiRegion>::const_iterator region;
110 for (region=regions.begin(); region!=regions.end(); region++) {
111 if (region->inRegion(thisCell->etaPos(),thisCell->phiPos())) {
118 if (!regional || withinRegion) {
119 seeds.push_back(*it);
129 std::cout <<
"JH Total number of seeds found in event = " <<
seeds.size() << std::endl;
137 mainSearch(geometry_p,topology_p,geometryES_p,ecalPart );
142 std::cout <<
"---------- end of main search. clusters have been sorted ----" << std::endl;
159 std::cout <<
"Building clusters............" << std::endl;
163 std::vector<EcalRecHit>::iterator it;
164 for (it =
seeds.begin(); it !=
seeds.end(); it++)
169 bool usedButCanSeed =
false;
173 if ((
used_s.find(it->id()) !=
used_s.end()) && (usedButCanSeed ==
false))
175 if (it ==
seeds.begin())
179 std::cout <<
"##############################################################" << std::endl;
180 std::cout <<
"DEBUG ALERT: Highest energy seed already belongs to a cluster!" << std::endl;
181 std::cout <<
"##############################################################" << std::endl;
228 double energySecond = 0.;
229 double energyMax = 0.;
235 std::vector<DetId>::iterator it;
244 uint32_t rhFlag = (*itt).recoFlag();
257 if (uhit_p.
amplitude() > energySecond ) {energySecond = uhit_p.
amplitude(); detSec = uhit_p.
id();}
258 if (energySecond > energyMax ) {
std::swap(energySecond,energyMax);
std::swap(detFir,detSec);}
286 if (energy == 0 && position ==
Point(0,0,0))
return;
290 std::cout <<
"JH******** NEW CLUSTER ********" << std::endl;
292 std::cout <<
"JH Energy = " << energy << std::endl;
293 std::cout <<
"JH Phi = " << position.phi() << std::endl;
294 std::cout <<
"JH Eta = " << position.eta() << std::endl;
295 std::cout <<
"JH*****************************" << std::endl;
309 double thisEnergy = 0.;
310 double seedEnergy = seedHit->energy();
312 std::vector<DetId> swissCrossVec;
313 swissCrossVec.clear();
315 swissCrossVec.push_back(navigator.
west());
317 swissCrossVec.push_back(navigator.
east());
319 swissCrossVec.push_back(navigator.
north());
321 swissCrossVec.push_back(navigator.
south());
324 std::vector<DetId>::const_iterator detItr;
325 for (
unsigned int i = 0;
i < swissCrossVec.size(); ++
i)
328 if ((swissCrossVec[i] ==
DetId(0)) || thisHit ==
recHits_->
end()) thisEnergy = 0.0;
329 else thisEnergy = thisHit->energy();
330 if (thisEnergy > seedEnergy)
346 std::set<DetId>::iterator setItr;
353 for (
int dx = -2;
dx < 3; ++
dx)
355 for (
int dy = -2;
dy < 3; ++
dy)
412 if ((thisIt->energy() >= -1.) && !(thisItu->chi2() < -1.))
const EcalUncalibratedRecHitCollection * uncalibRecHits_
double ecalEndcapSeedThreshold
double ecalBarrelSupThreshold
double ecalBarrelSingleThreshold
std::vector< reco::BasicCluster > makeClusters(const EcalRecHitCollection *hits, const EcalUncalibratedRecHitCollection *uncalibhits, const CaloSubdetectorGeometry *geometry, const CaloSubdetectorTopology *topology_p, const CaloSubdetectorGeometry *geometryES_p, EcalPart ecalPart, bool regional=false, const std::vector< RectangularEtaPhiRegion > ®ions=std::vector< RectangularEtaPhiRegion >())
std::vector< EcalRecHit >::const_iterator const_iterator
std::vector< DetId > current_v9
std::vector< reco::BasicCluster > clusters_v
void mainSearch(const CaloSubdetectorGeometry *geometry_p, const CaloSubdetectorTopology *topology_p, const CaloSubdetectorGeometry *geometryES_p, EcalPart ecalPart)
double ecalEndcapSingleThreshold
T offsetBy(int deltaX, int deltaY) const
Free movement of arbitray steps.
std::vector< std::pair< DetId, float > > current_v25Sup
T west() const
move the navigator west
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
double ecalBarrelSecondThreshold
const EcalRecHitCollection * recHits_
void prepareCluster(CaloNavigator< DetId > &navigator, const CaloSubdetectorGeometry *geometry)
Abs< T >::type abs(const T &t)
T south() const
move the navigator south
T pos() const
get the current position
const_iterator end() const
std::vector< EcalRecHit > seeds
T east() const
move the navigator east
void home() const
move the navigator back to the starting point
double ecalEndcapSecondThreshold
DetId id() const
get the id
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.
void makeCluster(const CaloSubdetectorGeometry *geometry_p, const CaloSubdetectorGeometry *geometryES_p, DetId seedId)
std::vector< DetId > current_v25
std::set< DetId > canSeed_s
void addCrystal(const DetId &det, const bool in9)
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]
T north() const
move the navigator north
math::XYZPoint Point
point in the space
bool checkMaxima(CaloNavigator< DetId > &navigator)
double ecalBarrelSeedThreshold
PositionCalc posCalculator_
const_iterator begin() const
double ecalEndcapSupThreshold