17 template<
typename FECODEC,
typename DATA>
47 triggercell_threshold_silicon_( conf.getParameter<double>(
"triggercell_threshold_silicon") ),
48 triggercell_threshold_scintillator_( conf.getParameter<double>(
"triggercell_threshold_scintillator") )
51 if(typeCluster==
"dRC2d"){
52 clusteringAlgorithmType_ = dRC2d;
53 }
else if(typeCluster==
"NNC2d"){
54 clusteringAlgorithmType_ = NNC2d;
55 }
else if(typeCluster==
"dRNNC2d"){
56 clusteringAlgorithmType_ = dRNNC2d;
59 <<
"Unknown clustering type '" << typeCluster;
62 if(typeMulticluster==
"dRC3d"){
63 multiclusteringAlgoType_ = dRC3d;
64 }
else if(typeMulticluster==
"DBSCANC3d"){
65 multiclusteringAlgoType_ = DBSCANC3d;
68 <<
"Unknown Multiclustering type '" << typeMulticluster;
89 virtual void reset() override final
119 template<
typename FECODEC,
typename DATA>
125 calibration_.eventSetup(es);
126 clustering_.eventSetup(es);
127 multiclustering_.eventSetup(es);
129 for(
const auto& digi : coll ){
135 digi.decode(codec_, data);
137 for(
const auto& triggercell : data.payload)
140 if( triggercell.hwPt() > 0 )
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 );
159 triggerCellsHandle = evt.
put(
std::move( trgcell_product_ ),
"calibratedTriggerCells");
162 std::vector<edm::Ptr<l1t::HGCalTriggerCell>> triggerCellsPtrs;
163 for(
unsigned i = 0;
i < triggerCellsHandle->
size(); ++
i ) {
165 triggerCellsPtrs.push_back(ptr);
169 switch(clusteringAlgorithmType_){
171 clustering_.clusterizeDR( triggerCellsPtrs, *cluster_product_);
174 clustering_.clusterizeNN( triggerCellsPtrs, *cluster_product_, *triggerGeometry_ );
177 clustering_.clusterizeDRNN( triggerCellsPtrs, *cluster_product_, *triggerGeometry_ );
185 clustersHandle = evt.
put(
std::move( cluster_product_ ),
"cluster2D");
188 std::vector<edm::Ptr<l1t::HGCalCluster>> clustersPtrs;
189 for(
unsigned i = 0;
i < clustersHandle->
size(); ++
i ) {
191 clustersPtrs.push_back(ptr);
195 switch(multiclusteringAlgoType_){
197 multiclustering_.clusterizeDR( clustersPtrs, *multicluster_product_, *triggerGeometry_);
200 multiclustering_.clusterizeDBSCAN( clustersPtrs, *multicluster_product_, *triggerGeometry_);
208 multiclustersHandle = evt.
put(
std::move( multicluster_product_ ),
"cluster3D");
220 "HGCClusterAlgoBestChoice");
224 "HGCClusterAlgoThreshold");
T getParameter(std::string const &) const
ClusterType clusteringAlgorithmType_
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
HGCalTriggerCellCalibration calibration_
unsigned size(int bx) const
BXVector< HGCalTriggerCell > HGCalTriggerCellBxCollection
virtual void setProduces(edm::stream::EDProducer<> &prod) const override final
virtual void putInEvent(edm::Event &evt) override final
ParameterSet const & getParameterSet(ParameterSetID const &id)
HGCClusterAlgo< HGCalTriggerCellThresholdCodec, HGCalTriggerCellThresholdCodec::data_type > HGCClusterAlgoThreshold
HGCClusterAlgo(const edm::ParameterSet &conf, edm::ConsumesCollector &cc)
std::unique_ptr< l1t::HGCalTriggerCellBxCollection > trgcell_product_
virtual void run(const l1t::HGCFETriggerDigiCollection &coll, const edm::EventSetup &es, edm::Event &evt) override final
HGCClusterAlgo< HGCalTriggerCellBestChoiceCodec, HGCalTriggerCellBestChoiceCodec::data_type > HGCClusterAlgoBestChoice
BXVector< HGCalMulticluster > HGCalMulticlusterBxCollection
HGCalMulticlusteringImpl multiclustering_
HGCalClusteringImpl clustering_
MulticlusterType multiclusteringAlgoType_
ParameterSet const & getParameterSet(std::string const &) const
virtual void reset() override final
double triggercell_threshold_scintillator_
std::unique_ptr< l1t::HGCalMulticlusterBxCollection > multicluster_product_
BXVector< HGCalCluster > HGCalClusterBxCollection
char data[epos_bytes_allocation]
#define DEFINE_EDM_PLUGIN(factory, type, name)
std::unique_ptr< l1t::HGCalClusterBxCollection > cluster_product_
edm::ESHandle< HGCalTriggerGeometryBase > triggerGeometry_
double triggercell_threshold_silicon_