Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-10-08 22:26:30

0001 #ifndef __L1Trigger_L1THGCal_HGCalHistoClusteringImpl_h__
0002 #define __L1Trigger_L1THGCal_HGCalHistoClusteringImpl_h__
0003 
0004 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0005 #include "DataFormats/L1THGCal/interface/HGCalCluster.h"
0006 #include "DataFormats/L1THGCal/interface/HGCalMulticluster.h"
0007 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0008 
0009 #include "L1Trigger/L1THGCal/interface/HGCalTriggerGeometryBase.h"
0010 #include "L1Trigger/L1THGCal/interface/backend/HGCalShowerShape.h"
0011 #include "L1Trigger/L1THGCal/interface/HGCalTriggerTools.h"
0012 #include "L1Trigger/L1THGCal/interface/backend/HGCalTriggerClusterIdentificationBase.h"
0013 
0014 class HGCalHistoClusteringImpl {
0015 public:
0016   HGCalHistoClusteringImpl(const edm::ParameterSet& conf);
0017 
0018   void setGeometry(const HGCalTriggerGeometryBase* const geom) {
0019     triggerTools_.setGeometry(geom);
0020     shape_.setGeometry(geom);
0021     if ((!dr_byLayer_coefficientA_.empty() && (dr_byLayer_coefficientA_.size() - 1) < triggerTools_.lastLayerBH()) ||
0022         (!dr_byLayer_coefficientB_.empty() && (dr_byLayer_coefficientB_.size() - 1) < triggerTools_.lastLayerBH())) {
0023       throw cms::Exception("Configuration")
0024           << "The per-layer dR values go up to " << (dr_byLayer_coefficientA_.size() - 1) << "(A) and "
0025           << (dr_byLayer_coefficientB_.size() - 1) << "(B), while layers go up to " << triggerTools_.lastLayerBH()
0026           << "\n";
0027     }
0028   }
0029 
0030   float dR(const l1t::HGCalCluster& clu, const GlobalPoint& seed) const;
0031 
0032   void clusterizeHisto(const std::vector<edm::Ptr<l1t::HGCalCluster>>& clustersPtr,
0033                        const std::vector<std::pair<GlobalPoint, double>>& seedPositionsEnergy,
0034                        const HGCalTriggerGeometryBase& triggerGeometry,
0035                        l1t::HGCalMulticlusterBxCollection& multiclusters,
0036                        l1t::HGCalClusterBxCollection& rejected_clusters) const;
0037 
0038 private:
0039   enum ClusterAssociationStrategy { NearestNeighbour, EnergySplit };
0040 
0041   std::vector<l1t::HGCalMulticluster> clusterSeedMulticluster(
0042       const std::vector<edm::Ptr<l1t::HGCalCluster>>& clustersPtrs,
0043       const std::vector<std::pair<GlobalPoint, double>>& seeds,
0044       std::vector<l1t::HGCalCluster>& rejected_clusters) const;
0045 
0046   void finalizeClusters(std::vector<l1t::HGCalMulticluster>&,
0047                         const std::vector<l1t::HGCalCluster>&,
0048                         l1t::HGCalMulticlusterBxCollection&,
0049                         l1t::HGCalClusterBxCollection&,
0050                         const HGCalTriggerGeometryBase&) const;
0051 
0052   double dr_;
0053   std::vector<double> dr_byLayer_coefficientA_;
0054   std::vector<double> dr_byLayer_coefficientB_;
0055   double ptC3dThreshold_;
0056 
0057   std::string cluster_association_input_;
0058   ClusterAssociationStrategy cluster_association_strategy_;
0059 
0060   HGCalShowerShape shape_;
0061   HGCalTriggerTools triggerTools_;
0062   std::unique_ptr<HGCalTriggerClusterIdentificationBase> id_;
0063 
0064   static constexpr double kMidRadius_ = 2.3;
0065 };
0066 
0067 #endif