CMS 3D CMS Logo

FlagsCleanerECAL.cc
Go to the documentation of this file.
5 
7 public:
9  FlagsCleanerECAL(const FlagsCleanerECAL&) = delete;
11 
12  // mark rechits which are flagged as one of the values provided in the vector
13  void clean(const edm::Handle<reco::PFRecHitCollection>& input, std::vector<bool>& mask) override;
14 
15 private:
16  std::vector<int> v_chstatus_excl_; // list of rechit status flags to be excluded from seeding
17  bool checkFlags(const reco::PFRecHit& hit);
18 };
19 
21 
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 }
27 
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 }
39 
40 // returns true if one of the flags in the exclusion list is up
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 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
void clean(const edm::Handle< reco::PFRecHitCollection > &input, std::vector< bool > &mask) override
FlagsCleanerECAL & operator=(const FlagsCleanerECAL &)=delete
constexpr uint32_t mask
Definition: gpuClustering.h:24
std::vector< int > v_chstatus_excl_
static std::string const input
Definition: EdmProvDump.cc:50
Particle flow rechit (rechit + geometry and topology information). See clustering algorithm in PFClus...
Definition: PFRecHit.h:31
bool checkFlags(const reco::PFRecHit &hit)
FlagsCleanerECAL(const edm::ParameterSet &conf, edm::ConsumesCollector &cc)
#define DEFINE_EDM_PLUGIN(factory, type, name)