8 std::pair<double,bool>
eECALmatrix(
const DetId& detId,
edm::Handle<EcalRecHitCollection>& hitsEB,
edm::Handle<EcalRecHitCollection>& hitsEE,
const EcalChannelStatus& chStatus,
const CaloGeometry* geo,
const CaloTopology* caloTopology,
const EcalSeverityLevelAlgo* sevlv,
int ieta,
int iphi,
double ebThr,
double eeThr,
double tMin,
double tMax,
bool debug) {
10 std::vector<DetId> vdets;
17 std::cout <<
"Inside eECALmatrix " << 2*ieta+1 <<
"X" << 2*iphi+1
18 <<
" nXtals " << vdets.size() << std::endl;
22 for (
unsigned int i1=0; i1<vdets.size(); i1++) {
23 if (vdets[i1] !=
DetId(0)) {
25 std::vector<EcalRecHitCollection::const_iterator>
hit;
34 double ener=0, ethr=ebThr;
35 if (vdets[i1].subdetId() !=
EcalBarrel) ethr = eeThr;
36 for (
unsigned int ihit=0; ihit<hit.size(); ihit++) {
39 if (hit[ihit] != hitsEB->end()) {
40 en = hit[ihit]->energy();
41 tt = hit[ihit]->time();
44 if (hit[ihit] != hitsEE->end()) {
45 en = hit[ihit]->energy();
46 tt = hit[ihit]->time();
49 if (debug)
std::cout <<
" " << ihit <<
" " << en;
50 if (
tt > tMin &&
tt < tMax) ener += en;
54 if (debug)
std::cout <<
" detected to be a spike";
57 if (ener > ethr) energySum += ener;
60 if (debug)
std::cout <<
"energyECAL: energySum = " << energySum <<
" flag = " << flag << std::endl;
64 std::pair<double,bool>
eECALmatrix(
const DetId& detId,
edm::Handle<EcalRecHitCollection>& hitsEB,
edm::Handle<EcalRecHitCollection>& hitsEE,
const EcalChannelStatus& chStatus,
const CaloGeometry* geo,
const CaloTopology* caloTopology,
const EcalSeverityLevelAlgo* sevlv,
const EcalTrigTowerConstituentsMap& ttMap,
int ieta,
int iphi,
double ebThr,
double eeThr,
double tMin,
double tMax,
bool debug) {
66 std::vector<DetId> vdets;
73 std::cout <<
"Inside eECALmatrix " << 2*ieta+1 <<
"X" << 2*iphi+1
74 <<
" nXtals " << vdets.size() << std::endl;
78 for (
unsigned int i1=0; i1<vdets.size(); i1++) {
79 if (vdets[i1] !=
DetId(0)) {
82 if (vdets[i1].subdetId()==
EcalBarrel) ok = (eTower > ebThr);
83 else if (vdets[i1].subdetId()==
EcalEndcap) ok = (eTower > eeThr);
84 if (debug)
std::cout <<
"Crystal 0x" <<std::hex << vdets[i1]()
87 std::vector<EcalRecHitCollection::const_iterator>
hit;
96 for (
unsigned int ihit=0; ihit<hit.size(); ihit++) {
99 if (hit[ihit] != hitsEB->end()) {
100 en = hit[ihit]->energy();
101 tt = hit[ihit]->time();
103 }
else if (vdets[i1].subdetId()==
EcalEndcap) {
104 if (hit[ihit] != hitsEE->end()) {
105 en = hit[ihit]->energy();
106 tt = hit[ihit]->time();
109 if (debug)
std::cout <<
" " << ihit <<
" E " << en <<
" T " <<
tt;
110 if (tt > tMin && tt < tMax) ener += en;
114 if (debug)
std::cout <<
" detected to be a spike";
121 if (debug)
std::cout <<
"energyECAL: energySum = " << energySum <<
" flag = " << flag << std::endl;
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)
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)