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 HBHERecHit &) const override
 
bool validHit (const EcalRecHit &) 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 42 of file HBHEIsolatedNoiseAlgos.cc.

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

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

◆ 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

Definition at line 73 of file HBHEIsolatedNoiseAlgos.h.

97  theHcalChStatus_(nullptr),
98  theEcalChStatus_(nullptr),
99  theHcalSevLvlComputer_(nullptr),
100  theEcalSevLvlAlgo_(nullptr),
101  theEBRecHitCollection_(nullptr),
102  theEERecHitCollection_(nullptr) {}
const EcalChannelStatus * theEcalChStatus_
const EcalRecHitCollection * theEERecHitCollection_
const EcalRecHitCollection * theEBRecHitCollection_
const EcalSeverityLevelAlgo * theEcalSevLvlAlgo_
const HcalChannelQuality * theHcalChStatus_
const HcalSeverityLevelComputer * theHcalSevLvlComputer_

◆ ~ObjectValidator()

ObjectValidator::~ObjectValidator ( )
override

Definition at line 69 of file HBHEIsolatedNoiseAlgos.cc.

69 {}

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 HBHERecHit hit) const
overridevirtual

Implements ObjectValidatorAbs.

Definition at line 71 of file HBHEIsolatedNoiseAlgos.cc.

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_.

71  {
72  assert(theHcalSevLvlComputer_ != nullptr && theHcalChStatus_ != nullptr);
73 
76  return true;
77 
78  // require the hit to pass a certain energy threshold
79  if (hit.id().subdet() == HcalBarrel && hit.energy() < HBThreshold_)
80  return false;
81  else if (hit.id().subdet() == HcalEndcap && hit.id().ietaAbs() <= 20 && hit.energy() < HESThreshold_)
82  return false;
83  else if (hit.id().subdet() == HcalEndcap && hit.id().ietaAbs() > 20 && hit.energy() < HEDThreshold_)
84  return false;
85 
86  // determine if the hit is good, bad, or recovered
87  const DetId id = hit.detid();
88  const uint32_t recHitFlag = hit.flags();
89  const uint32_t dbStatusFlag = theHcalChStatus_->getValues(id)->getValue();
90  int severityLevel = theHcalSevLvlComputer_->getSeverityLevel(id, recHitFlag, dbStatusFlag);
91  bool isRecovered = theHcalSevLvlComputer_->recoveredRecHit(id, recHitFlag);
92 
93  if (severityLevel == 0)
94  return true;
95  if (isRecovered)
96  return UseHcalRecoveredHits_;
97  if (severityLevel > static_cast<int>(HcalAcceptSeverityLevel_))
98  return false;
99  else
100  return true;
101 }
bool recoveredRecHit(const DetId &myid, const uint32_t &myflag) const
assert(be >=bs)
const Item * getValues(DetId fId, bool throwOnFail=true) const
uint32_t getValue() const
constexpr bool getBit(const uint32_t u, const unsigned bitnum)
unsigned int id
Definition: DetId.h:17
static const unsigned OFF_COMBINED
int getSeverityLevel(const DetId &myid, const uint32_t &myflag, const uint32_t &mystatus) const
const HcalChannelQuality * theHcalChStatus_
const HcalSeverityLevelComputer * theHcalSevLvlComputer_

◆ validHit() [2/2]

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

Implements ObjectValidatorAbs.

Definition at line 103 of file HBHEIsolatedNoiseAlgos.cc.

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

103  {
104  assert(theEcalSevLvlAlgo_ != nullptr && theEcalChStatus_ != nullptr);
105 
106  // require the hit to pass a certain energy threshold
107  const DetId id = hit.detid();
108  if (id.subdetId() == EcalBarrel && hit.energy() < EBThreshold_)
109  return false;
110  else if (id.subdetId() == EcalEndcap && hit.energy() < EEThreshold_)
111  return false;
112 
113  // determine if the hit is good, bad, or recovered
114  int severityLevel = 999;
115  if (id.subdetId() == EcalBarrel && theEBRecHitCollection_ != nullptr)
117  hit); //id, *theEBRecHitCollection_, *theEcalChStatus_, 5., EcalSeverityLevelAlgo::kSwissCross, 0.95, 2., 15., 0.999);
118  else if (id.subdetId() == EcalEndcap && theEERecHitCollection_ != nullptr)
120  hit); //id, *theEERecHitCollection_, *theEcalChStatus_, 5., EcalSeverityLevelAlgo::kSwissCross, 0.95, 2., 15., 0.999);
121  else
122  return false;
123 
125  return true;
127  return UseEcalRecoveredHits_;
128  if (severityLevel > static_cast<int>(EcalAcceptSeverityLevel_))
129  return false;
130  else
131  return true;
132 }
assert(be >=bs)
EcalSeverityLevel::SeverityLevel severityLevel(const DetId &id) const
Evaluate status from id use channelStatus from DB.
const EcalChannelStatus * theEcalChStatus_
const EcalRecHitCollection * theEERecHitCollection_
const EcalRecHitCollection * theEBRecHitCollection_
Definition: DetId.h:17
const EcalSeverityLevelAlgo * theEcalSevLvlAlgo_

◆ validTrack()

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

Implements ObjectValidatorAbs.

Definition at line 134 of file HBHEIsolatedNoiseAlgos.cc.

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

134  {
135  if (trk.pt() < MinValidTrackPt_)
136  return false;
137  if (trk.pt() < MinValidTrackPtBarrel_ && std::fabs(trk.momentum().eta()) < 1.479)
138  return false;
140  return false;
141  return true;
142 }
unsigned short numberOfValidHits() const
number of valid hits found
Definition: TrackBase.h:798
double pt() const
track transverse momentum
Definition: TrackBase.h:637
const Vector & momentum() const
track momentum vector
Definition: TrackBase.h:664

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