CMS 3D CMS Logo

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

Public Member Functions

 HGCalBackendLayer2Processor3DClusteringSA (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 Attributes

const edm::ParameterSet conf_
 
HGCalStage2ClusterDistribution distributor_
 
std::vector< std::unique_ptr< HGCalTriggerClusterInterpreterBase > > energy_interpreters_
 
std::unique_ptr< HGCalHistoClusteringWrapperBasemulticlusteringHistoClusteringWrapper_
 
std::unique_ptr< HGCalHistoSeedingImplmulticlusteringHistoSeeding_
 
std::unique_ptr< HGCalStage2FilteringWrapperBasemulticlusteringSortingTruncationWrapper_
 

Additional Inherited Members

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

Detailed Description

Definition at line 15 of file HGCalBackendLayer2Processor3DClustering_SA.cc.

Constructor & Destructor Documentation

◆ HGCalBackendLayer2Processor3DClusteringSA()

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

Definition at line 17 of file HGCalBackendLayer2Processor3DClustering_SA.cc.

References energy_interpreters_, get, edm::ParameterSet::getParameter(), edm::ParameterSet::getParameterSet(), eostools::move(), multiclusteringHistoClusteringWrapper_, multiclusteringHistoSeeding_, multiclusteringSortingTruncationWrapper_, and AlCaHLTBitMon_QueryRunRegistry::string.

19  distributor_(conf.getParameterSet("DistributionParameters")),
20  conf_(conf) {
21  multiclusteringHistoSeeding_ = std::make_unique<HGCalHistoSeedingImpl>(
22  conf.getParameterSet("C3d_parameters").getParameterSet("histoMax_C3d_seeding_parameters"));
23 
24  const edm::ParameterSet& clusteringParamConfig =
25  conf.getParameterSet("C3d_parameters").getParameterSet("histoMax_C3d_clustering_parameters");
26  const edm::ParameterSet& sortingTruncationParamConfig =
27  conf.getParameterSet("C3d_parameters").getParameterSet("histoMax_C3d_sorting_truncation_parameters");
28  const std::string& clusteringAlgoWrapperName = clusteringParamConfig.getParameter<std::string>("AlgoName");
29  const std::string& sortingTruncationAlgoWrapperName =
30  sortingTruncationParamConfig.getParameter<std::string>("AlgoName");
31 
32  multiclusteringHistoClusteringWrapper_ = std::unique_ptr<HGCalHistoClusteringWrapperBase>{
33  HGCalHistoClusteringWrapperBaseFactory::get()->create(clusteringAlgoWrapperName, clusteringParamConfig)};
35  std::unique_ptr<HGCalStage2FilteringWrapperBase>{HGCalStage2FilteringWrapperBaseFactory::get()->create(
36  sortingTruncationAlgoWrapperName, sortingTruncationParamConfig)};
37 
38  for (const auto& interpretationPset : conf.getParameter<std::vector<edm::ParameterSet>>("energy_interpretations")) {
39  std::unique_ptr<HGCalTriggerClusterInterpreterBase> interpreter{
40  HGCalTriggerClusterInterpreterFactory::get()->create(interpretationPset.getParameter<std::string>("type"))};
41  interpreter->initialize(interpretationPset);
42  energy_interpreters_.push_back(std::move(interpreter));
43  }
44  }
HGCalProcessorBaseT< edm::Handle< l1t::HGCalClusterBxCollection >, std::pair< l1t::HGCalMulticlusterBxCollection, l1t::HGCalClusterBxCollection > > HGCalBackendLayer2ProcessorBase
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
std::unique_ptr< HGCalStage2FilteringWrapperBase > multiclusteringSortingTruncationWrapper_
std::unique_ptr< HGCalHistoClusteringWrapperBase > multiclusteringHistoClusteringWrapper_
ParameterSet const & getParameterSet(std::string const &) const
std::vector< std::unique_ptr< HGCalTriggerClusterInterpreterBase > > energy_interpreters_
#define get
def move(src, dest)
Definition: eostools.py:511
std::unique_ptr< HGCalHistoSeedingImpl > multiclusteringHistoSeeding_

Member Function Documentation

◆ run()

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

Definition at line 46 of file HGCalBackendLayer2Processor3DClustering_SA.cc.

References conf_, JetHT_cfg::configuration, l1t::HGCalClusterT< C >::detId(), distributor_, energy_interpreters_, HGCalProcessorBaseT< InputCollection, OutputCollection >::geometry(), HGCalTriggerGeometryBase::getModuleFromTriggerCell(), HGCalTriggerGeometryBase::getStage1FpgaFromModule(), HGCalStage2ClusterDistribution::getStage2FPGAs(), HGCalTriggerGeometryBase::getStage2FpgasFromStage1Fpga(), mps_fire::i, callgraph::module, multiclusteringHistoClusteringWrapper_, multiclusteringHistoSeeding_, multiclusteringSortingTruncationWrapper_, BXVector< T >::push_back(), and BXVector< T >::size().

47  {
49  multiclusteringHistoSeeding_->setGeometry(geometry());
50  l1t::HGCalMulticlusterBxCollection& collCluster3D_sorted = be_output.first;
51  l1t::HGCalClusterBxCollection& rejectedClusters = be_output.second;
52 
53  /* create a persistent vector of pointers to the trigger-cells */
54  std::unordered_map<uint32_t, std::vector<edm::Ptr<l1t::HGCalCluster>>> tcs_per_fpga;
55 
56  for (unsigned i = 0; i < collHandle->size(); ++i) {
57  edm::Ptr<l1t::HGCalCluster> tc_ptr(collHandle, i);
58  uint32_t module = geometry()->getModuleFromTriggerCell(tc_ptr->detId());
59  uint32_t stage1_fpga = geometry()->getStage1FpgaFromModule(module);
60  HGCalTriggerGeometryBase::geom_set possible_stage2_fpgas = geometry()->getStage2FpgasFromStage1Fpga(stage1_fpga);
61 
63  distributor_.getStage2FPGAs(stage1_fpga, possible_stage2_fpgas, tc_ptr);
64 
65  for (auto& fpga : stage2_fpgas) {
66  tcs_per_fpga[fpga].push_back(tc_ptr);
67  }
68  }
69 
70  // Configuration
71  const std::pair<const HGCalTriggerGeometryBase* const, const edm::ParameterSet&> configuration{geometry(), conf_};
74 
75  for (auto& fpga_tcs : tcs_per_fpga) {
76  /* create a vector of seed positions and their energy*/
77  std::vector<std::pair<GlobalPoint, double>> seedPositionsEnergy;
78 
79  /* call to multiclustering and compute shower shape*/
80  multiclusteringHistoSeeding_->findHistoSeeds(fpga_tcs.second, seedPositionsEnergy);
81 
82  // Inputs
83  std::pair<const std::vector<edm::Ptr<l1t::HGCalCluster>>&, const std::vector<std::pair<GlobalPoint, double>>&>
84  inputClustersAndSeeds{fpga_tcs.second, seedPositionsEnergy};
85  // Outputs
86  l1t::HGCalMulticlusterBxCollection collCluster3D_perFPGA;
87  l1t::HGCalMulticlusterBxCollection collCluster3D_perFPGA_sorted;
88  l1t::HGCalClusterBxCollection rejectedClusters_perFPGA;
89 
90  std::pair<l1t::HGCalMulticlusterBxCollection&, l1t::HGCalClusterBxCollection&>
91  outputMulticlustersAndRejectedClusters_perFPGA{collCluster3D_perFPGA, rejectedClusters_perFPGA};
92 
93  // Process
94  multiclusteringHistoClusteringWrapper_->process(inputClustersAndSeeds,
95  outputMulticlustersAndRejectedClusters_perFPGA);
96 
97  multiclusteringSortingTruncationWrapper_->process(collCluster3D_perFPGA, collCluster3D_perFPGA_sorted);
98 
99  // Call all the energy interpretation modules on the cluster collection
100  for (const auto& interpreter : energy_interpreters_) {
101  interpreter->setGeometry(geometry());
102  interpreter->interpret(collCluster3D_perFPGA_sorted);
103  }
104 
105  for (const auto& collcluster : collCluster3D_perFPGA_sorted) {
106  collCluster3D_sorted.push_back(0, collcluster);
107  }
108  for (const auto& rejectedcluster : rejectedClusters_perFPGA) {
109  rejectedClusters.push_back(0, rejectedcluster);
110  }
111  }
112  }
std::unique_ptr< HGCalStage2FilteringWrapperBase > multiclusteringSortingTruncationWrapper_
virtual unsigned getStage1FpgaFromModule(const unsigned module_id) const =0
std::unique_ptr< HGCalHistoClusteringWrapperBase > multiclusteringHistoClusteringWrapper_
std::vector< std::unique_ptr< HGCalTriggerClusterInterpreterBase > > energy_interpreters_
unsigned size(int bx) const
dictionary configuration
Definition: JetHT_cfg.py:38
virtual geom_set getStage2FpgasFromStage1Fpga(const unsigned stage1_id) const =0
const HGCalTriggerGeometryBase * geometry() const
virtual unsigned getModuleFromTriggerCell(const unsigned trigger_cell_det_id) const =0
std::unordered_set< unsigned > geom_set
HGCalTriggerGeometryBase::geom_set getStage2FPGAs(const unsigned stage1_fpga, const HGCalTriggerGeometryBase::geom_set &stage2_fpgas, const edm::Ptr< l1t::HGCalCluster > &tc_ptr) const
std::unique_ptr< HGCalHistoSeedingImpl > multiclusteringHistoSeeding_
void push_back(int bx, T object)

Member Data Documentation

◆ conf_

const edm::ParameterSet HGCalBackendLayer2Processor3DClusteringSA::conf_
private

Definition at line 125 of file HGCalBackendLayer2Processor3DClustering_SA.cc.

Referenced by run().

◆ distributor_

HGCalStage2ClusterDistribution HGCalBackendLayer2Processor3DClusteringSA::distributor_
private

Definition at line 124 of file HGCalBackendLayer2Processor3DClustering_SA.cc.

Referenced by run().

◆ energy_interpreters_

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

◆ multiclusteringHistoClusteringWrapper_

std::unique_ptr<HGCalHistoClusteringWrapperBase> HGCalBackendLayer2Processor3DClusteringSA::multiclusteringHistoClusteringWrapper_
private

◆ multiclusteringHistoSeeding_

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

◆ multiclusteringSortingTruncationWrapper_

std::unique_ptr<HGCalStage2FilteringWrapperBase> HGCalBackendLayer2Processor3DClusteringSA::multiclusteringSortingTruncationWrapper_
private