CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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
 
bool validHit (const EcalRecHit &) const
 
bool validTrack (const reco::Track &) const
 
virtual ~ObjectValidator ()
 
- 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 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_, UseEcalRecoveredHits_, and UseHcalRecoveredHits_.

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 
55  MinValidTrackPt_ = iConfig.getParameter<double>("MinValidTrackPt");
56  MinValidTrackPtBarrel_ = iConfig.getParameter<double>("MinValidTrackPtBarrel");
57  MinValidTrackNHits_ = iConfig.getParameter<int>("MinValidTrackNHits");
58 
65 
66  return;
67 }
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 74 of file HBHEIsolatedNoiseAlgos.h.

76  :
77  HBThreshold_(HBThreshold),
78  HESThreshold_(HESThreshold),
79  HEDThreshold_(HEDThreshold),
80  EBThreshold_(EBThreshold),
81  EEThreshold_(EEThreshold),
82  HcalAcceptSeverityLevel_(HcalAcceptSeverityLevel),
83  EcalAcceptSeverityLevel_(EcalAcceptSeverityLevel),
84  UseHcalRecoveredHits_(UseHcalRecoveredHits),
85  UseEcalRecoveredHits_(UseEcalRecoveredHits),
86  MinValidTrackPt_(MinValidTrackPt),
87  MinValidTrackPtBarrel_(MinValidTrackPtBarrel),
88  MinValidTrackNHits_(MinValidTrackNHits),
const EcalChannelStatus * theEcalChStatus_
const EcalRecHitCollection * theEERecHitCollection_
const EcalRecHitCollection * theEBRecHitCollection_
const EcalSeverityLevelAlgo * theEcalSevLvlAlgo_
const HcalChannelQuality * theHcalChStatus_
const HcalSeverityLevelComputer * theHcalSevLvlComputer_
ObjectValidator::~ObjectValidator ( )
virtual

Definition at line 69 of file HBHEIsolatedNoiseAlgos.cc.

70 {
71 }

Member Function Documentation

void ObjectValidator::setEBRecHitCollection ( const EcalRecHitCollection q)
inline

Definition at line 101 of file HBHEIsolatedNoiseAlgos.h.

References lumiQueryAPI::q, and theEBRecHitCollection_.

Referenced by HBHEIsolatedNoiseReflagger::produce().

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

Definition at line 98 of file HBHEIsolatedNoiseAlgos.h.

References lumiQueryAPI::q, and theEcalChStatus_.

Referenced by HBHEIsolatedNoiseReflagger::produce().

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

Definition at line 100 of file HBHEIsolatedNoiseAlgos.h.

References lumiQueryAPI::q, and theEcalSevLvlAlgo_.

Referenced by HBHEIsolatedNoiseReflagger::produce().

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

Definition at line 102 of file HBHEIsolatedNoiseAlgos.h.

References lumiQueryAPI::q, and theEERecHitCollection_.

Referenced by HBHEIsolatedNoiseReflagger::produce().

const EcalRecHitCollection * theEERecHitCollection_
void ObjectValidator::setHcalChannelQuality ( const HcalChannelQuality q)
inline

Definition at line 97 of file HBHEIsolatedNoiseAlgos.h.

References lumiQueryAPI::q, and theHcalChStatus_.

Referenced by HBHEIsolatedNoiseReflagger::produce().

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

Definition at line 99 of file HBHEIsolatedNoiseAlgos.h.

References lumiQueryAPI::q, and theHcalSevLvlComputer_.

Referenced by HBHEIsolatedNoiseReflagger::produce().

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

Implements ObjectValidatorAbs.

Definition at line 73 of file HBHEIsolatedNoiseAlgos.cc.

References CaloRecHit::detid(), CaloRecHit::energy(), CaloRecHit::flags(), HcalSeverityLevelComputer::getSeverityLevel(), HcalChannelStatus::getValue(), HcalCondObjectContainer< Item >::getValues(), HBThreshold_, HcalAcceptSeverityLevel_, HcalBarrel, HcalEndcap, HEDThreshold_, HESThreshold_, HBHERecHit::id(), HcalDetId::ietaAbs(), HcalSeverityLevelComputer::recoveredRecHit(), HcalDetId::subdet(), theHcalChStatus_, theHcalSevLvlComputer_, and UseHcalRecoveredHits_.

74 {
76 
77  // require the hit to pass a certain energy threshold
78  if(hit.id().subdet()==HcalBarrel && hit.energy()<HBThreshold_) return false;
79  else if(hit.id().subdet()==HcalEndcap && hit.id().ietaAbs()<=20 && hit.energy()<HESThreshold_) return false;
80  else if(hit.id().subdet()==HcalEndcap && hit.id().ietaAbs()>20 && hit.energy()<HEDThreshold_) return false;
81 
82  // determine if the hit is good, bad, or recovered
83  const DetId id = hit.detid();
84  const uint32_t recHitFlag = hit.flags();
85  const uint32_t dbStatusFlag = theHcalChStatus_->getValues(id)->getValue();
86  int severityLevel = theHcalSevLvlComputer_->getSeverityLevel(id, recHitFlag, dbStatusFlag);
87  bool isRecovered = theHcalSevLvlComputer_->recoveredRecHit(id, recHitFlag);
88 
89  if(severityLevel==0) return true;
90  if(isRecovered) return UseHcalRecoveredHits_;
91  if(severityLevel>static_cast<int>(HcalAcceptSeverityLevel_)) return false;
92  else return true;
93 }
HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:30
const DetId & detid() const
Definition: CaloRecHit.h:20
HcalDetId id() const
get the id
Definition: HBHERecHit.h:23
const Item * getValues(DetId fId, bool throwOnFail=true) const
float energy() const
Definition: CaloRecHit.h:17
bool recoveredRecHit(const DetId &myid, const uint32_t &myflag) const
uint32_t flags() const
Definition: CaloRecHit.h:21
int ietaAbs() const
get the absolute value of the cell ieta
Definition: HcalDetId.h:34
Definition: DetId.h:18
int getSeverityLevel(const DetId &myid, const uint32_t &myflag, const uint32_t &mystatus) const
const HcalChannelQuality * theHcalChStatus_
uint32_t getValue() const
const HcalSeverityLevelComputer * theHcalSevLvlComputer_
bool ObjectValidator::validHit ( const EcalRecHit hit) const
virtual

Implements ObjectValidatorAbs.

Definition at line 95 of file HBHEIsolatedNoiseAlgos.cc.

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

96 {
97  assert(theEcalSevLvlAlgo_!=0 && theEcalChStatus_!=0);
98 
99  // require the hit to pass a certain energy threshold
100  const DetId id = hit.detid();
101  if(id.subdetId()==EcalBarrel && hit.energy()<EBThreshold_) return false;
102  else if(id.subdetId()==EcalEndcap && hit.energy()<EEThreshold_) return false;
103 
104  // determine if the hit is good, bad, or recovered
105  int severityLevel = 999;
106  if (id.subdetId() == EcalBarrel && theEBRecHitCollection_!=0) severityLevel = theEcalSevLvlAlgo_->severityLevel(hit);//id, *theEBRecHitCollection_, *theEcalChStatus_, 5., EcalSeverityLevelAlgo::kSwissCross, 0.95, 2., 15., 0.999);
107  else if(id.subdetId() == EcalEndcap && theEERecHitCollection_!=0) severityLevel = theEcalSevLvlAlgo_->severityLevel(hit);//id, *theEERecHitCollection_, *theEcalChStatus_, 5., EcalSeverityLevelAlgo::kSwissCross, 0.95, 2., 15., 0.999);
108  else return false;
109 
110  if(severityLevel == EcalSeverityLevel::kGood) return true;
111  if(severityLevel == EcalSeverityLevel::kRecovered) return UseEcalRecoveredHits_;
112  if(severityLevel > static_cast<int>(EcalAcceptSeverityLevel_)) return false;
113  else return true;
114 }
EcalSeverityLevel::SeverityLevel severityLevel(const DetId &id) const
Evaluate status from id use channelStatus from DB.
const DetId & detid() const
Definition: EcalRecHit.h:71
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
virtual

Implements ObjectValidatorAbs.

Definition at line 116 of file HBHEIsolatedNoiseAlgos.cc.

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

117 {
118  if(trk.pt()<MinValidTrackPt_) return false;
119  if(trk.pt()<MinValidTrackPtBarrel_ && std::fabs(trk.momentum().eta())<1.479) return false;
120  if(trk.numberOfValidHits()<MinValidTrackNHits_) return false;
121  return true;
122 }
const Vector & momentum() const
track momentum vector
Definition: TrackBase.h:723
double pt() const
track transverse momentum
Definition: TrackBase.h:669
unsigned short numberOfValidHits() const
number of valid hits found
Definition: TrackBase.h:868

Member Data Documentation

double ObjectValidator::EBThreshold_
private

Definition at line 114 of file HBHEIsolatedNoiseAlgos.h.

Referenced by ObjectValidator(), and validHit().

uint32_t ObjectValidator::EcalAcceptSeverityLevel_
private

Definition at line 118 of file HBHEIsolatedNoiseAlgos.h.

Referenced by ObjectValidator(), and validHit().

double ObjectValidator::EEThreshold_
private

Definition at line 115 of file HBHEIsolatedNoiseAlgos.h.

Referenced by ObjectValidator(), and validHit().

double ObjectValidator::HBThreshold_
private

Definition at line 111 of file HBHEIsolatedNoiseAlgos.h.

Referenced by ObjectValidator(), and validHit().

uint32_t ObjectValidator::HcalAcceptSeverityLevel_
private

Definition at line 117 of file HBHEIsolatedNoiseAlgos.h.

Referenced by ObjectValidator(), and validHit().

double ObjectValidator::HEDThreshold_
private

Definition at line 113 of file HBHEIsolatedNoiseAlgos.h.

Referenced by ObjectValidator(), and validHit().

double ObjectValidator::HESThreshold_
private

Definition at line 112 of file HBHEIsolatedNoiseAlgos.h.

Referenced by ObjectValidator(), and validHit().

int ObjectValidator::MinValidTrackNHits_
private

Definition at line 124 of file HBHEIsolatedNoiseAlgos.h.

Referenced by ObjectValidator(), and validTrack().

double ObjectValidator::MinValidTrackPt_
private

Definition at line 122 of file HBHEIsolatedNoiseAlgos.h.

Referenced by ObjectValidator(), and validTrack().

double ObjectValidator::MinValidTrackPtBarrel_
private

Definition at line 123 of file HBHEIsolatedNoiseAlgos.h.

Referenced by ObjectValidator(), and validTrack().

const EcalRecHitCollection* ObjectValidator::theEBRecHitCollection_
private

Definition at line 135 of file HBHEIsolatedNoiseAlgos.h.

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

const EcalChannelStatus* ObjectValidator::theEcalChStatus_
private

Definition at line 128 of file HBHEIsolatedNoiseAlgos.h.

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

const EcalSeverityLevelAlgo* ObjectValidator::theEcalSevLvlAlgo_
private

Definition at line 132 of file HBHEIsolatedNoiseAlgos.h.

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

const EcalRecHitCollection* ObjectValidator::theEERecHitCollection_
private

Definition at line 136 of file HBHEIsolatedNoiseAlgos.h.

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

const HcalChannelQuality* ObjectValidator::theHcalChStatus_
private

Definition at line 127 of file HBHEIsolatedNoiseAlgos.h.

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

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

Definition at line 120 of file HBHEIsolatedNoiseAlgos.h.

Referenced by ObjectValidator(), and validHit().

bool ObjectValidator::UseHcalRecoveredHits_
private

Definition at line 119 of file HBHEIsolatedNoiseAlgos.h.

Referenced by ObjectValidator(), and validHit().