CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Protected Attributes | Private 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, edm::ConsumesCollector &cc)
 
bool test (reco::PFRecHit &hit, const CaloTower &rh, bool &clean) override
 
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 HGCRecHit &rh, bool &clean) override
 
bool test (reco::PFRecHit &hit, const HORecHit &rh, bool &clean) override
 
- Public Member Functions inherited from PFRecHitQTestBase
 PFRecHitQTestBase ()=default
 
 PFRecHitQTestBase (const edm::ParameterSet &iConfig, edm::ConsumesCollector &cc)
 
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_
 
std::vector< std::string > flagStr_
 
const HcalSeverityLevelComputerhcalSevLvlComputer_
 
const HcalChannelQualitytheHcalChStatus_
 
const HcalTopologytheHcalTopology_
 
std::vector< int > thresholds_
 

Private Attributes

edm::ESGetToken< HcalChannelQuality, HcalChannelQualityRcdqualityToken_
 
edm::ESGetToken< HcalSeverityLevelComputer, HcalSeverityLevelComputerRcdseverityToken_
 
edm::ESGetToken< HcalTopology, HcalRecNumberingRecordtopoToken_
 

Detailed Description

Definition at line 92 of file PFRecHitQTests.h.

Constructor & Destructor Documentation

◆ PFRecHitQTestHCALChannel() [1/2]

PFRecHitQTestHCALChannel::PFRecHitQTestHCALChannel ( )
inline

Definition at line 94 of file PFRecHitQTests.h.

94 {}

◆ PFRecHitQTestHCALChannel() [2/2]

PFRecHitQTestHCALChannel::PFRecHitQTestHCALChannel ( const edm::ParameterSet iConfig,
edm::ConsumesCollector cc 
)
inline

Definition at line 96 of file PFRecHitQTests.h.

97  : PFRecHitQTestBase(iConfig, cc),
98  flagStr_(iConfig.getParameter<std::vector<std::string> >("flags")),
99  thresholds_(iConfig.getParameter<std::vector<int> >("maxSeverities")),
100  cleanThresholds_(iConfig.getParameter<std::vector<double> >("cleaningThresholds")),
101  topoToken_(cc.esConsumes()),
102  qualityToken_(cc.esConsumes(edm::ESInputTag("", "withTopo"))),
103  severityToken_(cc.esConsumes()) {
104  for (auto& flag : flagStr_) {
105  if (flag == "Standard") {
106  flags_.push_back(-1);
107  depths_.push_back(-1);
108  } else if (flag == "HFInTime") {
110  depths_.push_back(-1);
111  } else if (flag == "HFDigi") {
112  flags_.push_back(1 << HcalCaloFlagLabels::HFDigiTime);
113  depths_.push_back(-1);
114  } else if (flag == "HFLong") {
115  flags_.push_back(1 << HcalCaloFlagLabels::HFLongShort);
116  depths_.push_back(1);
117  } else if (flag == "HFShort") {
118  flags_.push_back(1 << HcalCaloFlagLabels::HFLongShort);
119  depths_.push_back(2);
120  } else if (flag == "HFSignalAsymmetry") {
122  depths_.push_back(-1);
123  } else {
124  flags_.push_back(-1);
125  depths_.push_back(-1);
126  }
127  }
128  }

References depths_, RemoveAddSevLevel::flag, flags_, flagStr_, HcalCaloFlagLabels::HFDigiTime, HcalCaloFlagLabels::HFInTimeWindow, HcalCaloFlagLabels::HFLongShort, and HcalPhase1FlagLabels::HFSignalAsymmetry.

Member Function Documentation

◆ beginEvent()

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

◆ test() [1/7]

bool PFRecHitQTestHCALChannel::test ( reco::PFRecHit hit,
const CaloTower rh,
bool &  clean 
)
inlineoverridevirtual

Implements PFRecHitQTestBase.

Definition at line 148 of file PFRecHitQTests.h.

148 { return true; }

◆ test() [2/7]

bool PFRecHitQTestHCALChannel::test ( reco::PFRecHit hit,
const EcalRecHit rh,
bool &  clean,
bool  fullReadOut 
)
inlineoverridevirtual

Implements PFRecHitQTestBase.

Definition at line 136 of file PFRecHitQTests.h.

136 { return true; }

Referenced by test().

◆ test() [3/7]

bool PFRecHitQTestHCALChannel::test ( reco::PFRecHit hit,
const HBHERecHit rh,
bool &  clean 
)
inlineoverridevirtual

Implements PFRecHitQTestBase.

Definition at line 137 of file PFRecHitQTests.h.

137  {
138  return test(rh.detid(), rh.energy(), rh.flags(), clean);
139  }

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

◆ test() [4/7]

bool PFRecHitQTestHCALChannel::test ( reco::PFRecHit hit,
const HFRecHit rh,
bool &  clean 
)
inlineoverridevirtual

Implements PFRecHitQTestBase.

Definition at line 141 of file PFRecHitQTests.h.

141  {
142  return test(rh.detid(), rh.energy(), rh.flags(), clean);
143  }

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

◆ test() [5/7]

bool PFRecHitQTestHCALChannel::test ( reco::PFRecHit hit,
const HGCRecHit rh,
bool &  clean 
)
inlineoverridevirtual

Implements PFRecHitQTestBase.

Definition at line 150 of file PFRecHitQTests.h.

150 { return true; }

◆ test() [6/7]

bool PFRecHitQTestHCALChannel::test ( reco::PFRecHit hit,
const HORecHit rh,
bool &  clean 
)
inlineoverridevirtual

Implements PFRecHitQTestBase.

Definition at line 144 of file PFRecHitQTests.h.

144  {
145  return test(rh.detid(), rh.energy(), rh.flags(), clean);
146  }

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

◆ test() [7/7]

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

Definition at line 162 of file PFRecHitQTests.h.

162  {
163  HcalDetId detid = (HcalDetId)aDETID;
164  if (theHcalTopology_->getMergePositionFlag() and detid.subdet() == HcalEndcap) {
165  detid = theHcalTopology_->idFront(detid);
166  }
167 
168  const HcalChannelStatus* theStatus = theHcalChStatus_->getValues(detid);
169  unsigned theStatusValue = theStatus->getValue();
170  // Now get severity of problems for the given detID, based on the rechit flag word and the channel quality status value
171  for (unsigned int i = 0; i < thresholds_.size(); ++i) {
172  int hitSeverity = 0;
173  if (energy < cleanThresholds_[i])
174  continue;
175 
176  if (flags_[i] < 0) {
177  hitSeverity = hcalSevLvlComputer_->getSeverityLevel(detid, flags, theStatusValue);
178  } else {
179  hitSeverity = hcalSevLvlComputer_->getSeverityLevel(detid, flags & flags_[i], theStatusValue);
180  }
181 
182  if (hitSeverity > thresholds_[i] and ((depths_[i] < 0 or (depths_[i] == detid.depth())))) {
183  clean = true;
184  return false;
185  }
186  }
187  return true;
188  }

References clean(), cleanThresholds_, HcalDetId::depth(), depths_, HCALHighEnergyHPDFilter_cfi::energy, HLT_FULL_cff::flags, flags_, HcalTopology::getMergePositionFlag(), HcalSeverityLevelComputer::getSeverityLevel(), HcalChannelStatus::getValue(), HcalCondObjectContainer< Item >::getValues(), HcalEndcap, hcalSevLvlComputer_, mps_fire::i, HcalTopology::idFront(), or, HcalDetId::subdet(), theHcalChStatus_, theHcalTopology_, and thresholds_.

Member Data Documentation

◆ cleanThresholds_

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

Definition at line 155 of file PFRecHitQTests.h.

Referenced by test().

◆ depths_

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

Definition at line 157 of file PFRecHitQTests.h.

Referenced by PFRecHitQTestHCALChannel(), and test().

◆ flags_

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

Definition at line 156 of file PFRecHitQTests.h.

Referenced by PFRecHitQTestHCALChannel(), and test().

◆ flagStr_

std::vector<std::string> PFRecHitQTestHCALChannel::flagStr_
protected

Definition at line 153 of file PFRecHitQTests.h.

Referenced by PFRecHitQTestHCALChannel().

◆ hcalSevLvlComputer_

const HcalSeverityLevelComputer* PFRecHitQTestHCALChannel::hcalSevLvlComputer_
protected

Definition at line 160 of file PFRecHitQTests.h.

Referenced by beginEvent(), and test().

◆ qualityToken_

edm::ESGetToken<HcalChannelQuality, HcalChannelQualityRcd> PFRecHitQTestHCALChannel::qualityToken_
private

Definition at line 192 of file PFRecHitQTests.h.

Referenced by beginEvent().

◆ severityToken_

edm::ESGetToken<HcalSeverityLevelComputer, HcalSeverityLevelComputerRcd> PFRecHitQTestHCALChannel::severityToken_
private

Definition at line 193 of file PFRecHitQTests.h.

Referenced by beginEvent().

◆ theHcalChStatus_

const HcalChannelQuality* PFRecHitQTestHCALChannel::theHcalChStatus_
protected

Definition at line 159 of file PFRecHitQTests.h.

Referenced by beginEvent(), and test().

◆ theHcalTopology_

const HcalTopology* PFRecHitQTestHCALChannel::theHcalTopology_
protected

Definition at line 158 of file PFRecHitQTests.h.

Referenced by beginEvent(), and test().

◆ thresholds_

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

Definition at line 154 of file PFRecHitQTests.h.

Referenced by test().

◆ topoToken_

edm::ESGetToken<HcalTopology, HcalRecNumberingRecord> PFRecHitQTestHCALChannel::topoToken_
private

Definition at line 191 of file PFRecHitQTests.h.

Referenced by beginEvent().

mps_fire.i
i
Definition: mps_fire.py:428
edm::ESInputTag
Definition: ESInputTag.h:87
HcalTopology::idFront
HcalDetId idFront(const HcalDetId &id) const
Definition: HcalTopology.h:170
CaloRecHit::energy
constexpr float energy() const
Definition: CaloRecHit.h:29
PFRecHitQTestHCALChannel::cleanThresholds_
std::vector< double > cleanThresholds_
Definition: PFRecHitQTests.h:155
PFRecHitQTestHCALChannel::theHcalTopology_
const HcalTopology * theHcalTopology_
Definition: PFRecHitQTests.h:158
HcalDetId::depth
constexpr int depth() const
get the tower depth
Definition: HcalDetId.h:164
CaloRecHit::detid
constexpr const DetId & detid() const
Definition: CaloRecHit.h:33
HcalTopology::getMergePositionFlag
bool getMergePositionFlag() const
Definition: HcalTopology.h:167
HcalCondObjectContainer::getValues
const Item * getValues(DetId fId, bool throwOnFail=true) const
Definition: HcalCondObjectContainer.h:159
PFRecHitQTestHCALChannel::depths_
std::vector< int > depths_
Definition: PFRecHitQTests.h:157
HcalChannelStatus
Definition: HcalChannelStatus.h:13
HcalCaloFlagLabels::HFDigiTime
Definition: HcalCaloFlagLabels.h:38
PFRecHitQTestHCALChannel::topoToken_
edm::ESGetToken< HcalTopology, HcalRecNumberingRecord > topoToken_
Definition: PFRecHitQTests.h:191
HCALHighEnergyHPDFilter_cfi.energy
energy
Definition: HCALHighEnergyHPDFilter_cfi.py:5
PFRecHitQTestHCALChannel::test
bool test(reco::PFRecHit &hit, const EcalRecHit &rh, bool &clean, bool fullReadOut) override
Definition: PFRecHitQTests.h:136
HcalSeverityLevelComputer::getSeverityLevel
int getSeverityLevel(const DetId &myid, const uint32_t &myflag, const uint32_t &mystatus) const
Definition: HcalSeverityLevelComputer.cc:304
HcalChannelStatus::getValue
uint32_t getValue() const
Definition: HcalChannelStatus.h:60
HcalPhase1FlagLabels::HFSignalAsymmetry
Definition: HcalPhase1FlagLabels.h:22
HcalDetId::subdet
constexpr HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:138
HcalDetId
Definition: HcalDetId.h:12
PFRecHitQTestHCALChannel::thresholds_
std::vector< int > thresholds_
Definition: PFRecHitQTests.h:154
PFRecHitQTestBase::PFRecHitQTestBase
PFRecHitQTestBase()=default
cc
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition: EventSetup.h:127
HcalCaloFlagLabels::HFInTimeWindow
Definition: HcalCaloFlagLabels.h:39
PFRecHitQTestHCALChannel::qualityToken_
edm::ESGetToken< HcalChannelQuality, HcalChannelQualityRcd > qualityToken_
Definition: PFRecHitQTests.h:192
HcalEndcap
Definition: HcalAssistant.h:34
PFRecHitQTestHCALChannel::flags_
std::vector< int > flags_
Definition: PFRecHitQTests.h:156
clean
static void clean(char *s)
Definition: ConnectionManager.cc:13
or
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
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
PFRecHitQTestHCALChannel::theHcalChStatus_
const HcalChannelQuality * theHcalChStatus_
Definition: PFRecHitQTests.h:159
HcalCaloFlagLabels::HFLongShort
Definition: HcalCaloFlagLabels.h:37
PFRecHitQTestHCALChannel::severityToken_
edm::ESGetToken< HcalSeverityLevelComputer, HcalSeverityLevelComputerRcd > severityToken_
Definition: PFRecHitQTests.h:193
HLT_FULL_cff.flags
flags
Definition: HLT_FULL_cff.py:13168
CaloRecHit::flags
constexpr uint32_t flags() const
Definition: CaloRecHit.h:34
RemoveAddSevLevel.flag
flag
Definition: RemoveAddSevLevel.py:117
PFRecHitQTestHCALChannel::hcalSevLvlComputer_
const HcalSeverityLevelComputer * hcalSevLvlComputer_
Definition: PFRecHitQTests.h:160
PFRecHitQTestHCALChannel::flagStr_
std::vector< std::string > flagStr_
Definition: PFRecHitQTests.h:153