ATLAS Offline Software
HIEventDefs.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef HIEVENTUTILS_HIEVENTDEFS_H
6 #define HIEVENTUTILS_HIEVENTDEFS_H
7 
8 #include <utility>
9 #include <cmath>
12 #include "CaloGeoHelpers/CaloSampling.h"
13 
14 namespace HI{
15 
16  enum BinningScheme{ TOWER = 100, COMPACT = 562 };
17 
18  namespace TowerBins{
19  constexpr unsigned int numEtaBins() {return 100;}
20  constexpr float etaMin() {return -5.;}
21  constexpr float etaMax() {return 5.;}
22  constexpr unsigned int numPhiBins() {return 64;}
23  constexpr unsigned int numLayers() {return 24;}
24  //these fail b/c Root doesn't know about constexpr
25  //constexpr float PhiMin() {return -TMath::Pi();}
26  //constexpr float PhiMax() {return TMath::Pi();}
27  //use cmath's M_PI
28  constexpr float PhiMin() {return -M_PI;}
29  constexpr float PhiMax() {return M_PI;}
30 
31  constexpr float getBinSizeEta() {return (etaMax()-etaMin())/((float)numEtaBins());}
32  constexpr float getBinSizePhi() {return (PhiMax()-PhiMin())/((float)numPhiBins());}
33 
34  constexpr float getBinArea() {return getBinSizeEta()*getBinSizePhi();}
35  constexpr float getTotalArea() {return (etaMax()-etaMin())*(PhiMax()-PhiMin());}
36  constexpr unsigned int getNumEtaPhiBins() {return numEtaBins()*numPhiBins();}
37 
38  inline float getBinLowEdgeEta(unsigned int eb) {return etaMin()+eb*getBinSizeEta();}
39  inline float getBinUpEdgeEta(unsigned int eb) {return etaMin()+(eb+1)*getBinSizeEta();}
40  inline float getBinCenterEta(unsigned int eb) {return etaMin()+(eb+0.5)*getBinSizeEta();}
41 
42  inline float getBinLowEdgePhi(unsigned int pb) {return PhiMin()+pb*getBinSizePhi();}
43  inline float getBinUpEdgePhi(unsigned int pb) {return PhiMin()+(pb+1)*getBinSizePhi();}
44  inline float getBinCenterPhi(unsigned int pb) {return PhiMin()+(pb+0.5)*getBinSizePhi();}
45 
46  inline unsigned int findBinEta(float eta) {return std::floor((eta-etaMin())/getBinSizeEta());}
47  inline unsigned int findBinPhi(float phi)
48  {
49  int pb=std::floor((phi-PhiMin()) /getBinSizePhi());
50  return pb % numPhiBins();
51  }
52  inline unsigned int findEtaPhiBin(float eta, float phi) { return numPhiBins()*findBinEta(eta)+findBinPhi(phi);}
53  }
54 
55  namespace SubCalo
56  {
57 
58  namespace Lists
59  {
66  constexpr std::initializer_list<int> FCal{CaloSampling::FCAL0, CaloSampling::FCAL1, CaloSampling::FCAL2};
67 
77  constexpr std::initializer_list<int> PreSampler{CaloSampling::PreSamplerB,CaloSampling::PreSamplerE};
78 
86 
87  }
88  }
89  //selectors
90  namespace Sel
91  {
104 
117 
130 
131  }
132 
133 
134 }
135 
136 #endif
HI::Sel::TileExt_N
constexpr ByLayersN TileExt_N
Definition: HIEventDefs.h:123
HI::TOWER
@ TOWER
Definition: HIEventDefs.h:16
HI::Sel::PreSampler_P
constexpr ByLayersP PreSampler_P
Definition: HIEventDefs.h:115
HI::SubCalo::Lists::TileExt
constexpr std::initializer_list< int > TileExt
Definition: HIEventDefs.h:65
HI::SubCalo::Lists::FCal
constexpr std::initializer_list< int > FCal
Definition: HIEventDefs.h:66
HI::Sel::FCal
constexpr ByLayers FCal
Definition: HIEventDefs.h:98
HI::TowerBins::etaMin
constexpr float etaMin()
Definition: HIEventDefs.h:20
HI::Sel::EMBarrel_P
constexpr ByLayersP EMBarrel_P
Definition: HIEventDefs.h:105
CaloCell_ID_FCS::TileExt2
@ TileExt2
Definition: FastCaloSim_CaloCell_ID.h:39
HI::Sel::EMCal_P
constexpr ByLayersP EMCal_P
Definition: HIEventDefs.h:112
constants.EMB1
int EMB1
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:53
keylayer_zslicemap.pb
pb
Definition: keylayer_zslicemap.py:188
HI::SubCalo::Lists::EMBarrel
constexpr std::initializer_list< int > EMBarrel
Definition: HIEventDefs.h:60
HI::TowerBins::getTotalArea
constexpr float getTotalArea()
Definition: HIEventDefs.h:35
HI::Sel::EMEC_N
constexpr ByLayersN EMEC_N
Definition: HIEventDefs.h:119
HI::Sel::TileBarrel_N
constexpr ByLayersN TileBarrel_N
Definition: HIEventDefs.h:121
CaloCell_ID_FCS::TileExt0
@ TileExt0
Definition: FastCaloSim_CaloCell_ID.h:37
HI::TowerBins::findBinEta
unsigned int findBinEta(float eta)
Definition: HIEventDefs.h:46
CaloCell_ID_FCS::TileBar1
@ TileBar1
Definition: FastCaloSim_CaloCell_ID.h:32
HI::Sel::EMBarrel
constexpr ByLayers EMBarrel
Definition: HIEventDefs.h:92
HI::TowerBins::findBinPhi
unsigned int findBinPhi(float phi)
Definition: HIEventDefs.h:47
HI::Sel::EMEC
constexpr ByLayers EMEC
Definition: HIEventDefs.h:93
M_PI
#define M_PI
Definition: ActiveFraction.h:11
CaloCell_ID_FCS::FCAL1
@ FCAL1
Definition: FastCaloSim_CaloCell_ID.h:41
HI::Sel::ALL_N
constexpr ByLayersN ALL_N
Definition: HIEventDefs.h:129
HI::TowerBins::getBinCenterPhi
float getBinCenterPhi(unsigned int pb)
Definition: HIEventDefs.h:44
HI::TowerBins::getNumEtaPhiBins
constexpr unsigned int getNumEtaPhiBins()
Definition: HIEventDefs.h:36
HI::Sel::FCal_N
constexpr ByLayersN FCal_N
Definition: HIEventDefs.h:124
HI::TowerBins::findEtaPhiBin
unsigned int findEtaPhiBin(float eta, float phi)
Definition: HIEventDefs.h:52
CaloCell_ID_FCS::HEC2
@ HEC2
Definition: FastCaloSim_CaloCell_ID.h:29
HI::SubCalo::Lists::HEC
constexpr std::initializer_list< int > HEC
Definition: HIEventDefs.h:62
HI::Sel::HCal_P
constexpr ByLayersP HCal_P
Definition: HIEventDefs.h:114
HI::Sel::TileGap_N
constexpr ByLayersN TileGap_N
Definition: HIEventDefs.h:122
HI::TowerBins::getBinLowEdgeEta
float getBinLowEdgeEta(unsigned int eb)
Definition: HIEventDefs.h:38
CaloCell_ID_FCS::TileGap3
@ TileGap3
Definition: FastCaloSim_CaloCell_ID.h:36
HI::Sel::ALL_P
constexpr ByLayersP ALL_P
Definition: HIEventDefs.h:116
HI::Sel::HCal
constexpr ByLayers HCal
Definition: HIEventDefs.h:101
HI::TowerBins::getBinArea
constexpr float getBinArea()
Definition: HIEventDefs.h:34
HIEventShapeSummaryUtils.h
HI::TowerBins::getBinUpEdgeEta
float getBinUpEdgeEta(unsigned int eb)
Definition: HIEventDefs.h:39
Tile
Definition: TileVolumeBuilder.h:43
HI::Sel::EMCal
constexpr ByLayers EMCal
Definition: HIEventDefs.h:99
CaloCell_ID_FCS::HEC1
@ HEC1
Definition: FastCaloSim_CaloCell_ID.h:28
constants.EMB2
int EMB2
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:54
CaloCell_ID_FCS::TileBar0
@ TileBar0
Definition: FastCaloSim_CaloCell_ID.h:31
HI::TowerBins::getBinCenterEta
float getBinCenterEta(unsigned int eb)
Definition: HIEventDefs.h:40
CaloCell_ID_FCS::TileGap2
@ TileGap2
Definition: FastCaloSim_CaloCell_ID.h:35
HI::TowerBins::PhiMin
constexpr float PhiMin()
Definition: HIEventDefs.h:28
HI::Sel::HEC
constexpr ByLayers HEC
Definition: HIEventDefs.h:94
HI::TowerBins::etaMax
constexpr float etaMax()
Definition: HIEventDefs.h:21
HIEventShape.h
HI::Sel::PreSampler
constexpr ByLayers PreSampler
Definition: HIEventDefs.h:102
HI::Sel::EMEC_P
constexpr ByLayersP EMEC_P
Definition: HIEventDefs.h:106
HI::COMPACT
@ COMPACT
Definition: HIEventDefs.h:16
constants.EME1
int EME1
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:55
HI::Sel::TileExt_P
constexpr ByLayersP TileExt_P
Definition: HIEventDefs.h:110
HI::Sel::TileGap
constexpr ByLayers TileGap
Definition: HIEventDefs.h:96
HI::Sel::TileBarrel
constexpr ByLayers TileBarrel
Definition: HIEventDefs.h:95
CaloCell_ID_FCS::TileGap1
@ TileGap1
Definition: FastCaloSim_CaloCell_ID.h:34
HI::Sel::HEC_P
constexpr ByLayersP HEC_P
Definition: HIEventDefs.h:107
HI::TowerBins::numEtaBins
constexpr unsigned int numEtaBins()
Definition: HIEventDefs.h:19
HI
Definition: HIEventDefs.h:14
CaloCell_ID_FCS::TileExt1
@ TileExt1
Definition: FastCaloSim_CaloCell_ID.h:38
HI::SubCalo::Lists::ALL
constexpr std::initializer_list< int > ALL
Definition: HIEventDefs.h:79
CaloCell_ID_FCS::EME3
@ EME3
Definition: FastCaloSim_CaloCell_ID.h:26
HI::Sel::TileExt
constexpr ByLayers TileExt
Definition: HIEventDefs.h:97
HI::TowerBins::getBinSizeEta
constexpr float getBinSizeEta()
Definition: HIEventDefs.h:31
HI::ByLayersN
Definition: HIEventShapeSummaryUtils.h:94
HI::TowerBins::numLayers
constexpr unsigned int numLayers()
Definition: HIEventDefs.h:23
HI::SubCalo::Lists::PreSampler
constexpr std::initializer_list< int > PreSampler
Definition: HIEventDefs.h:77
HI::Sel::HCal_N
constexpr ByLayersN HCal_N
Definition: HIEventDefs.h:127
CaloCell_ID_FCS::HEC0
@ HEC0
Definition: FastCaloSim_CaloCell_ID.h:27
HI::Sel::ALL
constexpr ByLayers ALL
Definition: HIEventDefs.h:103
HI::Sel::FCal_P
constexpr ByLayersP FCal_P
Definition: HIEventDefs.h:111
HI::SubCalo::Lists::TileBarrel
constexpr std::initializer_list< int > TileBarrel
Definition: HIEventDefs.h:63
HI::Sel::EMBarrel_N
constexpr ByLayersN EMBarrel_N
Definition: HIEventDefs.h:118
HI::SubCalo::Lists::EMCal
constexpr std::initializer_list< int > EMCal
Definition: HIEventDefs.h:68
CaloCell_ID_FCS::PreSamplerE
@ PreSamplerE
Definition: FastCaloSim_CaloCell_ID.h:23
CaloCell_ID_FCS::PreSamplerB
@ PreSamplerB
Definition: FastCaloSim_CaloCell_ID.h:19
HI::Sel::PreSampler_N
constexpr ByLayersN PreSampler_N
Definition: HIEventDefs.h:128
HI::ByLayers
Definition: HIEventShapeSummaryUtils.h:55
HI::BinningScheme
BinningScheme
Definition: HIEventDefs.h:16
HI::Sel::TileBarrel_P
constexpr ByLayersP TileBarrel_P
Definition: HIEventDefs.h:108
HI::TowerBins::getBinSizePhi
constexpr float getBinSizePhi()
Definition: HIEventDefs.h:32
CaloCell_ID_FCS::FCAL2
@ FCAL2
Definition: FastCaloSim_CaloCell_ID.h:42
HI::ByLayersP
Definition: HIEventShapeSummaryUtils.h:86
HI::Sel::HEC_N
constexpr ByLayersN HEC_N
Definition: HIEventDefs.h:120
HI::SubCalo::Lists::TileGap
constexpr std::initializer_list< int > TileGap
Definition: HIEventDefs.h:64
HI::Sel::TileGap_P
constexpr ByLayersP TileGap_P
Definition: HIEventDefs.h:109
HI::Sel::Tile_N
constexpr ByLayersN Tile_N
Definition: HIEventDefs.h:126
HI::SubCalo::Lists::HCal
constexpr std::initializer_list< int > HCal
Definition: HIEventDefs.h:73
CaloCell_ID_FCS::HEC3
@ HEC3
Definition: FastCaloSim_CaloCell_ID.h:30
CaloCell_ID_FCS::FCAL0
@ FCAL0
Definition: FastCaloSim_CaloCell_ID.h:40
HI::TowerBins::numPhiBins
constexpr unsigned int numPhiBins()
Definition: HIEventDefs.h:22
CaloCell_ID_FCS::EMB3
@ EMB3
Definition: FastCaloSim_CaloCell_ID.h:22
HI::TowerBins::getBinLowEdgePhi
float getBinLowEdgePhi(unsigned int pb)
Definition: HIEventDefs.h:42
CaloCell_ID_FCS::TileBar2
@ TileBar2
Definition: FastCaloSim_CaloCell_ID.h:33
HI::SubCalo::Lists::EMEC
constexpr std::initializer_list< int > EMEC
Definition: HIEventDefs.h:61
readCCLHist.float
float
Definition: readCCLHist.py:83
HI::Sel::Tile_P
constexpr ByLayersP Tile_P
Definition: HIEventDefs.h:113
HI::SubCalo::Lists::Tile
constexpr std::initializer_list< int > Tile
Definition: HIEventDefs.h:70
constants.EME2
int EME2
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:56
HI::TowerBins::getBinUpEdgePhi
float getBinUpEdgePhi(unsigned int pb)
Definition: HIEventDefs.h:43
HI::TowerBins::PhiMax
constexpr float PhiMax()
Definition: HIEventDefs.h:29
HI::Sel::EMCal_N
constexpr ByLayersN EMCal_N
Definition: HIEventDefs.h:125