CMS 3D CMS Logo

List of all members | Public Member Functions | Private Types | Private Attributes
HGCClusterAlgo< FECODEC, DATA > Class Template Reference
Inheritance diagram for HGCClusterAlgo< FECODEC, DATA >:
HGCalTriggerBackend::Algorithm< FECODEC > HGCalTriggerBackendAlgorithmBase

Public Member Functions

 HGCClusterAlgo (const edm::ParameterSet &conf, edm::ConsumesCollector &cc)
 
void putInEvent (edm::Event &evt) final
 
void reset () final
 
void run (const l1t::HGCFETriggerDigiCollection &coll, const edm::EventSetup &es, edm::Event &evt) final
 
void setProduces (edm::stream::EDProducer<> &prod) const final
 
- Public Member Functions inherited from HGCalTriggerBackend::Algorithm< FECODEC >
 Algorithm (const edm::ParameterSet &conf, edm::ConsumesCollector &cc)
 
void setGeometry (const HGCalTriggerGeometryBase *const geom) final
 
- Public Member Functions inherited from HGCalTriggerBackendAlgorithmBase
 HGCalTriggerBackendAlgorithmBase (const edm::ParameterSet &conf, edm::ConsumesCollector &cc)
 
const std::string & name () const
 
virtual ~HGCalTriggerBackendAlgorithmBase ()
 

Private Types

enum  ClusterType { dRC2d, NNC2d, dRNNC2d }
 
enum  MulticlusterType { dRC3d, DBSCANC3d }
 

Private Attributes

HGCalTriggerCellCalibration calibration_
 
std::unique_ptr< l1t::HGCalClusterBxCollectioncluster_product_
 
HGCalClusteringImpl clustering_
 
ClusterType clusteringAlgorithmType_
 
std::unique_ptr< l1t::HGCalMulticlusterBxCollectionmulticluster_product_
 
HGCalMulticlusteringImpl multiclustering_
 
MulticlusterType multiclusteringAlgoType_
 
std::unique_ptr< l1t::HGCalTriggerCellBxCollectiontrgcell_product_
 
double triggercell_threshold_scintillator_
 
double triggercell_threshold_silicon_
 
edm::ESHandle< HGCalTriggerGeometryBasetriggerGeometry_
 

Additional Inherited Members

- Protected Attributes inherited from HGCalTriggerBackend::Algorithm< FECODEC >
FECODEC codec_
 
- Protected Attributes inherited from HGCalTriggerBackendAlgorithmBase
const HGCalTriggerGeometryBasegeometry_
 

Detailed Description

template<typename FECODEC, typename DATA>
class HGCClusterAlgo< FECODEC, DATA >

Definition at line 18 of file HGCClusterAlgo.cc.

Member Enumeration Documentation

template<typename FECODEC , typename DATA >
enum HGCClusterAlgo::ClusterType
private
Enumerator
dRC2d 
NNC2d 
dRNNC2d 

Definition at line 27 of file HGCClusterAlgo.cc.

template<typename FECODEC , typename DATA >
enum HGCClusterAlgo::MulticlusterType
private
Enumerator
dRC3d 
DBSCANC3d 

Definition at line 32 of file HGCClusterAlgo.cc.

Constructor & Destructor Documentation

template<typename FECODEC , typename DATA >
HGCClusterAlgo< FECODEC, DATA >::HGCClusterAlgo ( const edm::ParameterSet conf,
edm::ConsumesCollector cc 
)
inline

Definition at line 39 of file HGCClusterAlgo.cc.

References Exception, edm::ParameterSet::getParameter(), edm::ParameterSet::getParameterSet(), and AlCaHLTBitMon_QueryRunRegistry::string.

39  :
40  Algorithm<FECODEC>(conf, cc),
44  calibration_( conf.getParameterSet("calib_parameters") ),
45  clustering_( conf.getParameterSet("C2d_parameters") ),
46  multiclustering_( conf.getParameterSet("C3d_parameters" ) ),
47  triggercell_threshold_silicon_( conf.getParameter<double>("triggercell_threshold_silicon") ),
48  triggercell_threshold_scintillator_( conf.getParameter<double>("triggercell_threshold_scintillator") )
49  {
50  std::string typeCluster(conf.getParameterSet("C2d_parameters").getParameter<std::string>("clusterType"));
51  if(typeCluster=="dRC2d"){
53  }else if(typeCluster=="NNC2d"){
55  }else if(typeCluster=="dRNNC2d"){
57  }else {
58  throw cms::Exception("HGCTriggerParameterError")
59  << "Unknown clustering type '" << typeCluster;
60  }
61  std::string typeMulticluster(conf.getParameterSet("C3d_parameters").getParameter<std::string>("type_multicluster"));
62  if(typeMulticluster=="dRC3d"){
64  }else if(typeMulticluster=="DBSCANC3d"){
66  }else {
67  throw cms::Exception("HGCTriggerParameterError")
68  << "Unknown Multiclustering type '" << typeMulticluster;
69  }
70 
71  }
ClusterType clusteringAlgorithmType_
HGCalTriggerCellCalibration calibration_
std::unique_ptr< l1t::HGCalTriggerCellBxCollection > trgcell_product_
HGCalMulticlusteringImpl multiclustering_
HGCalClusteringImpl clustering_
MulticlusterType multiclusteringAlgoType_
double triggercell_threshold_scintillator_
std::unique_ptr< l1t::HGCalMulticlusterBxCollection > multicluster_product_
std::unique_ptr< l1t::HGCalClusterBxCollection > cluster_product_
double triggercell_threshold_silicon_

Member Function Documentation

template<typename FECODEC , typename DATA >
void HGCClusterAlgo< FECODEC, DATA >::putInEvent ( edm::Event evt)
inlinefinalvirtual

Implements HGCalTriggerBackendAlgorithmBase.

Definition at line 83 of file HGCClusterAlgo.cc.

84  {
85 
86  }
template<typename FECODEC , typename DATA >
void HGCClusterAlgo< FECODEC, DATA >::reset ( void  )
inlinefinalvirtual

Implements HGCalTriggerBackendAlgorithmBase.

Definition at line 89 of file HGCClusterAlgo.cc.

90  {
94  }
std::unique_ptr< l1t::HGCalTriggerCellBxCollection > trgcell_product_
std::unique_ptr< l1t::HGCalMulticlusterBxCollection > multicluster_product_
std::unique_ptr< l1t::HGCalClusterBxCollection > cluster_product_
template<typename FECODEC , typename DATA >
void HGCClusterAlgo< FECODEC, DATA >::run ( const l1t::HGCFETriggerDigiCollection coll,
const edm::EventSetup es,
edm::Event evt 
)
finalvirtual

Implements HGCalTriggerBackendAlgorithmBase.

Definition at line 120 of file HGCClusterAlgo.cc.

References cscdqm::DATA, data, edm::EventSetup::get(), HGCHEB, mps_fire::i, l1t::HGCalTriggerCell::mipPt(), eostools::move(), edm::Event::put(), and BXVector< T >::size().

123 {
124  es.get<CaloGeometryRecord>().get("", triggerGeometry_);
128 
129  for( const auto& digi : coll ){
130 
131  HGCalDetId module_id( digi.id() );
132 
133  DATA data;
134  data.reset();
135  digi.decode(codec_, data);
136 
137  for(const auto& triggercell : data.payload)
138  {
139 
140  if( triggercell.hwPt() > 0 )
141  {
142  l1t::HGCalTriggerCell calibratedtriggercell( triggercell );
143  calibration_.calibrateInGeV( calibratedtriggercell);
144  double triggercell_threshold = (triggercell.subdetId()==HGCHEB ? triggercell_threshold_scintillator_ : triggercell_threshold_silicon_);
145  if(calibratedtriggercell.mipPt()<triggercell_threshold) continue;
146  trgcell_product_->push_back( 0, calibratedtriggercell );
147  }
148 
149  }
150 
151  }
152 
153  /* orphan handles to the collections of trigger-cells, clusters and multiclusters */
157 
158  /* retrieve the orphan handle to the trigger-cells collection and put the collection in the event */
159  triggerCellsHandle = evt.put( std::move( trgcell_product_ ), "calibratedTriggerCells");
160 
161  /* create a persistent vector of pointers to the trigger-cells */
162  std::vector<edm::Ptr<l1t::HGCalTriggerCell>> triggerCellsPtrs;
163  for( unsigned i = 0; i < triggerCellsHandle->size(); ++i ) {
164  edm::Ptr<l1t::HGCalTriggerCell> ptr(triggerCellsHandle,i);
165  triggerCellsPtrs.push_back(ptr);
166  }
167 
168  /* call to C2d clustering */
169  switch(clusteringAlgorithmType_){
170  case dRC2d :
171  clustering_.clusterizeDR( triggerCellsPtrs, *cluster_product_);
172  break;
173  case NNC2d:
175  break;
176  case dRNNC2d:
178  break;
179  default:
180  // Should not happen, clustering type checked in constructor
181  break;
182  }
183 
184  /* retrieve the orphan handle to the clusters collection and put the collection in the event */
185  clustersHandle = evt.put( std::move( cluster_product_ ), "cluster2D");
186 
187  /* create a persistent vector of pointers to the trigger-cells */
188  std::vector<edm::Ptr<l1t::HGCalCluster>> clustersPtrs;
189  for( unsigned i = 0; i < clustersHandle->size(); ++i ) {
190  edm::Ptr<l1t::HGCalCluster> ptr(clustersHandle,i);
191  clustersPtrs.push_back(ptr);
192  }
193 
194  /* call to multiclustering and compute shower shape*/
195  switch(multiclusteringAlgoType_){
196  case dRC3d :
198  break;
199  case DBSCANC3d:
201  break;
202  default:
203  // Should not happen, clustering type checked in constructor
204  break;
205  }
206 
207  /* retrieve the orphan handle to the multiclusters collection and put the collection in the event */
208  multiclustersHandle = evt.put( std::move( multicluster_product_ ), "cluster3D");
209 
210 
211 
212 }
ClusterType clusteringAlgorithmType_
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:137
HGCalTriggerCellCalibration calibration_
unsigned size(int bx) const
void eventSetup(const edm::EventSetup &es)
std::unique_ptr< l1t::HGCalTriggerCellBxCollection > trgcell_product_
void clusterizeDRNN(const std::vector< edm::Ptr< l1t::HGCalTriggerCell >> &triggerCellsPtrs, l1t::HGCalClusterBxCollection &clusters, const HGCalTriggerGeometryBase &triggerGeometry)
void clusterizeNN(const std::vector< edm::Ptr< l1t::HGCalTriggerCell >> &triggerCellsPtrs, l1t::HGCalClusterBxCollection &clusters, const HGCalTriggerGeometryBase &triggerGeometry)
HGCalMulticlusteringImpl multiclustering_
void eventSetup(const edm::EventSetup &es)
void clusterizeDR(const std::vector< edm::Ptr< l1t::HGCalCluster >> &clustersPtr, l1t::HGCalMulticlusterBxCollection &multiclusters, const HGCalTriggerGeometryBase &triggerGeometry)
HGCalClusteringImpl clustering_
MulticlusterType multiclusteringAlgoType_
double triggercell_threshold_scintillator_
std::unique_ptr< l1t::HGCalMulticlusterBxCollection > multicluster_product_
void clusterizeDR(const std::vector< edm::Ptr< l1t::HGCalTriggerCell >> &triggerCellsPtrs, l1t::HGCalClusterBxCollection &clusters)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
void eventSetup(const edm::EventSetup &es)
T get() const
Definition: EventSetup.h:62
std::unique_ptr< l1t::HGCalClusterBxCollection > cluster_product_
void calibrateInGeV(l1t::HGCalTriggerCell &)
edm::ESHandle< HGCalTriggerGeometryBase > triggerGeometry_
double triggercell_threshold_silicon_
def move(src, dest)
Definition: eostools.py:511
void clusterizeDBSCAN(const std::vector< edm::Ptr< l1t::HGCalCluster >> &clustersPtr, l1t::HGCalMulticlusterBxCollection &multiclusters, const HGCalTriggerGeometryBase &triggerGeometry)
template<typename FECODEC , typename DATA >
void HGCClusterAlgo< FECODEC, DATA >::setProduces ( edm::stream::EDProducer<> &  prod) const
inlinefinalvirtual

Implements HGCalTriggerBackendAlgorithmBase.

Definition at line 73 of file HGCClusterAlgo.cc.

References coll, parseEventContent::prod, and findQualityFiles::run.

74  {
75  prod.produces<l1t::HGCalTriggerCellBxCollection>( "calibratedTriggerCells" );
76  prod.produces<l1t::HGCalClusterBxCollection>( "cluster2D" );
77  prod.produces<l1t::HGCalMulticlusterBxCollection>( "cluster3D" );
78  }

Member Data Documentation

template<typename FECODEC , typename DATA >
HGCalTriggerCellCalibration HGCClusterAlgo< FECODEC, DATA >::calibration_
private

Definition at line 107 of file HGCClusterAlgo.cc.

template<typename FECODEC , typename DATA >
std::unique_ptr<l1t::HGCalClusterBxCollection> HGCClusterAlgo< FECODEC, DATA >::cluster_product_
private

Definition at line 101 of file HGCClusterAlgo.cc.

template<typename FECODEC , typename DATA >
HGCalClusteringImpl HGCClusterAlgo< FECODEC, DATA >::clustering_
private

Definition at line 108 of file HGCClusterAlgo.cc.

template<typename FECODEC , typename DATA >
ClusterType HGCClusterAlgo< FECODEC, DATA >::clusteringAlgorithmType_
private

Definition at line 112 of file HGCClusterAlgo.cc.

template<typename FECODEC , typename DATA >
std::unique_ptr<l1t::HGCalMulticlusterBxCollection> HGCClusterAlgo< FECODEC, DATA >::multicluster_product_
private

Definition at line 102 of file HGCClusterAlgo.cc.

template<typename FECODEC , typename DATA >
HGCalMulticlusteringImpl HGCClusterAlgo< FECODEC, DATA >::multiclustering_
private

Definition at line 109 of file HGCClusterAlgo.cc.

template<typename FECODEC , typename DATA >
MulticlusterType HGCClusterAlgo< FECODEC, DATA >::multiclusteringAlgoType_
private

Definition at line 115 of file HGCClusterAlgo.cc.

template<typename FECODEC , typename DATA >
std::unique_ptr<l1t::HGCalTriggerCellBxCollection> HGCClusterAlgo< FECODEC, DATA >::trgcell_product_
private

Definition at line 100 of file HGCClusterAlgo.cc.

template<typename FECODEC , typename DATA >
double HGCClusterAlgo< FECODEC, DATA >::triggercell_threshold_scintillator_
private

Definition at line 114 of file HGCClusterAlgo.cc.

template<typename FECODEC , typename DATA >
double HGCClusterAlgo< FECODEC, DATA >::triggercell_threshold_silicon_
private

Definition at line 113 of file HGCClusterAlgo.cc.

template<typename FECODEC , typename DATA >
edm::ESHandle<HGCalTriggerGeometryBase> HGCClusterAlgo< FECODEC, DATA >::triggerGeometry_
private

Definition at line 104 of file HGCClusterAlgo.cc.