22 std::vector<EcalRecHitCollection::const_iterator>
hits;
31 for (
const auto&
hit : hits) {
33 if (
hit != hitsEC->
end()) {
41 if (tt > tMin && tt < tMax)
50 return std::pair<double, bool>(ener,
flag);
53 std::pair<double, bool>
energyECAL(
const std::vector<DetId>& vdets,
64 for (
const auto&
id : vdets) {
66 std::pair<double, bool> ecalEn =
spr::energyECAL(
id, hitsEC, sevlv, testSpike, tMin, tMax, debug);
69 if ((ecalEn.first > eThr) || noThrCut)
70 energySum += ecalEn.first;
75 std::cout <<
"energyECAL: energySum = " << energySum <<
" flag = " << flag << std::endl;
94 std::vector<DetId> vdets;
98 std::cout <<
"Inside eECALmatrix " << 2 * ieta + 1 <<
"X" << 2 * iphi + 1 <<
" nXtals " << vdets.size()
103 for (
const auto&
id : vdets) {
112 return std::pair<double, bool>(
spr::energyECAL(vdets, hitsEB, hitsEE, ebThr, eeThr, tMin, tMax, debug),
flag);
130 std::vector<DetId> vdets;
134 std::cout <<
"Inside eECALmatrix " << 2 * ieta + 1 <<
"X" << 2 * iphi + 1 <<
" nXtals " << vdets.size()
141 for (
const auto&
id : vdets) {
145 bool ok = (
id.subdetId() ==
EcalBarrel) ? (eTower > ebThr) : (eTower > eeThr);
148 std::cout <<
"Crystal 0x" << std::hex <<
id() <<
std::dec <<
" Flag " << ok << std::endl;
151 std::pair<double, bool> ecalEn = (
id.subdetId() ==
EcalBarrel)
156 energySum += ecalEn.first;
162 std::cout <<
"energyECAL: energySum = " << energySum <<
" flag = " << flag << std::endl;
182 std::cout <<
"eECALmatrix: " << detId <<
" belongs to " << tower <<
" which has " << ids.size() <<
" constituents" 184 for (
unsigned int i = 0;
i < ids.size(); ++
i) {
200 std::vector<DetId> idEBEE;
202 for (
const auto&
id : ids) {
204 idEBEE.emplace_back(
id);
208 idEBEE.emplace_back(
id);
215 std::cout <<
"eECALmatrix: with " << idEBEE.size() <<
" EB+EE hits and " 216 <<
"spike flag " << flag << std::endl;
218 double etot = (!idEBEE.empty()) ?
spr::energyECAL(idEBEE, hitsEB, hitsEE, ebThr, eeThr, tMin, tMax, debug) : 0;
219 return std::pair<double, bool>(etot,
flag);
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)
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)
const_iterator end() const
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)