CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes
PFRecHitQTestECALMultiThreshold Class Reference

#include <PFRecHitQTests.h>

Inheritance diagram for PFRecHitQTestECALMultiThreshold:
PFRecHitQTestBase

Public Member Functions

void beginEvent (const edm::Event &event, const edm::EventSetup &iSetup) override
 
 PFRecHitQTestECALMultiThreshold ()
 
 PFRecHitQTestECALMultiThreshold (const edm::ParameterSet &iConfig, edm::ConsumesCollector &cc)
 
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, edm::ConsumesCollector &cc)
 
virtual ~PFRecHitQTestBase ()=default
 

Protected Member Functions

bool pass (const reco::PFRecHit &hit)
 

Protected Attributes

bool applySelectionsToAllCrystals_
 
bool endcapGeometrySet_
 
const std::vector< double > thresholds_
 

Private Attributes

edm::ESGetToken< CaloGeometry,
CaloGeometryRecord
geomToken_
 

Detailed Description

Definition at line 358 of file PFRecHitQTests.h.

Constructor & Destructor Documentation

PFRecHitQTestECALMultiThreshold::PFRecHitQTestECALMultiThreshold ( )
inline

Definition at line 360 of file PFRecHitQTests.h.

360 {}
PFRecHitQTestECALMultiThreshold::PFRecHitQTestECALMultiThreshold ( const edm::ParameterSet iConfig,
edm::ConsumesCollector cc 
)
inline

Definition at line 362 of file PFRecHitQTests.h.

References edm::errors::Configuration, EcalRingCalibrationTools::N_RING_TOTAL, and thresholds_.

363  : PFRecHitQTestBase(iConfig, cc),
364  thresholds_(iConfig.getParameter<std::vector<double> >("thresholds")),
365  applySelectionsToAllCrystals_(iConfig.getParameter<bool>("applySelectionsToAllCrystals")),
366  geomToken_(cc.esConsumes()) {
368  throw edm::Exception(edm::errors::Configuration, "ValueError")
369  << "thresholds is expected to have " << EcalRingCalibrationTools::N_RING_TOTAL << " elements but has "
370  << thresholds_.size();
371  }
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > geomToken_
const std::vector< double > thresholds_
PFRecHitQTestBase()=default
static constexpr short N_RING_TOTAL
T getParameter(std::string const &) const
Definition: ParameterSet.h:303

Member Function Documentation

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

Implements PFRecHitQTestBase.

Definition at line 373 of file PFRecHitQTests.h.

References DetId::Ecal, EcalEndcap, endcapGeometrySet_, geomToken_, edm::EventSetup::getHandle(), and EcalRingCalibrationTools::setCaloGeometry().

373  {
375  CaloSubdetectorGeometry const* endcapGeometry = pG->getSubdetectorGeometry(DetId::Ecal, EcalEndcap);
376  endcapGeometrySet_ = false;
377  if (endcapGeometry) {
379  endcapGeometrySet_ = true;
380  }
381  }
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > geomToken_
static void setCaloGeometry(const CaloGeometry *geometry)
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:157
bool PFRecHitQTestECALMultiThreshold::pass ( const reco::PFRecHit hit)
inlineprotected

Definition at line 405 of file PFRecHitQTests.h.

References reco::PFRecHit::detId(), EcalBarrel, endcapGeometrySet_, reco::PFRecHit::energy(), EcalRingCalibrationTools::getRingIndex(), and thresholds_.

Referenced by test().

405  {
406  DetId detId(hit.detId());
407 
408  // this is to skip endcap ZS for Phase2 until there is a defined geometry
409  // apply the loosest ZS threshold, for the first eta-ring in EB
410  if (not endcapGeometrySet_) {
411  // there is only ECAL EB in Phase 2
412  if (detId.subdetId() != EcalBarrel)
413  return true;
414 
415  // 0-169: EB eta-rings
416  // 170-208: EE- eta rings
417  // 209-247: EE+ eta rings
418  int firstEBRing = 0;
419  return (hit.energy() > thresholds_[firstEBRing]);
420  }
421 
422  int iring = EcalRingCalibrationTools::getRingIndex(detId);
423  if (hit.energy() > thresholds_[iring])
424  return true;
425 
426  return false;
427  }
unsigned detId() const
rechit detId
Definition: PFRecHit.h:93
static short getRingIndex(DetId aDetId)
Retrieve the phi-ring index corresponding to a DetId.
float energy() const
rechit energy
Definition: PFRecHit.h:99
const std::vector< double > thresholds_
Definition: DetId.h:17
bool PFRecHitQTestECALMultiThreshold::test ( reco::PFRecHit hit,
const EcalRecHit rh,
bool &  clean,
bool  fullReadOut 
)
inlineoverridevirtual

Implements PFRecHitQTestBase.

Definition at line 383 of file PFRecHitQTests.h.

References applySelectionsToAllCrystals_, or, and pass().

383  {
385  return pass(hit);
386  else
387  return fullReadOut or pass(hit);
388  }
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::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
bool pass(const reco::PFRecHit &hit)
bool PFRecHitQTestECALMultiThreshold::test ( reco::PFRecHit hit,
const HBHERecHit rh,
bool &  clean 
)
inlineoverridevirtual

Implements PFRecHitQTestBase.

Definition at line 389 of file PFRecHitQTests.h.

389 { return true; }
bool PFRecHitQTestECALMultiThreshold::test ( reco::PFRecHit hit,
const HFRecHit rh,
bool &  clean 
)
inlineoverridevirtual

Implements PFRecHitQTestBase.

Definition at line 391 of file PFRecHitQTests.h.

391 { return true; }
bool PFRecHitQTestECALMultiThreshold::test ( reco::PFRecHit hit,
const HORecHit rh,
bool &  clean 
)
inlineoverridevirtual

Implements PFRecHitQTestBase.

Definition at line 392 of file PFRecHitQTests.h.

392 { return true; }
bool PFRecHitQTestECALMultiThreshold::test ( reco::PFRecHit hit,
const CaloTower rh,
bool &  clean 
)
inlineoverridevirtual

Implements PFRecHitQTestBase.

Definition at line 394 of file PFRecHitQTests.h.

394 { return true; }
bool PFRecHitQTestECALMultiThreshold::test ( reco::PFRecHit hit,
const HGCRecHit rh,
bool &  clean 
)
inlineoverridevirtual

Implements PFRecHitQTestBase.

Definition at line 396 of file PFRecHitQTests.h.

396 { return true; }

Member Data Documentation

bool PFRecHitQTestECALMultiThreshold::applySelectionsToAllCrystals_
protected

Definition at line 403 of file PFRecHitQTests.h.

Referenced by test().

bool PFRecHitQTestECALMultiThreshold::endcapGeometrySet_
protected

Definition at line 400 of file PFRecHitQTests.h.

Referenced by beginEvent(), and pass().

edm::ESGetToken<CaloGeometry, CaloGeometryRecord> PFRecHitQTestECALMultiThreshold::geomToken_
private

Definition at line 430 of file PFRecHitQTests.h.

Referenced by beginEvent().

const std::vector<double> PFRecHitQTestECALMultiThreshold::thresholds_
protected

Definition at line 399 of file PFRecHitQTests.h.

Referenced by pass(), and PFRecHitQTestECALMultiThreshold().