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 71 of file HBHEIsolatedNoiseAlgos.h.

Constructor & Destructor Documentation

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

Definition at line 43 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_.

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

77  :
90  theHcalChStatus_(nullptr),
91  theEcalChStatus_(nullptr),
92  theHcalSevLvlComputer_(nullptr),
93  theEcalSevLvlAlgo_(nullptr),
94  theEBRecHitCollection_(nullptr),
95  theEERecHitCollection_(nullptr) {}
HEDThreshold
GeV, Oprimized on 10% occupancy.
const EcalChannelStatus * theEcalChStatus_
const EcalRecHitCollection * theEERecHitCollection_
const EcalRecHitCollection * theEBRecHitCollection_
const EcalSeverityLevelAlgo * theEcalSevLvlAlgo_
const HcalChannelQuality * theHcalChStatus_
EEThreshold
GeV, Oprimized on 10% occupancy.
const HcalSeverityLevelComputer * theHcalSevLvlComputer_
HESThreshold
GeV, ORCA value w/o selective readout.
ObjectValidator::~ObjectValidator ( )
override

Definition at line 71 of file HBHEIsolatedNoiseAlgos.cc.

72 {
73 }

Member Function Documentation

void ObjectValidator::setEBRecHitCollection ( const EcalRecHitCollection q)
inline

Definition at line 102 of file HBHEIsolatedNoiseAlgos.h.

References lumiQueryAPI::q.

Referenced by HBHEIsolatedNoiseReflagger::produce().

const EcalRecHitCollection * theEBRecHitCollection_
void ObjectValidator::setEcalChannelStatus ( const EcalChannelStatus q)
inline

Definition at line 99 of file HBHEIsolatedNoiseAlgos.h.

References lumiQueryAPI::q.

Referenced by HBHEIsolatedNoiseReflagger::produce().

const EcalChannelStatus * theEcalChStatus_
void ObjectValidator::setEcalSeverityLevelAlgo ( const EcalSeverityLevelAlgo q)
inline

Definition at line 101 of file HBHEIsolatedNoiseAlgos.h.

References lumiQueryAPI::q.

Referenced by HBHEIsolatedNoiseReflagger::produce().

const EcalSeverityLevelAlgo * theEcalSevLvlAlgo_
void ObjectValidator::setEERecHitCollection ( const EcalRecHitCollection q)
inline
void ObjectValidator::setHcalChannelQuality ( const HcalChannelQuality q)
inline

Definition at line 98 of file HBHEIsolatedNoiseAlgos.h.

References lumiQueryAPI::q.

Referenced by HBHEIsolatedNoiseReflagger::produce().

const HcalChannelQuality * theHcalChStatus_
void ObjectValidator::setHcalSeverityLevelComputer ( const HcalSeverityLevelComputer q)
inline

Definition at line 100 of file HBHEIsolatedNoiseAlgos.h.

References lumiQueryAPI::q.

Referenced by HBHEIsolatedNoiseReflagger::produce().

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

Implements ObjectValidatorAbs.

Definition at line 75 of file HBHEIsolatedNoiseAlgos.cc.

References 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(), interestingDetIdCollectionProducer_cfi::severityLevel, HcalDetId::subdet(), theHcalChStatus_, theHcalSevLvlComputer_, UseAllCombinedRechits_, and UseHcalRecoveredHits_.

76 {
77  assert(theHcalSevLvlComputer_!=nullptr && theHcalChStatus_!=nullptr);
78 
81  return true;
82 
83  // require the hit to pass a certain energy threshold
84  if(hit.id().subdet()==HcalBarrel && hit.energy()<HBThreshold_) return false;
85  else if(hit.id().subdet()==HcalEndcap && hit.id().ietaAbs()<=20 && hit.energy()<HESThreshold_) return false;
86  else if(hit.id().subdet()==HcalEndcap && hit.id().ietaAbs()>20 && hit.energy()<HEDThreshold_) return false;
87 
88  // determine if the hit is good, bad, or recovered
89  const DetId id = hit.detid();
90  const uint32_t recHitFlag = hit.flags();
91  const uint32_t dbStatusFlag = theHcalChStatus_->getValues(id)->getValue();
92  int severityLevel = theHcalSevLvlComputer_->getSeverityLevel(id, recHitFlag, dbStatusFlag);
93  bool isRecovered = theHcalSevLvlComputer_->recoveredRecHit(id, recHitFlag);
94 
95  if(severityLevel==0) return true;
96  if(isRecovered) return UseHcalRecoveredHits_;
97  if(severityLevel>static_cast<int>(HcalAcceptSeverityLevel_)) return false;
98  else return true;
99 }
constexpr float energy() const
Definition: CaloRecHit.h:31
HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:146
constexpr const DetId & detid() const
Definition: CaloRecHit.h:35
HcalDetId id() const
get the id
Definition: HBHERecHit.h:42
uint32_t auxPhase1() const
Definition: HBHERecHit.h:57
const Item * getValues(DetId fId, bool throwOnFail=true) const
bool recoveredRecHit(const DetId &myid, const uint32_t &myflag) const
constexpr bool getBit(const uint32_t u, const unsigned bitnum)
int ietaAbs() const
get the absolute value of the cell ieta
Definition: HcalDetId.h:154
Definition: DetId.h:18
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:36
bool ObjectValidator::validHit ( const EcalRecHit hit) const
overridevirtual

Implements ObjectValidatorAbs.

Definition at line 101 of file HBHEIsolatedNoiseAlgos.cc.

References EcalRecHit::detid(), EBThreshold_, EcalAcceptSeverityLevel_, EcalBarrel, EcalEndcap, EEThreshold_, EcalRecHit::energy(), EcalSeverityLevel::kGood, EcalSeverityLevel::kRecovered, interestingDetIdCollectionProducer_cfi::severityLevel, EcalSeverityLevelAlgo::severityLevel(), theEBRecHitCollection_, theEcalChStatus_, theEcalSevLvlAlgo_, theEERecHitCollection_, and UseEcalRecoveredHits_.

102 {
103  assert(theEcalSevLvlAlgo_!=nullptr && theEcalChStatus_!=nullptr);
104 
105  // require the hit to pass a certain energy threshold
106  const DetId id = hit.detid();
107  if(id.subdetId()==EcalBarrel && hit.energy()<EBThreshold_) return false;
108  else if(id.subdetId()==EcalEndcap && hit.energy()<EEThreshold_) return false;
109 
110  // determine if the hit is good, bad, or recovered
111  int severityLevel = 999;
112  if (id.subdetId() == EcalBarrel && theEBRecHitCollection_!=nullptr) severityLevel = theEcalSevLvlAlgo_->severityLevel(hit);//id, *theEBRecHitCollection_, *theEcalChStatus_, 5., EcalSeverityLevelAlgo::kSwissCross, 0.95, 2., 15., 0.999);
113  else if(id.subdetId() == EcalEndcap && theEERecHitCollection_!=nullptr) severityLevel = theEcalSevLvlAlgo_->severityLevel(hit);//id, *theEERecHitCollection_, *theEcalChStatus_, 5., EcalSeverityLevelAlgo::kSwissCross, 0.95, 2., 15., 0.999);
114  else return false;
115 
116  if(severityLevel == EcalSeverityLevel::kGood) return true;
117  if(severityLevel == EcalSeverityLevel::kRecovered) return UseEcalRecoveredHits_;
118  if(severityLevel > static_cast<int>(EcalAcceptSeverityLevel_)) return false;
119  else return true;
120 }
EcalSeverityLevel::SeverityLevel severityLevel(const DetId &id) const
Evaluate status from id use channelStatus from DB.
const DetId & detid() const
Definition: EcalRecHit.h:72
const EcalChannelStatus * theEcalChStatus_
const EcalRecHitCollection * theEERecHitCollection_
float energy() const
Definition: EcalRecHit.h:68
const EcalRecHitCollection * theEBRecHitCollection_
Definition: DetId.h:18
const EcalSeverityLevelAlgo * theEcalSevLvlAlgo_
bool ObjectValidator::validTrack ( const reco::Track trk) const
overridevirtual

Implements ObjectValidatorAbs.

Definition at line 122 of file HBHEIsolatedNoiseAlgos.cc.

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

123 {
124  if(trk.pt()<MinValidTrackPt_) return false;
125  if(trk.pt()<MinValidTrackPtBarrel_ && std::fabs(trk.momentum().eta())<1.479) return false;
126  if(trk.numberOfValidHits()<MinValidTrackNHits_) return false;
127  return true;
128 }
const Vector & momentum() const
track momentum vector
Definition: TrackBase.h:714
double pt() const
track transverse momentum
Definition: TrackBase.h:660
unsigned short numberOfValidHits() const
number of valid hits found
Definition: TrackBase.h:901

Member Data Documentation

double ObjectValidator::EBThreshold_
private

Definition at line 115 of file HBHEIsolatedNoiseAlgos.h.

Referenced by ObjectValidator(), and validHit().

uint32_t ObjectValidator::EcalAcceptSeverityLevel_
private

Definition at line 119 of file HBHEIsolatedNoiseAlgos.h.

Referenced by ObjectValidator(), and validHit().

double ObjectValidator::EEThreshold_
private

Definition at line 116 of file HBHEIsolatedNoiseAlgos.h.

Referenced by ObjectValidator(), and validHit().

double ObjectValidator::HBThreshold_
private

Definition at line 112 of file HBHEIsolatedNoiseAlgos.h.

Referenced by ObjectValidator(), and validHit().

uint32_t ObjectValidator::HcalAcceptSeverityLevel_
private

Definition at line 118 of file HBHEIsolatedNoiseAlgos.h.

Referenced by ObjectValidator(), and validHit().

double ObjectValidator::HEDThreshold_
private

Definition at line 114 of file HBHEIsolatedNoiseAlgos.h.

Referenced by ObjectValidator(), and validHit().

double ObjectValidator::HESThreshold_
private

Definition at line 113 of file HBHEIsolatedNoiseAlgos.h.

Referenced by ObjectValidator(), and validHit().

int ObjectValidator::MinValidTrackNHits_
private

Definition at line 126 of file HBHEIsolatedNoiseAlgos.h.

Referenced by ObjectValidator(), and validTrack().

double ObjectValidator::MinValidTrackPt_
private

Definition at line 124 of file HBHEIsolatedNoiseAlgos.h.

Referenced by ObjectValidator(), and validTrack().

double ObjectValidator::MinValidTrackPtBarrel_
private

Definition at line 125 of file HBHEIsolatedNoiseAlgos.h.

Referenced by ObjectValidator(), and validTrack().

const EcalRecHitCollection* ObjectValidator::theEBRecHitCollection_
private

Definition at line 137 of file HBHEIsolatedNoiseAlgos.h.

Referenced by ObjectValidator(), and validHit().

const EcalChannelStatus* ObjectValidator::theEcalChStatus_
private

Definition at line 130 of file HBHEIsolatedNoiseAlgos.h.

Referenced by ObjectValidator(), and validHit().

const EcalSeverityLevelAlgo* ObjectValidator::theEcalSevLvlAlgo_
private

Definition at line 134 of file HBHEIsolatedNoiseAlgos.h.

Referenced by ObjectValidator(), and validHit().

const EcalRecHitCollection* ObjectValidator::theEERecHitCollection_
private

Definition at line 138 of file HBHEIsolatedNoiseAlgos.h.

Referenced by ObjectValidator(), and validHit().

const HcalChannelQuality* ObjectValidator::theHcalChStatus_
private

Definition at line 129 of file HBHEIsolatedNoiseAlgos.h.

Referenced by ObjectValidator(), and validHit().

const HcalSeverityLevelComputer* ObjectValidator::theHcalSevLvlComputer_
private

Definition at line 133 of file HBHEIsolatedNoiseAlgos.h.

Referenced by ObjectValidator(), and validHit().

bool ObjectValidator::UseAllCombinedRechits_
private

Definition at line 122 of file HBHEIsolatedNoiseAlgos.h.

Referenced by ObjectValidator(), and validHit().

bool ObjectValidator::UseEcalRecoveredHits_
private

Definition at line 121 of file HBHEIsolatedNoiseAlgos.h.

Referenced by ObjectValidator(), and validHit().

bool ObjectValidator::UseHcalRecoveredHits_
private

Definition at line 120 of file HBHEIsolatedNoiseAlgos.h.

Referenced by ObjectValidator(), and validHit().