test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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_
 
std::vector< int > thresholds_
 

Detailed Description

Definition at line 67 of file PFRecHitQTests.h.

Constructor & Destructor Documentation

PFRecHitQTestHCALChannel::PFRecHitQTestHCALChannel ( )
inline

Definition at line 72 of file PFRecHitQTests.h.

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

Definition at line 76 of file PFRecHitQTests.h.

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

76  :
77  PFRecHitQTestBase(iConfig)
78  {
79  thresholds_ = iConfig.getParameter<std::vector<int> >("maxSeverities");
80  cleanThresholds_ = iConfig.getParameter<std::vector<double> >("cleaningThresholds");
81  std::vector<std::string> flags = iConfig.getParameter<std::vector<std::string> >("flags");
82  for (unsigned int i=0;i<flags.size();++i) {
83  if (flags[i] =="Standard") {
84  flags_.push_back(-1);
85  depths_.push_back(-1);
86 
87  }
88  else if (flags[i] =="HFInTime") {
90  depths_.push_back(-1);
91  }
92  else if (flags[i] =="HFDigi") {
94  depths_.push_back(-1);
95 
96  }
97  else if (flags[i] =="HFLong") {
99  depths_.push_back(1);
100 
101  }
102  else if (flags[i] =="HFShort") {
104  depths_.push_back(2);
105 
106  }
107  else {
108  flags_.push_back(-1);
109  depths_.push_back(-1);
110 
111  }
112  }
113 
114  }
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 116 of file PFRecHitQTests.h.

References edm::EventSetup::get(), hcalSevLvlComputer_, edm::ESHandle< class >::product(), and theHcalChStatus_.

116  {
118  iSetup.get<HcalRecNumberingRecord>().get(topo);
119  edm::ESHandle<HcalChannelQuality> hcalChStatus;
120  iSetup.get<HcalChannelQualityRcd>().get( "withTopo", hcalChStatus );
121  theHcalChStatus_ = hcalChStatus.product();
122  edm::ESHandle<HcalSeverityLevelComputer> hcalSevLvlComputerHndl;
123  iSetup.get<HcalSeverityLevelComputerRcd>().get(hcalSevLvlComputerHndl);
124  hcalSevLvlComputer_ = hcalSevLvlComputerHndl.product();
125  }
const HcalChannelQuality * theHcalChStatus_
const HcalSeverityLevelComputer * hcalSevLvlComputer_
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 127 of file PFRecHitQTests.h.

Referenced by test().

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

Implements PFRecHitQTestBase.

Definition at line 130 of file PFRecHitQTests.h.

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

130  {
131  return test(rh.detid(),rh.energy(),rh.flags(),clean);
132  }
const DetId & detid() const
Definition: CaloRecHit.h:20
float energy() const
Definition: CaloRecHit.h:17
uint32_t flags() const
Definition: CaloRecHit.h:21
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 134 of file PFRecHitQTests.h.

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

134  {
135  return test(rh.detid(),rh.energy(),rh.flags(),clean);
136  }
const DetId & detid() const
Definition: CaloRecHit.h:20
float energy() const
Definition: CaloRecHit.h:17
uint32_t flags() const
Definition: CaloRecHit.h:21
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 137 of file PFRecHitQTests.h.

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

137  {
138  return test(rh.detid(),rh.energy(),rh.flags(),clean);
139  }
const DetId & detid() const
Definition: CaloRecHit.h:20
float energy() const
Definition: CaloRecHit.h:17
uint32_t flags() const
Definition: CaloRecHit.h:21
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 141 of file PFRecHitQTests.h.

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

Implements PFRecHitQTestBase.

Definition at line 145 of file PFRecHitQTests.h.

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

Definition at line 157 of file PFRecHitQTests.h.

References cleanThresholds_, HcalDetId::depth(), depths_, flags_, HcalSeverityLevelComputer::getSeverityLevel(), HcalChannelStatus::getValue(), HcalCondObjectContainer< Item >::getValues(), hcalSevLvlComputer_, i, theHcalChStatus_, and thresholds_.

157  {
158  const HcalDetId& detid = (HcalDetId)aDETID;
159  const HcalChannelStatus* theStatus = theHcalChStatus_->getValues(detid);
160  unsigned theStatusValue = theStatus->getValue();
161  // Now get severity of problems for the given detID, based on the rechit flag word and the channel quality status value
162  for (unsigned int i=0;i<thresholds_.size();++i) {
163  int hitSeverity =0;
164  if (energy < cleanThresholds_[i])
165  continue;
166 
167  if(flags_[i]<0) {
168  hitSeverity=hcalSevLvlComputer_->getSeverityLevel(detid, flags,theStatusValue);
169  }
170  else {
171  hitSeverity=hcalSevLvlComputer_->getSeverityLevel(detid, flags & flags_[i],theStatusValue);
172  }
173 
174  if (hitSeverity>thresholds_[i] && ((depths_[i]<0 || (depths_[i]==detid.depth())))) {
175  clean=true;
176  return false;
177  }
178  }
179  return true;
180  }
int i
Definition: DBlmapReader.cc:9
const HcalChannelQuality * theHcalChStatus_
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_
int depth() const
get the tower depth
Definition: HcalDetId.cc:106
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_
uint32_t getValue() const
std::vector< int > flags_

Member Data Documentation

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

Definition at line 151 of file PFRecHitQTests.h.

Referenced by PFRecHitQTestHCALChannel(), and test().

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

Definition at line 153 of file PFRecHitQTests.h.

Referenced by PFRecHitQTestHCALChannel(), and test().

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

Definition at line 152 of file PFRecHitQTests.h.

Referenced by PFRecHitQTestHCALChannel(), and test().

const HcalSeverityLevelComputer* PFRecHitQTestHCALChannel::hcalSevLvlComputer_
protected

Definition at line 155 of file PFRecHitQTests.h.

Referenced by beginEvent(), and test().

const HcalChannelQuality* PFRecHitQTestHCALChannel::theHcalChStatus_
protected

Definition at line 154 of file PFRecHitQTests.h.

Referenced by beginEvent(), and test().

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

Definition at line 150 of file PFRecHitQTests.h.

Referenced by PFRecHitQTestHCALChannel(), and test().