CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
FlagsCleanerECAL Class Reference

#include <FlagsCleanerECAL.h>

Inheritance diagram for FlagsCleanerECAL:
RecHitTopologicalCleanerBase

Public Member Functions

void clean (const edm::Handle< reco::PFRecHitCollection > &input, std::vector< bool > &mask) override
 
 FlagsCleanerECAL (const edm::ParameterSet &conf)
 
 FlagsCleanerECAL (const FlagsCleanerECAL &)=delete
 
FlagsCleanerECALoperator= (const FlagsCleanerECAL &)=delete
 
- Public Member Functions inherited from RecHitTopologicalCleanerBase
const std::string & name () const
 
RecHitTopologicalCleanerBaseoperator= (const RecHitTopologicalCleanerBase &)=delete
 
 RecHitTopologicalCleanerBase (const edm::ParameterSet &conf)
 
 RecHitTopologicalCleanerBase (const RecHitTopologicalCleanerBase &)=delete
 
virtual void update (const edm::EventSetup &)
 
virtual ~RecHitTopologicalCleanerBase ()=default
 

Private Member Functions

bool checkFlags (const reco::PFRecHit &hit)
 

Private Attributes

std::vector< int > v_chstatus_excl_
 

Detailed Description

Definition at line 6 of file FlagsCleanerECAL.h.

Constructor & Destructor Documentation

◆ FlagsCleanerECAL() [1/2]

FlagsCleanerECAL::FlagsCleanerECAL ( const edm::ParameterSet conf)

Definition at line 5 of file FlagsCleanerECAL.cc.

6  const std::vector<std::string> flagnames = conf.getParameter<std::vector<std::string> >("RecHitFlagsToBeExcluded");
7  v_chstatus_excl_ = StringToEnumValue<EcalRecHit::Flags>(flagnames);
8 }

References edm::ParameterSet::getParameter(), and v_chstatus_excl_.

◆ FlagsCleanerECAL() [2/2]

FlagsCleanerECAL::FlagsCleanerECAL ( const FlagsCleanerECAL )
delete

Member Function Documentation

◆ checkFlags()

bool FlagsCleanerECAL::checkFlags ( const reco::PFRecHit hit)
private

Definition at line 23 of file FlagsCleanerECAL.cc.

23  {
24  for (auto flag : v_chstatus_excl_) { // check if one of the flags is up
25  if (hit.flags() & (0x1 << flag))
26  return true;
27  }
28  return false;
29 }

References RemoveAddSevLevel::flag, and v_chstatus_excl_.

Referenced by clean().

◆ clean()

void FlagsCleanerECAL::clean ( const edm::Handle< reco::PFRecHitCollection > &  input,
std::vector< bool > &  mask 
)
overridevirtual

Implements RecHitTopologicalCleanerBase.

Definition at line 10 of file FlagsCleanerECAL.cc.

10  {
11  auto const& hits = *input;
12 
13  for (uint16_t idx = 0; idx < hits.size(); ++idx) {
14  if (!mask[idx])
15  continue; // don't need to re-mask things :-)
16  const reco::PFRecHit& rechit = hits[idx];
17  if (checkFlags(rechit))
18  mask[idx] = false;
19  }
20 }

References checkFlags(), hfClusterShapes_cfi::hits, training_settings::idx, and input.

◆ operator=()

FlagsCleanerECAL& FlagsCleanerECAL::operator= ( const FlagsCleanerECAL )
delete

Member Data Documentation

◆ v_chstatus_excl_

std::vector<int> FlagsCleanerECAL::v_chstatus_excl_
private

Definition at line 16 of file FlagsCleanerECAL.h.

Referenced by checkFlags(), and FlagsCleanerECAL().

input
static const std::string input
Definition: EdmProvDump.cc:48
hfClusterShapes_cfi.hits
hits
Definition: hfClusterShapes_cfi.py:5
training_settings.idx
idx
Definition: training_settings.py:16
RecHitTopologicalCleanerBase::RecHitTopologicalCleanerBase
RecHitTopologicalCleanerBase(const edm::ParameterSet &conf)
Definition: RecHitTopologicalCleanerBase.h:14
FlagsCleanerECAL::v_chstatus_excl_
std::vector< int > v_chstatus_excl_
Definition: FlagsCleanerECAL.h:16
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
reco::PFRecHit
Particle flow rechit (rechit + geometry and topology information). See clustering algorithm in PFClus...
Definition: PFRecHit.h:31
hit
Definition: SiStripHitEffFromCalibTree.cc:88
FlagsCleanerECAL::checkFlags
bool checkFlags(const reco::PFRecHit &hit)
Definition: FlagsCleanerECAL.cc:23
RemoveAddSevLevel.flag
flag
Definition: RemoveAddSevLevel.py:116