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

Constructor & Destructor Documentation

◆ PFRecHitQTestHCALChannel() [1/2]

PFRecHitQTestHCALChannel::PFRecHitQTestHCALChannel ( )
inline

Definition at line 91 of file PFRecHitQTests.h.

91 {}

◆ PFRecHitQTestHCALChannel() [2/2]

PFRecHitQTestHCALChannel::PFRecHitQTestHCALChannel ( const edm::ParameterSet iConfig)
inline

Definition at line 93 of file PFRecHitQTests.h.

93  : PFRecHitQTestBase(iConfig) {
94  thresholds_ = iConfig.getParameter<std::vector<int> >("maxSeverities");
95  cleanThresholds_ = iConfig.getParameter<std::vector<double> >("cleaningThresholds");
96  std::vector<std::string> flags = iConfig.getParameter<std::vector<std::string> >("flags");
97  for (auto& flag : flags) {
98  if (flag == "Standard") {
99  flags_.push_back(-1);
100  depths_.push_back(-1);
101  } else if (flag == "HFInTime") {
103  depths_.push_back(-1);
104  } else if (flag == "HFDigi") {
105  flags_.push_back(1 << HcalCaloFlagLabels::HFDigiTime);
106  depths_.push_back(-1);
107  } else if (flag == "HFLong") {
108  flags_.push_back(1 << HcalCaloFlagLabels::HFLongShort);
109  depths_.push_back(1);
110  } else if (flag == "HFShort") {
111  flags_.push_back(1 << HcalCaloFlagLabels::HFLongShort);
112  depths_.push_back(2);
113  } else {
114  flags_.push_back(-1);
115  depths_.push_back(-1);
116  }
117  }
118  }

References cleanThresholds_, depths_, RemoveAddSevLevel::flag, HLT_FULL_cff::flags, flags_, edm::ParameterSet::getParameter(), HcalCaloFlagLabels::HFDigiTime, HcalCaloFlagLabels::HFInTimeWindow, HcalCaloFlagLabels::HFLongShort, and thresholds_.

Member Function Documentation

◆ beginEvent()

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

Implements PFRecHitQTestBase.

Definition at line 120 of file PFRecHitQTests.h.

120  {
122  iSetup.get<HcalRecNumberingRecord>().get(topo);
123  theHcalTopology_ = topo.product();
125  iSetup.get<HcalChannelQualityRcd>().get("withTopo", hcalChStatus);
126  theHcalChStatus_ = hcalChStatus.product();
127  edm::ESHandle<HcalSeverityLevelComputer> hcalSevLvlComputerHndl;
128  iSetup.get<HcalSeverityLevelComputerRcd>().get(hcalSevLvlComputerHndl);
129  hcalSevLvlComputer_ = hcalSevLvlComputerHndl.product();
130  }

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

◆ test() [1/7]

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

Implements PFRecHitQTestBase.

Definition at line 144 of file PFRecHitQTests.h.

144 { return true; }

◆ test() [2/7]

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

Implements PFRecHitQTestBase.

Definition at line 132 of file PFRecHitQTests.h.

132 { 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 133 of file PFRecHitQTests.h.

133  {
134  return test(rh.detid(), rh.energy(), rh.flags(), clean);
135  }

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 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() [5/7]

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

Implements PFRecHitQTestBase.

Definition at line 146 of file PFRecHitQTests.h.

146 { return true; }

◆ test() [6/7]

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

Implements PFRecHitQTestBase.

Definition at line 140 of file PFRecHitQTests.h.

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

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

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

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

Referenced by PFRecHitQTestHCALChannel(), and test().

◆ depths_

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

Definition at line 152 of file PFRecHitQTests.h.

Referenced by PFRecHitQTestHCALChannel(), and test().

◆ flags_

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

Definition at line 151 of file PFRecHitQTests.h.

Referenced by PFRecHitQTestHCALChannel(), and test().

◆ hcalSevLvlComputer_

const HcalSeverityLevelComputer* PFRecHitQTestHCALChannel::hcalSevLvlComputer_
protected

Definition at line 155 of file PFRecHitQTests.h.

Referenced by beginEvent(), and test().

◆ theHcalChStatus_

const HcalChannelQuality* PFRecHitQTestHCALChannel::theHcalChStatus_
protected

Definition at line 154 of file PFRecHitQTests.h.

Referenced by beginEvent(), and test().

◆ theHcalTopology_

const HcalTopology* PFRecHitQTestHCALChannel::theHcalTopology_
protected

Definition at line 153 of file PFRecHitQTests.h.

Referenced by beginEvent(), and test().

◆ thresholds_

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

Definition at line 149 of file PFRecHitQTests.h.

Referenced by PFRecHitQTestHCALChannel(), and test().

edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
mps_fire.i
i
Definition: mps_fire.py:428
HcalTopology::idFront
HcalDetId idFront(const HcalDetId &id) const
Definition: HcalTopology.h:170
CaloRecHit::energy
constexpr float energy() const
Definition: CaloRecHit.h:29
HcalChannelQualityRcd
Definition: HcalChannelQualityRcd.h:8
PFRecHitQTestHCALChannel::cleanThresholds_
std::vector< double > cleanThresholds_
Definition: PFRecHitQTests.h:150
PFRecHitQTestHCALChannel::theHcalTopology_
const HcalTopology * theHcalTopology_
Definition: PFRecHitQTests.h:153
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:152
edm::EventSetup::get
T get() const
Definition: EventSetup.h:80
HcalChannelStatus
Definition: HcalChannelStatus.h:13
HcalCaloFlagLabels::HFDigiTime
Definition: HcalCaloFlagLabels.h:38
edm::ESHandle< HcalTopology >
HCALHighEnergyHPDFilter_cfi.energy
energy
Definition: HCALHighEnergyHPDFilter_cfi.py:5
HcalRecNumberingRecord
Definition: HcalRecNumberingRecord.h:23
PFRecHitQTestHCALChannel::test
bool test(reco::PFRecHit &hit, const EcalRecHit &rh, bool &clean, bool fullReadOut) override
Definition: PFRecHitQTests.h:132
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
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:149
PFRecHitQTestBase::PFRecHitQTestBase
PFRecHitQTestBase()=default
get
#define get
HcalCaloFlagLabels::HFInTimeWindow
Definition: HcalCaloFlagLabels.h:39
HcalEndcap
Definition: HcalAssistant.h:34
PFRecHitQTestHCALChannel::flags_
std::vector< int > flags_
Definition: PFRecHitQTests.h:151
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:154
HcalCaloFlagLabels::HFLongShort
Definition: HcalCaloFlagLabels.h:37
HLT_FULL_cff.flags
flags
Definition: HLT_FULL_cff.py:13150
HcalSeverityLevelComputerRcd
Definition: HcalSeverityLevelComputerRcd.h:23
CaloRecHit::flags
constexpr uint32_t flags() const
Definition: CaloRecHit.h:34
RemoveAddSevLevel.flag
flag
Definition: RemoveAddSevLevel.py:116
PFRecHitQTestHCALChannel::hcalSevLvlComputer_
const HcalSeverityLevelComputer * hcalSevLvlComputer_
Definition: PFRecHitQTests.h:155