CMS 3D CMS Logo

FlagsCleanerECAL.cc
Go to the documentation of this file.
1 #include "FlagsCleanerECAL.h"
4 
6  const std::vector<std::string> flagnames = conf.getParameter<std::vector<std::string> >("RecHitFlagsToBeExcluded");
7  v_chstatus_excl_ = StringToEnumValue<EcalRecHit::Flags>(flagnames);
8 }
9 
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 }
21 
22 // returns true if one of the flags in the exclusion list is up
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 }
T getParameter(std::string const &) const
FlagsCleanerECAL(const edm::ParameterSet &conf)
void clean(const edm::Handle< reco::PFRecHitCollection > &input, std::vector< bool > &mask) override
std::vector< int > v_chstatus_excl_
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)
uint32_t flags() const
Definition: PFRecHit.h:111