CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PFRecHitQTests.h
Go to the documentation of this file.
1 #ifndef RecoParticleFlow_PFClusterProducer_PFEcalRecHitQTests_h
2 #define RecoParticleFlow_PFClusterProducer_PFEcalRecHitQTests_h
3 
5 
6 
7 
8 //
9 // Quality test that checks threshold
10 //
12  public:
14 
15  }
16 
18  PFRecHitQTestBase(iConfig)
19  {
20  threshold_ = iConfig.getParameter<double>("threshold");
21 
22  }
23 
24  void beginEvent(const edm::Event& event,const edm::EventSetup& iSetup) {
25  }
26 
27  bool test(reco::PFRecHit& hit,const EcalRecHit& rh,bool& clean) {
28  return pass(hit);
29  }
30  bool test(reco::PFRecHit& hit,const HBHERecHit& rh,bool& clean) {
31  return pass(hit);
32  }
33 
34  bool test(reco::PFRecHit& hit,const HFRecHit& rh,bool& clean) {
35  return pass(hit);
36  }
37  bool test(reco::PFRecHit& hit,const HORecHit& rh,bool& clean) {
38  return pass(hit);
39  }
40 
41  bool test(reco::PFRecHit& hit,const CaloTower& rh,bool& clean) {
42  return pass(hit);
43  }
44 
45  protected:
46  double threshold_;
47 
48  bool pass(const reco::PFRecHit& hit) {
49  if (hit.energy()>threshold_) return true;
50 
51  return false;
52  }
53 };
54 
55 
56 
57 
58 //
59 // Quality test that checks kHCAL Severity
60 //
62  public:
64 
65  }
66 
68  PFRecHitQTestBase(iConfig)
69  {
70  threshold_ = iConfig.getParameter<int>("maxSeverity");
71  }
72 
73  void beginEvent(const edm::Event& event,const edm::EventSetup& iSetup) {
75  iSetup.get<IdealGeometryRecord>().get(topo);
77  iSetup.get<HcalChannelQualityRcd>().get( hcalChStatus );
78  theHcalChStatus_ = hcalChStatus.product();
80  edm::ESHandle<HcalSeverityLevelComputer> hcalSevLvlComputerHndl;
81  iSetup.get<HcalSeverityLevelComputerRcd>().get(hcalSevLvlComputerHndl);
82  hcalSevLvlComputer_ = hcalSevLvlComputerHndl.product();
83  }
84 
85  bool test(reco::PFRecHit& hit,const EcalRecHit& rh,bool& clean) {
86  return true;
87  }
88  bool test(reco::PFRecHit& hit,const HBHERecHit& rh,bool& clean) {
89  const HcalDetId& detid = (HcalDetId)rh.detid();
90  const HcalChannelStatus* theStatus = theHcalChStatus_->getValues(detid);
91  unsigned theStatusValue = theStatus->getValue();
92  // Now get severity of problems for the given detID, based on the rechit flag word and the channel quality status value
93  int hitSeverity=hcalSevLvlComputer_->getSeverityLevel(detid, rh.flags(),theStatusValue);
94 
95  if (hitSeverity>threshold_) {
96  clean=true;
97  return false;
98  }
99 
100  return true;
101  }
102 
103  bool test(reco::PFRecHit& hit,const HFRecHit& rh,bool& clean) {
104  const HcalDetId& detid = (HcalDetId)rh.detid();
105  const HcalChannelStatus* theStatus = theHcalChStatus_->getValues(detid);
106  unsigned theStatusValue = theStatus->getValue();
107  // Now get severity of problems for the given detID, based on the rechit flag word and the channel quality status value
108  int hitSeverity=hcalSevLvlComputer_->getSeverityLevel(detid, rh.flags(),theStatusValue);
109 
110  if (hitSeverity>threshold_) {
111  clean=true;
112  return false;
113  }
114 
115  return true;
116  }
117  bool test(reco::PFRecHit& hit,const HORecHit& rh,bool& clean) {
118 
119  const HcalDetId& detid = (HcalDetId)rh.detid();
120  const HcalChannelStatus* theStatus = theHcalChStatus_->getValues(detid);
121  unsigned theStatusValue = theStatus->getValue();
122 
123  // Now get severity of problems for the given detID, based on the rechit flag word and the channel quality status value
124 
125  int hitSeverity=hcalSevLvlComputer_->getSeverityLevel(detid, rh.flags(),theStatusValue);
126 
127  if (hitSeverity>threshold_) {
128  clean=true;
129  return false;
130  }
131 
132  return true;
133  }
134 
135  bool test(reco::PFRecHit& hit,const CaloTower& rh,bool& clean) {
136  return true;
137 
138  }
139 
140  protected:
144 };
145 
146 
147 //
148 // Quality test that checks HO threshold applying different threshold in rings
149 //
151  public:
153 
154  }
155 
157  PFRecHitQTestBase(iConfig)
158  {
159  threshold0_ = iConfig.getParameter<double>("threshold_ring0");
160  threshold12_ = iConfig.getParameter<double>("threshold_ring12");
161  }
162 
163  void beginEvent(const edm::Event& event,const edm::EventSetup& iSetup) {
164  }
165 
166  bool test(reco::PFRecHit& hit,const EcalRecHit& rh,bool& clean) {
167  return true;
168  }
169  bool test(reco::PFRecHit& hit,const HBHERecHit& rh,bool& clean) {
170  return true;
171  }
172 
173  bool test(reco::PFRecHit& hit,const HFRecHit& rh,bool& clean) {
174  return true;
175  }
176  bool test(reco::PFRecHit& hit,const HORecHit& rh,bool& clean) {
177  HcalDetId detid(rh.detid());
178  if (abs(detid.ieta())<=4 && hit.energy()>threshold0_)
179  return true;
180  if (abs(detid.ieta())>4 && hit.energy()>threshold12_)
181  return true;
182 
183  return false;
184  }
185 
186  bool test(reco::PFRecHit& hit,const CaloTower& rh,bool& clean) {
187  return true;
188  }
189 
190  protected:
191  double threshold0_;
192  double threshold12_;
193 
194 };
195 
196 //
197 // Quality test that checks ecal quality cuts
198 //
200  public:
202 
203  }
204 
206  PFRecHitQTestBase(iConfig)
207  {
208  thresholdCleaning_ = iConfig.getParameter<double>("cleaningThreshold");
209  timingCleaning_ = iConfig.getParameter<bool>("timingCleaning");
210  topologicalCleaning_ = iConfig.getParameter<bool>("topologicalCleaning");
211  skipTTRecoveredHits_ = iConfig.getParameter<bool>("skipTTRecoveredHits");
212 
213  }
214 
215  void beginEvent(const edm::Event& event,const edm::EventSetup& iSetup) {
216  }
217 
218  bool test(reco::PFRecHit& hit,const EcalRecHit& rh,bool& clean) {
220  {
221  clean=true;
222  return false;
223  }
224  if ( timingCleaning_ && rh.energy() > thresholdCleaning_ &&
226  clean=true;
227  return false;
228  }
229 
230  if ( topologicalCleaning_ &&
231  ( rh.checkFlag(EcalRecHit::kWeird) ||
233  clean=true;
234  return false;
235  }
236 
237  return true;
238  }
239 
240  bool test(reco::PFRecHit& hit,const HBHERecHit& rh,bool& clean) {
241  return true;
242  }
243 
244  bool test(reco::PFRecHit& hit,const HFRecHit& rh,bool& clean) {
245  return true;
246 
247  }
248 
249  bool test(reco::PFRecHit& hit,const HORecHit& rh,bool& clean) {
250  return true;
251  }
252 
253  bool test(reco::PFRecHit& hit,const CaloTower& rh,bool& clean) {
254  return true;
255 
256  }
257 
258 
259  protected:
264 
265 };
266 
267 
268 
269 
270 
271 //
272 // Quality test that calibrates tower 29 of HCAL
273 //
275  public:
277 
278  }
279 
281  PFRecHitQTestBase(iConfig)
282  {
283  calibFactor_ =iConfig.getParameter<double>("calibFactor");
284  }
285 
286  void beginEvent(const edm::Event& event,const edm::EventSetup& iSetup) {
287  }
288 
289  bool test(reco::PFRecHit& hit,const EcalRecHit& rh,bool& clean) {
290  return true;
291  }
292  bool test(reco::PFRecHit& hit,const HBHERecHit& rh,bool& clean) {
293  HcalDetId detId(hit.detId());
294  if (abs(detId.ieta())==29)
295  hit.setEnergy(hit.energy()*calibFactor_);
296  return true;
297 
298  }
299 
300  bool test(reco::PFRecHit& hit,const HFRecHit& rh,bool& clean) {
301  return true;
302 
303  }
304  bool test(reco::PFRecHit& hit,const HORecHit& rh,bool& clean) {
305  return true;
306  }
307 
308  bool test(reco::PFRecHit& hit,const CaloTower& rh,bool& clean) {
309  CaloTowerDetId detId(hit.detId());
310  if (detId.ietaAbs()==29)
311  hit.setEnergy(hit.energy()*calibFactor_);
312  return true;
313 
314  }
315 
316  protected:
318 };
319 
320 
321 
322 #endif
T getParameter(std::string const &) const
const HcalChannelQuality * theHcalChStatus_
bool test(reco::PFRecHit &hit, const HBHERecHit &rh, bool &clean)
bool test(reco::PFRecHit &hit, const HFRecHit &rh, bool &clean)
bool pass(const reco::PFRecHit &hit)
void beginEvent(const edm::Event &event, const edm::EventSetup &iSetup)
bool test(reco::PFRecHit &hit, const HFRecHit &rh, bool &clean)
const DetId & detid() const
Definition: CaloRecHit.h:20
unsigned detId() const
rechit detId
Definition: PFRecHit.h:101
PFRecHitQTestThreshold(const edm::ParameterSet &iConfig)
bool test(reco::PFRecHit &hit, const HBHERecHit &rh, bool &clean)
const HcalSeverityLevelComputer * hcalSevLvlComputer_
bool test(reco::PFRecHit &hit, const HFRecHit &rh, bool &clean)
void setTopo(const HcalTopology *topo) const
bool test(reco::PFRecHit &hit, const HORecHit &rh, bool &clean)
bool test(reco::PFRecHit &hit, const HORecHit &rh, bool &clean)
PFRecHitQTestECAL(const edm::ParameterSet &iConfig)
const Item * getValues(DetId fId, bool throwOnFail=true) const
bool test(reco::PFRecHit &hit, const HORecHit &rh, bool &clean)
void beginEvent(const edm::Event &event, const edm::EventSetup &iSetup)
PFRecHitQTestHCALChannel(const edm::ParameterSet &iConfig)
void beginEvent(const edm::Event &event, const edm::EventSetup &iSetup)
bool test(reco::PFRecHit &hit, const HBHERecHit &rh, bool &clean)
bool test(reco::PFRecHit &hit, const CaloTower &rh, bool &clean)
void setEnergy(double energy)
Definition: PFRecHit.h:69
bool test(reco::PFRecHit &hit, const HORecHit &rh, bool &clean)
bool test(reco::PFRecHit &hit, const EcalRecHit &rh, bool &clean)
Particle flow rechit (rechit + geometry and topology information). See clustering algorithm in PFClus...
Definition: PFRecHit.h:35
bool checkFlag(int flag) const
check if the flag is true
Definition: EcalRecHit.h:176
bool test(reco::PFRecHit &hit, const HFRecHit &rh, bool &clean)
bool test(reco::PFRecHit &hit, const CaloTower &rh, bool &clean)
PFRecHitQTestHCALCalib29(const edm::ParameterSet &iConfig)
uint32_t flags() const
Definition: CaloRecHit.h:21
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool test(reco::PFRecHit &hit, const HBHERecHit &rh, bool &clean)
float energy() const
Definition: EcalRecHit.h:68
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
std::vector< T * > clean
Definition: MVATrainer.cc:156
PFRecHitQTestHOThreshold(const edm::ParameterSet &iConfig)
bool test(reco::PFRecHit &hit, const EcalRecHit &rh, bool &clean)
bool test(reco::PFRecHit &hit, const HFRecHit &rh, bool &clean)
const T & get() const
Definition: EventSetup.h:55
bool test(reco::PFRecHit &hit, const CaloTower &rh, bool &clean)
T const * product() const
Definition: ESHandle.h:62
int getSeverityLevel(const DetId &myid, const uint32_t &myflag, const uint32_t &mystatus) const
bool test(reco::PFRecHit &hit, const CaloTower &rh, bool &clean)
bool test(reco::PFRecHit &hit, const EcalRecHit &rh, bool &clean)
double energy() const
rechit energy
Definition: PFRecHit.h:107
bool test(reco::PFRecHit &hit, const CaloTower &rh, bool &clean)
bool test(reco::PFRecHit &hit, const EcalRecHit &rh, bool &clean)
bool test(reco::PFRecHit &hit, const EcalRecHit &rh, bool &clean)
uint32_t getValue() const
bool test(reco::PFRecHit &hit, const HORecHit &rh, bool &clean)
void beginEvent(const edm::Event &event, const edm::EventSetup &iSetup)
void beginEvent(const edm::Event &event, const edm::EventSetup &iSetup)
const HcalTopology * topo() const
bool test(reco::PFRecHit &hit, const HBHERecHit &rh, bool &clean)