CMS 3D CMS Logo

ClusterTools.h
Go to the documentation of this file.
1 #ifndef __RecoLocalCalo_HGCalRecAlgos_ClusterTools_h__
2 #define __RecoLocalCalo_HGCalRecAlgos_ClusterTools_h__
3 
4 #include <array>
5 #include <cmath>
6 #include <numeric>
7 
13 
16 
19 
20 class HGCalGeometry;
21 class HGCalDDDConstants;
22 class DetId;
23 
24 namespace edm {
25  class Event;
26  class EventSetup;
27 } // namespace edm
28 
29 namespace hgcal {
30  class ClusterTools {
31  public:
32  ClusterTools();
35 
36  void getEvent(const edm::Event &);
37  void getEventSetup(const edm::EventSetup &);
38 
39  float getClusterHadronFraction(const reco::CaloCluster &) const;
40 
42 
43  int getLayer(const DetId) const;
44 
45  double getMultiClusterEnergy(const reco::HGCalMultiCluster &) const;
46 
47  // only for EE
48  bool getWidths(const reco::CaloCluster &clus,
49  double &sigmaetaeta,
50  double &sigmaphiphi,
51  double &sigmaetaetalog,
52  double &sigmaphiphilog) const;
53 
54  private:
55  std::vector<size_t> sort_by_z(const reco::HGCalMultiCluster &v) const {
56  std::vector<size_t> idx(v.size());
57  std::iota(std::begin(idx), std::end(idx), 0);
58  sort(
59  idx.begin(), idx.end(), [&v](size_t i1, size_t i2) { return v.clusters()[i1]->z() < v.clusters()[i2]->z(); });
60  return idx;
61  }
62 
67 
69  const std::unordered_map<DetId, const unsigned int> *hitMap_;
70  std::unique_ptr<MultiVectorManager<HGCRecHit>> rechitManager_;
71  };
72 } // namespace hgcal
73 
74 #endif
void getEvent(const edm::Event &)
Definition: ClusterTools.cc:29
double getMultiClusterEnergy(const reco::HGCalMultiCluster &) const
std::vector< HGCRecHit > HGCRecHitCollection
int getLayer(const DetId) const
Definition: ClusterTools.cc:98
const edm::ESGetToken< CaloGeometry, CaloGeometryRecord > caloGeometryToken_
Definition: ClusterTools.h:66
float getClusterHadronFraction(const reco::CaloCluster &) const
Definition: ClusterTools.cc:42
RecHitTools rhtools_
Definition: ClusterTools.h:63
const edm::EDGetTokenT< std::unordered_map< DetId, const unsigned int > > hitMapToken_
Definition: ClusterTools.h:65
const HGCRecHitCollection * eerh_
Definition: ClusterTools.h:68
math::XYZPoint getMultiClusterPosition(const reco::HGCalMultiCluster &) const
Definition: ClusterTools.cc:69
Definition: DetId.h:17
bool getWidths(const reco::CaloCluster &clus, double &sigmaetaeta, double &sigmaphiphi, double &sigmaetaetalog, double &sigmaphiphilog) const
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
const std::unordered_map< DetId, const unsigned int > * hitMap_
Definition: ClusterTools.h:69
const edm::EDGetTokenT< HGCRecHitCollection > fhtok
Definition: ClusterTools.h:64
const edm::EDGetTokenT< HGCRecHitCollection > eetok
Definition: ClusterTools.h:64
const HGCRecHitCollection * bhrh_
Definition: ClusterTools.h:68
HLT enums.
const edm::EDGetTokenT< HGCRecHitCollection > bhtok
Definition: ClusterTools.h:64
const HGCRecHitCollection * fhrh_
Definition: ClusterTools.h:68
std::unique_ptr< MultiVectorManager< HGCRecHit > > rechitManager_
Definition: ClusterTools.h:70
std::vector< size_t > sort_by_z(const reco::HGCalMultiCluster &v) const
Definition: ClusterTools.h:55
void getEventSetup(const edm::EventSetup &)
Definition: ClusterTools.cc:40