CMS 3D CMS Logo

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

#include <HBHEIsolatedNoiseAlgos.h>

Inheritance diagram for ObjectValidator:
ObjectValidatorAbs

Public Member Functions

 ObjectValidator (const edm::ParameterSet &)
 
 ObjectValidator (double HBThreshold, double HESThreshold, double HEDThreshold, double EBThreshold, double EEThreshold, uint32_t HcalAcceptSeverityLevel, uint32_t EcalAcceptSeverityLevel, bool UseHcalRecoveredHits, bool UseEcalRecoveredHits, double MinValidTrackPt, double MinValidTrackPtBarrel, int MinValidTrackNHits)
 
void setEBRecHitCollection (const EcalRecHitCollection *q)
 
void setEcalChannelStatus (const EcalChannelStatus *q)
 
void setEcalSeverityLevelAlgo (const EcalSeverityLevelAlgo *q)
 
void setEERecHitCollection (const EcalRecHitCollection *q)
 
void setHcalChannelQuality (const HcalChannelQuality *q)
 
void setHcalSeverityLevelComputer (const HcalSeverityLevelComputer *q)
 
bool validHit (const EcalRecHit &) const override
 
bool validHit (const HBHERecHit &) const override
 
bool validTrack (const reco::Track &) const override
 
 ~ObjectValidator () override
 
- Public Member Functions inherited from ObjectValidatorAbs
 ObjectValidatorAbs ()
 
virtual ~ObjectValidatorAbs ()
 

Private Attributes

double EBThreshold_
 
uint32_t EcalAcceptSeverityLevel_
 
double EEThreshold_
 
double HBThreshold_
 
uint32_t HcalAcceptSeverityLevel_
 
double HEDThreshold_
 
double HESThreshold_
 
int MinValidTrackNHits_
 
double MinValidTrackPt_
 
double MinValidTrackPtBarrel_
 
const EcalRecHitCollectiontheEBRecHitCollection_
 
const EcalChannelStatustheEcalChStatus_
 
const EcalSeverityLevelAlgotheEcalSevLvlAlgo_
 
const EcalRecHitCollectiontheEERecHitCollection_
 
const HcalChannelQualitytheHcalChStatus_
 
const HcalSeverityLevelComputertheHcalSevLvlComputer_
 
bool UseAllCombinedRechits_
 
bool UseEcalRecoveredHits_
 
bool UseHcalRecoveredHits_
 

Detailed Description

Definition at line 70 of file HBHEIsolatedNoiseAlgos.h.

Constructor & Destructor Documentation

◆ ObjectValidator() [1/2]

ObjectValidator::ObjectValidator ( const edm::ParameterSet iConfig)
explicit

Definition at line 43 of file HBHEIsolatedNoiseAlgos.cc.

43  {
44  HBThreshold_ = iConfig.getParameter<double>("HBThreshold");
45  HESThreshold_ = iConfig.getParameter<double>("HESThreshold");
46  HEDThreshold_ = iConfig.getParameter<double>("HEDThreshold");
47  EBThreshold_ = iConfig.getParameter<double>("EBThreshold");
48  EEThreshold_ = iConfig.getParameter<double>("EEThreshold");
49 
50  HcalAcceptSeverityLevel_ = iConfig.getParameter<uint32_t>("HcalAcceptSeverityLevel");
51  EcalAcceptSeverityLevel_ = iConfig.getParameter<uint32_t>("EcalAcceptSeverityLevel");
52  UseHcalRecoveredHits_ = iConfig.getParameter<bool>("UseHcalRecoveredHits");
53  UseEcalRecoveredHits_ = iConfig.getParameter<bool>("UseEcalRecoveredHits");
54  UseAllCombinedRechits_ = iConfig.getParameter<bool>("UseAllCombinedRechits");
55 
56  MinValidTrackPt_ = iConfig.getParameter<double>("MinValidTrackPt");
57  MinValidTrackPtBarrel_ = iConfig.getParameter<double>("MinValidTrackPtBarrel");
58  MinValidTrackNHits_ = iConfig.getParameter<int>("MinValidTrackNHits");
59 
60  theHcalChStatus_ = nullptr;
61  theEcalChStatus_ = nullptr;
62  theHcalSevLvlComputer_ = nullptr;
63  theEcalSevLvlAlgo_ = nullptr;
64  theEBRecHitCollection_ = nullptr;
65  theEERecHitCollection_ = nullptr;
66 
67  return;
68 }

References EBThreshold_, EcalAcceptSeverityLevel_, EEThreshold_, edm::ParameterSet::getParameter(), HBThreshold_, HcalAcceptSeverityLevel_, HEDThreshold_, HESThreshold_, MinValidTrackNHits_, MinValidTrackPt_, MinValidTrackPtBarrel_, theEBRecHitCollection_, theEcalChStatus_, theEcalSevLvlAlgo_, theEERecHitCollection_, theHcalChStatus_, theHcalSevLvlComputer_, UseAllCombinedRechits_, UseEcalRecoveredHits_, and UseHcalRecoveredHits_.

◆ ObjectValidator() [2/2]

ObjectValidator::ObjectValidator ( double  HBThreshold,
double  HESThreshold,
double  HEDThreshold,
double  EBThreshold,
double  EEThreshold,
uint32_t  HcalAcceptSeverityLevel,
uint32_t  EcalAcceptSeverityLevel,
bool  UseHcalRecoveredHits,
bool  UseEcalRecoveredHits,
double  MinValidTrackPt,
double  MinValidTrackPtBarrel,
int  MinValidTrackNHits 
)
inline

◆ ~ObjectValidator()

ObjectValidator::~ObjectValidator ( )
override

Definition at line 70 of file HBHEIsolatedNoiseAlgos.cc.

70 {}

Member Function Documentation

◆ setEBRecHitCollection()

void ObjectValidator::setEBRecHitCollection ( const EcalRecHitCollection q)
inline

◆ setEcalChannelStatus()

void ObjectValidator::setEcalChannelStatus ( const EcalChannelStatus q)
inline

◆ setEcalSeverityLevelAlgo()

void ObjectValidator::setEcalSeverityLevelAlgo ( const EcalSeverityLevelAlgo q)
inline

◆ setEERecHitCollection()

void ObjectValidator::setEERecHitCollection ( const EcalRecHitCollection q)
inline

◆ setHcalChannelQuality()

void ObjectValidator::setHcalChannelQuality ( const HcalChannelQuality q)
inline

◆ setHcalSeverityLevelComputer()

void ObjectValidator::setHcalSeverityLevelComputer ( const HcalSeverityLevelComputer q)
inline

◆ validHit() [1/2]

bool ObjectValidator::validHit ( const EcalRecHit hit) const
overridevirtual

Implements ObjectValidatorAbs.

Definition at line 104 of file HBHEIsolatedNoiseAlgos.cc.

104  {
105  assert(theEcalSevLvlAlgo_ != nullptr && theEcalChStatus_ != nullptr);
106 
107  // require the hit to pass a certain energy threshold
108  const DetId id = hit.detid();
109  if (id.subdetId() == EcalBarrel && hit.energy() < EBThreshold_)
110  return false;
111  else if (id.subdetId() == EcalEndcap && hit.energy() < EEThreshold_)
112  return false;
113 
114  // determine if the hit is good, bad, or recovered
115  int severityLevel = 999;
116  if (id.subdetId() == EcalBarrel && theEBRecHitCollection_ != nullptr)
118  hit); //id, *theEBRecHitCollection_, *theEcalChStatus_, 5., EcalSeverityLevelAlgo::kSwissCross, 0.95, 2., 15., 0.999);
119  else if (id.subdetId() == EcalEndcap && theEERecHitCollection_ != nullptr)
121  hit); //id, *theEERecHitCollection_, *theEcalChStatus_, 5., EcalSeverityLevelAlgo::kSwissCross, 0.95, 2., 15., 0.999);
122  else
123  return false;
124 
126  return true;
128  return UseEcalRecoveredHits_;
129  if (severityLevel > static_cast<int>(EcalAcceptSeverityLevel_))
130  return false;
131  else
132  return true;
133 }

References cms::cuda::assert(), EBThreshold_, EcalAcceptSeverityLevel_, EcalBarrel, EcalEndcap, EEThreshold_, EcalSeverityLevel::kGood, EcalSeverityLevel::kRecovered, interestingDetIdCollectionProducer_cfi::severityLevel, EcalSeverityLevelAlgo::severityLevel(), theEBRecHitCollection_, theEcalChStatus_, theEcalSevLvlAlgo_, theEERecHitCollection_, and UseEcalRecoveredHits_.

◆ validHit() [2/2]

bool ObjectValidator::validHit ( const HBHERecHit hit) const
overridevirtual

Implements ObjectValidatorAbs.

Definition at line 72 of file HBHEIsolatedNoiseAlgos.cc.

72  {
73  assert(theHcalSevLvlComputer_ != nullptr && theHcalChStatus_ != nullptr);
74 
77  return true;
78 
79  // require the hit to pass a certain energy threshold
80  if (hit.id().subdet() == HcalBarrel && hit.energy() < HBThreshold_)
81  return false;
82  else if (hit.id().subdet() == HcalEndcap && hit.id().ietaAbs() <= 20 && hit.energy() < HESThreshold_)
83  return false;
84  else if (hit.id().subdet() == HcalEndcap && hit.id().ietaAbs() > 20 && hit.energy() < HEDThreshold_)
85  return false;
86 
87  // determine if the hit is good, bad, or recovered
88  const DetId id = hit.detid();
89  const uint32_t recHitFlag = hit.flags();
90  const uint32_t dbStatusFlag = theHcalChStatus_->getValues(id)->getValue();
91  int severityLevel = theHcalSevLvlComputer_->getSeverityLevel(id, recHitFlag, dbStatusFlag);
92  bool isRecovered = theHcalSevLvlComputer_->recoveredRecHit(id, recHitFlag);
93 
94  if (severityLevel == 0)
95  return true;
96  if (isRecovered)
97  return UseHcalRecoveredHits_;
98  if (severityLevel > static_cast<int>(HcalAcceptSeverityLevel_))
99  return false;
100  else
101  return true;
102 }

References cms::cuda::assert(), CaloRecHitAuxSetter::getBit(), HcalSeverityLevelComputer::getSeverityLevel(), HcalChannelStatus::getValue(), HcalCondObjectContainer< Item >::getValues(), HBThreshold_, HcalAcceptSeverityLevel_, HcalBarrel, HcalEndcap, HEDThreshold_, HESThreshold_, hit::id, HBHERecHitAuxSetter::OFF_COMBINED, HcalSeverityLevelComputer::recoveredRecHit(), interestingDetIdCollectionProducer_cfi::severityLevel, theHcalChStatus_, theHcalSevLvlComputer_, UseAllCombinedRechits_, and UseHcalRecoveredHits_.

◆ validTrack()

bool ObjectValidator::validTrack ( const reco::Track trk) const
overridevirtual

Implements ObjectValidatorAbs.

Definition at line 135 of file HBHEIsolatedNoiseAlgos.cc.

135  {
136  if (trk.pt() < MinValidTrackPt_)
137  return false;
138  if (trk.pt() < MinValidTrackPtBarrel_ && std::fabs(trk.momentum().eta()) < 1.479)
139  return false;
141  return false;
142  return true;
143 }

References MinValidTrackNHits_, MinValidTrackPt_, MinValidTrackPtBarrel_, reco::TrackBase::momentum(), reco::TrackBase::numberOfValidHits(), and reco::TrackBase::pt().

Member Data Documentation

◆ EBThreshold_

double ObjectValidator::EBThreshold_
private

Definition at line 120 of file HBHEIsolatedNoiseAlgos.h.

Referenced by ObjectValidator(), and validHit().

◆ EcalAcceptSeverityLevel_

uint32_t ObjectValidator::EcalAcceptSeverityLevel_
private

Definition at line 124 of file HBHEIsolatedNoiseAlgos.h.

Referenced by ObjectValidator(), and validHit().

◆ EEThreshold_

double ObjectValidator::EEThreshold_
private

Definition at line 121 of file HBHEIsolatedNoiseAlgos.h.

Referenced by ObjectValidator(), and validHit().

◆ HBThreshold_

double ObjectValidator::HBThreshold_
private

Definition at line 117 of file HBHEIsolatedNoiseAlgos.h.

Referenced by ObjectValidator(), and validHit().

◆ HcalAcceptSeverityLevel_

uint32_t ObjectValidator::HcalAcceptSeverityLevel_
private

Definition at line 123 of file HBHEIsolatedNoiseAlgos.h.

Referenced by ObjectValidator(), and validHit().

◆ HEDThreshold_

double ObjectValidator::HEDThreshold_
private

Definition at line 119 of file HBHEIsolatedNoiseAlgos.h.

Referenced by ObjectValidator(), and validHit().

◆ HESThreshold_

double ObjectValidator::HESThreshold_
private

Definition at line 118 of file HBHEIsolatedNoiseAlgos.h.

Referenced by ObjectValidator(), and validHit().

◆ MinValidTrackNHits_

int ObjectValidator::MinValidTrackNHits_
private

Definition at line 131 of file HBHEIsolatedNoiseAlgos.h.

Referenced by ObjectValidator(), and validTrack().

◆ MinValidTrackPt_

double ObjectValidator::MinValidTrackPt_
private

Definition at line 129 of file HBHEIsolatedNoiseAlgos.h.

Referenced by ObjectValidator(), and validTrack().

◆ MinValidTrackPtBarrel_

double ObjectValidator::MinValidTrackPtBarrel_
private

Definition at line 130 of file HBHEIsolatedNoiseAlgos.h.

Referenced by ObjectValidator(), and validTrack().

◆ theEBRecHitCollection_

const EcalRecHitCollection* ObjectValidator::theEBRecHitCollection_
private

Definition at line 142 of file HBHEIsolatedNoiseAlgos.h.

Referenced by ObjectValidator(), setEBRecHitCollection(), and validHit().

◆ theEcalChStatus_

const EcalChannelStatus* ObjectValidator::theEcalChStatus_
private

Definition at line 135 of file HBHEIsolatedNoiseAlgos.h.

Referenced by ObjectValidator(), setEcalChannelStatus(), and validHit().

◆ theEcalSevLvlAlgo_

const EcalSeverityLevelAlgo* ObjectValidator::theEcalSevLvlAlgo_
private

Definition at line 139 of file HBHEIsolatedNoiseAlgos.h.

Referenced by ObjectValidator(), setEcalSeverityLevelAlgo(), and validHit().

◆ theEERecHitCollection_

const EcalRecHitCollection* ObjectValidator::theEERecHitCollection_
private

Definition at line 143 of file HBHEIsolatedNoiseAlgos.h.

Referenced by ObjectValidator(), setEERecHitCollection(), and validHit().

◆ theHcalChStatus_

const HcalChannelQuality* ObjectValidator::theHcalChStatus_
private

Definition at line 134 of file HBHEIsolatedNoiseAlgos.h.

Referenced by ObjectValidator(), setHcalChannelQuality(), and validHit().

◆ theHcalSevLvlComputer_

const HcalSeverityLevelComputer* ObjectValidator::theHcalSevLvlComputer_
private

◆ UseAllCombinedRechits_

bool ObjectValidator::UseAllCombinedRechits_
private

Definition at line 127 of file HBHEIsolatedNoiseAlgos.h.

Referenced by ObjectValidator(), and validHit().

◆ UseEcalRecoveredHits_

bool ObjectValidator::UseEcalRecoveredHits_
private

Definition at line 126 of file HBHEIsolatedNoiseAlgos.h.

Referenced by ObjectValidator(), and validHit().

◆ UseHcalRecoveredHits_

bool ObjectValidator::UseHcalRecoveredHits_
private

Definition at line 125 of file HBHEIsolatedNoiseAlgos.h.

Referenced by ObjectValidator(), and validHit().

HBHERecHitAuxSetter::OFF_COMBINED
static const unsigned OFF_COMBINED
Definition: HBHERecHitAuxSetter.h:41
ObjectValidator::theHcalSevLvlComputer_
const HcalSeverityLevelComputer * theHcalSevLvlComputer_
Definition: HBHEIsolatedNoiseAlgos.h:138
EcalSeverityLevel::kGood
Definition: EcalSeverityLevel.h:19
HcalSeverityLevelComputer::recoveredRecHit
bool recoveredRecHit(const DetId &myid, const uint32_t &myflag) const
Definition: HcalSeverityLevelComputer.cc:363
hit::id
unsigned int id
Definition: SiStripHitEffFromCalibTree.cc:92
EcalSeverityLevelAlgo::severityLevel
EcalSeverityLevel::SeverityLevel severityLevel(const DetId &id) const
Evaluate status from id use channelStatus from DB.
Definition: EcalSeverityLevelAlgo.cc:85
ObjectValidator::UseEcalRecoveredHits_
bool UseEcalRecoveredHits_
Definition: HBHEIsolatedNoiseAlgos.h:126
HLT_FULL_cff.UseEcalRecoveredHits
UseEcalRecoveredHits
Definition: HLT_FULL_cff.py:8619
HLT_FULL_cff.HESThreshold
HESThreshold
Definition: HLT_FULL_cff.py:8640
ObjectValidator::theHcalChStatus_
const HcalChannelQuality * theHcalChStatus_
Definition: HBHEIsolatedNoiseAlgos.h:134
HBHEIsolatedNoiseReflagger_cfi.MinValidTrackPtBarrel
MinValidTrackPtBarrel
Definition: HBHEIsolatedNoiseReflagger_cfi.py:58
cms::cuda::assert
assert(be >=bs)
ObjectValidator::UseHcalRecoveredHits_
bool UseHcalRecoveredHits_
Definition: HBHEIsolatedNoiseAlgos.h:125
HcalBarrel
Definition: HcalAssistant.h:33
ObjectValidator::EcalAcceptSeverityLevel_
uint32_t EcalAcceptSeverityLevel_
Definition: HBHEIsolatedNoiseAlgos.h:124
reco::TrackBase::numberOfValidHits
unsigned short numberOfValidHits() const
number of valid hits found
Definition: TrackBase.h:798
HcalCondObjectContainer::getValues
const Item * getValues(DetId fId, bool throwOnFail=true) const
Definition: HcalCondObjectContainer.h:159
EcalBarrel
Definition: EcalSubdetector.h:10
HLT_FULL_cff.HEDThreshold
HEDThreshold
Definition: HLT_FULL_cff.py:8665
reco::TrackBase::pt
double pt() const
track transverse momentum
Definition: TrackBase.h:637
DetId
Definition: DetId.h:17
ObjectValidator::theEcalChStatus_
const EcalChannelStatus * theEcalChStatus_
Definition: HBHEIsolatedNoiseAlgos.h:135
ObjectValidator::theEERecHitCollection_
const EcalRecHitCollection * theEERecHitCollection_
Definition: HBHEIsolatedNoiseAlgos.h:143
ObjectValidator::EBThreshold_
double EBThreshold_
Definition: HBHEIsolatedNoiseAlgos.h:120
HLT_FULL_cff.HBThreshold
HBThreshold
Definition: HLT_FULL_cff.py:8617
ObjectValidator::theEBRecHitCollection_
const EcalRecHitCollection * theEBRecHitCollection_
Definition: HBHEIsolatedNoiseAlgos.h:142
EcalEndcap
Definition: EcalSubdetector.h:10
CaloTowerSchemeBnoEE_cfi.EcalAcceptSeverityLevel
EcalAcceptSeverityLevel
Definition: CaloTowerSchemeBnoEE_cfi.py:52
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
HLT_FULL_cff.EBThreshold
EBThreshold
Definition: HLT_FULL_cff.py:8667
HLT_FULL_cff.HcalAcceptSeverityLevel
HcalAcceptSeverityLevel
Definition: HLT_FULL_cff.py:8525
HLT_FULL_cff.UseHcalRecoveredHits
UseHcalRecoveredHits
Definition: HLT_FULL_cff.py:8669
ObjectValidator::HESThreshold_
double HESThreshold_
Definition: HBHEIsolatedNoiseAlgos.h:118
ObjectValidator::HEDThreshold_
double HEDThreshold_
Definition: HBHEIsolatedNoiseAlgos.h:119
ObjectValidator::MinValidTrackNHits_
int MinValidTrackNHits_
Definition: HBHEIsolatedNoiseAlgos.h:131
ObjectValidator::UseAllCombinedRechits_
bool UseAllCombinedRechits_
Definition: HBHEIsolatedNoiseAlgos.h:127
CaloRecHitAuxSetter::getBit
constexpr bool getBit(const uint32_t u, const unsigned bitnum)
Definition: CaloRecHitAuxSetter.h:37
submitPVResolutionJobs.q
q
Definition: submitPVResolutionJobs.py:84
HBHEIsolatedNoiseReflagger_cfi.MinValidTrackPt
MinValidTrackPt
Definition: HBHEIsolatedNoiseReflagger_cfi.py:57
ObjectValidator::HBThreshold_
double HBThreshold_
Definition: HBHEIsolatedNoiseAlgos.h:117
interestingDetIdCollectionProducer_cfi.severityLevel
severityLevel
Definition: interestingDetIdCollectionProducer_cfi.py:10
HcalEndcap
Definition: HcalAssistant.h:34
EcalSeverityLevel::kRecovered
Definition: EcalSeverityLevel.h:21
HBHEIsolatedNoiseReflagger_cfi.MinValidTrackNHits
MinValidTrackNHits
Definition: HBHEIsolatedNoiseReflagger_cfi.py:59
ObjectValidator::EEThreshold_
double EEThreshold_
Definition: HBHEIsolatedNoiseAlgos.h:121
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
ObjectValidator::theEcalSevLvlAlgo_
const EcalSeverityLevelAlgo * theEcalSevLvlAlgo_
Definition: HBHEIsolatedNoiseAlgos.h:139
ObjectValidator::HcalAcceptSeverityLevel_
uint32_t HcalAcceptSeverityLevel_
Definition: HBHEIsolatedNoiseAlgos.h:123
ObjectValidator::MinValidTrackPt_
double MinValidTrackPt_
Definition: HBHEIsolatedNoiseAlgos.h:129
HLT_FULL_cff.EEThreshold
EEThreshold
Definition: HLT_FULL_cff.py:8647
reco::TrackBase::momentum
const Vector & momentum() const
track momentum vector
Definition: TrackBase.h:664
hit
Definition: SiStripHitEffFromCalibTree.cc:88
ObjectValidator::MinValidTrackPtBarrel_
double MinValidTrackPtBarrel_
Definition: HBHEIsolatedNoiseAlgos.h:130