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