CMS 3D CMS Logo

HGCalBackendLayer2Processor3DClustering.cc
Go to the documentation of this file.
2 
12 
13 #include <utility>
14 
16 public:
18  std::string typeMulticluster(conf.getParameterSet("C3d_parameters").getParameter<std::string>("type_multicluster"));
19  if (typeMulticluster == "dRC3d") {
21  multiclustering_ = std::make_unique<HGCalMulticlusteringImpl>(conf.getParameterSet("C3d_parameters"));
22  } else if (typeMulticluster == "DBSCANC3d") {
24  multiclustering_ = std::make_unique<HGCalMulticlusteringImpl>(conf.getParameterSet("C3d_parameters"));
25  } else if (typeMulticluster == "Histo") {
27  multiclusteringHistoSeeding_ = std::make_unique<HGCalHistoSeedingImpl>(
28  conf.getParameterSet("C3d_parameters").getParameterSet("histoMax_C3d_seeding_parameters"));
29  multiclusteringHistoClustering_ = std::make_unique<HGCalHistoClusteringImpl>(
30  conf.getParameterSet("C3d_parameters").getParameterSet("histoMax_C3d_clustering_parameters"));
31  } else {
32  throw cms::Exception("HGCTriggerParameterError") << "Unknown Multiclustering type '" << typeMulticluster << "'";
33  }
34 
35  for (const auto& interpretationPset : conf.getParameter<std::vector<edm::ParameterSet>>("energy_interpretations")) {
36  std::unique_ptr<HGCalTriggerClusterInterpreterBase> interpreter{
37  HGCalTriggerClusterInterpreterFactory::get()->create(interpretationPset.getParameter<std::string>("type"))};
38  interpreter->initialize(interpretationPset);
39  energy_interpreters_.push_back(std::move(interpreter));
40  }
41  }
42 
44  std::pair<l1t::HGCalMulticlusterBxCollection, l1t::HGCalClusterBxCollection>& be_output,
45  const edm::EventSetup& es) override {
47  if (multiclustering_)
48  multiclustering_->eventSetup(es);
50  multiclusteringHistoSeeding_->eventSetup(es);
52  multiclusteringHistoClustering_->eventSetup(es);
53 
54  auto& collCluster3D = be_output.first;
55  auto& rejectedClusters = be_output.second;
56 
57  /* create a persistent vector of pointers to the trigger-cells */
58  std::vector<edm::Ptr<l1t::HGCalCluster>> clustersPtrs;
59  for (unsigned i = 0; i < collHandle->size(); ++i) {
60  edm::Ptr<l1t::HGCalCluster> ptr(collHandle, i);
61  clustersPtrs.push_back(ptr);
62  }
63 
64  /* create a vector of seed positions and their energy*/
65  std::vector<std::pair<GlobalPoint, double>> seedPositionsEnergy;
66 
67  /* call to multiclustering and compute shower shape*/
68  switch (multiclusteringAlgoType_) {
69  case dRC3d:
70  multiclustering_->clusterizeDR(clustersPtrs, collCluster3D, *triggerGeometry_);
71  break;
72  case DBSCANC3d:
73  multiclustering_->clusterizeDBSCAN(clustersPtrs, collCluster3D, *triggerGeometry_);
74  break;
75  case HistoC3d:
76  multiclusteringHistoSeeding_->findHistoSeeds(clustersPtrs, seedPositionsEnergy);
77  multiclusteringHistoClustering_->clusterizeHisto(
78  clustersPtrs, seedPositionsEnergy, *triggerGeometry_, collCluster3D, rejectedClusters);
79  break;
80  default:
81  // Should not happen, clustering type checked in constructor
82  break;
83  }
84 
85  // Call all the energy interpretation modules on the cluster collection
86  for (const auto& interpreter : energy_interpreters_) {
87  interpreter->eventSetup(es);
88  interpreter->interpret(collCluster3D);
89  }
90  }
91 
92 private:
94 
96 
97  /* algorithms instances */
98  std::unique_ptr<HGCalMulticlusteringImpl> multiclustering_;
99  std::unique_ptr<HGCalHistoSeedingImpl> multiclusteringHistoSeeding_;
100  std::unique_ptr<HGCalHistoClusteringImpl> multiclusteringHistoClustering_;
101 
102  /* algorithm type */
104 
105  std::vector<std::unique_ptr<HGCalTriggerClusterInterpreterBase>> energy_interpreters_;
106 };
107 
110  "HGCalBackendLayer2Processor3DClustering");
mps_fire.i
i
Definition: mps_fire.py:428
HGCalHistoClusteringImpl.h
HGCalBackendLayer2Processor3DClustering::triggerGeometry_
edm::ESHandle< HGCalTriggerGeometryBase > triggerGeometry_
Definition: HGCalBackendLayer2Processor3DClustering.cc:95
CaloGeometryRecord
Definition: CaloGeometryRecord.h:30
HGCalMulticlusteringImpl.h
HGCalTriggerClusterInterpreterBase.h
HGCalBackendLayer2Processor3DClustering::multiclusteringHistoClustering_
std::unique_ptr< HGCalHistoClusteringImpl > multiclusteringHistoClustering_
Definition: HGCalBackendLayer2Processor3DClustering.cc:100
HGCalBackendLayer2Processor3DClustering::DBSCANC3d
Definition: HGCalBackendLayer2Processor3DClustering.cc:93
HGCalHistoSeedingImpl.h
edm::Handle
Definition: AssociativeIterator.h:50
HGCalMulticluster.h
edm::EventSetup::get
T get() const
Definition: EventSetup.h:87
HGCalTriggerGeometryBase.h
edm::ESHandle< HGCalTriggerGeometryBase >
HGCalBackendLayer2Processor3DClustering::HGCalBackendLayer2Processor3DClustering
HGCalBackendLayer2Processor3DClustering(const edm::ParameterSet &conf)
Definition: HGCalBackendLayer2Processor3DClustering.cc:17
DEFINE_EDM_PLUGIN
#define DEFINE_EDM_PLUGIN(factory, type, name)
Definition: PluginFactory.h:124
HGCalBackendLayer2Processor3DClustering::MulticlusterType
MulticlusterType
Definition: HGCalBackendLayer2Processor3DClustering.cc:93
CaloGeometryRecord.h
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HGCalBackendLayer2Processor3DClustering::multiclusteringHistoSeeding_
std::unique_ptr< HGCalHistoSeedingImpl > multiclusteringHistoSeeding_
Definition: HGCalBackendLayer2Processor3DClustering.cc:99
HGCalBackendLayer2Processor3DClustering::energy_interpreters_
std::vector< std::unique_ptr< HGCalTriggerClusterInterpreterBase > > energy_interpreters_
Definition: HGCalBackendLayer2Processor3DClustering.cc:105
edm::ParameterSet
Definition: ParameterSet.h:47
HGCalBackendLayer2Processor3DClustering::dRC3d
Definition: HGCalBackendLayer2Processor3DClustering.cc:93
edmplugin::PluginFactory
Definition: PluginFactory.h:34
edm::EventSetup
Definition: EventSetup.h:58
HGCalBackendLayer2Processor3DClustering::HistoC3d
Definition: HGCalBackendLayer2Processor3DClustering.cc:93
HGCalBackendLayer2Processor3DClustering::multiclusteringAlgoType_
MulticlusterType multiclusteringAlgoType_
Definition: HGCalBackendLayer2Processor3DClustering.cc:103
HGCalCluster.h
get
#define get
edm::Ptr
Definition: AssociationVector.h:31
eostools.move
def move(src, dest)
Definition: eostools.py:511
HGCalBackendLayer2Processor3DClustering
Definition: HGCalBackendLayer2Processor3DClustering.cc:15
HGCalBackendLayer2Processor3DClustering::run
void run(const edm::Handle< l1t::HGCalClusterBxCollection > &collHandle, std::pair< l1t::HGCalMulticlusterBxCollection, l1t::HGCalClusterBxCollection > &be_output, const edm::EventSetup &es) override
Definition: HGCalBackendLayer2Processor3DClustering.cc:43
Exception
Definition: hltDiff.cc:245
HGCalProcessorBase.h
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
HGCalBackendLayer2Processor3DClustering::multiclustering_
std::unique_ptr< HGCalMulticlusteringImpl > multiclustering_
Definition: HGCalBackendLayer2Processor3DClustering.cc:98
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