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.

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

23  : RecHitTopologicalCleanerBase(conf, cc) {
24  const std::vector<std::string> flagnames = conf.getParameter<std::vector<std::string> >("RecHitFlagsToBeExcluded");
25  v_chstatus_excl_ = StringToEnumValue<EcalRecHit::Flags>(flagnames);
26 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
std::vector< int > v_chstatus_excl_
RecHitTopologicalCleanerBase(const edm::ParameterSet &conf, edm::ConsumesCollector &cc)

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

References RemoveAddSevLevel::flag, and v_chstatus_excl_.

Referenced by clean().

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 }
std::vector< int > v_chstatus_excl_

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

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

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 }
constexpr uint32_t mask
Definition: gpuClustering.h:24
static std::string const input
Definition: EdmProvDump.cc:47
Particle flow rechit (rechit + geometry and topology information). See clustering algorithm in PFClus...
Definition: PFRecHit.h:31
bool checkFlags(const reco::PFRecHit &hit)

◆ 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().