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

Constructor & Destructor Documentation

PFRecHitQTestHCALChannel::PFRecHitQTestHCALChannel ( )
inline

Definition at line 67 of file PFRecHitQTests.h.

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

Definition at line 71 of file PFRecHitQTests.h.

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

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

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

111  {
113  iSetup.get<IdealGeometryRecord>().get(topo);
114  edm::ESHandle<HcalChannelQuality> hcalChStatus;
115  iSetup.get<HcalChannelQualityRcd>().get( "withTopo", hcalChStatus );
116  theHcalChStatus_ = hcalChStatus.product();
117  edm::ESHandle<HcalSeverityLevelComputer> hcalSevLvlComputerHndl;
118  iSetup.get<HcalSeverityLevelComputerRcd>().get(hcalSevLvlComputerHndl);
119  hcalSevLvlComputer_ = hcalSevLvlComputerHndl.product();
120  }
const HcalChannelQuality * theHcalChStatus_
const HcalSeverityLevelComputer * hcalSevLvlComputer_
const T & get() const
Definition: EventSetup.h:55
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 122 of file PFRecHitQTests.h.

Referenced by test().

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

Implements PFRecHitQTestBase.

Definition at line 125 of file PFRecHitQTests.h.

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

125  {
126  return test(rh.detid(),rh.energy(),rh.flags(),clean);
127  }
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 129 of file PFRecHitQTests.h.

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

129  {
130  return test(rh.detid(),rh.energy(),rh.flags(),clean);
131  }
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 132 of file PFRecHitQTests.h.

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

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

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

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

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

Referenced by PFRecHitQTestHCALChannel(), and test().

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

Definition at line 145 of file PFRecHitQTests.h.

Referenced by PFRecHitQTestHCALChannel(), and test().

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

Definition at line 144 of file PFRecHitQTests.h.

Referenced by PFRecHitQTestHCALChannel(), and test().

const HcalSeverityLevelComputer* PFRecHitQTestHCALChannel::hcalSevLvlComputer_
protected

Definition at line 147 of file PFRecHitQTests.h.

Referenced by beginEvent(), and test().

const HcalChannelQuality* PFRecHitQTestHCALChannel::theHcalChStatus_
protected

Definition at line 146 of file PFRecHitQTests.h.

Referenced by beginEvent(), and test().

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

Definition at line 142 of file PFRecHitQTests.h.

Referenced by PFRecHitQTestHCALChannel(), and test().