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

Constructor & Destructor Documentation

◆ PFRecHitQTestHCALChannel() [1/2]

PFRecHitQTestHCALChannel::PFRecHitQTestHCALChannel ( )
inline

Definition at line 96 of file PFRecHitQTests.h.

96 {}

◆ PFRecHitQTestHCALChannel() [2/2]

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

Definition at line 98 of file PFRecHitQTests.h.

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

99  : PFRecHitQTestBase(iConfig, cc),
100  flagStr_(iConfig.getParameter<std::vector<std::string>>("flags")),
101  thresholds_(iConfig.getParameter<std::vector<int>>("maxSeverities")),
102  cleanThresholds_(iConfig.getParameter<std::vector<double>>("cleaningThresholds")),
103  topoToken_(cc.esConsumes()),
104  qualityToken_(cc.esConsumes(edm::ESInputTag("", "withTopo"))),
105  severityToken_(cc.esConsumes()) {
106  for (auto& flag : flagStr_) {
107  if (flag == "Standard") {
108  flags_.push_back(-1);
109  depths_.push_back(-1);
110  } else if (flag == "HFInTime") {
112  depths_.push_back(-1);
113  } else if (flag == "HFDigi") {
114  flags_.push_back(1 << HcalCaloFlagLabels::HFDigiTime);
115  depths_.push_back(-1);
116  } else if (flag == "HFLong") {
117  flags_.push_back(1 << HcalCaloFlagLabels::HFLongShort);
118  depths_.push_back(1);
119  } else if (flag == "HFShort") {
120  flags_.push_back(1 << HcalCaloFlagLabels::HFLongShort);
121  depths_.push_back(2);
122  } else if (flag == "HFSignalAsymmetry") {
124  depths_.push_back(-1);
125  } else {
126  flags_.push_back(-1);
127  depths_.push_back(-1);
128  }
129  }
130  }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
edm::ESGetToken< HcalSeverityLevelComputer, HcalSeverityLevelComputerRcd > severityToken_
uint32_t cc[maxCellsPerHit]
Definition: gpuFishbone.h:49
std::vector< int > depths_
edm::ESGetToken< HcalTopology, HcalRecNumberingRecord > topoToken_
std::vector< double > cleanThresholds_
edm::ESGetToken< HcalChannelQuality, HcalChannelQualityRcd > qualityToken_
PFRecHitQTestBase()=default
std::vector< std::string > flagStr_
std::vector< int > thresholds_
std::vector< int > flags_

Member Function Documentation

◆ beginEvent()

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

Implements PFRecHitQTestBase.

Definition at line 132 of file PFRecHitQTests.h.

References edm::EventSetup::getData(), hcalSevLvlComputer_, qualityToken_, severityToken_, theHcalChStatus_, theHcalTopology_, and topoToken_.

132  {
136  }
const HcalChannelQuality * theHcalChStatus_
edm::ESGetToken< HcalSeverityLevelComputer, HcalSeverityLevelComputerRcd > severityToken_
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
const HcalSeverityLevelComputer * hcalSevLvlComputer_
edm::ESGetToken< HcalTopology, HcalRecNumberingRecord > topoToken_
const HcalTopology * theHcalTopology_
edm::ESGetToken< HcalChannelQuality, HcalChannelQualityRcd > qualityToken_

◆ test() [1/7]

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

Implements PFRecHitQTestBase.

Definition at line 138 of file PFRecHitQTests.h.

Referenced by test().

138 { return true; }

◆ test() [2/7]

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 test().

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

◆ test() [3/7]

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 test().

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

◆ test() [4/7]

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 test().

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

◆ test() [5/7]

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; }

◆ test() [6/7]

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; }

◆ test() [7/7]

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

Definition at line 164 of file PFRecHitQTests.h.

References clean(), cleanThresholds_, HcalDetId::depth(), depths_, hcalRecHitTable_cff::energy, HLT_2024v14_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_.

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

Member Data Documentation

◆ cleanThresholds_

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

Definition at line 157 of file PFRecHitQTests.h.

Referenced by test().

◆ depths_

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

Definition at line 159 of file PFRecHitQTests.h.

Referenced by PFRecHitQTestHCALChannel(), and test().

◆ flags_

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

Definition at line 158 of file PFRecHitQTests.h.

Referenced by PFRecHitQTestHCALChannel(), and test().

◆ flagStr_

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

Definition at line 155 of file PFRecHitQTests.h.

Referenced by PFRecHitQTestHCALChannel().

◆ hcalSevLvlComputer_

const HcalSeverityLevelComputer* PFRecHitQTestHCALChannel::hcalSevLvlComputer_
protected

Definition at line 162 of file PFRecHitQTests.h.

Referenced by beginEvent(), and test().

◆ qualityToken_

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

Definition at line 194 of file PFRecHitQTests.h.

Referenced by beginEvent().

◆ severityToken_

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

Definition at line 195 of file PFRecHitQTests.h.

Referenced by beginEvent().

◆ theHcalChStatus_

const HcalChannelQuality* PFRecHitQTestHCALChannel::theHcalChStatus_
protected

Definition at line 161 of file PFRecHitQTests.h.

Referenced by beginEvent(), and test().

◆ theHcalTopology_

const HcalTopology* PFRecHitQTestHCALChannel::theHcalTopology_
protected

Definition at line 160 of file PFRecHitQTests.h.

Referenced by beginEvent(), and test().

◆ thresholds_

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

Definition at line 156 of file PFRecHitQTests.h.

Referenced by test().

◆ topoToken_

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

Definition at line 193 of file PFRecHitQTests.h.

Referenced by beginEvent().