CMS 3D CMS Logo

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

Public Member Functions

void configure (const std::pair< const HGCalTriggerGeometryBase *const, const edm::ParameterSet &> &configuration) override
 
 HGCalSortingTruncationWrapper (const edm::ParameterSet &conf)
 
void process (const l1t::HGCalMulticlusterBxCollection &, l1t::HGCalMulticlusterBxCollection &) const override
 
 ~HGCalSortingTruncationWrapper () 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 l1thgcfirmware::HGCalMulticlusterSACollection &multiclusters_out, const l1t::HGCalMulticlusterBxCollection &multiclusters_original, l1t::HGCalMulticlusterBxCollection &multiclustersBXCollection) const
 
void convertCMSSWInputs (const l1t::HGCalMulticlusterBxCollection &multiclusters, l1thgcfirmware::HGCalMulticlusterSACollection &multiclusters_SA) const
 
void setGeometry (const HGCalTriggerGeometryBase *const geom)
 

Private Attributes

HGCalSortingTruncationImplSA theAlgo_
 
l1thgcfirmware::SortingTruncationAlgoConfig theConfiguration_
 
HGCalTriggerTools triggerTools_
 

Detailed Description

Definition at line 14 of file HGCalSortingTruncationWrapper.cc.

Constructor & Destructor Documentation

◆ HGCalSortingTruncationWrapper()

HGCalSortingTruncationWrapper::HGCalSortingTruncationWrapper ( const edm::ParameterSet conf)

Definition at line 38 of file HGCalSortingTruncationWrapper.cc.

39  : HGCalStage2FilteringWrapperBase(conf), theAlgo_(), theConfiguration_(conf.getParameter<unsigned>("maxTCs")) {}
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
l1thgcfirmware::SortingTruncationAlgoConfig theConfiguration_
HGCalAlgoWrapperBaseT< l1t::HGCalMulticlusterBxCollection, l1t::HGCalMulticlusterBxCollection, std::pair< const HGCalTriggerGeometryBase *const, const edm::ParameterSet & > > HGCalStage2FilteringWrapperBase

◆ ~HGCalSortingTruncationWrapper()

HGCalSortingTruncationWrapper::~HGCalSortingTruncationWrapper ( )
overridedefault

Member Function Documentation

◆ configure()

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

Definition at line 104 of file HGCalSortingTruncationWrapper.cc.

References JetHT_cfg::configuration, and setGeometry().

105  {
106  setGeometry(configuration.first);
107 };
dictionary configuration
Definition: JetHT_cfg.py:38
void setGeometry(const HGCalTriggerGeometryBase *const geom)

◆ convertAlgorithmOutputs()

void HGCalSortingTruncationWrapper::convertAlgorithmOutputs ( const l1thgcfirmware::HGCalMulticlusterSACollection multiclusters_out,
const l1t::HGCalMulticlusterBxCollection multiclusters_original,
l1t::HGCalMulticlusterBxCollection multiclustersBXCollection 
) const
private

Definition at line 82 of file HGCalSortingTruncationWrapper.cc.

References BXVector< T >::push_back().

Referenced by process().

85  {
86  for (unsigned int imulticluster = 0; imulticluster < multiclusters_out.size(); ++imulticluster) {
87  unsigned multicluster_id = multiclusters_out[imulticluster].constituents().at(0).index_cmssw();
88  multiclustersBXCollection.push_back(0, multiclusters_original[multicluster_id]);
89  }
90 }
void push_back(int bx, T object)

◆ convertCMSSWInputs()

void HGCalSortingTruncationWrapper::convertCMSSWInputs ( const l1t::HGCalMulticlusterBxCollection multiclusters,
l1thgcfirmware::HGCalMulticlusterSACollection multiclusters_SA 
) const
private

Definition at line 41 of file HGCalSortingTruncationWrapper.cc.

References HGCalTriggerTools::layerWithOffset(), BXVector< T >::size(), triggerTools_, and HGCalTriggerTools::zside().

Referenced by process().

43  {
44  multiclusters_SA.reserve(multiclusters.size());
45 
46  for (unsigned int imulticluster = 0; imulticluster < multiclusters.size(); ++imulticluster) {
47  bool firstConstituent = true;
48  for (const auto& constituent : multiclusters[imulticluster].constituents()) {
49  if (firstConstituent) {
50  multiclusters_SA.emplace_back(l1thgcfirmware::HGCalMulticluster(
51  l1thgcfirmware::HGCalCluster(constituent.second->centreProj().x(),
52  constituent.second->centreProj().y(),
53  constituent.second->centreProj().z(),
54  triggerTools_.zside(constituent.second->detId()),
55  triggerTools_.layerWithOffset(constituent.second->detId()),
56  constituent.second->eta(),
57  constituent.second->phi(),
58  constituent.second->pt(),
59  constituent.second->mipPt(),
60  imulticluster),
61  1.));
62 
63  } else {
64  multiclusters_SA.at(imulticluster)
65  .addConstituent(l1thgcfirmware::HGCalCluster(constituent.second->centreProj().x(),
66  constituent.second->centreProj().y(),
67  constituent.second->centreProj().z(),
68  triggerTools_.zside(constituent.second->detId()),
69  triggerTools_.layerWithOffset(constituent.second->detId()),
70  constituent.second->eta(),
71  constituent.second->phi(),
72  constituent.second->pt(),
73  constituent.second->mipPt(),
74  imulticluster),
75  1.);
76  }
77  firstConstituent = false;
78  }
79  }
80 }
unsigned size(int bx) const
int zside(const DetId &) const
unsigned layerWithOffset(const DetId &) const

◆ process()

void HGCalSortingTruncationWrapper::process ( const l1t::HGCalMulticlusterBxCollection inputMulticlusters,
l1t::HGCalMulticlusterBxCollection outputMulticlusters 
) const
override

Definition at line 92 of file HGCalSortingTruncationWrapper.cc.

References convertAlgorithmOutputs(), convertCMSSWInputs(), HGCalSortingTruncationImplSA::sortAndTruncate_SA(), theAlgo_, and theConfiguration_.

93  {
95  convertCMSSWInputs(inputMulticlusters, multiclusters_SA);
96 
97  l1thgcfirmware::HGCalMulticlusterSACollection multiclusters_finalized_SA;
98 
99  theAlgo_.sortAndTruncate_SA(multiclusters_SA, multiclusters_finalized_SA, theConfiguration_);
100 
101  convertAlgorithmOutputs(multiclusters_finalized_SA, inputMulticlusters, outputMulticlusters);
102 }
void sortAndTruncate_SA(const std::vector< l1thgcfirmware::HGCalMulticluster > &inputMulticlusters, std::vector< l1thgcfirmware::HGCalMulticluster > &outputMulticlusters, const l1thgcfirmware::SortingTruncationAlgoConfig &configuration) const
void convertCMSSWInputs(const l1t::HGCalMulticlusterBxCollection &multiclusters, l1thgcfirmware::HGCalMulticlusterSACollection &multiclusters_SA) const
l1thgcfirmware::SortingTruncationAlgoConfig theConfiguration_
std::vector< HGCalMulticluster > HGCalMulticlusterSACollection
void convertAlgorithmOutputs(const l1thgcfirmware::HGCalMulticlusterSACollection &multiclusters_out, const l1t::HGCalMulticlusterBxCollection &multiclusters_original, l1t::HGCalMulticlusterBxCollection &multiclustersBXCollection) const

◆ setGeometry()

void HGCalSortingTruncationWrapper::setGeometry ( const HGCalTriggerGeometryBase *const  geom)
inlineprivate

Member Data Documentation

◆ theAlgo_

HGCalSortingTruncationImplSA HGCalSortingTruncationWrapper::theAlgo_
private

Definition at line 34 of file HGCalSortingTruncationWrapper.cc.

Referenced by process().

◆ theConfiguration_

l1thgcfirmware::SortingTruncationAlgoConfig HGCalSortingTruncationWrapper::theConfiguration_
private

Definition at line 35 of file HGCalSortingTruncationWrapper.cc.

Referenced by process().

◆ triggerTools_

HGCalTriggerTools HGCalSortingTruncationWrapper::triggerTools_
private

Definition at line 33 of file HGCalSortingTruncationWrapper.cc.

Referenced by convertCMSSWInputs(), and setGeometry().