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 | 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::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 }
std::vector< int > v_chstatus_excl_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
RecHitTopologicalCleanerBase(const edm::ParameterSet &conf, edm::ConsumesCollector &cc)
FlagsCleanerECAL::FlagsCleanerECAL ( const FlagsCleanerECAL )
delete

Member Function Documentation

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

Definition at line 41 of file FlagsCleanerECAL.cc.

References reco::PFRecHit::flags(), 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_
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 28 of file FlagsCleanerECAL.cc.

References checkFlags(), input, 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 }
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)
FlagsCleanerECAL& FlagsCleanerECAL::operator= ( const FlagsCleanerECAL )
delete

Member Data Documentation

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

Definition at line 16 of file FlagsCleanerECAL.cc.

Referenced by checkFlags(), and FlagsCleanerECAL().