Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:25:52

0001 #ifndef RecoLocalCalo_HGCalRecAlgos_HGCalDepthPreClusterer
0002 #define RecoLocalCalo_HGCalRecAlgos_HGCalDepthPreClusterer
0003 
0004 #include "DataFormats/Math/interface/Point3D.h"
0005 #include "DataFormats/EgammaReco/interface/BasicCluster.h"
0006 #include "DataFormats/ParticleFlowReco/interface/HGCalMultiCluster.h"
0007 
0008 #include <list>
0009 
0010 #include "RecoLocalCalo/HGCalRecAlgos/interface/RecHitTools.h"
0011 #include "RecoLocalCalo/HGCalRecAlgos/interface/ClusterTools.h"
0012 
0013 class HGCalDepthPreClusterer {
0014 public:
0015   HGCalDepthPreClusterer()
0016       : radii({
0017             0.,
0018             0.,
0019             0.,
0020         }),
0021         minClusters(0),
0022         realSpaceCone(false),
0023         clusterTools(nullptr) {}
0024 
0025   HGCalDepthPreClusterer(const edm::ParameterSet& conf,
0026                          edm::ConsumesCollector& sumes,
0027                          std::vector<float> radii_in,
0028                          uint32_t min_clusters,
0029                          bool real_space_cone)
0030       : radii(radii_in),
0031         minClusters(min_clusters),
0032         realSpaceCone(real_space_cone),
0033         clusterTools(std::make_unique<hgcal::ClusterTools>(conf, sumes)),
0034         caloGeomToken_(sumes.esConsumes<CaloGeometry, CaloGeometryRecord>()) {}
0035 
0036   void getEvent(const edm::Event& ev) { clusterTools->getEvent(ev); }
0037   void getEventSetup(const edm::EventSetup& es) {
0038     clusterTools->getEventSetup(es);
0039     edm::ESHandle<CaloGeometry> geom = es.getHandle(caloGeomToken_);
0040     rhtools_.setGeometry(*geom);
0041   }
0042 
0043   typedef std::vector<reco::BasicCluster> ClusterCollection;
0044   //  typedef std::vector<reco::BasicCluster> MultiCluster;
0045 
0046   std::vector<reco::HGCalMultiCluster> makePreClusters(const reco::HGCalMultiCluster::ClusterCollection&) const;
0047 
0048 private:
0049   std::vector<float> radii;
0050   uint32_t minClusters;
0051   bool realSpaceCone; /*!< flag to use cartesian space clustering. */
0052 
0053   std::unique_ptr<hgcal::ClusterTools> clusterTools;
0054   hgcal::RecHitTools rhtools_; /*!< instance of tools to access RecHit information. */
0055   edm::ESGetToken<CaloGeometry, CaloGeometryRecord> caloGeomToken_;
0056 };
0057 
0058 #endif