CMS 3D CMS Logo

PFClusterBuilderBase.h
Go to the documentation of this file.
1 #ifndef __PFClusterBuilderBase_H__
2 #define __PFClusterBuilderBase_H__
3 
8 
10 
11 #include <string>
12 #include <iostream>
13 #include <memory>
14 
15 namespace edm {
16  class EventSetup;
17 }
18 
21 
22 public:
25  : _nSeeds(0),
26  _nClustersFound(0),
27  _minFractionToKeep(conf.getParameter<double>("minFractionToKeep")),
28  _algoName(conf.getParameter<std::string>("algoName")) {
29  if (conf.exists("positionCalc")) {
30  const edm::ParameterSet& pcConf = conf.getParameterSet("positionCalc");
31  const std::string& algo = pcConf.getParameter<std::string>("algoName");
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 << "\" located " << _nSeeds << " seeds and built "
48  << _nClustersFound << " PFClusters from those seeds"
49  << " using position calculation: " << _positionCalc->name() << "." << std::endl;
50  return o;
51  }
52 
53  void reset() { _nSeeds = _nClustersFound = 0; }
54 
55 protected:
56  unsigned _nSeeds, _nClustersFound; // basic performance information
57  const float _minFractionToKeep; // min fraction value to keep in clusters
58  std::unique_ptr<PosCalc> _positionCalc;
59 
60 private:
62 };
63 
64 std::ostream& operator<<(std::ostream& o, const PFClusterBuilderBase& a);
65 
69 
70 #endif
reco::PFClusterCollection
std::vector< PFCluster > PFClusterCollection
collection of PFCluster objects
Definition: PFClusterFwd.h:9
PFClusterBuilderBase::buildClusters
virtual void buildClusters(const reco::PFClusterCollection &topos, const std::vector< bool > &seedable, reco::PFClusterCollection &outclus)=0
PluginFactory.h
PFClusterBuilderBase::operator<<
std::ostream & operator<<(std::ostream &o) const
Definition: PFClusterBuilderBase.h:46
PFClusterBuilderBase::~PFClusterBuilderBase
virtual ~PFClusterBuilderBase()=default
PFClusterBuilderBase::PosCalc
PFCPositionCalculatorBase PosCalc
Definition: PFClusterBuilderBase.h:23
operator<<
std::ostream & operator<<(std::ostream &o, const PFClusterBuilderBase &a)
Definition: PFClusterBuilderBase.cc:3
edm
HLT enums.
Definition: AlignableModifier.h:19
EcalTangentSkim_cfg.o
o
Definition: EcalTangentSkim_cfg.py:42
cmsdt::algo
algo
Definition: constants.h:171
PFClusterBuilderBase::update
virtual void update(const edm::EventSetup &)
Definition: PFClusterBuilderBase.h:40
PFClusterBuilderBase::PFClusterBuilderBase
PFClusterBuilderBase(const edm::ParameterSet &conf, edm::ConsumesCollector &cc)
Definition: PFClusterBuilderBase.h:24
PFCluster.h
PFCPositionCalculatorBase.h
PFCPositionCalculatorBase
Definition: PFCPositionCalculatorBase.h:15
edm::ParameterSet::exists
bool exists(std::string const &parameterName) const
checks if a parameter exists
Definition: ParameterSet.cc:681
edm::ParameterSet
Definition: ParameterSet.h:47
a
double a
Definition: hdecay.h:119
edmplugin::PluginFactory
Definition: PluginFactory.h:34
PFClusterBuilderBase::_nSeeds
unsigned _nSeeds
Definition: PFClusterBuilderBase.h:56
PFClusterFwd.h
edm::EventSetup
Definition: EventSetup.h:58
get
#define get
cc
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
PFClusterBuilderBase::_nClustersFound
unsigned _nClustersFound
Definition: PFClusterBuilderBase.h:56
std
Definition: JetResolutionObject.h:76
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
PFClusterBuilderBase
Definition: PFClusterBuilderBase.h:19
ConsumesCollector.h
EventSetup
PFClusterBuilderBase::reset
void reset()
Definition: PFClusterBuilderBase.h:53
ParameterSet.h
PFClusterBuilderBase::_positionCalc
std::unique_ptr< PosCalc > _positionCalc
Definition: PFClusterBuilderBase.h:58
PFClusterBuilderBase::_algoName
std::string _algoName
Definition: PFClusterBuilderBase.h:61
PFClusterBuilderBase::_minFractionToKeep
const float _minFractionToKeep
Definition: PFClusterBuilderBase.h:57
PFClusterBuilderBase::PFCBB
PFClusterBuilderBase PFCBB
Definition: PFClusterBuilderBase.h:20
PFClusterBuilderBase::operator=
PFCBB & operator=(const PFCBB &)=delete
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
edm::ParameterSet::getParameterSet
ParameterSet const & getParameterSet(std::string const &) const
Definition: ParameterSet.cc:2128