1 #ifndef __InitialClusteringStepBase_H__ 2 #define __InitialClusteringStepBase_H__ 14 #include <unordered_map> 29 _nSeeds(0), _nClustersFound(0),
42 _algoName(conf.getParameter<
std::string>(
"algoName")) {
43 const std::vector<edm::ParameterSet>&
thresholds =
44 conf.getParameterSetVector(
"thresholdsByDetector");
45 for(
const auto&
pset : thresholds ) {
49 std::vector<double> thresh_E;
50 std::vector<double> thresh_pT ;
51 std::vector<double> thresh_pT2;
54 depths =
pset.getParameter<std::vector<int> >(
"depths");
55 thresh_E =
pset.getParameter<std::vector<double> >(
"gatheringThreshold");
56 thresh_pT =
pset.getParameter<std::vector<double> >(
"gatheringThresholdPt");
57 if(thresh_E.size()!=depths.size() || thresh_pT.size()!=depths.size()) {
59 <<
"gatheringThresholds mismatch with the numbers of depths";
63 thresh_E.push_back(
pset.getParameter<
double>(
"gatheringThreshold"));
64 thresh_pT.push_back(
pset.getParameter<
double>(
"gatheringThresholdPt"));
67 for(
unsigned int i=0;
i < thresh_pT.size();++
i){
68 thresh_pT2.push_back(thresh_pT[
i]*thresh_pT[
i]);
71 auto entry = _layerMap.find(det);
72 if(
entry == _layerMap.end() ) {
74 <<
"Detector layer : " << det <<
" is not in the list of recognized" 75 <<
" detector layers!";
77 _thresholds.emplace(_layerMap.find(det)->second,
78 std::make_tuple(depths,thresh_E,thresh_pT2));
84 ICSB& operator=(
const ICSB&) =
delete;
91 const std::vector<bool>&
mask,
92 const std::vector<bool>& seeds,
96 o <<
"InitialClusteringStep with algo \"" << _algoName
97 <<
"\" located " << _nSeeds <<
" seeds and built " 98 << _nClustersFound <<
" clusters from those seeds. ";
102 void reset() { _nSeeds = _nClustersFound = 0; }
106 const unsigned i )
const {
112 typedef std::tuple<std::vector<int> ,std::vector<double> , std::vector<double> >
I3tuple;
std::unordered_map< int, I3tuple > _thresholds
const std::unordered_map< std::string, int > _layerMap
reco::PFRecHitRef makeRefhit(const edm::Handle< reco::PFRecHitCollection > &h, const unsigned i) const
InitialClusteringStepBase ICSB
edmplugin::PluginFactory< InitialClusteringStepBase *(const edm::ParameterSet &, edm::ConsumesCollector &) > InitialClusteringStepFactory
virtual void updateEvent(const edm::Event &)
const std::string _algoName
std::tuple< std::vector< int >,std::vector< double >, std::vector< double > > I3tuple
edm::Ref< PFRecHitCollection > PFRecHitRef
persistent reference to PFRecHit objects
virtual void update(const edm::EventSetup &)
InitialClusteringStepBase(const edm::ParameterSet &conf, edm::ConsumesCollector &sumes)
std::vector< PFCluster > PFClusterCollection
collection of PFCluster objects
std::ostream & operator<<(std::ostream &ost, const HLTGlobalStatus &hlt)
Formatted printout of trigger tbale.
std::ostream & operator<<(std::ostream &o) const