CMS 3D CMS Logo

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