CMS 3D CMS Logo

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

Public Member Functions

 HGCalBackendLayer1Processor2DClustering (const edm::ParameterSet &conf)
 
void run (const edm::Handle< l1t::HGCalTriggerCellBxCollection > &collHandle, l1t::HGCalClusterBxCollection &collCluster2D, const edm::EventSetup &es) 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, const edm::EventSetup &es)=0
 
void setGeometry (const HGCalTriggerGeometryBase *const geom)
 
virtual ~HGCalProcessorBaseT ()
 

Private Types

enum  ClusterType { dRC2d, NNC2d, dRNNC2d, dummyC2d }
 

Private Attributes

std::unique_ptr< HGCalClusteringImplclustering_
 
ClusterType clusteringAlgorithmType_
 
std::unique_ptr< HGCalClusteringDummyImplclusteringDummy_
 
edm::ESHandle< HGCalTriggerGeometryBasetriggerGeometry_
 

Additional Inherited Members

- Protected Attributes inherited from HGCalProcessorBaseT< InputCollection, OutputCollection >
const HGCalTriggerGeometryBasegeometry_
 

Detailed Description

Definition at line 10 of file HGCalBackendLayer1Processor2DClustering.cc.

Member Enumeration Documentation

Constructor & Destructor Documentation

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

Definition at line 12 of file HGCalBackendLayer1Processor2DClustering.cc.

References clustering_, clusteringAlgorithmType_, clusteringDummy_, dRC2d, dRNNC2d, dummyC2d, Exception, edm::ParameterSet::getParameter(), edm::ParameterSet::getParameterSet(), NNC2d, and AlCaHLTBitMon_QueryRunRegistry::string.

13  std::string typeCluster(conf.getParameterSet("C2d_parameters").getParameter<std::string>("clusterType"));
14  if (typeCluster == "dRC2d") {
16  clustering_ = std::make_unique<HGCalClusteringImpl>(conf.getParameterSet("C2d_parameters"));
17  } else if (typeCluster == "NNC2d") {
19  clustering_ = std::make_unique<HGCalClusteringImpl>(conf.getParameterSet("C2d_parameters"));
20  } else if (typeCluster == "dRNNC2d") {
22  clustering_ = std::make_unique<HGCalClusteringImpl>(conf.getParameterSet("C2d_parameters"));
23  } else if (typeCluster == "dummyC2d") {
25  clusteringDummy_ = std::make_unique<HGCalClusteringDummyImpl>(conf.getParameterSet("C2d_parameters"));
26  } else {
27  throw cms::Exception("HGCTriggerParameterError") << "Unknown clustering type '" << typeCluster;
28  }
29  }
T getParameter(std::string const &) const
HGCalProcessorBaseT< edm::Handle< l1t::HGCalTriggerCellBxCollection >, l1t::HGCalClusterBxCollection > HGCalBackendLayer1ProcessorBase
std::unique_ptr< HGCalClusteringDummyImpl > clusteringDummy_
ParameterSet const & getParameterSet(std::string const &) const

Member Function Documentation

void HGCalBackendLayer1Processor2DClustering::run ( const edm::Handle< l1t::HGCalTriggerCellBxCollection > &  collHandle,
l1t::HGCalClusterBxCollection collCluster2D,
const edm::EventSetup es 
)
inlineoverride

Definition at line 31 of file HGCalBackendLayer1Processor2DClustering.cc.

References a, b, clustering_, clusteringAlgorithmType_, clusteringDummy_, dRC2d, dRNNC2d, dummyC2d, edm::EventSetup::get(), mps_fire::i, l1t::HGCalTriggerCell::mipPt(), NNC2d, BXVector< T >::size(), and triggerGeometry_.

33  {
35  if (clustering_)
36  clustering_->eventSetup(es);
37  if (clusteringDummy_)
38  clusteringDummy_->eventSetup(es);
39 
40  /* create a persistent vector of pointers to the trigger-cells */
41  std::vector<edm::Ptr<l1t::HGCalTriggerCell>> triggerCellsPtrs;
42  for (unsigned i = 0; i < collHandle->size(); ++i) {
43  edm::Ptr<l1t::HGCalTriggerCell> ptr(collHandle, i);
44  triggerCellsPtrs.push_back(ptr);
45  }
46 
47  std::sort(triggerCellsPtrs.begin(),
48  triggerCellsPtrs.end(),
50  return a->mipPt() > b->mipPt();
51  });
52 
53  /* call to C2d clustering */
54  switch (clusteringAlgorithmType_) {
55  case dRC2d:
56  clustering_->clusterizeDR(triggerCellsPtrs, collCluster2D);
57  break;
58  case NNC2d:
59  clustering_->clusterizeNN(triggerCellsPtrs, collCluster2D, *triggerGeometry_);
60  break;
61  case dRNNC2d:
62  clustering_->clusterizeDRNN(triggerCellsPtrs, collCluster2D, *triggerGeometry_);
63  break;
64  case dummyC2d:
65  clusteringDummy_->clusterizeDummy(triggerCellsPtrs, collCluster2D);
66  break;
67  default:
68  // Should not happen, clustering type checked in constructor
69  break;
70  }
71  }
unsigned size(int bx) const
double mipPt() const
edm::ESHandle< HGCalTriggerGeometryBase > triggerGeometry_
std::unique_ptr< HGCalClusteringDummyImpl > clusteringDummy_
double b
Definition: hdecay.h:118
double a
Definition: hdecay.h:119
T get() const
Definition: EventSetup.h:73

Member Data Documentation

std::unique_ptr<HGCalClusteringImpl> HGCalBackendLayer1Processor2DClustering::clustering_
private
ClusterType HGCalBackendLayer1Processor2DClustering::clusteringAlgorithmType_
private
std::unique_ptr<HGCalClusteringDummyImpl> HGCalBackendLayer1Processor2DClustering::clusteringDummy_
private
edm::ESHandle<HGCalTriggerGeometryBase> HGCalBackendLayer1Processor2DClustering::triggerGeometry_
private

Definition at line 76 of file HGCalBackendLayer1Processor2DClustering.cc.

Referenced by run().