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)
 
virtual void putInEvent (edm::Event &evt) override final
 
virtual void reset () override final
 
virtual void run (const l1t::HGCFETriggerDigiCollection &coll, const edm::EventSetup &es, edm::Event &evt) override final
 
virtual void setProduces (edm::stream::EDProducer<> &prod) const override final
 
- Public Member Functions inherited from HGCalTriggerBackend::Algorithm< FECODEC >
 Algorithm (const edm::ParameterSet &conf, edm::ConsumesCollector &cc)
 
virtual void setGeometry (const HGCalTriggerGeometryBase *const geom) override 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 }
 

Private Attributes

HGCalTriggerCellCalibration calibration_
 
std::unique_ptr< l1t::HGCalClusterBxCollectioncluster_product_
 
HGCalClusteringImpl clustering_
 
double clustering_threshold_scintillator_
 
double clustering_threshold_silicon_
 
ClusterType clusteringAlgorithmType_
 
std::unique_ptr< l1t::HGCalMulticlusterBxCollectionmulticluster_product_
 
HGCalMulticlusteringImpl multiclustering_
 
std::unique_ptr< l1t::HGCalTriggerCellBxCollectiontrgcell_product_
 
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 

Definition at line 27 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 34 of file HGCClusterAlgo.cc.

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

34  :
35  Algorithm<FECODEC>(conf, cc),
39  calibration_( conf.getParameterSet("calib_parameters") ),
40  clustering_( conf.getParameterSet("C2d_parameters") ),
41  multiclustering_( conf.getParameterSet("C3d_parameters" ) )
42  {
43  clustering_threshold_silicon_ = conf.getParameterSet("C2d_parameters").getParameter<double>("clustering_threshold_silicon");
44  clustering_threshold_scintillator_ = conf.getParameterSet("C2d_parameters").getParameter<double>("clustering_threshold_scintillator");
45  std::string type(conf.getParameterSet("C2d_parameters").getParameter<std::string>("clusterType"));
46  if(type=="dRC2d"){
48  }else if(type=="NNC2d"){
50  }else {
51  edm::LogWarning("ParameterError") << "Unknown clustering type '" << type
52  << "'. Using nearest neighbor NNC2d instead.\n";
54  }
55 
56  }
type
Definition: HCALResponse.h:21
ClusterType clusteringAlgorithmType_
double clustering_threshold_silicon_
HGCalTriggerCellCalibration calibration_
std::unique_ptr< l1t::HGCalTriggerCellBxCollection > trgcell_product_
HGCalMulticlusteringImpl multiclustering_
HGCalClusteringImpl clustering_
std::unique_ptr< l1t::HGCalMulticlusterBxCollection > multicluster_product_
double clustering_threshold_scintillator_
std::unique_ptr< l1t::HGCalClusterBxCollection > cluster_product_

Member Function Documentation

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

Implements HGCalTriggerBackendAlgorithmBase.

Definition at line 68 of file HGCClusterAlgo.cc.

69  {
70 
71  }
template<typename FECODEC , typename DATA >
virtual void HGCClusterAlgo< FECODEC, DATA >::reset ( void  )
inlinefinaloverridevirtual

Implements HGCalTriggerBackendAlgorithmBase.

Definition at line 74 of file HGCClusterAlgo.cc.

75  {
79  }
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 
)
finaloverridevirtual

Implements HGCalTriggerBackendAlgorithmBase.

Definition at line 104 of file HGCClusterAlgo.cc.

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

107 {
108  es.get<CaloGeometryRecord>().get("", triggerGeometry_);
109 
110  for( const auto& digi : coll ){
111 
112  HGCalDetId module_id( digi.id() );
113 
114  DATA data;
115  data.reset();
116  digi.decode(codec_, data);
117 
118  for(const auto& triggercell : data.payload)
119  {
120 
121  if( triggercell.hwPt() > 0 )
122  {
123  l1t::HGCalTriggerCell calibratedtriggercell( triggercell );
124  calibration_.calibrateInGeV( calibratedtriggercell);
125  double clustering_threshold = (triggercell.subdetId()==HGCHEB ? clustering_threshold_scintillator_ : clustering_threshold_silicon_);
126  if(calibratedtriggercell.mipPt()<clustering_threshold) continue;
127  trgcell_product_->push_back( 0, calibratedtriggercell );
128  }
129 
130  }
131 
132  }
133 
134  /* orphan handles to the collections of trigger-cells, clusters and multiclusters */
138 
139  /* retrieve the orphan handle to the trigger-cells collection and put the collection in the event */
140  triggerCellsHandle = evt.put( std::move( trgcell_product_ ), "calibratedTriggerCells");
141 
142  /* create a persistent vector of pointers to the trigger-cells */
143  edm::PtrVector<l1t::HGCalTriggerCell> triggerCellsPtrs;
144  for( unsigned i = 0; i < triggerCellsHandle->size(); ++i ) {
145  edm::Ptr<l1t::HGCalTriggerCell> ptr(triggerCellsHandle,i);
146  triggerCellsPtrs.push_back(ptr);
147  }
148 
149  /* call to C2d clustering */
150  switch(clusteringAlgorithmType_){
151  case dRC2d :
152  clustering_.clusterizeDR( triggerCellsPtrs, *cluster_product_);
153  break;
154  case NNC2d:
156  break;
157  default:
158  // Should not happen, clustering type checked in constructor
159  break;
160  }
161 
162  /* retrieve the orphan handle to the clusters collection and put the collection in the event */
163  clustersHandle = evt.put( std::move( cluster_product_ ), "cluster2D");
164 
165  /* create a persistent vector of pointers to the trigger-cells */
167  for( unsigned i = 0; i < clustersHandle->size(); ++i ) {
168  edm::Ptr<l1t::HGCalCluster> ptr(clustersHandle,i);
169  clustersPtrs.push_back(ptr);
170  }
171 
172  /* call to multiclustering */
174 
175  /* retrieve the orphan handle to the multiclusters collection and put the collection in the event */
176  multiclustersHandle = evt.put( std::move( multicluster_product_ ), "cluster3D");
177 
178 }
ClusterType clusteringAlgorithmType_
double clustering_threshold_silicon_
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:127
HGCalTriggerCellCalibration calibration_
unsigned size(int bx) const
void push_back(Ptr< T > const &iPtr)
Definition: PtrVector.h:140
void clusterizeDR(const edm::PtrVector< l1t::HGCalTriggerCell > &triggerCellsPtrs, l1t::HGCalClusterBxCollection &clusters)
void clusterizeNN(const edm::PtrVector< l1t::HGCalTriggerCell > &triggerCellsPtrs, l1t::HGCalClusterBxCollection &clusters, const HGCalTriggerGeometryBase &triggerGeometry)
std::unique_ptr< l1t::HGCalTriggerCellBxCollection > trgcell_product_
HGCalMulticlusteringImpl multiclustering_
HGCalClusteringImpl clustering_
void clusterize(const edm::PtrVector< l1t::HGCalCluster > &clustersPtr, l1t::HGCalMulticlusterBxCollection &multiclusters)
const T & get() const
Definition: EventSetup.h:55
std::unique_ptr< l1t::HGCalMulticlusterBxCollection > multicluster_product_
double clustering_threshold_scintillator_
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
std::unique_ptr< l1t::HGCalClusterBxCollection > cluster_product_
void calibrateInGeV(l1t::HGCalTriggerCell &)
edm::ESHandle< HGCalTriggerGeometryBase > triggerGeometry_
def move(src, dest)
Definition: eostools.py:510
template<typename FECODEC , typename DATA >
virtual void HGCClusterAlgo< FECODEC, DATA >::setProduces ( edm::stream::EDProducer<> &  prod) const
inlinefinaloverridevirtual

Implements HGCalTriggerBackendAlgorithmBase.

Definition at line 58 of file HGCClusterAlgo.cc.

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

59  {
60  prod.produces<l1t::HGCalTriggerCellBxCollection>( "calibratedTriggerCells" );
61  prod.produces<l1t::HGCalClusterBxCollection>( "cluster2D" );
62  prod.produces<l1t::HGCalMulticlusterBxCollection>( "cluster3D" );
63  }

Member Data Documentation

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

Definition at line 92 of file HGCClusterAlgo.cc.

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

Definition at line 86 of file HGCClusterAlgo.cc.

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

Definition at line 93 of file HGCClusterAlgo.cc.

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

Definition at line 99 of file HGCClusterAlgo.cc.

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

Definition at line 98 of file HGCClusterAlgo.cc.

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

Definition at line 97 of file HGCClusterAlgo.cc.

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

Definition at line 87 of file HGCClusterAlgo.cc.

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

Definition at line 94 of file HGCClusterAlgo.cc.

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

Definition at line 85 of file HGCClusterAlgo.cc.

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

Definition at line 89 of file HGCClusterAlgo.cc.