CMS 3D CMS Logo

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

Public Member Functions

 HGCalTowerProcessor (const edm::ParameterSet &conf)
 
void run (const std::pair< edm::Handle< l1t::HGCalTowerMapBxCollection >, edm::Handle< l1t::HGCalClusterBxCollection >> &collHandle, l1t::HGCalTowerBxCollection &collTowers) override
 
void setGeometry (const HGCalTriggerGeometryBase *const geom) 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 ~HGCalProcessorBaseT ()
 

Private Attributes

bool includeTrigCells_
 
std::unique_ptr< HGCalTowerMap2DImpltowermap2D_
 
std::unique_ptr< HGCalTowerMap3DImpltowermap3D_
 

Additional Inherited Members

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

Detailed Description

Definition at line 12 of file HGCalTowerProcessor.cc.

Constructor & Destructor Documentation

◆ HGCalTowerProcessor()

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

Definition at line 14 of file HGCalTowerProcessor.cc.

References edm::ParameterSet::getParameter(), edm::ParameterSet::getParameterSet(), includeTrigCells_, towermap2D_, and towermap3D_.

14  : HGCalTowerProcessorBase(conf) {
15  includeTrigCells_ = conf.getParameter<bool>("includeTrigCells"),
16  towermap2D_ = std::make_unique<HGCalTowerMap2DImpl>(conf.getParameterSet("towermap_parameters"));
17  towermap3D_ = std::make_unique<HGCalTowerMap3DImpl>();
18  }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
ParameterSet const & getParameterSet(std::string const &) const
std::unique_ptr< HGCalTowerMap3DImpl > towermap3D_
HGCalProcessorBaseT< std::pair< edm::Handle< l1t::HGCalTowerMapBxCollection >, edm::Handle< l1t::HGCalClusterBxCollection > >, l1t::HGCalTowerBxCollection > HGCalTowerProcessorBase
std::unique_ptr< HGCalTowerMap2DImpl > towermap2D_

Member Function Documentation

◆ run()

void HGCalTowerProcessor::run ( const std::pair< edm::Handle< l1t::HGCalTowerMapBxCollection >, edm::Handle< l1t::HGCalClusterBxCollection >> &  collHandle,
l1t::HGCalTowerBxCollection collTowers 
)
inlineoverride

Definition at line 25 of file HGCalTowerProcessor.cc.

References l1t::HGCalClusterT< C >::constituents(), mps_fire::i, includeTrigCells_, BXVector< T >::size(), towermap2D_, and towermap3D_.

27  {
28  auto& towerMapCollHandle = collHandle.first;
29  auto& unclTCsCollHandle = collHandle.second;
30 
31  /* create a persistent vector of pointers to the towerMaps */
32  std::vector<edm::Ptr<l1t::HGCalTowerMap>> towerMapsPtrs;
33  for (unsigned i = 0; i < towerMapCollHandle->size(); ++i) {
34  towerMapsPtrs.emplace_back(towerMapCollHandle, i);
35  }
36 
37  if (includeTrigCells_) {
38  /* create additional TowerMaps from the unclustered TCs */
39 
40  // translate our HGCalClusters into HGCalTriggerCells
41  std::vector<edm::Ptr<l1t::HGCalTriggerCell>> trigCellVec;
42  for (unsigned i = 0; i < unclTCsCollHandle->size(); ++i) {
43  edm::Ptr<l1t::HGCalCluster> ptr(unclTCsCollHandle, i);
44  for (const auto& itTC : ptr->constituents()) {
45  trigCellVec.push_back(itTC.second);
46  }
47  }
48 
49  // fill the TowerMaps with the HGCalTriggersCells
50  l1t::HGCalTowerMapBxCollection towerMapsFromUnclTCs;
51  towermap2D_->buildTowerMap2D(trigCellVec, towerMapsFromUnclTCs);
52 
53  /* merge the two sets of TowerMaps */
54  unsigned int towerMapsPtrsSize = towerMapsPtrs.size();
55  for (unsigned int i = 0; i < towerMapsFromUnclTCs.size(); ++i) {
56  towerMapsPtrs.emplace_back(&(towerMapsFromUnclTCs[i]), i + towerMapsPtrsSize);
57  }
58 
59  /* call to towerMap3D clustering */
60  towermap3D_->buildTowerMap3D(towerMapsPtrs, collTowers);
61  } else {
62  /* call to towerMap3D clustering */
63  towermap3D_->buildTowerMap3D(towerMapsPtrs, collTowers);
64  }
65  }
unsigned size(int bx) const
std::unique_ptr< HGCalTowerMap3DImpl > towermap3D_
std::unique_ptr< HGCalTowerMap2DImpl > towermap2D_

◆ setGeometry()

void HGCalTowerProcessor::setGeometry ( const HGCalTriggerGeometryBase *const  geom)
inlineoverridevirtual

Reimplemented from HGCalProcessorBaseT< InputCollection, OutputCollection >.

Definition at line 20 of file HGCalTowerProcessor.cc.

References relativeConstraints::geom, HGCalProcessorBaseT< InputCollection, OutputCollection >::setGeometry(), and towermap2D_.

20  {
22  towermap2D_->setGeometry(geom);
23  }
virtual void setGeometry(const HGCalTriggerGeometryBase *const geom)
std::unique_ptr< HGCalTowerMap2DImpl > towermap2D_

Member Data Documentation

◆ includeTrigCells_

bool HGCalTowerProcessor::includeTrigCells_
private

Definition at line 68 of file HGCalTowerProcessor.cc.

Referenced by HGCalTowerProcessor(), and run().

◆ towermap2D_

std::unique_ptr<HGCalTowerMap2DImpl> HGCalTowerProcessor::towermap2D_
private

Definition at line 71 of file HGCalTowerProcessor.cc.

Referenced by HGCalTowerProcessor(), run(), and setGeometry().

◆ towermap3D_

std::unique_ptr<HGCalTowerMap3DImpl> HGCalTowerProcessor::towermap3D_
private

Definition at line 72 of file HGCalTowerProcessor.cc.

Referenced by HGCalTowerProcessor(), and run().