CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Protected Attributes
PFRecHitQTestHCALChannel Class Reference

#include <PFRecHitQTests.h>

Inheritance diagram for PFRecHitQTestHCALChannel:
PFRecHitQTestBase

Public Member Functions

void beginEvent (const edm::Event &event, const edm::EventSetup &iSetup)
 
 PFRecHitQTestHCALChannel ()
 
 PFRecHitQTestHCALChannel (const edm::ParameterSet &iConfig)
 
bool test (reco::PFRecHit &hit, const EcalRecHit &rh, bool &clean)
 
bool test (reco::PFRecHit &hit, const HBHERecHit &rh, bool &clean)
 
bool test (reco::PFRecHit &hit, const HFRecHit &rh, bool &clean)
 
bool test (reco::PFRecHit &hit, const HORecHit &rh, bool &clean)
 
bool test (reco::PFRecHit &hit, const CaloTower &rh, bool &clean)
 
bool test (reco::PFRecHit &hit, const HGCRecHit &rh, bool &clean)
 
- Public Member Functions inherited from PFRecHitQTestBase
 PFRecHitQTestBase ()
 
 PFRecHitQTestBase (const edm::ParameterSet &iConfig)
 

Protected Member Functions

bool test (unsigned aDETID, double energy, int flags, bool &clean)
 

Protected Attributes

std::vector< double > cleanThresholds_
 
std::vector< int > depths_
 
std::vector< int > flags_
 
const HcalSeverityLevelComputerhcalSevLvlComputer_
 
const HcalChannelQualitytheHcalChStatus_
 
const HcalTopologytheHcalTopology_
 
std::vector< int > thresholds_
 

Detailed Description

Definition at line 68 of file PFRecHitQTests.h.

Constructor & Destructor Documentation

PFRecHitQTestHCALChannel::PFRecHitQTestHCALChannel ( )
inline

Definition at line 73 of file PFRecHitQTests.h.

73  {
74 
75  }
PFRecHitQTestHCALChannel::PFRecHitQTestHCALChannel ( const edm::ParameterSet iConfig)
inline

Definition at line 77 of file PFRecHitQTests.h.

References flags, edm::ParameterSet::getParameter(), HcalCaloFlagLabels::HFDigiTime, HcalCaloFlagLabels::HFInTimeWindow, HcalCaloFlagLabels::HFLongShort, and i.

77  :
78  PFRecHitQTestBase(iConfig)
79  {
80  thresholds_ = iConfig.getParameter<std::vector<int> >("maxSeverities");
81  cleanThresholds_ = iConfig.getParameter<std::vector<double> >("cleaningThresholds");
82  std::vector<std::string> flags = iConfig.getParameter<std::vector<std::string> >("flags");
83  for (unsigned int i=0;i<flags.size();++i) {
84  if (flags[i] =="Standard") {
85  flags_.push_back(-1);
86  depths_.push_back(-1);
87 
88  }
89  else if (flags[i] =="HFInTime") {
91  depths_.push_back(-1);
92  }
93  else if (flags[i] =="HFDigi") {
95  depths_.push_back(-1);
96 
97  }
98  else if (flags[i] =="HFLong") {
100  depths_.push_back(1);
101 
102  }
103  else if (flags[i] =="HFShort") {
105  depths_.push_back(2);
106 
107  }
108  else {
109  flags_.push_back(-1);
110  depths_.push_back(-1);
111 
112  }
113  }
114 
115  }
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
std::vector< int > depths_
std::vector< Variable::Flags > flags
Definition: MVATrainer.cc:135
std::vector< double > cleanThresholds_
std::vector< int > thresholds_
std::vector< int > flags_

Member Function Documentation

void PFRecHitQTestHCALChannel::beginEvent ( const edm::Event event,
const edm::EventSetup iSetup 
)
inlinevirtual

Implements PFRecHitQTestBase.

Definition at line 117 of file PFRecHitQTests.h.

References edm::EventSetup::get(), and edm::ESHandle< T >::product().

117  {
119  iSetup.get<HcalRecNumberingRecord>().get(topo);
120  theHcalTopology_ = topo.product();
121  edm::ESHandle<HcalChannelQuality> hcalChStatus;
122  iSetup.get<HcalChannelQualityRcd>().get( "withTopo", hcalChStatus );
123  theHcalChStatus_ = hcalChStatus.product();
124  edm::ESHandle<HcalSeverityLevelComputer> hcalSevLvlComputerHndl;
125  iSetup.get<HcalSeverityLevelComputerRcd>().get(hcalSevLvlComputerHndl);
126  hcalSevLvlComputer_ = hcalSevLvlComputerHndl.product();
127  }
const HcalChannelQuality * theHcalChStatus_
const HcalSeverityLevelComputer * hcalSevLvlComputer_
const HcalTopology * theHcalTopology_
const T & get() const
Definition: EventSetup.h:56
T const * product() const
Definition: ESHandle.h:86
bool PFRecHitQTestHCALChannel::test ( reco::PFRecHit hit,
const EcalRecHit rh,
bool &  clean 
)
inlinevirtual

Implements PFRecHitQTestBase.

Definition at line 129 of file PFRecHitQTests.h.

129  {
130  return true;
131  }
bool PFRecHitQTestHCALChannel::test ( reco::PFRecHit hit,
const HBHERecHit rh,
bool &  clean 
)
inlinevirtual

Implements PFRecHitQTestBase.

Definition at line 132 of file PFRecHitQTests.h.

References clean, CaloRecHit::detid(), CaloRecHit::energy(), CaloRecHit::flags(), and PFRecHitQTestThreshold::test().

132  {
133  return test(rh.detid(),rh.energy(),rh.flags(),clean);
134  }
const DetId & detid() const
Definition: CaloRecHit.h:21
float energy() const
Definition: CaloRecHit.h:17
uint32_t flags() const
Definition: CaloRecHit.h:22
std::vector< T * > clean
Definition: MVATrainer.cc:156
bool test(reco::PFRecHit &hit, const EcalRecHit &rh, bool &clean)
bool PFRecHitQTestHCALChannel::test ( reco::PFRecHit hit,
const HFRecHit rh,
bool &  clean 
)
inlinevirtual

Implements PFRecHitQTestBase.

Definition at line 136 of file PFRecHitQTests.h.

References clean, CaloRecHit::detid(), CaloRecHit::energy(), CaloRecHit::flags(), and PFRecHitQTestThreshold::test().

136  {
137  return test(rh.detid(),rh.energy(),rh.flags(),clean);
138  }
const DetId & detid() const
Definition: CaloRecHit.h:21
float energy() const
Definition: CaloRecHit.h:17
uint32_t flags() const
Definition: CaloRecHit.h:22
std::vector< T * > clean
Definition: MVATrainer.cc:156
bool test(reco::PFRecHit &hit, const EcalRecHit &rh, bool &clean)
bool PFRecHitQTestHCALChannel::test ( reco::PFRecHit hit,
const HORecHit rh,
bool &  clean 
)
inlinevirtual

Implements PFRecHitQTestBase.

Definition at line 139 of file PFRecHitQTests.h.

References clean, CaloRecHit::detid(), CaloRecHit::energy(), CaloRecHit::flags(), and PFRecHitQTestThreshold::test().

139  {
140  return test(rh.detid(),rh.energy(),rh.flags(),clean);
141  }
const DetId & detid() const
Definition: CaloRecHit.h:21
float energy() const
Definition: CaloRecHit.h:17
uint32_t flags() const
Definition: CaloRecHit.h:22
std::vector< T * > clean
Definition: MVATrainer.cc:156
bool test(reco::PFRecHit &hit, const EcalRecHit &rh, bool &clean)
bool PFRecHitQTestHCALChannel::test ( reco::PFRecHit hit,
const CaloTower rh,
bool &  clean 
)
inlinevirtual

Implements PFRecHitQTestBase.

Definition at line 143 of file PFRecHitQTests.h.

143  {
144  return true;
145  }
bool PFRecHitQTestHCALChannel::test ( reco::PFRecHit hit,
const HGCRecHit rh,
bool &  clean 
)
inlinevirtual

Implements PFRecHitQTestBase.

Definition at line 147 of file PFRecHitQTests.h.

147  {
148  return true;
149  }
bool PFRecHitQTestHCALChannel::test ( unsigned  aDETID,
double  energy,
int  flags,
bool &  clean 
)
inlineprotected

Definition at line 160 of file PFRecHitQTests.h.

References HcalDetId::depth(), HcalSeverityLevelComputer::getSeverityLevel(), HcalChannelStatus::getValue(), HcalCondObjectContainer< Item >::getValues(), HcalEndcap, i, HcalTopology::idFront(), HcalDetId::subdet(), and HcalTopology::withSpecialRBXHBHE().

160  {
161  HcalDetId detid = (HcalDetId)aDETID;
163  detid = theHcalTopology_->idFront(detid);
164  }
165 
166  const HcalChannelStatus* theStatus = theHcalChStatus_->getValues(detid);
167  unsigned theStatusValue = theStatus->getValue();
168  // Now get severity of problems for the given detID, based on the rechit flag word and the channel quality status value
169  for (unsigned int i=0;i<thresholds_.size();++i) {
170  int hitSeverity =0;
171  if (energy < cleanThresholds_[i])
172  continue;
173 
174  if(flags_[i]<0) {
175  hitSeverity=hcalSevLvlComputer_->getSeverityLevel(detid, flags,theStatusValue);
176  }
177  else {
178  hitSeverity=hcalSevLvlComputer_->getSeverityLevel(detid, flags & flags_[i],theStatusValue);
179  }
180 
181  if (hitSeverity>thresholds_[i] && ((depths_[i]<0 || (depths_[i]==detid.depth())))) {
182  clean=true;
183  return false;
184  }
185  }
186  return true;
187  }
int i
Definition: DBlmapReader.cc:9
const HcalChannelQuality * theHcalChStatus_
HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:49
std::vector< int > depths_
const HcalSeverityLevelComputer * hcalSevLvlComputer_
std::vector< Variable::Flags > flags
Definition: MVATrainer.cc:135
const Item * getValues(DetId fId, bool throwOnFail=true) const
std::vector< double > cleanThresholds_
const HcalTopology * theHcalTopology_
int depth() const
get the tower depth
Definition: HcalDetId.cc:108
std::vector< T * > clean
Definition: MVATrainer.cc:156
int getSeverityLevel(const DetId &myid, const uint32_t &myflag, const uint32_t &mystatus) const
std::vector< int > thresholds_
HcalDetId idFront(const HcalDetId &id) const
Definition: HcalTopology.h:170
uint32_t getValue() const
bool withSpecialRBXHBHE() const
Definition: HcalTopology.h:162
std::vector< int > flags_

Member Data Documentation

std::vector<double> PFRecHitQTestHCALChannel::cleanThresholds_
protected

Definition at line 153 of file PFRecHitQTests.h.

std::vector<int> PFRecHitQTestHCALChannel::depths_
protected

Definition at line 155 of file PFRecHitQTests.h.

std::vector<int> PFRecHitQTestHCALChannel::flags_
protected

Definition at line 154 of file PFRecHitQTests.h.

const HcalSeverityLevelComputer* PFRecHitQTestHCALChannel::hcalSevLvlComputer_
protected

Definition at line 158 of file PFRecHitQTests.h.

const HcalChannelQuality* PFRecHitQTestHCALChannel::theHcalChStatus_
protected

Definition at line 157 of file PFRecHitQTests.h.

const HcalTopology* PFRecHitQTestHCALChannel::theHcalTopology_
protected

Definition at line 156 of file PFRecHitQTests.h.

std::vector<int> PFRecHitQTestHCALChannel::thresholds_
protected

Definition at line 152 of file PFRecHitQTests.h.