CMS 3D CMS Logo

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

Public Member Functions

void configure (const std::pair< const HGCalTriggerGeometryBase *const, const edm::ParameterSet &> &parameters) override
 
 HGCalTowerMapsWrapper (const edm::ParameterSet &conf)
 
void process (const std::vector< edm::Ptr< l1t::HGCalTowerMap >> &inputs, l1t::HGCalTowerBxCollection &outputs) const override
 
 ~HGCalTowerMapsWrapper () override=default
 
- Public Member Functions inherited from HGCalAlgoWrapperBaseT< InputCollection, OutputCollection, Tparam >
virtual void configure (const Tparam &parameters)=0
 
 HGCalAlgoWrapperBaseT (const edm::ParameterSet &conf)
 
const std::string & name () const
 
virtual void process (const InputCollection &inputCollection, OutputCollection &outputCollection) const =0
 
virtual ~HGCalAlgoWrapperBaseT ()
 

Private Member Functions

void convertAlgorithmOutputs (const std::vector< l1thgcfirmware::HGCalTower > &towerMaps_SA, l1t::HGCalTowerBxCollection &outputTowerMaps) const
 
void convertCMSSWInputs (const std::vector< edm::Ptr< l1t::HGCalTowerMap >> &inputTowerMaps, std::vector< l1thgcfirmware::HGCalTowerMap > &towerMaps_SA) const
 

Private Attributes

HGCalTowerMapImplSA theAlgo_
 
std::unique_ptr< l1thgcfirmware::TowerMapsAlgoConfigtheConfiguration_
 

Detailed Description

Definition at line 19 of file HGCalTowerMapsWrapper.cc.

Constructor & Destructor Documentation

◆ HGCalTowerMapsWrapper()

HGCalTowerMapsWrapper::HGCalTowerMapsWrapper ( const edm::ParameterSet conf)

Definition at line 40 of file HGCalTowerMapsWrapper.cc.

HGCalAlgoWrapperBaseT< std::vector< edm::Ptr< l1t::HGCalTowerMap > >, l1t::HGCalTowerBxCollection, std::pair< const HGCalTriggerGeometryBase *const, const edm::ParameterSet & > > HGCalTowerMapsWrapperBase

◆ ~HGCalTowerMapsWrapper()

HGCalTowerMapsWrapper::~HGCalTowerMapsWrapper ( )
overridedefault

Member Function Documentation

◆ configure()

void HGCalTowerMapsWrapper::configure ( const std::pair< const HGCalTriggerGeometryBase *const, const edm::ParameterSet &> &  parameters)
override

Definition at line 78 of file HGCalTowerMapsWrapper.cc.

79  {}

◆ convertAlgorithmOutputs()

void HGCalTowerMapsWrapper::convertAlgorithmOutputs ( const std::vector< l1thgcfirmware::HGCalTower > &  towerMaps_SA,
l1t::HGCalTowerBxCollection outputTowerMaps 
) const
private

Definition at line 59 of file HGCalTowerMapsWrapper.cc.

References BXVector< T >::push_back().

Referenced by process().

60  {
61  for (const auto& towerSA : towers_SA) {
62  outputTowerMaps.push_back(
63  0, l1t::HGCalTower(towerSA.etEm(), towerSA.etHad(), towerSA.eta(), towerSA.phi(), towerSA.id()));
64  }
65 }
void push_back(int bx, T object)

◆ convertCMSSWInputs()

void HGCalTowerMapsWrapper::convertCMSSWInputs ( const std::vector< edm::Ptr< l1t::HGCalTowerMap >> &  inputTowerMaps,
std::vector< l1thgcfirmware::HGCalTowerMap > &  towerMaps_SA 
) const
private

Definition at line 42 of file HGCalTowerMapsWrapper.cc.

References l1thgcfirmware::HGCalTowerMap::addEt(), genParticles_cff::map, and hgcalTowerProducer_cfi::tower.

Referenced by process().

43  {
44  for (const auto& map : inputTowerMaps) {
45  std::vector<l1thgcfirmware::HGCalTowerCoord> tower_ids;
46  for (const auto& tower : map->towers()) {
47  tower_ids.emplace_back(tower.first, tower.second.eta(), tower.second.phi());
48  }
49 
50  l1thgcfirmware::HGCalTowerMap towerMapSA(tower_ids);
51 
52  for (const auto& tower : map->towers()) {
53  towerMapSA.addEt(tower.first, tower.second.etEm(), tower.second.etHad());
54  }
55  towerMaps_SA.emplace_back(towerMapSA);
56  }
57 }

◆ process()

void HGCalTowerMapsWrapper::process ( const std::vector< edm::Ptr< l1t::HGCalTowerMap >> &  inputs,
l1t::HGCalTowerBxCollection outputs 
) const
override

Definition at line 67 of file HGCalTowerMapsWrapper.cc.

References convertAlgorithmOutputs(), convertCMSSWInputs(), PixelMapPlotter::inputs, PatBasicFWLiteJetAnalyzer_Selector_cfg::outputs, HGCalTowerMapImplSA::runAlgorithm(), and theAlgo_.

68  {
69  std::vector<l1thgcfirmware::HGCalTowerMap> inputs_SA;
70  convertCMSSWInputs(inputs, inputs_SA);
71 
72  std::vector<l1thgcfirmware::HGCalTower> outputs_SA;
73  theAlgo_.runAlgorithm(inputs_SA, outputs_SA);
74 
75  convertAlgorithmOutputs(outputs_SA, outputs);
76 }
void convertCMSSWInputs(const std::vector< edm::Ptr< l1t::HGCalTowerMap >> &inputTowerMaps, std::vector< l1thgcfirmware::HGCalTowerMap > &towerMaps_SA) const
void convertAlgorithmOutputs(const std::vector< l1thgcfirmware::HGCalTower > &towerMaps_SA, l1t::HGCalTowerBxCollection &outputTowerMaps) const
void runAlgorithm(const std::vector< l1thgcfirmware::HGCalTowerMap > &inputTowerMaps_SA, std::vector< l1thgcfirmware::HGCalTower > &outputTowers_SA) const
HGCalTowerMapImplSA theAlgo_

Member Data Documentation

◆ theAlgo_

HGCalTowerMapImplSA HGCalTowerMapsWrapper::theAlgo_
private

Definition at line 35 of file HGCalTowerMapsWrapper.cc.

Referenced by process().

◆ theConfiguration_

std::unique_ptr<l1thgcfirmware::TowerMapsAlgoConfig> HGCalTowerMapsWrapper::theConfiguration_
private

Definition at line 37 of file HGCalTowerMapsWrapper.cc.