8 float recHitEtThreshold,
11 float recHitEnergyThresholdForTiming,
12 float recHitEnergyThresholdForEE,
13 float spIdThresholdIEta85
21 if ( it == recHits.
end() ) {
24 if ( dbStatus >= 10 ) {
26 }
else if ( dbStatus > 0 && dbStatus < 10 ) {
29 }
else if ( dbStatus == 0 ) {
97 uint16_t dbStatus = 0;
98 if ( chIt != chStatus.
end() ) {
99 dbStatus = chIt->getStatusCode();
101 edm::LogError(
"EcalSeverityLevelError") <<
"No channel status found for xtal "
103 <<
"! something wrong with EcalChannelStatus in your DB? ";
110 float recHitThreshold,
116 return E1OverE9(
id, recHits, recHitThreshold );
119 return swissCross(
id, recHits, recHitThreshold ,
true);
122 return swissCross(
id, recHits, recHitThreshold ,
false);
125 edm::LogInfo(
"EcalSeverityLevelAlgo") <<
"Algorithm number " << spId
126 <<
" not known. Please check the enum in EcalSeverityLevelAlgo.h";
138 if (
recHitApproxEt(
id, recHits ) < recHitEtThreshold )
return 0;
141 for (
int deta = -1; deta <= +1; ++deta ) {
142 for (
int dphi = -1; dphi <= +1; ++dphi ) {
143 s9 +=
recHitE(
id, recHits, deta, dphi );
146 return recHitE(
id, recHits) / s9;
149 if (
recHitApproxEt(
id, recHits ) < recHitEtThreshold )
return 0;
152 for (
int dx = -1; dx <= +1; ++dx ) {
153 for (
int dy = -1; dy <= +1; ++dy ) {
154 s9 +=
recHitE(
id, recHits, dx, dy );
157 return recHitE(
id, recHits) / s9;
172 if (
abs(ebId.
ieta())==85 && avoidIeta85)
return 0;
176 float e1 =
recHitE(
id, recHits );
178 if ( e1 == 0 )
return 0;
179 s4 +=
recHitE(
id, recHits, 1, 0 );
180 s4 +=
recHitE(
id, recHits, -1, 0 );
181 s4 +=
recHitE(
id, recHits, 0, 1 );
182 s4 +=
recHitE(
id, recHits, 0, -1 );
187 float e1 =
recHitE(
id, recHits );
188 if ( e1 < recHitThreshold )
return 0;
191 if ( e1 == 0 )
return 0;
192 s4 +=
recHitE(
id, recHits, 1, 0 );
193 s4 +=
recHitE(
id, recHits, -1, 0 );
194 s4 +=
recHitE(
id, recHits, 0, 1 );
195 s4 +=
recHitE(
id, recHits, 0, -1 );
211 return ( nid ==
DetId(0) ? 0 :
recHitE( nid, recHits ) );
216 if (
id ==
DetId(0) ) {
220 if ( it != recHits.
end() )
return (*it).energy();
238 if ( recHit.
energy() < recHitEnergyThreshold )
return false;
246 float recHitEtThreshold,
float recHitEtThreshold2 ,
247 bool avoidIeta85,
bool KillSecondHit)
274 if (
abs(ebId.
ieta())==85 && avoidIeta85)
return 0;
279 float e1 =
recHitE(
id, recHits );
285 if (ete1 <
std::min(recHitEtThreshold,recHitEtThreshold2) )
return 0;
287 if (ete1 < recHitEtThreshold && !KillSecondHit )
return 0;
300 for (
int deta = -1; deta <= +1; ++deta ) {
301 for (
int dphi = -1; dphi <= +1; ++dphi ) {
305 float etmp=
recHitE(
id, recHits, deta, dphi );
312 if (etmp>e2 && eapproxet>recHitEtThreshold2 && !(deta==0 && dphi==0)) {
324 if ( e1 == 0 )
return 0;
327 if ( e2 == -1 )
return 0;
334 if (s9!=0) e2e9=e2nd/s9;
339 if (e1 > e2 && ete1>recHitEtThreshold)
return e2e9;
350 if (!KillSecondHit || ete2<recHitEtThreshold || ete1<recHitEtThreshold2) {
370 for (
int deta = -1; deta <= +1; ++deta ) {
371 for (
int dphi = -1; dphi <= +1; ++dphi ) {
375 float etmp=
recHitE( secondid, recHits, deta, dphi );
378 if (etmp>e2nd_prime && !(deta==0 && dphi==0)) {
389 if (!(e2prime_eta==-e2eta && e2prime_phi==-e2phi))
397 if (s92nd!=0) e2e9_2=e2nd/s92nd;
static float E2overE9(const DetId id, const EcalRecHitCollection &, float recHitEtThreshold=10.0, float recHitEtThreshold2=1.0, bool avoidIeta85=false, bool KillSecondHit=true)
std::vector< T >::const_iterator const_iterator
EEDetId offsetBy(int nrStepsX, int nrStepsY) const
uint32_t recoFlag() const
static bool spikeFromTiming(const EcalRecHit &, float recHitEnergyThreshold)
EBDetId offsetBy(int nrStepsEta, int nrStepsPhi) const
int ieta() const
get the crystal ieta
const_iterator end() const
static float recHitApproxEt(const DetId id, const EcalRecHitCollection &recHits)
static uint16_t retrieveDBStatus(const DetId, const EcalChannelStatus &chStatus)
Log< T >::type log(const T &t)
DetId id() const
get the id
std::vector< Item >::const_iterator const_iterator
static float recHitE(const DetId id, const EcalRecHitCollection &recHits)
iterator find(key_type k)
static float spikeFromNeighbours(const DetId id, const EcalRecHitCollection &, float recHitEtThreshold, SpikeId spId)
static float swissCross(const DetId id, const EcalRecHitCollection &, float recHitEtThreshold=0., bool avoidIeta85=true)
const_iterator find(uint32_t rawId) const
static int severityLevel(const DetId, const EcalRecHitCollection &, const EcalChannelStatus &, float recHitEtThreshold=5., SpikeId spId=kSwissCross, float spIdThreshold=0.95, float recHitEnergyThresholdForTiming=2., float recHitEnergyThresholdForEE=15, float spIdThresholdIEta85=0.999)
const_iterator end() const
static float E1OverE9(const DetId id, const EcalRecHitCollection &, float recHitEtThreshold=0.)