CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
FlagsCleanerECAL Class Reference
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, edm::ConsumesCollector &cc)
 
 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, edm::ConsumesCollector &cc)
 
 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.cc.

Constructor & Destructor Documentation

◆ FlagsCleanerECAL() [1/2]

FlagsCleanerECAL::FlagsCleanerECAL ( const edm::ParameterSet conf,
edm::ConsumesCollector cc 
)

Definition at line 22 of file FlagsCleanerECAL.cc.

24  const std::vector<std::string> flagnames = conf.getParameter<std::vector<std::string> >("RecHitFlagsToBeExcluded");
25  v_chstatus_excl_ = StringToEnumValue<EcalRecHit::Flags>(flagnames);
26 }

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 41 of file FlagsCleanerECAL.cc.

41  {
42  for (auto flag : v_chstatus_excl_) { // check if one of the flags is up
43  if (hit.flags() & (0x1 << flag))
44  return true;
45  }
46  return false;
47 }

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 28 of file FlagsCleanerECAL.cc.

28  {
29  auto const& hits = *input;
30 
31  for (uint idx = 0; idx < hits.size(); ++idx) {
32  if (!mask[idx])
33  continue; // don't need to re-mask things :-)
34  const reco::PFRecHit& rechit = hits[idx];
35  if (checkFlags(rechit))
36  mask[idx] = false;
37  }
38 }

References checkFlags(), hfClusterShapes_cfi::hits, heavyIonCSV_trainingSettings::idx, input, and parallelization::uint.

◆ 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.cc.

Referenced by checkFlags(), and FlagsCleanerECAL().

input
static const std::string input
Definition: EdmProvDump.cc:48
hfClusterShapes_cfi.hits
hits
Definition: hfClusterShapes_cfi.py:5
RecHitTopologicalCleanerBase::RecHitTopologicalCleanerBase
RecHitTopologicalCleanerBase(const edm::ParameterSet &conf, edm::ConsumesCollector &cc)
Definition: RecHitTopologicalCleanerBase.h:15
parallelization.uint
uint
Definition: parallelization.py:124
heavyIonCSV_trainingSettings.idx
idx
Definition: heavyIonCSV_trainingSettings.py:5
cc
FlagsCleanerECAL::v_chstatus_excl_
std::vector< int > v_chstatus_excl_
Definition: FlagsCleanerECAL.cc:16
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
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:41
RemoveAddSevLevel.flag
flag
Definition: RemoveAddSevLevel.py:117