CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 
14 
17 
18 class HGCalGeometry;
19 class HGCalDDDConstants;
20 class DetId;
21 
22 namespace edm {
23  class Event;
24  class EventSetup;
25 } // namespace edm
26 
27 namespace hgcal {
28  class ClusterTools {
29  public:
30  ClusterTools();
33 
34  void getEvent(const edm::Event &);
35  void getEventSetup(const edm::EventSetup &);
36 
37  float getClusterHadronFraction(const reco::CaloCluster &) const;
38 
40 
41  int getLayer(const DetId) const;
42 
43  double getMultiClusterEnergy(const reco::HGCalMultiCluster &) const;
44 
45  // only for EE
46  bool getWidths(const reco::CaloCluster &clus,
47  double &sigmaetaeta,
48  double &sigmaphiphi,
49  double &sigmaetaetalog,
50  double &sigmaphiphilog) const;
51 
52  private:
53  std::vector<size_t> sort_by_z(const reco::HGCalMultiCluster &v) const {
54  std::vector<size_t> idx(v.size());
55  std::iota(std::begin(idx), std::end(idx), 0);
56  sort(
57  idx.begin(), idx.end(), [&v](size_t i1, size_t i2) { return v.clusters()[i1]->z() < v.clusters()[i2]->z(); });
58  return idx;
59  }
60 
64 
66  };
67 } // namespace hgcal
68 
69 #endif
std::vector< size_t > sort_by_z(const reco::HGCalMultiCluster &v) const
Definition: ClusterTools.h:53
void getEvent(const edm::Event &)
Definition: ClusterTools.cc:27
math::XYZPoint getMultiClusterPosition(const reco::HGCalMultiCluster &) const
Definition: ClusterTools.cc:79
unsigned int size() const
const edm::ESGetToken< CaloGeometry, CaloGeometryRecord > caloGeometryToken_
Definition: ClusterTools.h:63
RecHitTools rhtools_
Definition: ClusterTools.h:61
const edm::PtrVector< reco::BasicCluster > & clusters() const
int getLayer(const DetId) const
const HGCRecHitCollection * eerh_
Definition: ClusterTools.h:65
Definition: DetId.h:17
double getMultiClusterEnergy(const reco::HGCalMultiCluster &) const
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
float getClusterHadronFraction(const reco::CaloCluster &) const
Definition: ClusterTools.cc:35
const edm::EDGetTokenT< HGCRecHitCollection > fhtok
Definition: ClusterTools.h:62
const edm::EDGetTokenT< HGCRecHitCollection > eetok
Definition: ClusterTools.h:62
const HGCRecHitCollection * bhrh_
Definition: ClusterTools.h:65
string end
Definition: dataset.py:937
const edm::EDGetTokenT< HGCRecHitCollection > bhtok
Definition: ClusterTools.h:62
bool getWidths(const reco::CaloCluster &clus, double &sigmaetaeta, double &sigmaphiphi, double &sigmaetaetalog, double &sigmaphiphilog) const
const HGCRecHitCollection * fhrh_
Definition: ClusterTools.h:65
void getEventSetup(const edm::EventSetup &)
Definition: ClusterTools.cc:33