25 const std::vector<RectangularEtaPhiRegion>&
regions)
41 ecalPart_string =
"EndCap";
47 ecalPart_string =
"Barrel";
53 std::cout <<
"-------------------------------------------------------------" << std::endl;
54 std::cout <<
"Island algorithm invoked for ECAL" << ecalPart_string << std::endl;
55 std::cout <<
"Looking for seeds, threshold used = " << threshold <<
" ADC" <<std::endl;
59 if(regional) nregions=regions.size();
61 if(!regional || nregions) {
70 std::cout <<
"-------------------------------------------------------------" << std::endl;
71 std::cout <<
"No Uncalibrated RecHits no Uncalibrated rec hit collection available" << std::endl;
78 uint32_t rhFlag = (*it).recoFlag();
91 std::cout <<
"-------------------------------------------------------------" << std::endl;
92 std::cout <<
"No Uncalibrated RecHit associated with the RecHit Probably no Uncalibrated rec hit collection available" << std::endl;
106 bool withinRegion =
false;
108 std::vector<RectangularEtaPhiRegion>::const_iterator region;
109 for (region=regions.begin(); region!=regions.end(); region++) {
110 if (region->inRegion(thisCell->etaPos(),thisCell->phiPos())) {
117 if (!regional || withinRegion) {
118 seeds.push_back(*it);
124 sort(
seeds.begin(),
seeds.end(), [](
auto const&
x,
auto const&
y){
return x.energy() >
y.energy();});
128 std::cout <<
"JH Total number of seeds found in event = " <<
seeds.size() << std::endl;
136 mainSearch(geometry_p,topology_p,geometryES_p,ecalPart );
141 std::cout <<
"---------- end of main search. clusters have been sorted ----" << std::endl;
158 std::cout <<
"Building clusters............" << std::endl;
162 std::vector<EcalRecHit>::iterator it;
163 for (it =
seeds.begin(); it !=
seeds.end(); it++)
168 bool usedButCanSeed =
false;
172 if ((
used_s.find(it->id()) !=
used_s.end()) && (usedButCanSeed ==
false))
174 if (it ==
seeds.begin())
178 std::cout <<
"##############################################################" << std::endl;
179 std::cout <<
"DEBUG ALERT: Highest energy seed already belongs to a cluster!" << std::endl;
180 std::cout <<
"##############################################################" << std::endl;
227 double energySecond = 0.;
228 double energyMax = 0.;
234 std::vector<DetId>::iterator it;
243 uint32_t rhFlag = (*itt).recoFlag();
256 if (uhit_p.
amplitude() > energySecond ) {energySecond = uhit_p.
amplitude(); detSec = uhit_p.
id();}
257 if (energySecond > energyMax ) {
std::swap(energySecond,energyMax);
std::swap(detFir,detSec);}
285 if (energy == 0 && position ==
Point(0,0,0))
return;
289 std::cout <<
"JH******** NEW CLUSTER ********" << std::endl;
291 std::cout <<
"JH Energy = " << energy << std::endl;
292 std::cout <<
"JH Phi = " << position.phi() << std::endl;
293 std::cout <<
"JH Eta = " << position.eta() << std::endl;
294 std::cout <<
"JH*****************************" << std::endl;
308 double thisEnergy = 0.;
309 double seedEnergy = seedHit->energy();
311 std::vector<DetId> swissCrossVec;
312 swissCrossVec.clear();
314 swissCrossVec.push_back(navigator.
west());
316 swissCrossVec.push_back(navigator.
east());
318 swissCrossVec.push_back(navigator.
north());
320 swissCrossVec.push_back(navigator.
south());
323 for (
unsigned int i = 0;
i < swissCrossVec.size(); ++
i)
326 if ((swissCrossVec[i] ==
DetId(0)) || thisHit ==
recHits_->
end()) thisEnergy = 0.0;
327 else thisEnergy = thisHit->energy();
328 if (thisEnergy > seedEnergy)
344 std::set<DetId>::iterator setItr;
351 for (
int dx = -2;
dx < 3; ++
dx)
353 for (
int dy = -2;
dy < 3; ++
dy)
410 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
bool isClusterEtLess(const reco::CaloCluster &x, const reco::CaloCluster &y)
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)
Structure Point Contains parameters of Gaussian fits to DMRs.
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