26 const std::vector<EcalEtaPhiRegion>& 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;
108 bool withinRegion =
false;
110 std::vector<EcalEtaPhiRegion>::const_iterator region;
111 for (region=regions.begin(); region!=regions.end(); region++) {
112 if (region->inRegion(position)) {
119 if (!regional || withinRegion) {
122 seeds.push_back(*it);
132 std::cout <<
"JH Total number of seeds found in event = " <<
seeds.size() << std::endl;
140 mainSearch(geometry_p,topology_p,geometryES_p,ecalPart );
145 std::cout <<
"---------- end of main search. clusters have been sorted ----" << std::endl;
162 std::cout <<
"Building clusters............" << std::endl;
166 std::vector<EcalRecHit>::iterator it;
167 for (it =
seeds.begin(); it !=
seeds.end(); it++)
172 bool usedButCanSeed =
false;
176 if ((
used_s.find(it->id()) !=
used_s.end()) && (usedButCanSeed ==
false))
178 if (it ==
seeds.begin())
182 std::cout <<
"##############################################################" << std::endl;
183 std::cout <<
"DEBUG ALERT: Highest energy seed already belongs to a cluster!" << std::endl;
184 std::cout <<
"##############################################################" << std::endl;
199 CaloNavigator<DetId> navigator(it->id(), topology_p);
200 DetId seedId = navigator.pos();
201 navigator.setHome(seedId);
231 double energySecond = 0.;
232 double energyMax = 0.;
239 std::vector<DetId>::iterator it;
248 uint32_t rhFlag = (*itt).recoFlag();
261 if (uhit_p.
amplitude() > energySecond ) {energySecond = uhit_p.
amplitude(); detSec = uhit_p.
id();}
262 if (energySecond > energyMax ) {
std::swap(energySecond,energyMax);
std::swap(detFir,detSec);}
291 if (energy == 0 && position ==
Point(0,0,0))
return;
296 std::cout <<
"JH******** NEW CLUSTER ********" << std::endl;
298 std::cout <<
"JH Energy = " << energy << std::endl;
299 std::cout <<
"JH Phi = " << position.phi() << std::endl;
300 std::cout <<
"JH Eta = " << position.eta() << std::endl;
301 std::cout <<
"JH*****************************" << std::endl;
315 double thisEnergy = 0.;
316 double seedEnergy = seedHit->energy();
318 std::vector<DetId> swissCrossVec;
319 swissCrossVec.clear();
321 swissCrossVec.push_back(navigator.west());
323 swissCrossVec.push_back(navigator.east());
325 swissCrossVec.push_back(navigator.north());
327 swissCrossVec.push_back(navigator.south());
330 std::vector<DetId>::const_iterator detItr;
331 for (
unsigned int i = 0;
i < swissCrossVec.size(); ++
i)
334 if ((swissCrossVec[i] ==
DetId(0)) || thisHit ==
recHits_->
end()) thisEnergy = 0.0;
335 else thisEnergy = thisHit->energy();
336 if (thisEnergy > seedEnergy)
352 std::set<DetId>::iterator setItr;
359 for (
int dx = -2; dx < 3; ++dx)
361 for (
int dy = -2; dy < 3; ++ dy)
366 thisDet = navigator.offsetBy(dx, dy);
376 if ((
abs(dx) > 1) || (
abs(dy) > 1))
418 if ((thisIt->energy() >= -1.) && !(thisItu->chi2() < -1.))
const EcalUncalibratedRecHitCollection * uncalibRecHits_
double ecalEndcapSeedThreshold
double ecalBarrelSupThreshold
double ecalBarrelSingleThreshold
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)
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.
double ecalEndcapSingleThreshold
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< EcalEtaPhiRegion > ®ions=std::vector< EcalEtaPhiRegion >())
std::vector< std::pair< DetId, float > > current_v25Sup
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)
const_iterator end() const
std::vector< EcalRecHit > seeds
double ecalEndcapSecondThreshold
DetId id() const
get the id
void makeCluster(const CaloSubdetectorGeometry *geometry_p, const CaloSubdetectorGeometry *geometryES_p, DetId seedId)
std::vector< DetId > current_v25
std::set< DetId > canSeed_s
ESHandle< TrackerGeometry > geometry
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)
math::XYZPoint Point
point in the space
bool checkMaxima(CaloNavigator< DetId > &navigator)
double ecalBarrelSeedThreshold
const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
PositionCalc posCalculator_
const_iterator begin() const
double ecalEndcapSupThreshold