23 const std::vector<RectangularEtaPhiRegion> &
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, threshold used = " <<
threshold <<
" ADC" << std::endl;
56 if (!regional || nregions) {
61 std::cout <<
"-------------------------------------------------------------" << std::endl;
62 std::cout <<
"No Uncalibrated RecHits no Uncalibrated rec hit collection available" << std::endl;
69 uint32_t rhFlag = (*it).recoFlag();
77 std::cout <<
"-------------------------------------------------------------" << std::endl;
78 std::cout <<
"No Uncalibrated RecHit associated with the RecHit Probably no Uncalibrated rec hit collection " 95 bool withinRegion =
false;
97 std::vector<RectangularEtaPhiRegion>::const_iterator
region;
99 if (
region->inRegion(thisCell->etaPos(), thisCell->phiPos())) {
106 if (!regional || withinRegion) {
113 sort(
seeds.begin(),
seeds.end(), [](
auto const &
x,
auto const &
y) {
return x.energy() >
y.energy(); });
116 std::cout <<
"JH Total number of seeds found in event = " <<
seeds.size() << std::endl;
122 mainSearch(geometry_p, topology_p, geometryES_p, ecalPart);
126 std::cout <<
"---------- end of main search. clusters have been sorted ----" << std::endl;
139 std::cout <<
"Building clusters............" << std::endl;
143 std::vector<EcalRecHit>::iterator
it;
147 bool usedButCanSeed =
false;
149 usedButCanSeed =
true;
152 if ((
used_s.find(
it->id()) !=
used_s.end()) && (usedButCanSeed ==
false)) {
155 std::cout <<
"##############################################################" << std::endl;
156 std::cout <<
"DEBUG ALERT: Highest energy seed already belongs to a cluster!" << std::endl;
157 std::cout <<
"##############################################################" << std::endl;
198 double energySecond = 0.;
199 double energyMax = 0.;
204 std::vector<DetId>::iterator
it;
213 uint32_t rhFlag = (*itt).recoFlag();
224 detSec = uhit_p.
id();
226 if (energySecond > energyMax) {
261 std::cout <<
"JH******** NEW CLUSTER ********" << std::endl;
266 std::cout <<
"JH*****************************" << std::endl;
279 double thisEnergy = 0.;
280 double seedEnergy = seedHit->energy();
282 std::vector<DetId> swissCrossVec;
283 swissCrossVec.clear();
285 swissCrossVec.push_back(
navigator.west());
287 swissCrossVec.push_back(
navigator.east());
289 swissCrossVec.push_back(
navigator.north());
291 swissCrossVec.push_back(
navigator.south());
294 for (
unsigned int i = 0;
i < swissCrossVec.size(); ++
i) {
299 thisEnergy = thisHit->energy();
300 if (thisEnergy > seedEnergy) {
311 std::set<DetId>::iterator setItr;
318 for (
int dx = -2;
dx < 3; ++
dx)
320 for (
int dy = -2;
dy < 3; ++
dy)
365 if ((thisIt->energy() >= -1.) && !(thisItu->chi2() < -1.)) {
const EcalUncalibratedRecHitCollection * uncalibRecHits_
virtual CellMayOwnPtr getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
double ecalEndcapSeedThreshold
double ecalBarrelSupThreshold
double ecalBarrelSingleThreshold
std::vector< std::pair< DetId, float > > current_v25Sup
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)
void swap(Association< C > &lhs, Association< C > &rhs)
double ecalEndcapSingleThreshold
double ecalBarrelSecondThreshold
const EcalRecHitCollection * recHits_
void prepareCluster(CaloNavigator< DetId > &navigator, const CaloSubdetectorGeometry *geometry)
Abs< T >::type abs(const T &t)
math::XYZPoint Calculate_Location(const HitsAndFractions &iDetIds, const edm::SortedCollection< HitType > *iRecHits, const CaloSubdetectorGeometry *iSubGeom, const CaloSubdetectorGeometry *iESGeom=nullptr)
const_iterator begin() const
bool isClusterEtLess(const reco::CaloCluster &x, const reco::CaloCluster &y)
const_iterator end() const
std::vector< EcalRecHit > seeds
double ecalEndcapSecondThreshold
void makeCluster(const CaloSubdetectorGeometry *geometry_p, const CaloSubdetectorGeometry *geometryES_p, DetId seedId)
std::vector< DetId > current_v25
DetId id() const
get the id
std::set< DetId > canSeed_s
void addCrystal(const DetId &det, const bool in9)
iterator find(key_type k)
Structure Point Contains parameters of Gaussian fits to DMRs.
static int position[264][3]
math::XYZPoint Point
point in the space
bool checkMaxima(CaloNavigator< DetId > &navigator)
double ecalBarrelSeedThreshold
PositionCalc posCalculator_
double ecalEndcapSupThreshold