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 95 of file PFRecHitQTests.h.

Constructor & Destructor Documentation

PFRecHitQTestHCALChannel::PFRecHitQTestHCALChannel ( )
inline

Definition at line 97 of file PFRecHitQTests.h.

97 {}
PFRecHitQTestHCALChannel::PFRecHitQTestHCALChannel ( const edm::ParameterSet iConfig)
inline

Definition at line 99 of file PFRecHitQTests.h.

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

99  : PFRecHitQTestBase(iConfig) {
100  thresholds_ = iConfig.getParameter<std::vector<int> >("maxSeverities");
101  cleanThresholds_ = iConfig.getParameter<std::vector<double> >("cleaningThresholds");
102  std::vector<std::string> flags = iConfig.getParameter<std::vector<std::string> >("flags");
103  for (auto& flag : flags) {
104  if (flag == "Standard") {
105  flags_.push_back(-1);
106  depths_.push_back(-1);
107  } else if (flag == "HFInTime") {
109  depths_.push_back(-1);
110  } else if (flag == "HFDigi") {
111  flags_.push_back(1 << HcalCaloFlagLabels::HFDigiTime);
112  depths_.push_back(-1);
113  } else if (flag == "HFLong") {
114  flags_.push_back(1 << HcalCaloFlagLabels::HFLongShort);
115  depths_.push_back(1);
116  } else if (flag == "HFShort") {
117  flags_.push_back(1 << HcalCaloFlagLabels::HFLongShort);
118  depths_.push_back(2);
119  } else {
120  flags_.push_back(-1);
121  depths_.push_back(-1);
122  }
123  }
124  }
T getParameter(std::string const &) const
std::vector< int > depths_
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 126 of file PFRecHitQTests.h.

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

126  {
128  iSetup.get<HcalRecNumberingRecord>().get(topo);
129  theHcalTopology_ = topo.product();
131  iSetup.get<HcalChannelQualityRcd>().get("withTopo", hcalChStatus);
132  theHcalChStatus_ = hcalChStatus.product();
133  edm::ESHandle<HcalSeverityLevelComputer> hcalSevLvlComputerHndl;
134  iSetup.get<HcalSeverityLevelComputerRcd>().get(hcalSevLvlComputerHndl);
135  hcalSevLvlComputer_ = hcalSevLvlComputerHndl.product();
136  }
const HcalChannelQuality * theHcalChStatus_
const HcalSeverityLevelComputer * hcalSevLvlComputer_
const HcalTopology * theHcalTopology_
T get() const
Definition: EventSetup.h:73
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 138 of file PFRecHitQTests.h.

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

Implements PFRecHitQTestBase.

Definition at line 139 of file PFRecHitQTests.h.

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

139  {
140  return test(rh.detid(), rh.energy(), rh.flags(), clean);
141  }
constexpr float energy() const
Definition: CaloRecHit.h:29
constexpr const DetId & detid() const
Definition: CaloRecHit.h:33
bool test(reco::PFRecHit &hit, const EcalRecHit &rh, bool &clean, bool fullReadOut) override
static void clean(char *s)
constexpr uint32_t flags() const
Definition: CaloRecHit.h:34
bool PFRecHitQTestHCALChannel::test ( reco::PFRecHit hit,
const HFRecHit rh,
bool &  clean 
)
inlineoverridevirtual

Implements PFRecHitQTestBase.

Definition at line 143 of file PFRecHitQTests.h.

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

143  {
144  return test(rh.detid(), rh.energy(), rh.flags(), clean);
145  }
constexpr float energy() const
Definition: CaloRecHit.h:29
constexpr const DetId & detid() const
Definition: CaloRecHit.h:33
bool test(reco::PFRecHit &hit, const EcalRecHit &rh, bool &clean, bool fullReadOut) override
static void clean(char *s)
constexpr uint32_t flags() const
Definition: CaloRecHit.h:34
bool PFRecHitQTestHCALChannel::test ( reco::PFRecHit hit,
const HORecHit rh,
bool &  clean 
)
inlineoverridevirtual

Implements PFRecHitQTestBase.

Definition at line 146 of file PFRecHitQTests.h.

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

146  {
147  return test(rh.detid(), rh.energy(), rh.flags(), clean);
148  }
constexpr float energy() const
Definition: CaloRecHit.h:29
constexpr const DetId & detid() const
Definition: CaloRecHit.h:33
bool test(reco::PFRecHit &hit, const EcalRecHit &rh, bool &clean, bool fullReadOut) override
static void clean(char *s)
constexpr uint32_t flags() const
Definition: CaloRecHit.h:34
bool PFRecHitQTestHCALChannel::test ( reco::PFRecHit hit,
const CaloTower rh,
bool &  clean 
)
inlineoverridevirtual

Implements PFRecHitQTestBase.

Definition at line 150 of file PFRecHitQTests.h.

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

Implements PFRecHitQTestBase.

Definition at line 152 of file PFRecHitQTests.h.

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

Definition at line 163 of file PFRecHitQTests.h.

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

163  {
164  HcalDetId detid = (HcalDetId)aDETID;
165  if (theHcalTopology_->getMergePositionFlag() and detid.subdet() == HcalEndcap) {
166  detid = theHcalTopology_->idFront(detid);
167  }
168 
169  const HcalChannelStatus* theStatus = theHcalChStatus_->getValues(detid);
170  unsigned theStatusValue = theStatus->getValue();
171  // Now get severity of problems for the given detID, based on the rechit flag word and the channel quality status value
172  for (unsigned int i = 0; i < thresholds_.size(); ++i) {
173  int hitSeverity = 0;
174  if (energy < cleanThresholds_[i])
175  continue;
176 
177  if (flags_[i] < 0) {
178  hitSeverity = hcalSevLvlComputer_->getSeverityLevel(detid, flags, theStatusValue);
179  } else {
180  hitSeverity = hcalSevLvlComputer_->getSeverityLevel(detid, flags & flags_[i], theStatusValue);
181  }
182 
183  if (hitSeverity > thresholds_[i] and ((depths_[i] < 0 or (depths_[i] == detid.depth())))) {
184  clean = true;
185  return false;
186  }
187  }
188  return true;
189  }
const HcalChannelQuality * theHcalChStatus_
HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:138
std::vector< int > depths_
const HcalSeverityLevelComputer * hcalSevLvlComputer_
const Item * getValues(DetId fId, bool throwOnFail=true) const
std::vector< double > cleanThresholds_
bool getMergePositionFlag() const
Definition: HcalTopology.h:167
const HcalTopology * theHcalTopology_
static void clean(char *s)
int depth() const
get the tower depth
Definition: HcalDetId.h:164
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
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
std::vector< int > flags_

Member Data Documentation

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

Definition at line 156 of file PFRecHitQTests.h.

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

Definition at line 158 of file PFRecHitQTests.h.

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

Definition at line 157 of file PFRecHitQTests.h.

const HcalSeverityLevelComputer* PFRecHitQTestHCALChannel::hcalSevLvlComputer_
protected

Definition at line 161 of file PFRecHitQTests.h.

const HcalChannelQuality* PFRecHitQTestHCALChannel::theHcalChStatus_
protected

Definition at line 160 of file PFRecHitQTests.h.

const HcalTopology* PFRecHitQTestHCALChannel::theHcalTopology_
protected

Definition at line 159 of file PFRecHitQTests.h.

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

Definition at line 155 of file PFRecHitQTests.h.