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 
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 
62  };
63 } // namespace hgcal
64 
65 #endif
hgcal::ClusterTools::bhtok
const edm::EDGetTokenT< HGCRecHitCollection > bhtok
Definition: ClusterTools.h:60
testProducerWithPsetDescEmpty_cfi.i2
i2
Definition: testProducerWithPsetDescEmpty_cfi.py:46
hgcal::RecHitTools
Definition: RecHitTools.h:23
edm::EDGetTokenT
Definition: EDGetToken.h:33
edm
HLT enums.
Definition: AlignableModifier.h:19
testProducerWithPsetDescEmpty_cfi.i1
i1
Definition: testProducerWithPsetDescEmpty_cfi.py:45
hgcal::ClusterTools::fhrh_
const HGCRecHitCollection * fhrh_
Definition: ClusterTools.h:61
HGCalMultiCluster.h
hgcal::ClusterTools::bhrh_
const HGCRecHitCollection * bhrh_
Definition: ClusterTools.h:61
edm::SortedCollection
Definition: SortedCollection.h:49
charmTagsComputerCvsB_cfi.idx
idx
Definition: charmTagsComputerCvsB_cfi.py:108
hgcal::ClusterTools::eetok
const edm::EDGetTokenT< HGCRecHitCollection > eetok
Definition: ClusterTools.h:60
findQualityFiles.v
v
Definition: findQualityFiles.py:179
hgcal::ClusterTools::rhtools_
RecHitTools rhtools_
Definition: ClusterTools.h:59
end
#define end
Definition: vmac.h:39
hgcal
Definition: EgammaPCAHelper.h:31
HGCalDDDConstants
Definition: HGCalDDDConstants.h:25
hgcal::ClusterTools::getMultiClusterEnergy
double getMultiClusterEnergy(const reco::HGCalMultiCluster &) const
Definition: ClusterTools.cc:119
DetId
Definition: DetId.h:17
hgcal::ClusterTools::getClusterHadronFraction
float getClusterHadronFraction(const reco::CaloCluster &) const
Definition: ClusterTools.cc:44
reco::CaloCluster
Definition: CaloCluster.h:31
Event
hgcal::ClusterTools::getLayer
int getLayer(const DetId) const
Definition: ClusterTools.cc:117
HGCalGeometry
Definition: HGCalGeometry.h:30
HGCRecHitCollections.h
hgcal::ClusterTools::getWidths
bool getWidths(const reco::CaloCluster &clus, double &sigmaetaeta, double &sigmaphiphi, double &sigmaetaetalog, double &sigmaphiphilog) const
Definition: ClusterTools.cc:127
edm::ParameterSet
Definition: ParameterSet.h:36
math::XYZPoint
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
hgcal::ClusterTools::getEvent
void getEvent(const edm::Event &)
Definition: ClusterTools.cc:28
edm::EventSetup
Definition: EventSetup.h:57
hgcal::ClusterTools::eerh_
const HGCRecHitCollection * eerh_
Definition: ClusterTools.h:61
reco::HGCalMultiCluster
Definition: HGCalMultiCluster.h:12
hgcal::ClusterTools
Definition: ClusterTools.h:26
hgcal::ClusterTools::~ClusterTools
~ClusterTools()
Definition: ClusterTools.h:30
hgcal::ClusterTools::sort_by_z
std::vector< size_t > sort_by_z(const reco::HGCalMultiCluster &v) const
Definition: ClusterTools.h:51
hgcal::ClusterTools::getMultiClusterPosition
math::XYZPoint getMultiClusterPosition(const reco::HGCalMultiCluster &) const
Definition: ClusterTools.cc:88
ConsumesCollector.h
EventSetup
ParameterSet.h
hgcal::ClusterTools::getEventSetup
void getEventSetup(const edm::EventSetup &)
Definition: ClusterTools.cc:38
edm::Event
Definition: Event.h:73
hgcal::ClusterTools::ClusterTools
ClusterTools()
Definition: ClusterTools.cc:21
begin
#define begin
Definition: vmac.h:32
edm::ConsumesCollector
Definition: ConsumesCollector.h:39
RecHitTools.h
hgcal::ClusterTools::fhtok
const edm::EDGetTokenT< HGCRecHitCollection > fhtok
Definition: ClusterTools.h:60
CaloCluster.h