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)
 
- 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 63 of file PFRecHitQTests.h.

Constructor & Destructor Documentation

PFRecHitQTestHCALChannel::PFRecHitQTestHCALChannel ( )
inline

Definition at line 68 of file PFRecHitQTests.h.

68  {
69 
70  }
PFRecHitQTestHCALChannel::PFRecHitQTestHCALChannel ( const edm::ParameterSet iConfig)
inline

Definition at line 72 of file PFRecHitQTests.h.

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

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

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

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

Referenced by test().

123  {
124  return true;
125  }
bool PFRecHitQTestHCALChannel::test ( reco::PFRecHit hit,
const HBHERecHit rh,
bool &  clean 
)
inlinevirtual

Implements PFRecHitQTestBase.

Definition at line 126 of file PFRecHitQTests.h.

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

126  {
127  return test(rh.detid(),rh.energy(),rh.flags(),clean);
128  }
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 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 HORecHit rh,
bool &  clean 
)
inlinevirtual

Implements PFRecHitQTestBase.

Definition at line 133 of file PFRecHitQTests.h.

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

133  {
134  return test(rh.detid(),rh.energy(),rh.flags(),clean);
135  }
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 137 of file PFRecHitQTests.h.

137  {
138  return true;
139 
140  }
bool PFRecHitQTestHCALChannel::test ( unsigned  aDETID,
double  energy,
int  flags,
bool &  clean 
)
inlineprotected

Definition at line 150 of file PFRecHitQTests.h.

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

150  {
151  const HcalDetId& detid = (HcalDetId)aDETID;
152  const HcalChannelStatus* theStatus = theHcalChStatus_->getValues(detid);
153  unsigned theStatusValue = theStatus->getValue();
154  // Now get severity of problems for the given detID, based on the rechit flag word and the channel quality status value
155  for (unsigned int i=0;i<thresholds_.size();++i) {
156  int hitSeverity =0;
157  if (energy < cleanThresholds_[i])
158  continue;
159 
160  if(flags_[i]<0) {
161  hitSeverity=hcalSevLvlComputer_->getSeverityLevel(detid, flags,theStatusValue);
162  }
163  else {
164  hitSeverity=hcalSevLvlComputer_->getSeverityLevel(detid, flags & flags_[i],theStatusValue);
165  }
166 
167  if (hitSeverity>thresholds_[i] && ((depths_[i]<0 || (depths_[i]==detid.depth())))) {
168  clean=true;
169  return false;
170  }
171  }
172  return true;
173  }
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.h:55
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 144 of file PFRecHitQTests.h.

Referenced by PFRecHitQTestHCALChannel(), and test().

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

Definition at line 146 of file PFRecHitQTests.h.

Referenced by PFRecHitQTestHCALChannel(), and test().

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

Definition at line 145 of file PFRecHitQTests.h.

Referenced by PFRecHitQTestHCALChannel(), and test().

const HcalSeverityLevelComputer* PFRecHitQTestHCALChannel::hcalSevLvlComputer_
protected

Definition at line 148 of file PFRecHitQTests.h.

Referenced by beginEvent(), and test().

const HcalChannelQuality* PFRecHitQTestHCALChannel::theHcalChStatus_
protected

Definition at line 147 of file PFRecHitQTests.h.

Referenced by beginEvent(), and test().

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

Definition at line 143 of file PFRecHitQTests.h.

Referenced by PFRecHitQTestHCALChannel(), and test().