CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
EcalCleaningAlgo Class Reference

#include <EcalCleaningAlgo.h>

Public Member Functions

EcalRecHit::Flags checkTopology (const DetId &id, const EcalRecHitCollection &rhs)
 
 EcalCleaningAlgo (const edm::ParameterSet &p)
 
void setFlags (EcalRecHitCollection &rhs)
 

Private Member Functions

float e4e1 (const DetId &id, const EcalRecHitCollection &rhs)
 yet another function to calculate swiss cross More...
 
float e6e2 (const DetId &id, const EcalRecHitCollection &rhs)
 
bool isNearCrack (const DetId &detid)
 in EB, check if we are near a crack More...
 
const std::vector< DetIdneighbours (const DetId &id)
 return the id of the 4 neighbours in the swiss cross More...
 
float recHitE (const DetId id, const EcalRecHitCollection &recHits, bool useTimingInfo)
 

Private Attributes

float cThreshold_barrel_
 
float cThreshold_double_
 
float cThreshold_endcap_
 
float e4e1_a_barrel_
 
float e4e1_a_endcap_
 
float e4e1_b_barrel_
 
float e4e1_b_endcap_
 
float e4e1Treshold_barrel_
 
float e4e1Treshold_endcap_
 
float e6e2thresh_
 
float ignoreOutOfTimeThresh_
 ignore kOutOfTime above threshold when calculating e4e1 More...
 
float tightenCrack_e1_double_
 
float tightenCrack_e1_single_
 
float tightenCrack_e4e1_single_
 
float tightenCrack_e6e2_double_
 

Detailed Description

Definition at line 19 of file EcalCleaningAlgo.h.

Constructor & Destructor Documentation

◆ EcalCleaningAlgo()

EcalCleaningAlgo::EcalCleaningAlgo ( const edm::ParameterSet p)

Definition at line 13 of file EcalCleaningAlgo.cc.

13  {
14  cThreshold_barrel_ = p.getParameter<double>("cThreshold_barrel");
15  ;
16  cThreshold_endcap_ = p.getParameter<double>("cThreshold_endcap");
17  ;
18  e4e1_a_barrel_ = p.getParameter<double>("e4e1_a_barrel");
19  e4e1_b_barrel_ = p.getParameter<double>("e4e1_b_barrel");
20  e4e1_a_endcap_ = p.getParameter<double>("e4e1_a_endcap");
21  e4e1_b_endcap_ = p.getParameter<double>("e4e1_b_endcap");
22  e4e1Treshold_barrel_ = p.getParameter<double>("e4e1Threshold_barrel");
23  e4e1Treshold_endcap_ = p.getParameter<double>("e4e1Threshold_endcap");
24 
25  cThreshold_double_ = p.getParameter<double>("cThreshold_double");
26 
27  ignoreOutOfTimeThresh_ = p.getParameter<double>("ignoreOutOfTimeThresh");
28  tightenCrack_e1_single_ = p.getParameter<double>("tightenCrack_e1_single");
29  tightenCrack_e4e1_single_ = p.getParameter<double>("tightenCrack_e4e1_single");
30  tightenCrack_e1_double_ = p.getParameter<double>("tightenCrack_e1_double");
31  tightenCrack_e6e2_double_ = p.getParameter<double>("tightenCrack_e6e2_double");
32  e6e2thresh_ = p.getParameter<double>("e6e2thresh");
33 }

References cThreshold_barrel_, cThreshold_double_, cThreshold_endcap_, e4e1_a_barrel_, e4e1_a_endcap_, e4e1_b_barrel_, e4e1_b_endcap_, e4e1Treshold_barrel_, e4e1Treshold_endcap_, e6e2thresh_, ignoreOutOfTimeThresh_, AlCaHLTBitMon_ParallelJobs::p, tightenCrack_e1_double_, tightenCrack_e1_single_, tightenCrack_e4e1_single_, and tightenCrack_e6e2_double_.

Member Function Documentation

◆ checkTopology()

EcalRecHit::Flags EcalCleaningAlgo::checkTopology ( const DetId id,
const EcalRecHitCollection rhs 
)

check topology, return : kGood : not anomalous kWeird : spike kDiWeird : dispike

Flag spikey channels

Mark single spikes. Spike definition:

Barrel: e> cThreshold_barrel_ && e4e1 > e4e1_a_barrel_ * log10(e) + e4e1_b_barrel_

Near cracks: energy threshold is multiplied by tightenCrack_e1_single e4e1 threshold is divided by tightenCrack_e4e1_single

Endcap : e> cThreshold_endcap_ && e4e1> e4e1_a_endcap_ * log10(e) + e4e1_b_endcap_

Mark double spikes (barrel only) e> cThreshold_double_ && e6e2 > e6e2thresh_;

Near cracks: energy threshold multiplied by tightenCrack_e1_double
e6e2 threshold divided by tightenCrack_e6e2_double

Out of time hits above e4e1_IgnoreOutOfTimeThresh_ are ignored in topological quantities

Definition at line 62 of file EcalCleaningAlgo.cc.

62  {
63  float a = 0, b = 0, e4e1thresh = 0, ethresh = 0;
64 
65  if (id.subdetId() == EcalBarrel) {
66  a = e4e1_a_barrel_;
67  b = e4e1_b_barrel_;
69 
70  } else if (id.subdetId() == EcalEndcap) {
71  a = e4e1_a_endcap_;
72  b = e4e1_b_endcap_;
74  }
75 
76  // for energies below threshold, we don't apply e4e1 cut
77  float energy = recHitE(id, rhs, false);
78 
79  if (energy < ethresh)
80  return EcalRecHit::kGood;
82  return EcalRecHit::kGood;
83 
84  float e4e1value = e4e1(id, rhs);
85  e4e1thresh = a * log10(energy) + b;
86 
87  // near cracks the cut is tighter by a factor
88  if (isNearCrack(id)) {
89  e4e1thresh /= tightenCrack_e4e1_single_;
90  }
91 
92  // identify spike
93  if (e4e1value < e4e1thresh)
94  return EcalRecHit::kWeird;
95 
96  // now for double spikes
97 
98  // no checking for double spikes in EE
99  if (id.subdetId() == EcalEndcap)
100  return EcalRecHit::kGood;
101 
102  float e6e2value = e6e2(id, rhs);
103  float e6e2thresh = e6e2thresh_;
105  return EcalRecHit::kGood;
106 
108  return EcalRecHit::kGood;
109 
110  // near cracks the cut is tighter by a factor
111  if (id.subdetId() == EcalBarrel && isNearCrack(id))
113 
114  // identify double spike
115  if (e6e2value < e6e2thresh)
116  return EcalRecHit::kDiWeird;
117 
118  return EcalRecHit::kGood;
119 }

References a, b, cThreshold_barrel_, cThreshold_double_, cThreshold_endcap_, e4e1(), e4e1_a_barrel_, e4e1_a_endcap_, e4e1_b_barrel_, e4e1_b_endcap_, e6e2(), HLT_FULL_cff::e6e2thresh, e6e2thresh_, EcalBarrel, EcalEndcap, HCALHighEnergyHPDFilter_cfi::energy, hybridSuperClusters_cfi::ethresh, isNearCrack(), EcalRecHit::kDiWeird, EcalRecHit::kGood, EcalRecHit::kWeird, recHitE(), tightenCrack_e1_double_, tightenCrack_e1_single_, tightenCrack_e4e1_single_, and tightenCrack_e6e2_double_.

Referenced by setFlags().

◆ e4e1()

float EcalCleaningAlgo::e4e1 ( const DetId id,
const EcalRecHitCollection rhs 
)
private

yet another function to calculate swiss cross

Definition at line 121 of file EcalCleaningAlgo.cc.

121  {
122  float s4 = 0;
123  float e1 = recHitE(id, rhs, false);
124 
125  if (e1 == 0)
126  return 0;
127  const std::vector<DetId>& neighs = neighbours(id);
128  for (size_t i = 0; i < neighs.size(); ++i)
129  // avoid hits out of time when making s4
130  s4 += recHitE(neighs[i], rhs, true);
131 
132  return s4 / e1;
133 }

References StorageManager_cfg::e1, mps_fire::i, neighbours(), and recHitE().

Referenced by checkTopology(), and e6e2().

◆ e6e2()

float EcalCleaningAlgo::e6e2 ( const DetId id,
const EcalRecHitCollection rhs 
)
private

Compute e6 over e2 around xtal 1, where 2 is the most energetic in the swiss cross around 1

  | | |   
+-+-+-+-+
| |1|2| |
+-+-+-+-+
  | | |               

Definition at line 135 of file EcalCleaningAlgo.cc.

135  {
136  float s4_1 = 0;
137  float s4_2 = 0;
138  float e1 = recHitE(id, rhs, false);
139 
140  float maxene = 0;
141  DetId maxid;
142 
143  if (e1 == 0)
144  return 0;
145 
146  const std::vector<DetId>& neighs = neighbours(id);
147 
148  // find the most energetic neighbour ignoring time info
149  for (size_t i = 0; i < neighs.size(); ++i) {
150  float ene = recHitE(neighs[i], rhs, false);
151  if (ene > maxene) {
152  maxene = ene;
153  maxid = neighs[i];
154  }
155  }
156 
157  float e2 = maxene;
158 
159  s4_1 = e4e1(id, rhs) * e1;
160  s4_2 = e4e1(maxid, rhs) * e2;
161 
162  return (s4_1 + s4_2) / (e1 + e2) - 1.;
163 }

References StorageManager_cfg::e1, e4e1(), mps_fire::i, neighbours(), and recHitE().

Referenced by checkTopology().

◆ isNearCrack()

bool EcalCleaningAlgo::isNearCrack ( const DetId detid)
private

in EB, check if we are near a crack

Definition at line 214 of file EcalCleaningAlgo.cc.

214  {
215  if (id.subdetId() == EcalEndcap) {
217  } else {
218  return EBDetId::isNextToBoundary(id);
219  }
220 }

References EcalEndcap, EBDetId::isNextToBoundary(), and EEDetId::isNextToRingBoundary().

Referenced by checkTopology().

◆ neighbours()

const std::vector< DetId > EcalCleaningAlgo::neighbours ( const DetId id)
private

return the id of the 4 neighbours in the swiss cross

four neighbours in the swiss cross around id

Definition at line 194 of file EcalCleaningAlgo.cc.

194  {
195  std::vector<DetId> ret;
196 
197  if (id.subdetId() == EcalBarrel) {
198  ret.push_back(EBDetId::offsetBy(id, 1, 0));
199  ret.push_back(EBDetId::offsetBy(id, -1, 0));
200  ret.push_back(EBDetId::offsetBy(id, 0, 1));
201  ret.push_back(EBDetId::offsetBy(id, 0, -1));
202  }
203  // nobody understands what polymorphism is for, sgrunt !
204  else if (id.subdetId() == EcalEndcap) {
205  ret.push_back(EEDetId::offsetBy(id, 1, 0));
206  ret.push_back(EEDetId::offsetBy(id, -1, 0));
207  ret.push_back(EEDetId::offsetBy(id, 0, 1));
208  ret.push_back(EEDetId::offsetBy(id, 0, -1));
209  }
210 
211  return ret;
212 }

References EcalBarrel, EcalEndcap, EBDetId::offsetBy(), EEDetId::offsetBy(), and runTheMatrix::ret.

Referenced by e4e1(), and e6e2().

◆ recHitE()

float EcalCleaningAlgo::recHitE ( const DetId  id,
const EcalRecHitCollection recHits,
bool  useTimingInfo 
)
private

Definition at line 165 of file EcalCleaningAlgo.cc.

165  {
166  if (id.rawId() == 0)
167  return 0;
168 
170  if (id.subdetId() == EcalEndcap)
172 
174  if (it != recHits.end()) {
175  float ene = (*it).energy();
176 
177  // ignore out of time in EB when making e4e1 if so configured
178  if (useTimingInfo) {
179  if (id.subdetId() == EcalBarrel && it->checkFlag(EcalRecHit::kOutOfTime) && ene > ignoreOutOfTimeThresh_)
180  return 0;
181  }
182 
183  // ignore hits below threshold
184  if (ene < threshold)
185  return 0;
186 
187  // else return the energy of this hit
188  return ene;
189  }
190  return 0;
191 }

References e4e1Treshold_barrel_, e4e1Treshold_endcap_, EcalBarrel, EcalEndcap, ignoreOutOfTimeThresh_, EcalRecHit::kOutOfTime, FastTrackerRecHitMaskProducer_cfi::recHits, and remoteMonitoring_LED_IterMethod_cfg::threshold.

Referenced by checkTopology(), e4e1(), and e6e2().

◆ setFlags()

void EcalCleaningAlgo::setFlags ( EcalRecHitCollection rhs)

Definition at line 222 of file EcalCleaningAlgo.cc.

222  {
224  //changing the collection on place
225  for (rh = rhs.begin(); rh != rhs.end(); ++rh) {
226  EcalRecHit::Flags state = checkTopology(rh->id(), rhs);
227  if (state != EcalRecHit::kGood) {
228  rh->unsetFlag(EcalRecHit::kGood);
229  rh->setFlag(state);
230  }
231  }
232 }

References edm::SortedCollection< T, SORT >::begin(), checkTopology(), edm::SortedCollection< T, SORT >::end(), and EcalRecHit::kGood.

Member Data Documentation

◆ cThreshold_barrel_

float EcalCleaningAlgo::cThreshold_barrel_
private

Definition at line 58 of file EcalCleaningAlgo.h.

Referenced by checkTopology(), and EcalCleaningAlgo().

◆ cThreshold_double_

float EcalCleaningAlgo::cThreshold_double_
private

Definition at line 69 of file EcalCleaningAlgo.h.

Referenced by checkTopology(), and EcalCleaningAlgo().

◆ cThreshold_endcap_

float EcalCleaningAlgo::cThreshold_endcap_
private

Definition at line 59 of file EcalCleaningAlgo.h.

Referenced by checkTopology(), and EcalCleaningAlgo().

◆ e4e1_a_barrel_

float EcalCleaningAlgo::e4e1_a_barrel_
private

Definition at line 60 of file EcalCleaningAlgo.h.

Referenced by checkTopology(), and EcalCleaningAlgo().

◆ e4e1_a_endcap_

float EcalCleaningAlgo::e4e1_a_endcap_
private

Definition at line 62 of file EcalCleaningAlgo.h.

Referenced by checkTopology(), and EcalCleaningAlgo().

◆ e4e1_b_barrel_

float EcalCleaningAlgo::e4e1_b_barrel_
private

Definition at line 61 of file EcalCleaningAlgo.h.

Referenced by checkTopology(), and EcalCleaningAlgo().

◆ e4e1_b_endcap_

float EcalCleaningAlgo::e4e1_b_endcap_
private

Definition at line 63 of file EcalCleaningAlgo.h.

Referenced by checkTopology(), and EcalCleaningAlgo().

◆ e4e1Treshold_barrel_

float EcalCleaningAlgo::e4e1Treshold_barrel_
private

Definition at line 65 of file EcalCleaningAlgo.h.

Referenced by EcalCleaningAlgo(), and recHitE().

◆ e4e1Treshold_endcap_

float EcalCleaningAlgo::e4e1Treshold_endcap_
private

Definition at line 66 of file EcalCleaningAlgo.h.

Referenced by EcalCleaningAlgo(), and recHitE().

◆ e6e2thresh_

float EcalCleaningAlgo::e6e2thresh_
private

Definition at line 72 of file EcalCleaningAlgo.h.

Referenced by checkTopology(), and EcalCleaningAlgo().

◆ ignoreOutOfTimeThresh_

float EcalCleaningAlgo::ignoreOutOfTimeThresh_
private

ignore kOutOfTime above threshold when calculating e4e1

Definition at line 54 of file EcalCleaningAlgo.h.

Referenced by EcalCleaningAlgo(), and recHitE().

◆ tightenCrack_e1_double_

float EcalCleaningAlgo::tightenCrack_e1_double_
private

Definition at line 70 of file EcalCleaningAlgo.h.

Referenced by checkTopology(), and EcalCleaningAlgo().

◆ tightenCrack_e1_single_

float EcalCleaningAlgo::tightenCrack_e1_single_
private

Definition at line 67 of file EcalCleaningAlgo.h.

Referenced by checkTopology(), and EcalCleaningAlgo().

◆ tightenCrack_e4e1_single_

float EcalCleaningAlgo::tightenCrack_e4e1_single_
private

Definition at line 68 of file EcalCleaningAlgo.h.

Referenced by checkTopology(), and EcalCleaningAlgo().

◆ tightenCrack_e6e2_double_

float EcalCleaningAlgo::tightenCrack_e6e2_double_
private

Definition at line 71 of file EcalCleaningAlgo.h.

Referenced by checkTopology(), and EcalCleaningAlgo().

runTheMatrix.ret
ret
prodAgent to be discontinued
Definition: runTheMatrix.py:373
HLT_FULL_cff.e6e2thresh
e6e2thresh
Definition: HLT_FULL_cff.py:8294
mps_fire.i
i
Definition: mps_fire.py:428
edm::SortedCollection< EcalRecHit >::const_iterator
std::vector< EcalRecHit >::const_iterator const_iterator
Definition: SortedCollection.h:80
EBDetId::isNextToBoundary
static bool isNextToBoundary(EBDetId id)
Definition: EBDetId.cc:106
EcalCleaningAlgo::cThreshold_endcap_
float cThreshold_endcap_
Definition: EcalCleaningAlgo.h:59
EcalCleaningAlgo::e4e1_b_endcap_
float e4e1_b_endcap_
Definition: EcalCleaningAlgo.h:63
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
EcalRecHit::Flags
Flags
Definition: EcalRecHit.h:20
EcalCleaningAlgo::cThreshold_barrel_
float cThreshold_barrel_
Definition: EcalCleaningAlgo.h:58
EcalCleaningAlgo::e6e2
float e6e2(const DetId &id, const EcalRecHitCollection &rhs)
Definition: EcalCleaningAlgo.cc:135
EcalCleaningAlgo::tightenCrack_e1_single_
float tightenCrack_e1_single_
Definition: EcalCleaningAlgo.h:67
EcalBarrel
Definition: EcalSubdetector.h:10
DetId
Definition: DetId.h:17
EEDetId::offsetBy
EEDetId offsetBy(int nrStepsX, int nrStepsY) const
Definition: EEDetId.cc:391
EcalCleaningAlgo::neighbours
const std::vector< DetId > neighbours(const DetId &id)
return the id of the 4 neighbours in the swiss cross
Definition: EcalCleaningAlgo.cc:194
edm::SortedCollection::begin
const_iterator begin() const
Definition: SortedCollection.h:262
EcalCleaningAlgo::ignoreOutOfTimeThresh_
float ignoreOutOfTimeThresh_
ignore kOutOfTime above threshold when calculating e4e1
Definition: EcalCleaningAlgo.h:54
EcalCleaningAlgo::e4e1_a_barrel_
float e4e1_a_barrel_
Definition: EcalCleaningAlgo.h:60
HCALHighEnergyHPDFilter_cfi.energy
energy
Definition: HCALHighEnergyHPDFilter_cfi.py:5
EcalCleaningAlgo::tightenCrack_e4e1_single_
float tightenCrack_e4e1_single_
Definition: EcalCleaningAlgo.h:68
EcalRecHit::kGood
Definition: EcalRecHit.h:21
b
double b
Definition: hdecay.h:118
EcalCleaningAlgo::e4e1_a_endcap_
float e4e1_a_endcap_
Definition: EcalCleaningAlgo.h:62
EcalEndcap
Definition: EcalSubdetector.h:10
FastTrackerRecHitMaskProducer_cfi.recHits
recHits
Definition: FastTrackerRecHitMaskProducer_cfi.py:8
EcalCleaningAlgo::checkTopology
EcalRecHit::Flags checkTopology(const DetId &id, const EcalRecHitCollection &rhs)
Definition: EcalCleaningAlgo.cc:62
EcalRecHit::kOutOfTime
Definition: EcalRecHit.h:23
EcalCleaningAlgo::e4e1Treshold_barrel_
float e4e1Treshold_barrel_
Definition: EcalCleaningAlgo.h:65
a
double a
Definition: hdecay.h:119
hybridSuperClusters_cfi.ethresh
ethresh
Definition: hybridSuperClusters_cfi.py:30
EEDetId::isNextToRingBoundary
static bool isNextToRingBoundary(EEDetId id)
Definition: EEDetId.cc:284
edm::SortedCollection< EcalRecHit >::iterator
std::vector< EcalRecHit >::iterator iterator
Definition: SortedCollection.h:81
edm::SortedCollection::end
const_iterator end() const
Definition: SortedCollection.h:267
StorageManager_cfg.e1
e1
Definition: StorageManager_cfg.py:16
EcalCleaningAlgo::e4e1
float e4e1(const DetId &id, const EcalRecHitCollection &rhs)
yet another function to calculate swiss cross
Definition: EcalCleaningAlgo.cc:121
EcalCleaningAlgo::e4e1_b_barrel_
float e4e1_b_barrel_
Definition: EcalCleaningAlgo.h:61
EcalRecHit::kWeird
Definition: EcalRecHit.h:35
EcalCleaningAlgo::e4e1Treshold_endcap_
float e4e1Treshold_endcap_
Definition: EcalCleaningAlgo.h:66
EBDetId::offsetBy
EBDetId offsetBy(int nrStepsEta, int nrStepsPhi) const
Definition: EBDetId.cc:50
EcalCleaningAlgo::e6e2thresh_
float e6e2thresh_
Definition: EcalCleaningAlgo.h:72
RunInfoPI::state
state
Definition: RunInfoPayloadInspectoHelper.h:16
EcalCleaningAlgo::isNearCrack
bool isNearCrack(const DetId &detid)
in EB, check if we are near a crack
Definition: EcalCleaningAlgo.cc:214
EcalCleaningAlgo::tightenCrack_e6e2_double_
float tightenCrack_e6e2_double_
Definition: EcalCleaningAlgo.h:71
EcalCleaningAlgo::recHitE
float recHitE(const DetId id, const EcalRecHitCollection &recHits, bool useTimingInfo)
Definition: EcalCleaningAlgo.cc:165
EcalRecHit::kDiWeird
Definition: EcalRecHit.h:36
EcalCleaningAlgo::tightenCrack_e1_double_
float tightenCrack_e1_double_
Definition: EcalCleaningAlgo.h:70
remoteMonitoring_LED_IterMethod_cfg.threshold
threshold
Definition: remoteMonitoring_LED_IterMethod_cfg.py:426
EcalCleaningAlgo::cThreshold_double_
float cThreshold_double_
Definition: EcalCleaningAlgo.h:69