CMS 3D CMS Logo

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

#include <PFRecHitQTests.h>

Inheritance diagram for PFRecHitQTestHCALThresholdVsDepth:
PFRecHitQTestBase

Public Member Functions

void beginEvent (const edm::Event &event, const edm::EventSetup &iSetup) override
 
 PFRecHitQTestHCALThresholdVsDepth ()
 
 PFRecHitQTestHCALThresholdVsDepth (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, double time, bool &clean)
 

Protected Attributes

std::vector< std::vector< int > > depths_
 
std::vector< int > detector_
 
HcalPFCuts const * paramPF = nullptr
 
std::vector< edm::ParameterSetpsets_
 
std::vector< std::vector< double > > thresholds_
 

Private Attributes

bool cutsFromDB
 
edm::ESGetToken< HcalPFCuts, HcalPFCutsRcdhcalCutsToken_
 
edm::ESGetToken< HcalTopology, HcalRecNumberingRecordhtopoToken_
 

Detailed Description

Definition at line 258 of file PFRecHitQTests.h.

Constructor & Destructor Documentation

◆ PFRecHitQTestHCALThresholdVsDepth() [1/2]

PFRecHitQTestHCALThresholdVsDepth::PFRecHitQTestHCALThresholdVsDepth ( )
inline

Definition at line 260 of file PFRecHitQTests.h.

260 {}

◆ PFRecHitQTestHCALThresholdVsDepth() [2/2]

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

Definition at line 262 of file PFRecHitQTests.h.

References gpuPixelDoublets::cc, cutsFromDB, depths_, detector_, Exception, hcalCutsToken_, muonDTDigis_cfi::pset, psets_, and thresholds_.

263  : PFRecHitQTestBase(iConfig, cc),
264  psets_(iConfig.getParameter<std::vector<edm::ParameterSet>>("cuts")),
265  cutsFromDB(iConfig.getParameter<bool>("usePFThresholdsFromDB")) {
266  if (cutsFromDB) {
267  hcalCutsToken_ = cc.esConsumes<HcalPFCuts, HcalPFCutsRcd>(edm::ESInputTag("", "withTopo"));
268  }
269  for (auto& pset : psets_) {
270  depths_.push_back(pset.getParameter<std::vector<int>>("depth"));
271  thresholds_.push_back(pset.getParameter<std::vector<double>>("threshold"));
272  detector_.push_back(pset.getParameter<int>("detectorEnum"));
273  if (thresholds_[thresholds_.size() - 1].size() != depths_[depths_.size() - 1].size()) {
274  throw cms::Exception("InvalidPFRecHitThreshold") << "PFRecHitThreshold mismatch with the numbers of depths";
275  }
276  }
277  }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
uint32_t cc[maxCellsPerHit]
Definition: gpuFishbone.h:49
PFRecHitQTestBase()=default
edm::ESGetToken< HcalPFCuts, HcalPFCutsRcd > hcalCutsToken_
std::vector< edm::ParameterSet > psets_
std::vector< std::vector< double > > thresholds_
std::vector< std::vector< int > > depths_

Member Function Documentation

◆ beginEvent()

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

Implements PFRecHitQTestBase.

Definition at line 279 of file PFRecHitQTests.h.

References cutsFromDB, edm::EventSetup::getData(), hcalCutsToken_, and paramPF.

279  {
280  if (cutsFromDB) {
281  paramPF = &iSetup.getData(hcalCutsToken_);
282  }
283  }
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
edm::ESGetToken< HcalPFCuts, HcalPFCutsRcd > hcalCutsToken_

◆ test() [1/7]

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

Implements PFRecHitQTestBase.

Definition at line 285 of file PFRecHitQTests.h.

Referenced by test().

285 { return true; }

◆ test() [2/7]

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

Implements PFRecHitQTestBase.

Definition at line 286 of file PFRecHitQTests.h.

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

286  {
287  return test(rh.detid(), rh.energy(), rh.time(), clean);
288  }
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 float time() const
Definition: CaloRecHit.h:31

◆ test() [3/7]

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

Implements PFRecHitQTestBase.

Definition at line 290 of file PFRecHitQTests.h.

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

290  {
291  return test(rh.detid(), rh.energy(), rh.time(), clean);
292  }
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 float time() const
Definition: CaloRecHit.h:31

◆ test() [4/7]

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

Implements PFRecHitQTestBase.

Definition at line 293 of file PFRecHitQTests.h.

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

293  {
294  return test(rh.detid(), rh.energy(), rh.time(), clean);
295  }
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 float time() const
Definition: CaloRecHit.h:31

◆ test() [5/7]

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

Implements PFRecHitQTestBase.

Definition at line 297 of file PFRecHitQTests.h.

297 { return true; }

◆ test() [6/7]

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

Implements PFRecHitQTestBase.

Definition at line 299 of file PFRecHitQTests.h.

299 { return true; }

◆ test() [7/7]

bool PFRecHitQTestHCALThresholdVsDepth::test ( unsigned  aDETID,
double  energy,
double  time,
bool &  clean 
)
inlineprotected

Definition at line 308 of file PFRecHitQTests.h.

References clean(), cutsFromDB, ztail::d, HcalDetId::depth(), depths_, detector_, hcalRecHitTable_cff::energy, HcalCondObjectContainer< Item >::getValues(), mps_fire::i, B2GTnPMonitor_cfi::item, paramPF, DetId::rawId(), HcalDetId::subdet(), and thresholds_.

308  {
309  HcalDetId detid(aDETID);
310  const HcalPFCut* item = nullptr;
311  if (cutsFromDB) {
312  item = paramPF->getValues(detid.rawId());
313  }
314 
315  for (unsigned int d = 0; d < detector_.size(); ++d) {
316  if (detid.subdet() != detector_[d])
317  continue;
318  for (unsigned int i = 0; i < thresholds_[d].size(); ++i) {
319  if (detid.depth() == depths_[d][i]) {
320  float thres = cutsFromDB ? item->noiseThreshold() : thresholds_[d][i];
321  if (energy < thres) {
322  clean = false;
323  return false;
324  }
325  break;
326  }
327  }
328  }
329  return true;
330  }
const Item * getValues(DetId fId, bool throwOnFail=true) const
static void clean(char *s)
d
Definition: ztail.py:151
std::vector< std::vector< double > > thresholds_
std::vector< std::vector< int > > depths_

Member Data Documentation

◆ cutsFromDB

bool PFRecHitQTestHCALThresholdVsDepth::cutsFromDB
private

Definition at line 335 of file PFRecHitQTests.h.

Referenced by beginEvent(), PFRecHitQTestHCALThresholdVsDepth(), and test().

◆ depths_

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

Definition at line 303 of file PFRecHitQTests.h.

Referenced by PFRecHitQTestHCALThresholdVsDepth(), and test().

◆ detector_

std::vector<int> PFRecHitQTestHCALThresholdVsDepth::detector_
protected

Definition at line 305 of file PFRecHitQTests.h.

Referenced by PFRecHitQTestHCALThresholdVsDepth(), and test().

◆ hcalCutsToken_

edm::ESGetToken<HcalPFCuts, HcalPFCutsRcd> PFRecHitQTestHCALThresholdVsDepth::hcalCutsToken_
private

Definition at line 334 of file PFRecHitQTests.h.

Referenced by beginEvent(), and PFRecHitQTestHCALThresholdVsDepth().

◆ htopoToken_

edm::ESGetToken<HcalTopology, HcalRecNumberingRecord> PFRecHitQTestHCALThresholdVsDepth::htopoToken_
private

Definition at line 333 of file PFRecHitQTests.h.

◆ paramPF

HcalPFCuts const* PFRecHitQTestHCALThresholdVsDepth::paramPF = nullptr
protected

Definition at line 306 of file PFRecHitQTests.h.

Referenced by beginEvent(), and test().

◆ psets_

std::vector<edm::ParameterSet> PFRecHitQTestHCALThresholdVsDepth::psets_
protected

Definition at line 302 of file PFRecHitQTests.h.

Referenced by PFRecHitQTestHCALThresholdVsDepth().

◆ thresholds_

std::vector<std::vector<double> > PFRecHitQTestHCALThresholdVsDepth::thresholds_
protected

Definition at line 304 of file PFRecHitQTests.h.

Referenced by PFRecHitQTestHCALThresholdVsDepth(), and test().