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

Constructor & Destructor Documentation

PFRecHitQTestHCALChannel::PFRecHitQTestHCALChannel ( )
inline

Definition at line 66 of file PFRecHitQTests.h.

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

Definition at line 70 of file PFRecHitQTests.h.

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

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

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

110  {
112  iSetup.get<IdealGeometryRecord>().get(topo);
113  edm::ESHandle<HcalChannelQuality> hcalChStatus;
114  iSetup.get<HcalChannelQualityRcd>().get( hcalChStatus );
115  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_
void setTopo(const HcalTopology *topo) const
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:86
const HcalTopology * topo() const
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().