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::FlagsCleanerECAL ( const edm::ParameterSet conf)

Definition at line 5 of file FlagsCleanerECAL.cc.

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

6  const std::vector<std::string> flagnames = conf.getParameter<std::vector<std::string> >("RecHitFlagsToBeExcluded");
7  v_chstatus_excl_ = StringToEnumValue<EcalRecHit::Flags>(flagnames);
8 }
T getParameter(std::string const &) const
RecHitTopologicalCleanerBase(const edm::ParameterSet &conf)
std::vector< int > v_chstatus_excl_
FlagsCleanerECAL::FlagsCleanerECAL ( const FlagsCleanerECAL )
delete

Member Function Documentation

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

Definition at line 23 of file FlagsCleanerECAL.cc.

References RemoveAddSevLevel::flag, reco::PFRecHit::flags(), and v_chstatus_excl_.

Referenced by clean().

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 }
std::vector< int > v_chstatus_excl_
uint32_t flags() const
Definition: PFRecHit.h:111
void FlagsCleanerECAL::clean ( const edm::Handle< reco::PFRecHitCollection > &  input,
std::vector< bool > &  mask 
)
overridevirtual

Implements RecHitTopologicalCleanerBase.

Definition at line 10 of file FlagsCleanerECAL.cc.

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

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 }
static std::string const input
Definition: EdmProvDump.cc:48
Particle flow rechit (rechit + geometry and topology information). See clustering algorithm in PFClus...
Definition: PFRecHit.h:31
bool checkFlags(const reco::PFRecHit &hit)
FlagsCleanerECAL& FlagsCleanerECAL::operator= ( const FlagsCleanerECAL )
delete

Member Data Documentation

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

Definition at line 16 of file FlagsCleanerECAL.h.

Referenced by checkFlags(), and FlagsCleanerECAL().