ATLAS Offline Software
Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/CaloGeoHelpers/CaloSampling.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 //Dear emacs, this is -*-c++-*-
6 
7 #ifndef CALOGEOHELPERS_CALOSAMPLING_H
8 #define CALOGEOHELPERS_CALOSAMPLING_H
9 
14 #include <string>
15 
16 
17 class CaloSampling {
18 public:
19  // The following enum lists the various calorimeter sampling layers.
20  // Calorimeter. Use this for type safety when calling methods here.
21  //
22  enum CaloSample {
23 #define CALOSAMPLING(NAME, ISBARREL, ISENDCAP) NAME,
24 #include "CaloGeoHelpers/CaloSampling.def"
25 #undef CALOSAMPLING
26  };
27 
28 
30  static unsigned int getNumberOfSamplings();
31 
33  static unsigned int getSamplingPattern(const CaloSample s) {
34  return (0x1U << s);
35  }
36 
38  static
39 #if __cplusplus >= 201100
40  constexpr
41 #endif // C++11
42  unsigned int barrelPattern();
43 
45  static
46 #if __cplusplus >= 201100
47  constexpr
48 #endif // C++11
49  unsigned int endcapPattern();
50 
55  static std::string getSamplingName (CaloSample theSample);
56 
57 
62  static std::string getSamplingName (unsigned int theSample);
63 };
64 
65 
66 #if __cplusplus >= 201100
67 constexpr
68 #else
69 inline
70 #endif // C++11
71 unsigned int CaloSampling::barrelPattern() {
72  return (//EM Barrel
73 #define CALOSAMPLING(NAME, ISBARREL, ISENDCAP) (((unsigned)ISBARREL)<<NAME) |
74 #include "CaloGeoHelpers/CaloSampling.def"
76  0 );
77 }
78 
79 #if __cplusplus >= 201100
80 constexpr
81 #else
82 inline
83 #endif // C++11
84 unsigned int CaloSampling::endcapPattern() {
85  return (//EMEC:
86 #define CALOSAMPLING(NAME, ISBARREL, ISENDCAP) (((unsigned)ISENDCAP)<<NAME) |
87 #include "CaloGeoHelpers/CaloSampling.def"
89  0 );
90 }
91 
92 #endif /* CALOSAMPLING_H */
CaloSampling::getSamplingName
static std::string getSamplingName(CaloSample theSample)
Returns a string (name) for each CaloSampling.
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
CaloSampling
provides Calorimeter Sampling enum
Definition: Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h:17
CaloSampling::barrelPattern
static constexpr unsigned int barrelPattern()
Get the bit-pattern for barrel samplings.
Definition: Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h:75
CaloSampling::endcapPattern
static unsigned int endcapPattern()
Get the bit-pattern for endcap samplings.
CaloSampling::getSamplingPattern
static unsigned int getSamplingPattern(const CaloSample s)
Get a unsigned with one bit set
Definition: Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/CaloGeoHelpers/CaloSampling.h:33
CaloSampling::CaloSample
CaloSample
Definition: Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h:22
python.Include.include
include
Definition: Include.py:319
CaloSampling::endcapPattern
static constexpr unsigned int endcapPattern()
Get the bit-pattern for endcap samplings.
Definition: Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h:84
undef
@ undef
Definition: L1CaloPprPlotManager.h:81
CaloSampling::getNumberOfSamplings
static unsigned int getNumberOfSamplings()
Get number of available samplings.
CaloSampling::getSamplingName
static std::string getSamplingName(unsigned int theSample)
Returns a string (name) for each CaloSampling.
CaloSampling::barrelPattern
static unsigned int barrelPattern()
Get the bit-pattern for barrel samplings.
CALOSAMPLING
#define CALOSAMPLING(NAME, ISBARREL, ISENDCAP)
Definition: Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/CaloGeoHelpers/CaloSampling.h:23