CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Protected Attributes
PFRecHitQTestHCALChannel Class Reference

#include <PFRecHitQTests.h>

Inheritance diagram for PFRecHitQTestHCALChannel:
PFRecHitQTestBase

Public Member Functions

void beginEvent (const edm::Event &event, const edm::EventSetup &iSetup) override
 
 PFRecHitQTestHCALChannel ()
 
 PFRecHitQTestHCALChannel (const edm::ParameterSet &iConfig)
 
bool test (reco::PFRecHit &hit, const EcalRecHit &rh, bool &clean, bool fullReadOut) override
 
bool test (reco::PFRecHit &hit, const HBHERecHit &rh, bool &clean) override
 
bool test (reco::PFRecHit &hit, const HFRecHit &rh, bool &clean) override
 
bool test (reco::PFRecHit &hit, const HORecHit &rh, bool &clean) override
 
bool test (reco::PFRecHit &hit, const CaloTower &rh, bool &clean) override
 
bool test (reco::PFRecHit &hit, const HGCRecHit &rh, bool &clean) override
 
- Public Member Functions inherited from PFRecHitQTestBase
 PFRecHitQTestBase ()=default
 
 PFRecHitQTestBase (const edm::ParameterSet &iConfig)
 
virtual ~PFRecHitQTestBase ()=default
 

Protected Member Functions

bool test (unsigned aDETID, double energy, int flags, bool &clean)
 

Protected Attributes

std::vector< double > cleanThresholds_
 
std::vector< int > depths_
 
std::vector< int > flags_
 
const HcalSeverityLevelComputerhcalSevLvlComputer_
 
const HcalChannelQualitytheHcalChStatus_
 
const HcalTopologytheHcalTopology_
 
std::vector< int > thresholds_
 

Detailed Description

Definition at line 66 of file PFRecHitQTests.h.

Constructor & Destructor Documentation

PFRecHitQTestHCALChannel::PFRecHitQTestHCALChannel ( )
inline

Definition at line 68 of file PFRecHitQTests.h.

68  {
69  }
PFRecHitQTestHCALChannel::PFRecHitQTestHCALChannel ( const edm::ParameterSet iConfig)
inline

Definition at line 71 of file PFRecHitQTests.h.

References RemoveAddSevLevel::flag, flags, edm::ParameterSet::getParameter(), HcalCaloFlagLabels::HFDigiTime, HcalCaloFlagLabels::HFInTimeWindow, and HcalCaloFlagLabels::HFLongShort.

71  :
72  PFRecHitQTestBase(iConfig)
73  {
74  thresholds_ = iConfig.getParameter<std::vector<int> >("maxSeverities");
75  cleanThresholds_ = iConfig.getParameter<std::vector<double> >("cleaningThresholds");
76  std::vector<std::string> flags = iConfig.getParameter<std::vector<std::string> >("flags");
77  for (auto & flag : flags) {
78  if (flag =="Standard") {
79  flags_.push_back(-1);
80  depths_.push_back(-1);
81  }
82  else if (flag =="HFInTime") {
84  depths_.push_back(-1);
85  }
86  else if (flag =="HFDigi") {
88  depths_.push_back(-1);
89  }
90  else if (flag =="HFLong") {
92  depths_.push_back(1);
93  }
94  else if (flag =="HFShort") {
96  depths_.push_back(2);
97  }
98  else {
99  flags_.push_back(-1);
100  depths_.push_back(-1);
101  }
102  }
103  }
T getParameter(std::string const &) const
std::vector< int > depths_
std::vector< Variable::Flags > flags
Definition: MVATrainer.cc:135
std::vector< double > cleanThresholds_
PFRecHitQTestBase()=default
std::vector< int > thresholds_
std::vector< int > flags_

Member Function Documentation

void PFRecHitQTestHCALChannel::beginEvent ( const edm::Event event,
const edm::EventSetup iSetup 
)
inlineoverridevirtual

Implements PFRecHitQTestBase.

Definition at line 105 of file PFRecHitQTests.h.

References edm::EventSetup::get(), and edm::ESHandle< T >::product().

105  {
107  iSetup.get<HcalRecNumberingRecord>().get(topo);
108  theHcalTopology_ = topo.product();
110  iSetup.get<HcalChannelQualityRcd>().get( "withTopo", hcalChStatus );
111  theHcalChStatus_ = hcalChStatus.product();
112  edm::ESHandle<HcalSeverityLevelComputer> hcalSevLvlComputerHndl;
113  iSetup.get<HcalSeverityLevelComputerRcd>().get(hcalSevLvlComputerHndl);
114  hcalSevLvlComputer_ = hcalSevLvlComputerHndl.product();
115  }
const HcalChannelQuality * theHcalChStatus_
const HcalSeverityLevelComputer * hcalSevLvlComputer_
const HcalTopology * theHcalTopology_
const T & get() const
Definition: EventSetup.h:56
T const * product() const
Definition: ESHandle.h:86
bool PFRecHitQTestHCALChannel::test ( reco::PFRecHit hit,
const EcalRecHit rh,
bool &  clean,
bool  fullReadOut 
)
inlineoverridevirtual

Implements PFRecHitQTestBase.

Definition at line 117 of file PFRecHitQTests.h.

117  {
118  return true;
119  }
bool PFRecHitQTestHCALChannel::test ( reco::PFRecHit hit,
const HBHERecHit rh,
bool &  clean 
)
inlineoverridevirtual

Implements PFRecHitQTestBase.

Definition at line 120 of file PFRecHitQTests.h.

References clean, CaloRecHit::detid(), CaloRecHit::energy(), CaloRecHit::flags(), and PFRecHitQTestThreshold::test().

120  {
121  return test(rh.detid(), rh.energy(), rh.flags(), clean);
122  }
const DetId & detid() const
Definition: CaloRecHit.h:21
bool test(reco::PFRecHit &hit, const EcalRecHit &rh, bool &clean, bool fullReadOut) override
float energy() const
Definition: CaloRecHit.h:17
uint32_t flags() const
Definition: CaloRecHit.h:22
std::vector< T * > clean
Definition: MVATrainer.cc:156
bool PFRecHitQTestHCALChannel::test ( reco::PFRecHit hit,
const HFRecHit rh,
bool &  clean 
)
inlineoverridevirtual

Implements PFRecHitQTestBase.

Definition at line 124 of file PFRecHitQTests.h.

References clean, CaloRecHit::detid(), CaloRecHit::energy(), CaloRecHit::flags(), and PFRecHitQTestThreshold::test().

124  {
125  return test(rh.detid(), rh.energy(), rh.flags(), clean);
126  }
const DetId & detid() const
Definition: CaloRecHit.h:21
bool test(reco::PFRecHit &hit, const EcalRecHit &rh, bool &clean, bool fullReadOut) override
float energy() const
Definition: CaloRecHit.h:17
uint32_t flags() const
Definition: CaloRecHit.h:22
std::vector< T * > clean
Definition: MVATrainer.cc:156
bool PFRecHitQTestHCALChannel::test ( reco::PFRecHit hit,
const HORecHit rh,
bool &  clean 
)
inlineoverridevirtual

Implements PFRecHitQTestBase.

Definition at line 127 of file PFRecHitQTests.h.

References clean, CaloRecHit::detid(), CaloRecHit::energy(), CaloRecHit::flags(), and PFRecHitQTestThreshold::test().

127  {
128  return test(rh.detid(), rh.energy(), rh.flags(), clean);
129  }
const DetId & detid() const
Definition: CaloRecHit.h:21
bool test(reco::PFRecHit &hit, const EcalRecHit &rh, bool &clean, bool fullReadOut) override
float energy() const
Definition: CaloRecHit.h:17
uint32_t flags() const
Definition: CaloRecHit.h:22
std::vector< T * > clean
Definition: MVATrainer.cc:156
bool PFRecHitQTestHCALChannel::test ( reco::PFRecHit hit,
const CaloTower rh,
bool &  clean 
)
inlineoverridevirtual

Implements PFRecHitQTestBase.

Definition at line 131 of file PFRecHitQTests.h.

131  {
132  return true;
133  }
bool PFRecHitQTestHCALChannel::test ( reco::PFRecHit hit,
const HGCRecHit rh,
bool &  clean 
)
inlineoverridevirtual

Implements PFRecHitQTestBase.

Definition at line 135 of file PFRecHitQTests.h.

135  {
136  return true;
137  }
bool PFRecHitQTestHCALChannel::test ( unsigned  aDETID,
double  energy,
int  flags,
bool &  clean 
)
inlineprotected

Definition at line 148 of file PFRecHitQTests.h.

References HcalDetId::depth(), HcalSeverityLevelComputer::getSeverityLevel(), HcalChannelStatus::getValue(), HcalCondObjectContainer< Item >::getValues(), HcalEndcap, mps_fire::i, HcalTopology::idFront(), or, HcalDetId::subdet(), and HcalTopology::withSpecialRBXHBHE().

148  {
149  HcalDetId detid = (HcalDetId)aDETID;
150  if (theHcalTopology_->withSpecialRBXHBHE() and detid.subdet() == HcalEndcap){
151  detid = theHcalTopology_->idFront(detid);
152  }
153 
154  const HcalChannelStatus* theStatus = theHcalChStatus_->getValues(detid);
155  unsigned theStatusValue = theStatus->getValue();
156  // Now get severity of problems for the given detID, based on the rechit flag word and the channel quality status value
157  for (unsigned int i=0;i<thresholds_.size();++i) {
158  int hitSeverity =0;
159  if (energy < cleanThresholds_[i])
160  continue;
161 
162  if(flags_[i]<0) {
163  hitSeverity=hcalSevLvlComputer_->getSeverityLevel(detid, flags, theStatusValue);
164  }
165  else {
166  hitSeverity=hcalSevLvlComputer_->getSeverityLevel(detid, flags & flags_[i], theStatusValue);
167  }
168 
169  if (hitSeverity>thresholds_[i] and ((depths_[i]<0 or (depths_[i]==detid.depth())))) {
170  clean=true;
171  return false;
172  }
173  }
174  return true;
175  }
const HcalChannelQuality * theHcalChStatus_
HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:49
std::vector< int > depths_
const HcalSeverityLevelComputer * hcalSevLvlComputer_
std::vector< Variable::Flags > flags
Definition: MVATrainer.cc:135
const Item * getValues(DetId fId, bool throwOnFail=true) const
std::vector< double > cleanThresholds_
const HcalTopology * theHcalTopology_
int depth() const
get the tower depth
Definition: HcalDetId.cc:108
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
std::vector< T * > clean
Definition: MVATrainer.cc:156
int getSeverityLevel(const DetId &myid, const uint32_t &myflag, const uint32_t &mystatus) const
std::vector< int > thresholds_
HcalDetId idFront(const HcalDetId &id) const
Definition: HcalTopology.h:170
uint32_t getValue() const
bool withSpecialRBXHBHE() const
Definition: HcalTopology.h:162
std::vector< int > flags_

Member Data Documentation

std::vector<double> PFRecHitQTestHCALChannel::cleanThresholds_
protected

Definition at line 141 of file PFRecHitQTests.h.

std::vector<int> PFRecHitQTestHCALChannel::depths_
protected

Definition at line 143 of file PFRecHitQTests.h.

std::vector<int> PFRecHitQTestHCALChannel::flags_
protected

Definition at line 142 of file PFRecHitQTests.h.

const HcalSeverityLevelComputer* PFRecHitQTestHCALChannel::hcalSevLvlComputer_
protected

Definition at line 146 of file PFRecHitQTests.h.

const HcalChannelQuality* PFRecHitQTestHCALChannel::theHcalChStatus_
protected

Definition at line 145 of file PFRecHitQTests.h.

const HcalTopology* PFRecHitQTestHCALChannel::theHcalTopology_
protected

Definition at line 144 of file PFRecHitQTests.h.

std::vector<int> PFRecHitQTestHCALChannel::thresholds_
protected

Definition at line 140 of file PFRecHitQTests.h.