|
|
Go to the documentation of this file.
28 constexpr
unsigned int nMaxClusters = 4;
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)) {
HcalDetId idFront(const HcalDetId &id) const
std::vector< DetId > constituentsOf(const CaloTowerDetId &id) const
Get the constituent detids for this tower id ( not yet implemented )
constexpr int iphi() const
get the cell iphi
constexpr Detector det() const
get the detector field from this detid
constexpr int depth() const
get the tower depth
double depth2HcalESum(std::vector< CaloTowerDetId > const &towers, CaloTowerCollection const &)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
const Item * getValues(DetId fId, bool throwOnFail=true) const
CaloTowerDetId towerOf(reco::CaloCluster const &cluster, CaloTowerConstituentsMap const &towerMap)
uint32_t getValue() const
std::vector< CaloTowerDetId > towersOf(reco::SuperCluster const &sc, CaloTowerConstituentsMap const &towerMap, HoeMode mode=HoeMode::SingleTower)
constexpr int ieta() const
get the cell ieta
const CaloClusterPtr & seed() const
seed BasicCluster
const std::vector< std::pair< DetId, float > > & hitsAndFractions() const
constexpr HcalSubdetector subdet() const
get the subdetector
CaloCluster_iterator clustersBegin() const
fist iterator over BasicCluster constituents
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
constexpr uint32_t rawId() const
get the raw id
double depth1HcalESum(std::vector< CaloTowerDetId > const &towers, CaloTowerCollection const &)
bool hasActiveHcal(std::vector< CaloTowerDetId > const &towers, CaloTowerConstituentsMap const &towerMap, HcalChannelQuality const &hcalQuality, HcalTopology const &hcalTopology)
CaloCluster_iterator clustersEnd() const
last iterator over BasicCluster constituents