CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Private Types | Private Attributes
InitialClusteringStepBase Class Referenceabstract

#include <InitialClusteringStepBase.h>

Inheritance diagram for InitialClusteringStepBase:
Basic2DClusterForEachSeed Basic2DGenericTopoClusterizer GenericSimClusterMapper PFClusterFromHGCalMultiCluster RealisticSimClusterMapper

Public Member Functions

virtual void buildClusters (const edm::Handle< reco::PFRecHitCollection > &, const std::vector< bool > &mask, const std::vector< bool > &seeds, reco::PFClusterCollection &)=0
 
 InitialClusteringStepBase (const edm::ParameterSet &conf, edm::ConsumesCollector &sumes)
 
 InitialClusteringStepBase (const ICSB &)=delete
 
std::ostream & operator<< (std::ostream &o) const
 
ICSBoperator= (const ICSB &)=delete
 
void reset ()
 
virtual void update (const edm::EventSetup &)
 
virtual void updateEvent (const edm::Event &)
 
virtual ~InitialClusteringStepBase ()=default
 

Protected Types

typedef std::tuple< std::vector< int >, std::vector< double >, std::vector< double > > I3tuple
 

Protected Member Functions

reco::PFRecHitRef makeRefhit (const edm::Handle< reco::PFRecHitCollection > &h, const unsigned i) const
 

Protected Attributes

const std::unordered_map< std::string, int > _layerMap
 
unsigned _nClustersFound
 
unsigned _nSeeds
 
std::unordered_map< int, I3tuple_thresholds
 

Private Types

typedef InitialClusteringStepBase ICSB
 

Private Attributes

const std::string _algoName
 

Detailed Description

Definition at line 24 of file InitialClusteringStepBase.h.

Member Typedef Documentation

◆ I3tuple

typedef std::tuple<std::vector<int>, std::vector<double>, std::vector<double> > InitialClusteringStepBase::I3tuple
protected

Definition at line 109 of file InitialClusteringStepBase.h.

◆ ICSB

Definition at line 25 of file InitialClusteringStepBase.h.

Constructor & Destructor Documentation

◆ InitialClusteringStepBase() [1/2]

InitialClusteringStepBase::InitialClusteringStepBase ( const edm::ParameterSet conf,
edm::ConsumesCollector sumes 
)
inline

Definition at line 28 of file InitialClusteringStepBase.h.

29  : _nSeeds(0),
30  _nClustersFound(0),
31  _layerMap({{"PS2", (int)PFLayer::PS2},
32  {"PS1", (int)PFLayer::PS1},
33  {"ECAL_ENDCAP", (int)PFLayer::ECAL_ENDCAP},
34  {"ECAL_BARREL", (int)PFLayer::ECAL_BARREL},
35  {"NONE", (int)PFLayer::NONE},
36  {"HCAL_BARREL1", (int)PFLayer::HCAL_BARREL1},
37  {"HCAL_BARREL2_RING0", (int)PFLayer::HCAL_BARREL2},
38  {"HCAL_BARREL2_RING1", 100 * (int)PFLayer::HCAL_BARREL2},
39  {"HCAL_ENDCAP", (int)PFLayer::HCAL_ENDCAP},
40  {"HF_EM", (int)PFLayer::HF_EM},
41  {"HF_HAD", (int)PFLayer::HF_HAD},
42  {"HGCAL", (int)PFLayer::HGCAL}}),
43  _algoName(conf.getParameter<std::string>("algoName")) {
44  const std::vector<edm::ParameterSet>& thresholds = conf.getParameterSetVector("thresholdsByDetector");
45  for (const auto& pset : thresholds) {
46  const std::string& det = pset.getParameter<std::string>("detector");
47 
48  std::vector<int> depths;
49  std::vector<double> thresh_E;
50  std::vector<double> thresh_pT;
51  std::vector<double> thresh_pT2;
52 
53  if (det == std::string("HCAL_BARREL1") || det == std::string("HCAL_ENDCAP")) {
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()) {
58  throw cms::Exception("InvalidGatheringThreshold")
59  << "gatheringThresholds mismatch with the numbers of depths";
60  }
61  } else {
62  depths.push_back(0);
63  thresh_E.push_back(pset.getParameter<double>("gatheringThreshold"));
64  thresh_pT.push_back(pset.getParameter<double>("gatheringThresholdPt"));
65  }
66 
67  for (unsigned int i = 0; i < thresh_pT.size(); ++i) {
68  thresh_pT2.push_back(thresh_pT[i] * thresh_pT[i]);
69  }
70 
71  auto entry = _layerMap.find(det);
72  if (entry == _layerMap.end()) {
73  throw cms::Exception("InvalidDetectorLayer")
74  << "Detector layer : " << det << " is not in the list of recognized"
75  << " detector layers!";
76  }
77  _thresholds.emplace(_layerMap.find(det)->second, std::make_tuple(depths, thresh_E, thresh_pT2));
78  }
79  }

References PFLayer::ECAL_BARREL, PFLayer::ECAL_ENDCAP, PFLayer::HCAL_BARREL1, PFLayer::HCAL_BARREL2, PFLayer::HCAL_ENDCAP, PFLayer::HF_EM, PFLayer::HF_HAD, PFLayer::HGCAL, createfilelist::int, PFLayer::NONE, PFLayer::PS1, and PFLayer::PS2.

◆ ~InitialClusteringStepBase()

virtual InitialClusteringStepBase::~InitialClusteringStepBase ( )
virtualdefault

◆ InitialClusteringStepBase() [2/2]

InitialClusteringStepBase::InitialClusteringStepBase ( const ICSB )
delete

Member Function Documentation

◆ buildClusters()

virtual void InitialClusteringStepBase::buildClusters ( const edm::Handle< reco::PFRecHitCollection > &  ,
const std::vector< bool > &  mask,
const std::vector< bool > &  seeds,
reco::PFClusterCollection  
)
pure virtual

◆ makeRefhit()

reco::PFRecHitRef InitialClusteringStepBase::makeRefhit ( const edm::Handle< reco::PFRecHitCollection > &  h,
const unsigned  i 
) const
inlineprotected

◆ operator<<()

std::ostream& InitialClusteringStepBase::operator<< ( std::ostream &  o) const
inline

Definition at line 94 of file InitialClusteringStepBase.h.

94  {
95  o << "InitialClusteringStep with algo \"" << _algoName << "\" located " << _nSeeds << " seeds and built "
96  << _nClustersFound << " clusters from those seeds. ";
97  return o;
98  }

References _algoName, _nClustersFound, _nSeeds, and EcalTangentSkim_cfg::o.

◆ operator=()

ICSB& InitialClusteringStepBase::operator= ( const ICSB )
delete

◆ reset()

void InitialClusteringStepBase::reset ( void  )
inline

Definition at line 100 of file InitialClusteringStepBase.h.

100 { _nSeeds = _nClustersFound = 0; }

References _nClustersFound, and _nSeeds.

◆ update()

virtual void InitialClusteringStepBase::update ( const edm::EventSetup )
inlinevirtual

◆ updateEvent()

virtual void InitialClusteringStepBase::updateEvent ( const edm::Event )
inlinevirtual

Member Data Documentation

◆ _algoName

const std::string InitialClusteringStepBase::_algoName
private

Definition at line 113 of file InitialClusteringStepBase.h.

Referenced by operator<<().

◆ _layerMap

const std::unordered_map<std::string, int> InitialClusteringStepBase::_layerMap
protected

Definition at line 107 of file InitialClusteringStepBase.h.

◆ _nClustersFound

unsigned InitialClusteringStepBase::_nClustersFound
protected

Definition at line 106 of file InitialClusteringStepBase.h.

Referenced by operator<<(), and reset().

◆ _nSeeds

unsigned InitialClusteringStepBase::_nSeeds
protected

Definition at line 106 of file InitialClusteringStepBase.h.

Referenced by operator<<(), and reset().

◆ _thresholds

std::unordered_map<int, I3tuple> InitialClusteringStepBase::_thresholds
protected
InitialClusteringStepBase::_nSeeds
unsigned _nSeeds
Definition: InitialClusteringStepBase.h:106
mps_fire.i
i
Definition: mps_fire.py:428
particleFlowZeroSuppressionECAL_cff.thresholds
thresholds
Definition: particleFlowZeroSuppressionECAL_cff.py:31
InitialClusteringStepBase::_nClustersFound
unsigned _nClustersFound
Definition: InitialClusteringStepBase.h:106
InitialClusteringStepBase::_thresholds
std::unordered_map< int, I3tuple > _thresholds
Definition: InitialClusteringStepBase.h:110
mps_splice.entry
entry
Definition: mps_splice.py:68
PFLayer::HCAL_ENDCAP
Definition: PFLayer.h:37
EcalTangentSkim_cfg.o
o
Definition: EcalTangentSkim_cfg.py:36
PFLayer::ECAL_BARREL
Definition: PFLayer.h:33
PFLayer::PS1
Definition: PFLayer.h:31
PFLayer::HCAL_BARREL2
Definition: PFLayer.h:36
PFLayer::HF_EM
Definition: PFLayer.h:38
PFLayer::HCAL_BARREL1
Definition: PFLayer.h:35
customizeHLTforCMSSW.depths
depths
Definition: customizeHLTforCMSSW.py:31
PFLayer::HGCAL
Definition: PFLayer.h:40
PFLayer::NONE
Definition: PFLayer.h:34
h
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
PFLayer::HF_HAD
Definition: PFLayer.h:39
createfilelist.int
int
Definition: createfilelist.py:10
reco::PFRecHitRef
edm::Ref< PFRecHitCollection > PFRecHitRef
persistent reference to PFRecHit objects
Definition: PFRecHitFwd.h:15
Exception
Definition: hltDiff.cc:246
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::ParameterSet::getParameterSetVector
VParameterSet const & getParameterSetVector(std::string const &name) const
Definition: ParameterSet.cc:2160
InitialClusteringStepBase::_layerMap
const std::unordered_map< std::string, int > _layerMap
Definition: InitialClusteringStepBase.h:107
PFLayer::ECAL_ENDCAP
Definition: PFLayer.h:32
PFLayer::PS2
Definition: PFLayer.h:30
InitialClusteringStepBase::_algoName
const std::string _algoName
Definition: InitialClusteringStepBase.h:113
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27