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 PFClusterFromHGCalTrackster RealisticSimClusterMapper

Public Member Functions

virtual void buildClusters (const edm::Handle< reco::PFRecHitCollection > &, const std::vector< bool > &mask, const std::vector< bool > &seeds, reco::PFClusterCollection &, const HcalPFCuts *)=0
 
 InitialClusteringStepBase (const edm::ParameterSet &conf, edm::ConsumesCollector &cc)
 
 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 26 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 112 of file InitialClusteringStepBase.h.

◆ ICSB

Definition at line 27 of file InitialClusteringStepBase.h.

Constructor & Destructor Documentation

◆ InitialClusteringStepBase() [1/2]

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

Definition at line 30 of file InitialClusteringStepBase.h.

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.

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

◆ ~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 ,
const HcalPFCuts  
)
pure virtual

◆ makeRefhit()

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

Definition at line 106 of file InitialClusteringStepBase.h.

References h, and mps_fire::i.

Referenced by Basic2DClusterForEachSeed::buildClusters(), GenericSimClusterMapper::buildClusters(), PFClusterFromHGCalTrackster::buildClusters(), RealisticSimClusterMapper::buildClusters(), and Basic2DGenericTopoClusterizer::buildTopoCluster().

106  {
107  return reco::PFRecHitRef(h, i);
108  }
edm::Ref< PFRecHitCollection > PFRecHitRef
persistent reference to PFRecHit objects
Definition: PFRecHitFwd.h:15
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4

◆ operator<<()

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

Definition at line 97 of file InitialClusteringStepBase.h.

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

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

◆ operator=()

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

◆ reset()

void InitialClusteringStepBase::reset ( void  )
inline

◆ 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 116 of file InitialClusteringStepBase.h.

Referenced by operator<<().

◆ _layerMap

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

Definition at line 110 of file InitialClusteringStepBase.h.

◆ _nClustersFound

unsigned InitialClusteringStepBase::_nClustersFound
protected

Definition at line 109 of file InitialClusteringStepBase.h.

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

◆ _nSeeds

unsigned InitialClusteringStepBase::_nSeeds
protected

Definition at line 109 of file InitialClusteringStepBase.h.

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

◆ _thresholds

std::unordered_map<int, I3tuple> InitialClusteringStepBase::_thresholds
protected