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 
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
hgcal::ClusterTools::bhtok
const edm::EDGetTokenT< HGCRecHitCollection > bhtok
Definition: ClusterTools.h:62
testProducerWithPsetDescEmpty_cfi.i2
i2
Definition: testProducerWithPsetDescEmpty_cfi.py:46
hgcal::RecHitTools
Definition: RecHitTools.h:23
hgcal::ClusterTools::caloGeometryToken_
const edm::ESGetToken< CaloGeometry, CaloGeometryRecord > caloGeometryToken_
Definition: ClusterTools.h:63
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:65
HGCalMultiCluster.h
hgcal::ClusterTools::bhrh_
const HGCRecHitCollection * bhrh_
Definition: ClusterTools.h:65
edm::SortedCollection
Definition: SortedCollection.h:49
hgcal::ClusterTools::eetok
const edm::EDGetTokenT< HGCRecHitCollection > eetok
Definition: ClusterTools.h:62
findQualityFiles.v
v
Definition: findQualityFiles.py:179
hgcal::ClusterTools::rhtools_
RecHitTools rhtools_
Definition: ClusterTools.h:61
hgcal
Definition: EgammaPCAHelper.h:31
HGCalDDDConstants
Definition: HGCalDDDConstants.h:26
heavyIonCSV_trainingSettings.idx
idx
Definition: heavyIonCSV_trainingSettings.py:5
hgcal::ClusterTools::getMultiClusterEnergy
double getMultiClusterEnergy(const reco::HGCalMultiCluster &) const
Definition: ClusterTools.cc:110
DetId
Definition: DetId.h:17
hgcal::ClusterTools::getClusterHadronFraction
float getClusterHadronFraction(const reco::CaloCluster &) const
Definition: ClusterTools.cc:35
reco::CaloCluster
Definition: CaloCluster.h:31
mps_fire.end
end
Definition: mps_fire.py:242
Event
hgcal::ClusterTools::getLayer
int getLayer(const DetId) const
Definition: ClusterTools.cc:108
HGCalGeometry
Definition: HGCalGeometry.h:29
CaloGeometryRecord.h
HGCRecHitCollections.h
hgcal::ClusterTools::getWidths
bool getWidths(const reco::CaloCluster &clus, double &sigmaetaeta, double &sigmaphiphi, double &sigmaetaetalog, double &sigmaphiphilog) const
Definition: ClusterTools.cc:118
edm::ParameterSet
Definition: ParameterSet.h:47
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:27
edm::EventSetup
Definition: EventSetup.h:57
edm::ESGetToken< CaloGeometry, CaloGeometryRecord >
hgcal::ClusterTools::eerh_
const HGCRecHitCollection * eerh_
Definition: ClusterTools.h:65
reco::HGCalMultiCluster
Definition: HGCalMultiCluster.h:12
hgcal::ClusterTools
Definition: ClusterTools.h:28
hgcal::ClusterTools::~ClusterTools
~ClusterTools()
Definition: ClusterTools.h:32
CaloGeometry.h
hgcal::ClusterTools::sort_by_z
std::vector< size_t > sort_by_z(const reco::HGCalMultiCluster &v) const
Definition: ClusterTools.h:53
hgcal::ClusterTools::getMultiClusterPosition
math::XYZPoint getMultiClusterPosition(const reco::HGCalMultiCluster &) const
Definition: ClusterTools.cc:79
ConsumesCollector.h
EventSetup
ParameterSet.h
hgcal::ClusterTools::getEventSetup
void getEventSetup(const edm::EventSetup &)
Definition: ClusterTools.cc:33
edm::Event
Definition: Event.h:73
hgcal::ClusterTools::ClusterTools
ClusterTools()
Definition: ClusterTools.cc:19
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
RecHitTools.h
hgcal::ClusterTools::fhtok
const edm::EDGetTokenT< HGCRecHitCollection > fhtok
Definition: ClusterTools.h:62
CaloCluster.h