17 int ieta,
int iphi,
double ebThr,
18 double eeThr,
double tMin,
double tMax,
21 std::vector<DetId> vdets;
29 std::cout <<
"Inside eECALmatrix " << 2*ieta+1 <<
"X" << 2*iphi+1
30 <<
" nXtals " << vdets.size() << std::endl;
34 for (
unsigned int i1=0; i1<vdets.size(); i1++) {
35 if (vdets[i1] !=
DetId(0)) {
37 std::vector<EcalRecHitCollection::const_iterator>
hit;
48 double ener=0, ethr=ebThr;
49 if (vdets[i1].subdetId() !=
EcalBarrel) ethr = eeThr;
50 for (
unsigned int ihit=0; ihit<hit.size(); ihit++) {
53 if (hit[ihit] != hitsEB->
end()) {
54 en = hit[ihit]->energy();
55 tt = hit[ihit]->time();
58 if (hit[ihit] != hitsEE->
end()) {
59 en = hit[ihit]->energy();
60 tt = hit[ihit]->time();
64 if (debug)
std::cout <<
" " << ihit <<
" " << en;
66 if (
tt > tMin &&
tt < tMax) ener += en;
71 if (debug)
std::cout <<
" detected to be a spike";
77 if (ener > ethr) energySum += ener;
81 if (debug)
std::cout <<
"energyECAL: energySum = " << energySum <<
" flag = " << flag << std::endl;
94 int ieta,
int iphi,
double ebThr,
95 double eeThr,
double tMin,
double tMax,
98 std::vector<DetId> vdets;
106 std::cout <<
"Inside eECALmatrix " << 2*ieta+1 <<
"X" << 2*iphi+1
107 <<
" nXtals " << vdets.size() << std::endl;
111 for (
unsigned int i1=0; i1<vdets.size(); i1++) {
112 if (vdets[i1] !=
DetId(0)) {
115 if (vdets[i1].subdetId()==
EcalBarrel) ok = (eTower > ebThr);
116 else if (vdets[i1].subdetId()==
EcalEndcap) ok = (eTower > eeThr);
118 if (debug)
std::cout <<
"Crystal 0x" <<std::hex << vdets[i1]()
122 std::vector<EcalRecHitCollection::const_iterator>
hit;
127 }
else if (vdets[i1].subdetId()==
EcalEndcap) {
131 for (
unsigned int ihit=0; ihit<hit.size(); ihit++) {
134 if (hit[ihit] != hitsEB->
end()) {
135 en = hit[ihit]->energy();
136 tt = hit[ihit]->time();
138 }
else if (vdets[i1].subdetId()==
EcalEndcap) {
139 if (hit[ihit] != hitsEE->
end()) {
140 en = hit[ihit]->energy();
141 tt = hit[ihit]->time();
145 if (debug)
std::cout <<
" " << ihit <<
" E " << en <<
" T " <<
tt;
147 if (tt > tMin && tt < tMax) ener += en;
152 if (debug)
std::cout <<
" detected to be a spike";
163 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)
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)