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) override
 
 PFRecHitQTestHCALChannel ()
 
 PFRecHitQTestHCALChannel (const edm::ParameterSet &iConfig)
 
bool test (reco::PFRecHit &hit, const EcalRecHit &rh, bool &clean, bool fullReadOut) override
 
bool test (reco::PFRecHit &hit, const HBHERecHit &rh, bool &clean) override
 
bool test (reco::PFRecHit &hit, const HFRecHit &rh, bool &clean) override
 
bool test (reco::PFRecHit &hit, const HORecHit &rh, bool &clean) override
 
bool test (reco::PFRecHit &hit, const CaloTower &rh, bool &clean) override
 
bool test (reco::PFRecHit &hit, const HGCRecHit &rh, bool &clean) override
 
- Public Member Functions inherited from PFRecHitQTestBase
 PFRecHitQTestBase ()=default
 
 PFRecHitQTestBase (const edm::ParameterSet &iConfig)
 
virtual ~PFRecHitQTestBase ()=default
 

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

Constructor & Destructor Documentation

PFRecHitQTestHCALChannel::PFRecHitQTestHCALChannel ( )
inline

Definition at line 131 of file PFRecHitQTests.h.

131  {
132  }
PFRecHitQTestHCALChannel::PFRecHitQTestHCALChannel ( const edm::ParameterSet iConfig)
inline

Definition at line 134 of file PFRecHitQTests.h.

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

134  :
135  PFRecHitQTestBase(iConfig)
136  {
137  thresholds_ = iConfig.getParameter<std::vector<int> >("maxSeverities");
138  cleanThresholds_ = iConfig.getParameter<std::vector<double> >("cleaningThresholds");
139  std::vector<std::string> flags = iConfig.getParameter<std::vector<std::string> >("flags");
140  for (auto & flag : flags) {
141  if (flag =="Standard") {
142  flags_.push_back(-1);
143  depths_.push_back(-1);
144  }
145  else if (flag =="HFInTime") {
147  depths_.push_back(-1);
148  }
149  else if (flag =="HFDigi") {
151  depths_.push_back(-1);
152  }
153  else if (flag =="HFLong") {
155  depths_.push_back(1);
156  }
157  else if (flag =="HFShort") {
159  depths_.push_back(2);
160  }
161  else {
162  flags_.push_back(-1);
163  depths_.push_back(-1);
164  }
165  }
166  }
T getParameter(std::string const &) const
std::vector< int > depths_
std::vector< Variable::Flags > flags
Definition: MVATrainer.cc:135
std::vector< double > cleanThresholds_
PFRecHitQTestBase()=default
std::vector< int > thresholds_
std::vector< int > flags_

Member Function Documentation

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

Implements PFRecHitQTestBase.

Definition at line 168 of file PFRecHitQTests.h.

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

168  {
170  iSetup.get<HcalRecNumberingRecord>().get(topo);
171  theHcalTopology_ = topo.product();
173  iSetup.get<HcalChannelQualityRcd>().get( "withTopo", hcalChStatus );
174  theHcalChStatus_ = hcalChStatus.product();
175  edm::ESHandle<HcalSeverityLevelComputer> hcalSevLvlComputerHndl;
176  iSetup.get<HcalSeverityLevelComputerRcd>().get(hcalSevLvlComputerHndl);
177  hcalSevLvlComputer_ = hcalSevLvlComputerHndl.product();
178  }
const HcalChannelQuality * theHcalChStatus_
const HcalSeverityLevelComputer * hcalSevLvlComputer_
const HcalTopology * theHcalTopology_
T get() const
Definition: EventSetup.h:68
T const * product() const
Definition: ESHandle.h:84
bool PFRecHitQTestHCALChannel::test ( reco::PFRecHit hit,
const EcalRecHit rh,
bool &  clean,
bool  fullReadOut 
)
inlineoverridevirtual

Implements PFRecHitQTestBase.

Definition at line 180 of file PFRecHitQTests.h.

180  {
181  return true;
182  }
bool PFRecHitQTestHCALChannel::test ( reco::PFRecHit hit,
const HBHERecHit rh,
bool &  clean 
)
inlineoverridevirtual

Implements PFRecHitQTestBase.

Definition at line 183 of file PFRecHitQTests.h.

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

183  {
184  return test(rh.detid(), rh.energy(), rh.flags(), clean);
185  }
constexpr float energy() const
Definition: CaloRecHit.h:31
constexpr const DetId & detid() const
Definition: CaloRecHit.h:35
bool test(reco::PFRecHit &hit, const EcalRecHit &rh, bool &clean, bool fullReadOut) override
std::vector< T * > clean
Definition: MVATrainer.cc:154
constexpr uint32_t flags() const
Definition: CaloRecHit.h:36
bool PFRecHitQTestHCALChannel::test ( reco::PFRecHit hit,
const HFRecHit rh,
bool &  clean 
)
inlineoverridevirtual

Implements PFRecHitQTestBase.

Definition at line 187 of file PFRecHitQTests.h.

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

187  {
188  return test(rh.detid(), rh.energy(), rh.flags(), clean);
189  }
constexpr float energy() const
Definition: CaloRecHit.h:31
constexpr const DetId & detid() const
Definition: CaloRecHit.h:35
bool test(reco::PFRecHit &hit, const EcalRecHit &rh, bool &clean, bool fullReadOut) override
std::vector< T * > clean
Definition: MVATrainer.cc:154
constexpr uint32_t flags() const
Definition: CaloRecHit.h:36
bool PFRecHitQTestHCALChannel::test ( reco::PFRecHit hit,
const HORecHit rh,
bool &  clean 
)
inlineoverridevirtual

Implements PFRecHitQTestBase.

Definition at line 190 of file PFRecHitQTests.h.

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

190  {
191  return test(rh.detid(), rh.energy(), rh.flags(), clean);
192  }
constexpr float energy() const
Definition: CaloRecHit.h:31
constexpr const DetId & detid() const
Definition: CaloRecHit.h:35
bool test(reco::PFRecHit &hit, const EcalRecHit &rh, bool &clean, bool fullReadOut) override
std::vector< T * > clean
Definition: MVATrainer.cc:154
constexpr uint32_t flags() const
Definition: CaloRecHit.h:36
bool PFRecHitQTestHCALChannel::test ( reco::PFRecHit hit,
const CaloTower rh,
bool &  clean 
)
inlineoverridevirtual

Implements PFRecHitQTestBase.

Definition at line 194 of file PFRecHitQTests.h.

194  {
195  return true;
196  }
bool PFRecHitQTestHCALChannel::test ( reco::PFRecHit hit,
const HGCRecHit rh,
bool &  clean 
)
inlineoverridevirtual

Implements PFRecHitQTestBase.

Definition at line 198 of file PFRecHitQTests.h.

198  {
199  return true;
200  }
bool PFRecHitQTestHCALChannel::test ( unsigned  aDETID,
double  energy,
int  flags,
bool &  clean 
)
inlineprotected

Definition at line 211 of file PFRecHitQTests.h.

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

211  {
212  HcalDetId detid = (HcalDetId)aDETID;
214  detid = theHcalTopology_->idFront(detid);
215  }
216 
217  const HcalChannelStatus* theStatus = theHcalChStatus_->getValues(detid);
218  unsigned theStatusValue = theStatus->getValue();
219  // Now get severity of problems for the given detID, based on the rechit flag word and the channel quality status value
220  for (unsigned int i=0;i<thresholds_.size();++i) {
221  int hitSeverity =0;
222  if (energy < cleanThresholds_[i])
223  continue;
224 
225  if(flags_[i]<0) {
226  hitSeverity=hcalSevLvlComputer_->getSeverityLevel(detid, flags, theStatusValue);
227  }
228  else {
229  hitSeverity=hcalSevLvlComputer_->getSeverityLevel(detid, flags & flags_[i], theStatusValue);
230  }
231 
232  if (hitSeverity>thresholds_[i] and ((depths_[i]<0 or (depths_[i]==detid.depth())))) {
233  clean=true;
234  return false;
235  }
236  }
237  return true;
238  }
const HcalChannelQuality * theHcalChStatus_
HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:146
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_
bool getMergePositionFlag() const
Definition: HcalTopology.h:170
const HcalTopology * theHcalTopology_
int depth() const
get the tower depth
Definition: HcalDetId.h:166
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
std::vector< T * > clean
Definition: MVATrainer.cc:154
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:176
uint32_t getValue() const
std::vector< int > flags_

Member Data Documentation

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

Definition at line 204 of file PFRecHitQTests.h.

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

Definition at line 206 of file PFRecHitQTests.h.

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

Definition at line 205 of file PFRecHitQTests.h.

const HcalSeverityLevelComputer* PFRecHitQTestHCALChannel::hcalSevLvlComputer_
protected

Definition at line 209 of file PFRecHitQTests.h.

const HcalChannelQuality* PFRecHitQTestHCALChannel::theHcalChStatus_
protected

Definition at line 208 of file PFRecHitQTests.h.

const HcalTopology* PFRecHitQTestHCALChannel::theHcalTopology_
protected

Definition at line 207 of file PFRecHitQTests.h.

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

Definition at line 203 of file PFRecHitQTests.h.