22 std::vector<EcalRecHitCollection::const_iterator> hits;
25 std::ostringstream st1;
27 st1 <<
"Xtal 0x" << std::hex <<
id() <<
std::dec;
31 for (
const auto&
hit : hits) {
33 if (
hit != hitsEC->end()) {
38 st1 <<
" " << tt <<
" " << en;
39 if (tt > tMin && tt < tMax)
44 st1 <<
" detected to be a spike";
47 return std::pair<double, bool>(ener, flag);
50 std::pair<double, bool>
energyECAL(
const std::vector<DetId>& vdets,
61 for (
const auto&
id : vdets) {
63 std::pair<double, bool> ecalEn =
spr::energyECAL(
id, hitsEC, sevlv, testSpike, tMin, tMax, debug);
66 if ((ecalEn.first > eThr) || noThrCut)
67 energySum += ecalEn.first;
71 edm::LogVerbatim(
"IsoTrack") <<
"energyECAL: energySum = " << energySum <<
" flag = " << flag;
72 return std::pair<double, bool>(
energySum, flag);
89 std::vector<DetId> vdets;
92 edm::LogVerbatim(
"IsoTrack") <<
"Inside eECALmatrix " << 2 * ieta + 1 <<
"X" << 2 * iphi + 1 <<
" nXtals "
95 for (
const auto&
id : vdets) {
104 return std::pair<double, bool>(
spr::energyECAL(vdets, hitsEB, hitsEE, ebThr, eeThr, tMin, tMax, debug), flag);
122 std::vector<DetId> vdets;
125 edm::LogVerbatim(
"IsoTrack") <<
"Inside eECALmatrix " << 2 * ieta + 1 <<
"X" << 2 * iphi + 1 <<
" nXtals "
130 for (
const auto&
id : vdets) {
134 bool ok = (
id.subdetId() ==
EcalBarrel) ? (eTower > ebThr) : (eTower > eeThr);
138 std::pair<double, bool> ecalEn = (
id.subdetId() ==
EcalBarrel)
143 energySum += ecalEn.first;
148 edm::LogVerbatim(
"IsoTrack") <<
"energyECAL: energySum = " << energySum <<
" flag = " << flag;
149 return std::pair<double, bool>(
energySum, flag);
166 edm::LogVerbatim(
"IsoTrack") <<
"eECALmatrix: " << detId <<
" belongs to " << tower <<
" which has " << ids.size()
168 for (
unsigned int i = 0;
i < ids.size(); ++
i) {
169 std::ostringstream st1;
170 st1 <<
"[" <<
i <<
"] " << std::hex << ids[
i].rawId() <<
std::dec;
184 std::vector<DetId> idEBEE;
186 for (
const auto&
id : ids) {
188 idEBEE.emplace_back(
id);
192 idEBEE.emplace_back(
id);
199 edm::LogVerbatim(
"IsoTrack") <<
"eECALmatrix: with " << idEBEE.size() <<
" EB+EE hits and "
200 <<
"spike flag " << flag;
201 double etot = (!idEBEE.empty()) ?
spr::energyECAL(idEBEE, hitsEB, hitsEE, ebThr, eeThr, tMin, tMax, debug) : 0;
202 return std::pair<double, bool>(etot, flag);
Log< level::Info, true > LogVerbatim
double energyECAL(std::vector< DetId > &vdets, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, double ebThr=-100, double eeThr=-100, double tMin=-500, double tMax=500, bool debug=false)
uint16_t *__restrict__ id
EcalSeverityLevel::SeverityLevel severityLevel(const DetId &id) const
Evaluate status from id use channelStatus from DB.
std::vector< typename T::const_iterator > findHit(edm::Handle< T > &hits, DetId thisDet, bool debug=false)
void matrixECALIds(const DetId &det, int ieta, int iphi, const CaloGeometry *geo, const CaloTopology *caloTopology, std::vector< DetId > &vdets, bool debug=false, bool igNoreTransition=true)
std::vector< DetId > constituentsOf(const CaloTowerDetId &id) const
Get the constituent detids for this tower id ( not yet implemented )
CaloTowerDetId towerOf(const DetId &id) const
Get the tower id for this det id (or null if not known)
T const * product() const
double energySum(const DataFrame &df, int fs, int ls)
double energyECALTower(const DetId &detId, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, const EcalTrigTowerConstituentsMap &ttMap, bool debug=false)
double eECALmatrix(const DetId &detId, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, const CaloGeometry *geo, const CaloTopology *caloTopology, int ieta, int iphi, double ebThr=-100, double eeThr=-100, double tMin=-500, double tMax=500, bool debug=false)