30 std::vector<CaloTowerDetId>
towers;
31 std::vector<reco::CaloClusterPtr> orderedClusters;
34 if (
mode == HoeMode::SingleTower) {
39 if (
mode == HoeMode::TowersBehindCluster) {
42 orderedClusters.push_back(*
it);
44 std::sort(orderedClusters.begin(), orderedClusters.end(), [](
auto&
c1,
auto& c2) {
return (*
c1 > *c2); });
45 unsigned nclusters = orderedClusters.size();
46 for (
unsigned iclus = 0; iclus < nclusters && iclus < nMaxClusters; ++iclus) {
50 std::cout <<
"CaloTowerId " <<
id << std::endl;
75 for (
auto const&
tower : towerCollection) {
77 esum +=
tower.ietaAbs() < 18 ||
tower.ietaAbs() > 29 ?
tower.hadEnergy() :
tower.hadEnergyHeInnerLayer();
85 for (
auto const&
tower : towerCollection) {
87 esum +=
tower.hadEnergyHeOuterLayer();
101 std::cout <<
"DEBUG: hasActiveHcal called with " <<
towers.size() <<
" detids. First tower detid ieta " 102 <<
towers.front().ieta() <<
" iphi " <<
towers.front().iphi() << std::endl;
104 for (
auto towerid :
towers) {
105 unsigned int ngood = 0, nbad = 0;
114 std::cout <<
"EgammaHadTower DetId " << std::hex <<
id.rawId() <<
" hid.rawId " << hid.
rawId() <<
std::dec 115 <<
" sub " << hid.
subdet() <<
" ieta " << hid.
ieta() <<
" iphi " << hid.
iphi() <<
" depth " 116 << hid.
depth() << std::endl;
127 if (
status & statusMask) {
137 std::cout <<
" overall ngood " << ngood <<
" nbad " << nbad <<
"\n";
139 if (nbad == 0 || (ngood > 0 && nbad < ngood)) {
const std::vector< std::pair< DetId, float > > & hitsAndFractions() const
CaloTowerDetId towerOf(const DetId &id) const
Get the tower id for this det id (or null if not known)
DetId seed() const
return DetId of seed
CaloCluster_iterator clustersBegin() const
fist iterator over BasicCluster constituents
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
constexpr Detector det() const
get the detector field from this detid
const Item * getValues(DetId fId, bool throwOnFail=true) const
CaloCluster_iterator clustersEnd() const
last iterator over BasicCluster constituents
constexpr HcalSubdetector subdet() const
get the subdetector
HcalDetId idFront(const HcalDetId &id) const
constexpr int ieta() const
get the cell ieta
bool hasActiveHcal(std::vector< CaloTowerDetId > const &towers, CaloTowerConstituentsMap const &towerMap, HcalChannelQuality const &hcalQuality, HcalTopology const &hcalTopology)
CaloTowerDetId towerOf(reco::CaloCluster const &cluster, CaloTowerConstituentsMap const &towerMap)
uint32_t getValue() const
double depth2HcalESum(std::vector< CaloTowerDetId > const &towers, CaloTowerCollection const &)
double depth1HcalESum(std::vector< CaloTowerDetId > const &towers, CaloTowerCollection const &)
constexpr uint32_t rawId() const
get the raw id
const CaloClusterPtr & seed() const
seed BasicCluster
constexpr int iphi() const
get the cell iphi
std::vector< DetId > constituentsOf(const CaloTowerDetId &id) const
Get the constituent detids for this tower id ( not yet implemented )
std::vector< CaloTowerDetId > towersOf(reco::SuperCluster const &sc, CaloTowerConstituentsMap const &towerMap, HoeMode mode=HoeMode::SingleTower)
constexpr int depth() const
get the tower depth