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 
12 
15 
16 class HGCalGeometry;
17 class HGCalDDDConstants;
18 class DetId;
19 
20 namespace edm {
21  class Event;
22  class EventSetup;
23 } // namespace edm
24 
25 namespace hgcal {
26  class ClusterTools {
27  public:
28  ClusterTools();
31 
32  void getEvent(const edm::Event &);
33  void getEventSetup(const edm::EventSetup &);
34 
35  float getClusterHadronFraction(const reco::CaloCluster &) const;
36 
37  math::XYZPoint getMultiClusterPosition(const reco::HGCalMultiCluster &) const;
38 
39  int getLayer(const DetId) const;
40 
41  double getMultiClusterEnergy(const reco::HGCalMultiCluster &) const;
42 
43  // only for EE
44  bool getWidths(const reco::CaloCluster &clus,
45  double &sigmaetaeta,
46  double &sigmaphiphi,
47  double &sigmaetaetalog,
48  double &sigmaphiphilog) const;
49 
50  private:
51  std::vector<size_t> sort_by_z(const reco::HGCalMultiCluster &v) const {
52  std::vector<size_t> idx(v.size());
53  std::iota(std::begin(idx), std::end(idx), 0);
54  sort(
55  idx.begin(), idx.end(), [&v](size_t i1, size_t i2) { return v.clusters()[i1]->z() < v.clusters()[i2]->z(); });
56  return idx;
57  }
58 
61  const HGCRecHitCollection *eerh_, *fhrh_, *bhrh_;
62  };
63 } // namespace hgcal
64 
65 #endif
std::vector< size_t > sort_by_z(const reco::HGCalMultiCluster &v) const
Definition: ClusterTools.h:51
unsigned int size() const
RecHitTools rhtools_
Definition: ClusterTools.h:59
const edm::PtrVector< reco::BasicCluster > & clusters() const
#define end
Definition: vmac.h:39
Definition: DetId.h:17
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
const edm::EDGetTokenT< HGCRecHitCollection > fhtok
Definition: ClusterTools.h:60
#define begin
Definition: vmac.h:32
HLT enums.
const HGCRecHitCollection * fhrh_
Definition: ClusterTools.h:61