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  public:
23  _nSeeds(0), _nClustersFound(0),
24  _minFractionToKeep(conf.getParameter<double>("minFractionToKeep")),
25  _algoName(conf.getParameter<std::string>("algoName")) {
26  _positionCalc.reset(nullptr);
27  if( conf.exists("positionCalc") ) {
28  const edm::ParameterSet& pcConf = conf.getParameterSet("positionCalc");
29  const std::string& algo = pcConf.getParameter<std::string>("algoName");
30  PosCalc* calcp = PFCPositionCalculatorFactory::get()->create(algo,
31  pcConf);
32  _positionCalc.reset(calcp);
33  }
34  }
35  virtual ~PFClusterBuilderBase() = default;
36  // get rid of things we should never use...
37  PFClusterBuilderBase(const PFCBB&) = delete;
38  PFCBB& operator=(const PFCBB&) = delete;
39 
40  virtual void update(const edm::EventSetup&) { }
41 
42  virtual void buildClusters(const reco::PFClusterCollection& topos,
43  const std::vector<bool>& seedable,
44  reco::PFClusterCollection& outclus) = 0;
45 
46  std::ostream& operator<<(std::ostream& o) const {
47  o << "PFClusterBuilder with algo \"" << _algoName
48  << "\" located " << _nSeeds << " seeds and built "
49  << _nClustersFound << " PFClusters from those seeds"
50  << " using position calculation: " << _positionCalc->name()
51  << "." << std::endl;
52  return o;
53  }
54 
55  void reset() { _nSeeds = _nClustersFound = 0; }
56 
57  protected:
58  unsigned _nSeeds, _nClustersFound; // basic performance information
59  const float _minFractionToKeep; // min fraction value to keep in clusters
60  std::unique_ptr<PosCalc> _positionCalc;
61 
62  private:
64 
65 };
66 
69 
70 #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
PFClusterBuilderBase PFCBB
edmplugin::PluginFactory< PFClusterBuilderBase *(const edm::ParameterSet &) > PFClusterBuilderFactory
ParameterSet const & getParameterSet(std::string const &) const
virtual void update(const edm::EventSetup &)
PFClusterBuilderBase(const edm::ParameterSet &conf)
HLT enums.
std::vector< PFCluster > PFClusterCollection
collection of PFCluster objects
Definition: PFClusterFwd.h:9
T get(const Candidate &c)
Definition: component.h:55
PFCPositionCalculatorBase PosCalc