CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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::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 }
const EcalChannelStatus * theEcalChStatus_
const EcalRecHitCollection * theEERecHitCollection_
const EcalRecHitCollection * theEBRecHitCollection_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
const EcalSeverityLevelAlgo * theEcalSevLvlAlgo_
const HcalChannelQuality * theHcalChStatus_
const HcalSeverityLevelComputer * theHcalSevLvlComputer_
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.

91  EcalAcceptSeverityLevel_(EcalAcceptSeverityLevel),
94  MinValidTrackPt_(MinValidTrackPt),
95  MinValidTrackPtBarrel_(MinValidTrackPtBarrel),
96  MinValidTrackNHits_(MinValidTrackNHits),
97  theHcalChStatus_(nullptr),
98  theEcalChStatus_(nullptr),
99  theHcalSevLvlComputer_(nullptr),
100  theEcalSevLvlAlgo_(nullptr),
101  theEBRecHitCollection_(nullptr),
102  theEERecHitCollection_(nullptr) {}
tuple HcalAcceptSeverityLevel
tuple HESThreshold
tuple UseHcalRecoveredHits
const EcalChannelStatus * theEcalChStatus_
const EcalRecHitCollection * theEERecHitCollection_
tuple HEDThreshold
const EcalRecHitCollection * theEBRecHitCollection_
const EcalSeverityLevelAlgo * theEcalSevLvlAlgo_
const HcalChannelQuality * theHcalChStatus_
const HcalSeverityLevelComputer * theHcalSevLvlComputer_
tuple UseEcalRecoveredHits
ObjectValidator::~ObjectValidator ( )
override

Definition at line 69 of file HBHEIsolatedNoiseAlgos.cc.

69 {}

Member Function Documentation

void ObjectValidator::setEBRecHitCollection ( const EcalRecHitCollection q)
inline
void ObjectValidator::setEcalChannelStatus ( const EcalChannelStatus q)
inline
void ObjectValidator::setEcalSeverityLevelAlgo ( const EcalSeverityLevelAlgo q)
inline

Definition at line 108 of file HBHEIsolatedNoiseAlgos.h.

References submitPVResolutionJobs::q, and theEcalSevLvlAlgo_.

Referenced by HBHEIsolatedNoiseReflagger::produce().

108 { theEcalSevLvlAlgo_ = q; }
const EcalSeverityLevelAlgo * theEcalSevLvlAlgo_
void ObjectValidator::setEERecHitCollection ( const EcalRecHitCollection q)
inline
void ObjectValidator::setHcalChannelQuality ( const HcalChannelQuality q)
inline
void ObjectValidator::setHcalSeverityLevelComputer ( const HcalSeverityLevelComputer q)
inline

Definition at line 107 of file HBHEIsolatedNoiseAlgos.h.

References submitPVResolutionJobs::q, and theHcalSevLvlComputer_.

Referenced by HBHEIsolatedNoiseReflagger::produce().

const HcalSeverityLevelComputer * theHcalSevLvlComputer_
bool ObjectValidator::validHit ( const HBHERecHit hit) const
overridevirtual

Implements ObjectValidatorAbs.

Definition at line 71 of file HBHEIsolatedNoiseAlgos.cc.

References cms::cuda::assert(), HBHERecHit::auxPhase1(), CaloRecHit::detid(), CaloRecHit::energy(), CaloRecHit::flags(), CaloRecHitAuxSetter::getBit(), HcalSeverityLevelComputer::getSeverityLevel(), HcalChannelStatus::getValue(), HcalCondObjectContainer< Item >::getValues(), HBThreshold_, HcalAcceptSeverityLevel_, HcalBarrel, HcalEndcap, HEDThreshold_, HESThreshold_, HBHERecHit::id(), HcalDetId::ietaAbs(), HBHERecHitAuxSetter::OFF_COMBINED, HcalSeverityLevelComputer::recoveredRecHit(), HcalDetId::subdet(), 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 }
constexpr float energy() const
Definition: CaloRecHit.h:29
constexpr int ietaAbs() const
get the absolute value of the cell ieta
Definition: HcalDetId.h:148
constexpr uint32_t auxPhase1() const
Definition: HBHERecHit.h:56
constexpr const DetId & detid() const
Definition: CaloRecHit.h:33
const Item * getValues(DetId fId, bool throwOnFail=true) const
assert(be >=bs)
constexpr HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:138
constexpr HcalDetId id() const
get the id
Definition: HBHERecHit.h:41
bool recoveredRecHit(const DetId &myid, const uint32_t &myflag) const
constexpr bool getBit(const uint32_t u, const unsigned bitnum)
Definition: DetId.h:17
int getSeverityLevel(const DetId &myid, const uint32_t &myflag, const uint32_t &mystatus) const
static const unsigned OFF_COMBINED
const HcalChannelQuality * theHcalChStatus_
uint32_t getValue() const
const HcalSeverityLevelComputer * theHcalSevLvlComputer_
constexpr uint32_t flags() const
Definition: CaloRecHit.h:34
bool ObjectValidator::validHit ( const EcalRecHit hit) const
overridevirtual

Implements ObjectValidatorAbs.

Definition at line 103 of file HBHEIsolatedNoiseAlgos.cc.

References cms::cuda::assert(), EcalRecHit::detid(), EBThreshold_, EcalAcceptSeverityLevel_, EcalBarrel, EcalEndcap, EEThreshold_, EcalRecHit::energy(), EcalSeverityLevel::kGood, EcalSeverityLevel::kRecovered, 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)
116  severityLevel = theEcalSevLvlAlgo_->severityLevel(
117  hit); //id, *theEBRecHitCollection_, *theEcalChStatus_, 5., EcalSeverityLevelAlgo::kSwissCross, 0.95, 2., 15., 0.999);
118  else if (id.subdetId() == EcalEndcap && theEERecHitCollection_ != nullptr)
119  severityLevel = theEcalSevLvlAlgo_->severityLevel(
120  hit); //id, *theEERecHitCollection_, *theEcalChStatus_, 5., EcalSeverityLevelAlgo::kSwissCross, 0.95, 2., 15., 0.999);
121  else
122  return false;
123 
124  if (severityLevel == EcalSeverityLevel::kGood)
125  return true;
126  if (severityLevel == EcalSeverityLevel::kRecovered)
127  return UseEcalRecoveredHits_;
128  if (severityLevel > static_cast<int>(EcalAcceptSeverityLevel_))
129  return false;
130  else
131  return true;
132 }
EcalSeverityLevel::SeverityLevel severityLevel(const DetId &id) const
Evaluate status from id use channelStatus from DB.
const DetId & detid() const
Definition: EcalRecHit.h:72
assert(be >=bs)
const EcalChannelStatus * theEcalChStatus_
const EcalRecHitCollection * theEERecHitCollection_
float energy() const
Definition: EcalRecHit.h:68
const EcalRecHitCollection * theEBRecHitCollection_
Definition: DetId.h:17
const EcalSeverityLevelAlgo * theEcalSevLvlAlgo_
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 }
const Vector & momentum() const
track momentum vector
Definition: TrackBase.h:664
double pt() const
track transverse momentum
Definition: TrackBase.h:637
unsigned short numberOfValidHits() const
number of valid hits found
Definition: TrackBase.h:798

Member Data Documentation

double ObjectValidator::EBThreshold_
private

Definition at line 120 of file HBHEIsolatedNoiseAlgos.h.

Referenced by ObjectValidator(), and validHit().

uint32_t ObjectValidator::EcalAcceptSeverityLevel_
private

Definition at line 124 of file HBHEIsolatedNoiseAlgos.h.

Referenced by ObjectValidator(), and validHit().

double ObjectValidator::EEThreshold_
private

Definition at line 121 of file HBHEIsolatedNoiseAlgos.h.

Referenced by ObjectValidator(), and validHit().

double ObjectValidator::HBThreshold_
private

Definition at line 117 of file HBHEIsolatedNoiseAlgos.h.

Referenced by ObjectValidator(), and validHit().

uint32_t ObjectValidator::HcalAcceptSeverityLevel_
private

Definition at line 123 of file HBHEIsolatedNoiseAlgos.h.

Referenced by ObjectValidator(), and validHit().

double ObjectValidator::HEDThreshold_
private

Definition at line 119 of file HBHEIsolatedNoiseAlgos.h.

Referenced by ObjectValidator(), and validHit().

double ObjectValidator::HESThreshold_
private

Definition at line 118 of file HBHEIsolatedNoiseAlgos.h.

Referenced by ObjectValidator(), and validHit().

int ObjectValidator::MinValidTrackNHits_
private

Definition at line 131 of file HBHEIsolatedNoiseAlgos.h.

Referenced by ObjectValidator(), and validTrack().

double ObjectValidator::MinValidTrackPt_
private

Definition at line 129 of file HBHEIsolatedNoiseAlgos.h.

Referenced by ObjectValidator(), and validTrack().

double ObjectValidator::MinValidTrackPtBarrel_
private

Definition at line 130 of file HBHEIsolatedNoiseAlgos.h.

Referenced by ObjectValidator(), and validTrack().

const EcalRecHitCollection* ObjectValidator::theEBRecHitCollection_
private

Definition at line 142 of file HBHEIsolatedNoiseAlgos.h.

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

const EcalChannelStatus* ObjectValidator::theEcalChStatus_
private

Definition at line 135 of file HBHEIsolatedNoiseAlgos.h.

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

const EcalSeverityLevelAlgo* ObjectValidator::theEcalSevLvlAlgo_
private

Definition at line 139 of file HBHEIsolatedNoiseAlgos.h.

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

const EcalRecHitCollection* ObjectValidator::theEERecHitCollection_
private

Definition at line 143 of file HBHEIsolatedNoiseAlgos.h.

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

const HcalChannelQuality* ObjectValidator::theHcalChStatus_
private

Definition at line 134 of file HBHEIsolatedNoiseAlgos.h.

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

const HcalSeverityLevelComputer* ObjectValidator::theHcalSevLvlComputer_
private
bool ObjectValidator::UseAllCombinedRechits_
private

Definition at line 127 of file HBHEIsolatedNoiseAlgos.h.

Referenced by ObjectValidator(), and validHit().

bool ObjectValidator::UseEcalRecoveredHits_
private

Definition at line 126 of file HBHEIsolatedNoiseAlgos.h.

Referenced by ObjectValidator(), and validHit().

bool ObjectValidator::UseHcalRecoveredHits_
private

Definition at line 125 of file HBHEIsolatedNoiseAlgos.h.

Referenced by ObjectValidator(), and validHit().