CMS 3D CMS Logo

HGCalBackendLayer1Processor2DClustering.cc
Go to the documentation of this file.
2 
9 
11 public:
13  std::string typeCluster(conf.getParameterSet("C2d_parameters").getParameter<std::string>("clusterType"));
14  if (typeCluster == "dRC2d") {
16  clustering_ = std::make_unique<HGCalClusteringImpl>(conf.getParameterSet("C2d_parameters"));
17  } else if (typeCluster == "NNC2d") {
19  clustering_ = std::make_unique<HGCalClusteringImpl>(conf.getParameterSet("C2d_parameters"));
20  } else if (typeCluster == "dRNNC2d") {
22  clustering_ = std::make_unique<HGCalClusteringImpl>(conf.getParameterSet("C2d_parameters"));
23  } else if (typeCluster == "dummyC2d") {
25  clusteringDummy_ = std::make_unique<HGCalClusteringDummyImpl>(conf.getParameterSet("C2d_parameters"));
26  } else {
27  throw cms::Exception("HGCTriggerParameterError") << "Unknown clustering type '" << typeCluster;
28  }
29  }
30 
32  l1t::HGCalClusterBxCollection& collCluster2D,
33  const edm::EventSetup& es) override {
35  if (clustering_)
36  clustering_->eventSetup(es);
37  if (clusteringDummy_)
38  clusteringDummy_->eventSetup(es);
39 
40  /* create a persistent vector of pointers to the trigger-cells */
41  std::vector<edm::Ptr<l1t::HGCalTriggerCell>> triggerCellsPtrs;
42  for (unsigned i = 0; i < collHandle->size(); ++i) {
43  edm::Ptr<l1t::HGCalTriggerCell> ptr(collHandle, i);
44  triggerCellsPtrs.push_back(ptr);
45  }
46 
47  std::sort(triggerCellsPtrs.begin(),
48  triggerCellsPtrs.end(),
50  return a->mipPt() > b->mipPt();
51  });
52 
53  /* call to C2d clustering */
54  switch (clusteringAlgorithmType_) {
55  case dRC2d:
56  clustering_->clusterizeDR(triggerCellsPtrs, collCluster2D);
57  break;
58  case NNC2d:
59  clustering_->clusterizeNN(triggerCellsPtrs, collCluster2D, *triggerGeometry_);
60  break;
61  case dRNNC2d:
62  clustering_->clusterizeDRNN(triggerCellsPtrs, collCluster2D, *triggerGeometry_);
63  break;
64  case dummyC2d:
65  clusteringDummy_->clusterizeDummy(triggerCellsPtrs, collCluster2D);
66  break;
67  default:
68  // Should not happen, clustering type checked in constructor
69  break;
70  }
71  }
72 
73 private:
75 
77 
78  /* algorithms instances */
79  std::unique_ptr<HGCalClusteringImpl> clustering_;
80  std::unique_ptr<HGCalClusteringDummyImpl> clusteringDummy_;
81 
82  /* algorithm type */
84 };
85 
88  "HGCalBackendLayer1Processor2DClustering");
mps_fire.i
i
Definition: mps_fire.py:428
HGCalBackendLayer1Processor2DClustering::HGCalBackendLayer1Processor2DClustering
HGCalBackendLayer1Processor2DClustering(const edm::ParameterSet &conf)
Definition: HGCalBackendLayer1Processor2DClustering.cc:12
CaloGeometryRecord
Definition: CaloGeometryRecord.h:30
HGCalBackendLayer1Processor2DClustering::clusteringDummy_
std::unique_ptr< HGCalClusteringDummyImpl > clusteringDummy_
Definition: HGCalBackendLayer1Processor2DClustering.cc:80
HGCalBackendLayer1Processor2DClustering::NNC2d
Definition: HGCalBackendLayer1Processor2DClustering.cc:74
edm::Handle
Definition: AssociativeIterator.h:50
HGCalBackendLayer1Processor2DClustering::run
void run(const edm::Handle< l1t::HGCalTriggerCellBxCollection > &collHandle, l1t::HGCalClusterBxCollection &collCluster2D, const edm::EventSetup &es) override
Definition: HGCalBackendLayer1Processor2DClustering.cc:31
HGCalClusteringImpl.h
HGCalBackendLayer1Processor2DClustering
Definition: HGCalBackendLayer1Processor2DClustering.cc:10
BXVector
Definition: BXVector.h:15
edm::EventSetup::get
T get() const
Definition: EventSetup.h:80
HGCalTriggerGeometryBase.h
edm::ESHandle< HGCalTriggerGeometryBase >
HGCalBackendLayer1Processor2DClustering::dummyC2d
Definition: HGCalBackendLayer1Processor2DClustering.cc:74
HGCalBackendLayer1Processor2DClustering::dRC2d
Definition: HGCalBackendLayer1Processor2DClustering.cc:74
DEFINE_EDM_PLUGIN
#define DEFINE_EDM_PLUGIN(factory, type, name)
Definition: PluginFactory.h:124
b
double b
Definition: hdecay.h:118
CaloGeometryRecord.h
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition: ParameterSet.h:47
a
double a
Definition: hdecay.h:119
HGCalClusteringDummyImpl.h
HGCalBackendLayer1Processor2DClustering::clustering_
std::unique_ptr< HGCalClusteringImpl > clustering_
Definition: HGCalBackendLayer1Processor2DClustering.cc:79
edmplugin::PluginFactory
Definition: PluginFactory.h:34
HGCalBackendLayer1Processor2DClustering::ClusterType
ClusterType
Definition: HGCalBackendLayer1Processor2DClustering.cc:74
HGCalBackendLayer1Processor2DClustering::triggerGeometry_
edm::ESHandle< HGCalTriggerGeometryBase > triggerGeometry_
Definition: HGCalBackendLayer1Processor2DClustering.cc:76
edm::EventSetup
Definition: EventSetup.h:57
HGCalCluster.h
get
#define get
edm::Ptr
Definition: AssociationVector.h:31
HGCalBackendLayer1Processor2DClustering::dRNNC2d
Definition: HGCalBackendLayer1Processor2DClustering.cc:74
HGCalBackendLayer1Processor2DClustering::clusteringAlgorithmType_
ClusterType clusteringAlgorithmType_
Definition: HGCalBackendLayer1Processor2DClustering.cc:83
Exception
Definition: hltDiff.cc:246
HGCalProcessorBase.h
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
BXVector::size
unsigned size(int bx) const
HGCalTriggerCell.h
HGCalProcessorBaseT
Definition: HGCalProcessorBaseT.h:10
edm::ParameterSet::getParameterSet
ParameterSet const & getParameterSet(std::string const &) const
Definition: ParameterSet.cc:2128