CMS 3D CMS Logo

PFClusterBuilderBase.h
Go to the documentation of this file.
1 #ifndef __PFClusterBuilderBase_H__
2 #define __PFClusterBuilderBase_H__
3 
8 
12 
13 #include <string>
14 #include <iostream>
15 #include <memory>
16 
17 namespace edm {
18  class EventSetup;
19 }
20 
23 
24 public:
27  : _nSeeds(0),
28  _nClustersFound(0),
29  _minFractionToKeep(conf.getParameter<double>("minFractionToKeep")),
30  _algoName(conf.getParameter<std::string>("algoName")) {
31  if (conf.exists("positionCalc")) {
32  const edm::ParameterSet& pcConf = conf.getParameterSet("positionCalc");
33  const std::string& algo = pcConf.getParameter<std::string>("algoName");
35  }
36  }
37  virtual ~PFClusterBuilderBase() = default;
38  // get rid of things we should never use...
39  PFClusterBuilderBase(const PFCBB&) = delete;
40  PFCBB& operator=(const PFCBB&) = delete;
41 
42  virtual void update(const edm::EventSetup&) {}
43 
44  virtual void buildClusters(const reco::PFClusterCollection& topos,
45  const std::vector<bool>& seedable,
47  const HcalPFCuts*) = 0;
48 
49  std::ostream& operator<<(std::ostream& o) const {
50  o << "PFClusterBuilder with algo \"" << _algoName << "\" located " << _nSeeds << " seeds and built "
51  << _nClustersFound << " PFClusters from those seeds"
52  << " using position calculation: " << _positionCalc->name() << "." << std::endl;
53  return o;
54  }
55 
56  void reset() { _nSeeds = _nClustersFound = 0; }
57 
58 protected:
59  unsigned _nSeeds, _nClustersFound; // basic performance information
60  const float _minFractionToKeep; // min fraction value to keep in clusters
61  std::unique_ptr<PosCalc> _positionCalc;
62 
63 private:
65 };
66 
67 std::ostream& operator<<(std::ostream& o, const PFClusterBuilderBase& a);
68 
72 
73 #endif
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
std::ostream & operator<<(std::ostream &o) const
PFCBB & operator=(const PFCBB &)=delete
uint32_t cc[maxCellsPerHit]
Definition: gpuFishbone.h:49
std::unique_ptr< PosCalc > _positionCalc
bool exists(std::string const &parameterName) const
checks if a parameter exists
ParameterSet const & getParameterSet(std::string const &) const
edmplugin::PluginFactory< PFClusterBuilderBase *(const edm::ParameterSet &, edm::ConsumesCollector &)> PFClusterBuilderFactory
std::ostream & operator<<(std::ostream &o, const PFClusterBuilderBase &a)
PFClusterBuilderBase PFCBB
virtual void update(const edm::EventSetup &)
virtual ~PFClusterBuilderBase()=default
virtual void buildClusters(const reco::PFClusterCollection &topos, const std::vector< bool > &seedable, reco::PFClusterCollection &outclus, const HcalPFCuts *)=0
HLT enums.
double a
Definition: hdecay.h:121
PFClusterBuilderBase(const edm::ParameterSet &conf, edm::ConsumesCollector &cc)
std::vector< PFCluster > PFClusterCollection
collection of PFCluster objects
Definition: PFClusterFwd.h:9
#define get
PFCPositionCalculatorBase PosCalc