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_
 
ClusterType clusteringAlgorithmType_
 
std::string HGCalEESensitive_
 
std::string HGCalHESiliconSensitive_
 
edm::ESHandle< HGCalTopologyhgceeTopoHandle_
 
edm::ESHandle< HGCalTopologyhgchefTopoHandle_
 
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 17 of file HGCClusterAlgo.cc.

Member Enumeration Documentation

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

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

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

33  :
34  Algorithm<FECODEC>(conf, cc),
38  HGCalEESensitive_( conf.getParameter<std::string>("HGCalEESensitive_tag") ),
39  HGCalHESiliconSensitive_( conf.getParameter<std::string>("HGCalHESiliconSensitive_tag") ),
40  calibration_( conf.getParameterSet("calib_parameters") ),
41  clustering_( conf.getParameterSet("C2d_parameters") ),
42  multiclustering_( conf.getParameterSet("C3d_parameters" ) )
43  {
44  std::string type(conf.getParameterSet("C2d_parameters").getParameter<std::string>("clusterType"));
45  if(type=="dRC2d"){
47  }else if(type=="NNC2d"){
49  }else {
50  edm::LogWarning("ParameterError") << "Unknown clustering type '" << type
51  << "'. Using nearest neighbor NNC2d instead.\n";
53  }
54 
55  }
type
Definition: HCALResponse.h:21
ClusterType clusteringAlgorithmType_
HGCalTriggerCellCalibration calibration_
std::string HGCalEESensitive_
std::unique_ptr< l1t::HGCalTriggerCellBxCollection > trgcell_product_
HGCalMulticlusteringImpl multiclustering_
HGCalClusteringImpl clustering_
std::string HGCalHESiliconSensitive_
std::unique_ptr< l1t::HGCalMulticlusterBxCollection > multicluster_product_
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 67 of file HGCClusterAlgo.cc.

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

Implements HGCalTriggerBackendAlgorithmBase.

Definition at line 73 of file HGCClusterAlgo.cc.

74  {
78  }
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 108 of file HGCClusterAlgo.cc.

References cscdqm::DATA, data, edm::EventSetup::get(), HGCEE, HGCHEB, HGCHEF, mps_fire::i, eostools::move(), edm::PtrVector< T >::push_back(), edm::Event::put(), BXVector< T >::size(), and DetId::subdetId().

111 {
112 
116 
117  for( const auto& digi : coll ){
118 
119  HGCalDetId module_id( digi.id() );
120 
121  DATA data;
122  data.reset();
123  digi.decode(codec_, data);
124 
125  for(const auto& triggercell : data.payload)
126  {
127 
128  if( triggercell.hwPt() > 0 )
129  {
130 
131  HGCalDetId detid(triggercell.detId());
132  int subdet = detid.subdetId();
133  int cellThickness = 0;
134 
135  if( subdet == HGCEE ){
136  cellThickness = hgceeTopoHandle_->dddConstants().waferTypeL( (unsigned int)detid.wafer() );
137  }
138  else if( subdet == HGCHEF ){
139  cellThickness = hgchefTopoHandle_->dddConstants().waferTypeL( (unsigned int)detid.wafer() );
140  }
141  else if( subdet == HGCHEB ){
142  edm::LogWarning("DataNotFound") << "ATTENTION: the BH trigger cells are not yet implemented";
143  }
144 
145  l1t::HGCalTriggerCell calibratedtriggercell( triggercell );
146  calibration_.calibrateInGeV( calibratedtriggercell, cellThickness );
147  trgcell_product_->push_back( 0, calibratedtriggercell );
148 
149  }
150 
151  }
152 
153  }
154 
155  /* orphan handles to the collections of trigger-cells, clusters and multiclusters */
159 
160  /* retrieve the orphan handle to the trigger-cells collection and put the collection in the event */
161  triggerCellsHandle = evt.put( std::move( trgcell_product_ ), "calibratedTriggerCells");
162 
163  /* create a persistent vector of pointers to the trigger-cells */
164  edm::PtrVector<l1t::HGCalTriggerCell> triggerCellsPtrs;
165  for( unsigned i = 0; i < triggerCellsHandle->size(); ++i ) {
166  edm::Ptr<l1t::HGCalTriggerCell> ptr(triggerCellsHandle,i);
167  triggerCellsPtrs.push_back(ptr);
168  }
169 
170  /* call to C2d clustering */
171  switch(clusteringAlgorithmType_){
172  case dRC2d :
173  clustering_.clusterizeDR( triggerCellsPtrs, *cluster_product_);
174  break;
175  case NNC2d:
177  break;
178  default:
179  // Should not happen, clustering type checked in constructor
180  break;
181  }
182 
183  /* retrieve the orphan handle to the clusters collection and put the collection in the event */
184  clustersHandle = evt.put( std::move( cluster_product_ ), "cluster2D");
185 
186  /* create a persistent vector of pointers to the trigger-cells */
188  for( unsigned i = 0; i < clustersHandle->size(); ++i ) {
189  edm::Ptr<l1t::HGCalCluster> ptr(clustersHandle,i);
190  clustersPtrs.push_back(ptr);
191  }
192 
193  /* call to multiclustering */
195 
196  /* retrieve the orphan handle to the multiclusters collection and put the collection in the event */
197  multiclustersHandle = evt.put( std::move( multicluster_product_ ), "cluster3D");
198 
199 }
ClusterType clusteringAlgorithmType_
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:122
HGCalTriggerCellCalibration calibration_
unsigned size(int bx) const
void push_back(Ptr< T > const &iPtr)
Definition: PtrVector.h:141
void clusterizeDR(const edm::PtrVector< l1t::HGCalTriggerCell > &triggerCellsPtrs, l1t::HGCalClusterBxCollection &clusters)
edm::ESHandle< HGCalTopology > hgchefTopoHandle_
std::string HGCalEESensitive_
void calibrateInGeV(l1t::HGCalTriggerCell &, int cellThickness)
void clusterizeNN(const edm::PtrVector< l1t::HGCalTriggerCell > &triggerCellsPtrs, l1t::HGCalClusterBxCollection &clusters, const HGCalTriggerGeometryBase &triggerGeometry)
std::unique_ptr< l1t::HGCalTriggerCellBxCollection > trgcell_product_
int waferTypeL(int wafer) const
HGCalMulticlusteringImpl multiclustering_
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
HGCalClusteringImpl clustering_
std::string HGCalHESiliconSensitive_
const HGCalDDDConstants & dddConstants() const
void clusterize(const edm::PtrVector< l1t::HGCalCluster > &clustersPtr, l1t::HGCalMulticlusterBxCollection &multiclusters)
const T & get() const
Definition: EventSetup.h:56
std::unique_ptr< l1t::HGCalMulticlusterBxCollection > multicluster_product_
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
std::unique_ptr< l1t::HGCalClusterBxCollection > cluster_product_
edm::ESHandle< HGCalTopology > hgceeTopoHandle_
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 57 of file HGCClusterAlgo.cc.

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

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

Member Data Documentation

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

Definition at line 98 of file HGCClusterAlgo.cc.

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

Definition at line 85 of file HGCClusterAlgo.cc.

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

Definition at line 99 of file HGCClusterAlgo.cc.

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

Definition at line 103 of file HGCClusterAlgo.cc.

template<typename FECODEC , typename DATA >
std::string HGCClusterAlgo< FECODEC, DATA >::HGCalEESensitive_
private

Definition at line 89 of file HGCClusterAlgo.cc.

template<typename FECODEC , typename DATA >
std::string HGCClusterAlgo< FECODEC, DATA >::HGCalHESiliconSensitive_
private

Definition at line 90 of file HGCClusterAlgo.cc.

template<typename FECODEC , typename DATA >
edm::ESHandle<HGCalTopology> HGCClusterAlgo< FECODEC, DATA >::hgceeTopoHandle_
private

Definition at line 93 of file HGCClusterAlgo.cc.

template<typename FECODEC , typename DATA >
edm::ESHandle<HGCalTopology> HGCClusterAlgo< FECODEC, DATA >::hgchefTopoHandle_
private

Definition at line 94 of file HGCClusterAlgo.cc.

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

Definition at line 86 of file HGCClusterAlgo.cc.

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

Definition at line 100 of file HGCClusterAlgo.cc.

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

Definition at line 84 of file HGCClusterAlgo.cc.

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

Definition at line 95 of file HGCClusterAlgo.cc.