CMS 3D CMS Logo

List of all members | Public Member Functions | Private Types | Private Attributes
HGCalBackendLayer2Processor3DClustering Class Reference
Inheritance diagram for HGCalBackendLayer2Processor3DClustering:
HGCalProcessorBaseT< InputCollection, OutputCollection >

Public Member Functions

 HGCalBackendLayer2Processor3DClustering (const edm::ParameterSet &conf)
 
void run (const edm::Handle< l1t::HGCalClusterBxCollection > &collHandle, std::pair< l1t::HGCalMulticlusterBxCollection, l1t::HGCalClusterBxCollection > &be_output) override
 
- Public Member Functions inherited from HGCalProcessorBaseT< InputCollection, OutputCollection >
 HGCalProcessorBaseT (const edm::ParameterSet &conf)
 
const std::string & name () const
 
virtual void run (const InputCollection &inputColl, OutputCollection &outColl)=0
 
virtual void setGeometry (const HGCalTriggerGeometryBase *const geom)
 
virtual ~HGCalProcessorBaseT ()
 

Private Types

enum  MulticlusterType { dRC3d, DBSCANC3d, HistoC3d }
 

Private Attributes

std::vector< std::unique_ptr< HGCalTriggerClusterInterpreterBase > > energy_interpreters_
 
std::unique_ptr< HGCalMulticlusteringImplmulticlustering_
 
MulticlusterType multiclusteringAlgoType_
 
std::unique_ptr< HGCalHistoClusteringImplmulticlusteringHistoClustering_
 
std::unique_ptr< HGCalHistoSeedingImplmulticlusteringHistoSeeding_
 

Additional Inherited Members

- Protected Member Functions inherited from HGCalProcessorBaseT< InputCollection, OutputCollection >
const HGCalTriggerGeometryBasegeometry () const
 

Detailed Description

Definition at line 15 of file HGCalBackendLayer2Processor3DClustering.cc.

Member Enumeration Documentation

◆ MulticlusterType

Constructor & Destructor Documentation

◆ HGCalBackendLayer2Processor3DClustering()

HGCalBackendLayer2Processor3DClustering::HGCalBackendLayer2Processor3DClustering ( const edm::ParameterSet conf)
inline

Definition at line 17 of file HGCalBackendLayer2Processor3DClustering.cc.

References DBSCANC3d, dRC3d, energy_interpreters_, Exception, get, edm::ParameterSet::getParameter(), edm::ParameterSet::getParameterSet(), HistoC3d, eostools::move(), multiclustering_, multiclusteringAlgoType_, multiclusteringHistoClustering_, multiclusteringHistoSeeding_, and AlCaHLTBitMon_QueryRunRegistry::string.

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  }
HGCalProcessorBaseT< edm::Handle< l1t::HGCalClusterBxCollection >, std::pair< l1t::HGCalMulticlusterBxCollection, l1t::HGCalClusterBxCollection > > HGCalBackendLayer2ProcessorBase
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
ParameterSet const & getParameterSet(std::string const &) const
std::unique_ptr< HGCalMulticlusteringImpl > multiclustering_
std::unique_ptr< HGCalHistoSeedingImpl > multiclusteringHistoSeeding_
std::unique_ptr< HGCalHistoClusteringImpl > multiclusteringHistoClustering_
std::vector< std::unique_ptr< HGCalTriggerClusterInterpreterBase > > energy_interpreters_
#define get
def move(src, dest)
Definition: eostools.py:511

Member Function Documentation

◆ run()

void HGCalBackendLayer2Processor3DClustering::run ( const edm::Handle< l1t::HGCalClusterBxCollection > &  collHandle,
std::pair< l1t::HGCalMulticlusterBxCollection, l1t::HGCalClusterBxCollection > &  be_output 
)
inlineoverride

Definition at line 43 of file HGCalBackendLayer2Processor3DClustering.cc.

References DBSCANC3d, dRC3d, energy_interpreters_, HGCalProcessorBaseT< InputCollection, OutputCollection >::geometry(), HistoC3d, mps_fire::i, multiclustering_, multiclusteringAlgoType_, multiclusteringHistoClustering_, multiclusteringHistoSeeding_, and BXVector< T >::size().

44  {
45  if (multiclustering_)
46  multiclustering_->setGeometry(geometry());
48  multiclusteringHistoSeeding_->setGeometry(geometry());
51 
52  auto& collCluster3D = be_output.first;
53  auto& rejectedClusters = be_output.second;
54 
55  /* create a persistent vector of pointers to the trigger-cells */
56  std::vector<edm::Ptr<l1t::HGCalCluster>> clustersPtrs;
57  for (unsigned i = 0; i < collHandle->size(); ++i) {
58  edm::Ptr<l1t::HGCalCluster> ptr(collHandle, i);
59  clustersPtrs.push_back(ptr);
60  }
61 
62  /* create a vector of seed positions and their energy*/
63  std::vector<std::pair<GlobalPoint, double>> seedPositionsEnergy;
64 
65  /* call to multiclustering and compute shower shape*/
66  switch (multiclusteringAlgoType_) {
67  case dRC3d:
68  multiclustering_->clusterizeDR(clustersPtrs, collCluster3D, *geometry());
69  break;
70  case DBSCANC3d:
71  multiclustering_->clusterizeDBSCAN(clustersPtrs, collCluster3D, *geometry());
72  break;
73  case HistoC3d:
74  multiclusteringHistoSeeding_->findHistoSeeds(clustersPtrs, seedPositionsEnergy);
75  multiclusteringHistoClustering_->clusterizeHisto(
76  clustersPtrs, seedPositionsEnergy, *geometry(), collCluster3D, rejectedClusters);
77  break;
78  default:
79  // Should not happen, clustering type checked in constructor
80  break;
81  }
82 
83  // Call all the energy interpretation modules on the cluster collection
84  for (const auto& interpreter : energy_interpreters_) {
85  interpreter->setGeometry(geometry());
86  interpreter->interpret(collCluster3D);
87  }
88  }
std::unique_ptr< HGCalMulticlusteringImpl > multiclustering_
unsigned size(int bx) const
std::unique_ptr< HGCalHistoSeedingImpl > multiclusteringHistoSeeding_
const HGCalTriggerGeometryBase * geometry() const
std::unique_ptr< HGCalHistoClusteringImpl > multiclusteringHistoClustering_
std::vector< std::unique_ptr< HGCalTriggerClusterInterpreterBase > > energy_interpreters_

Member Data Documentation

◆ energy_interpreters_

std::vector<std::unique_ptr<HGCalTriggerClusterInterpreterBase> > HGCalBackendLayer2Processor3DClustering::energy_interpreters_
private

◆ multiclustering_

std::unique_ptr<HGCalMulticlusteringImpl> HGCalBackendLayer2Processor3DClustering::multiclustering_
private

◆ multiclusteringAlgoType_

MulticlusterType HGCalBackendLayer2Processor3DClustering::multiclusteringAlgoType_
private

◆ multiclusteringHistoClustering_

std::unique_ptr<HGCalHistoClusteringImpl> HGCalBackendLayer2Processor3DClustering::multiclusteringHistoClustering_
private

◆ multiclusteringHistoSeeding_

std::unique_ptr<HGCalHistoSeedingImpl> HGCalBackendLayer2Processor3DClustering::multiclusteringHistoSeeding_
private