22 std::vector<EcalRecHitCollection::const_iterator>
hits;
25 std::ostringstream st1;
27 st1 <<
"Xtal 0x" << std::hex <<
id() <<
std::dec;
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)
89 std::vector<DetId> vdets;
95 for (
const auto&
id : vdets) {
122 std::vector<DetId> vdets;
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)
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);
216 std::vector<DetId> vdets;
222 for (
const auto&
id : vdets) {
232 for (
unsigned int i1 = 0;
i1 < vdets.size();
i1++) {
234 std::vector<EcalRecHitCollection::const_iterator>
hit;
240 std::ostringstream st1;
242 st1 <<
"Crystal 0x" << std::hex << vdets[
i1]() <<
std::dec;
243 double ener = 0, ethr =
static_cast<double>((*eThresholds)[vdets[
i1]]);
244 for (
unsigned int ihit = 0; ihit <
hit.size(); ihit++) {
247 if (
hit[ihit] != hitsEB->
end())
250 if (
hit[ihit] != hitsEE->
end())
254 st1 <<
" " << ihit <<
" " << en <<
" Thr " << ethr;
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)
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)
CaloTowerDetId towerOf(const DetId &id) const
Get the tower id for this det id (or null if not known)
T const * product() const
EcalSeverityLevel::SeverityLevel severityLevel(const DetId &id) const
Evaluate status from id use channelStatus from DB.
const_iterator end() 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)
std::vector< DetId > constituentsOf(const CaloTowerDetId &id) const
Get the constituent detids for this tower id ( not yet implemented )
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)