ATLAS Offline Software
Public Types | Static Public Member Functions | List of all members
CaloSampling Class Reference

provides Calorimeter Sampling enum More...

#include <CaloSampling.h>

Inheritance diagram for CaloSampling:
Collaboration diagram for CaloSampling:

Public Types

enum  CaloSample
 
enum  CaloSample
 

Static Public Member Functions

static constexpr unsigned int getNumberOfSamplings ()
 Get number of available samplings. More...
 
static unsigned int getSamplingPattern (const CaloSample s)
 Get a unsigned with one bit set
More...
 
static constexpr unsigned int barrelPattern ()
 Get the bit-pattern for barrel samplings. More...
 
static constexpr unsigned int endcapPattern ()
 Get the bit-pattern for endcap samplings. More...
 
static std::string getSamplingName (CaloSample theSample)
 Returns a string (name) for each CaloSampling. More...
 
static std::string getSamplingName (unsigned int theSample)
 Returns a string (name) for each CaloSampling. More...
 
static CaloSample getSampling (const std::string &name)
 Return the sampling code for a given name. More...
 
static unsigned int getNumberOfSamplings ()
 Get number of available samplings. More...
 
static unsigned int getSamplingPattern (const CaloSample s)
 Get a unsigned with one bit set
More...
 
static unsigned int barrelPattern ()
 Get the bit-pattern for barrel samplings. More...
 
static unsigned int endcapPattern ()
 Get the bit-pattern for endcap samplings. More...
 
static std::string getSamplingName (CaloSample theSample)
 Returns a string (name) for each CaloSampling. More...
 
static std::string getSamplingName (unsigned int theSample)
 Returns a string (name) for each CaloSampling. More...
 

Detailed Description

provides Calorimeter Sampling enum

Definition at line 17 of file Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h.

Member Enumeration Documentation

◆ CaloSample [1/2]

Definition at line 22 of file Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h.

22  {
23 #define CALOSAMPLING(NAME, ISBARREL, ISENDCAP) NAME,
24 #include "CaloGeoHelpers/CaloSampling.def"
25 #undef CALOSAMPLING
26  };

◆ CaloSample [2/2]

Definition at line 22 of file Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/CaloGeoHelpers/CaloSampling.h.

22  {
23 #define CALOSAMPLING(NAME, ISBARREL, ISENDCAP) NAME,
24 #include "CaloGeoHelpers/CaloSampling.def"
25 #undef CALOSAMPLING
26  };

Member Function Documentation

◆ barrelPattern() [1/2]

static unsigned int CaloSampling::barrelPattern ( )
static

Get the bit-pattern for barrel samplings.

◆ barrelPattern() [2/2]

unsigned int CaloSampling::barrelPattern ( )
inlinestaticconstexpr

Get the bit-pattern for barrel samplings.

Definition at line 75 of file Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h.

75  {
76  return (//EM Barrel
77 #define CALOSAMPLING(NAME, ISBARREL, ISENDCAP) (((unsigned)ISBARREL)<<NAME) |
78 #include "CaloGeoHelpers/CaloSampling.def"
79 #undef CALOSAMPLING
80  0 );
81 }

◆ endcapPattern() [1/2]

unsigned int CaloSampling::endcapPattern ( )
inlinestaticconstexpr

Get the bit-pattern for endcap samplings.

Definition at line 84 of file Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h.

84  {
85  return (//EMEC:
86 #define CALOSAMPLING(NAME, ISBARREL, ISENDCAP) (((unsigned)ISENDCAP)<<NAME) |
87 #include "CaloGeoHelpers/CaloSampling.def"
88 #undef CALOSAMPLING
89  0 );
90 }

◆ endcapPattern() [2/2]

static unsigned int CaloSampling::endcapPattern ( )
static

Get the bit-pattern for endcap samplings.

◆ getNumberOfSamplings() [1/2]

static unsigned int CaloSampling::getNumberOfSamplings ( )
static

Get number of available samplings.

◆ getNumberOfSamplings() [2/2]

unsigned int CaloSampling::getNumberOfSamplings ( )
inlinestaticconstexpr

Get number of available samplings.

Definition at line 30 of file Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h.

31  {
32  return static_cast<unsigned int>(Unknown);
33  }

◆ getSampling()

CaloSampling::CaloSample CaloSampling::getSampling ( const std::string &  name)
static

Return the sampling code for a given name.

Parameters
[in]nameThe name to translate.

Returns Unknown if the name is not known.

Definition at line 32 of file Calorimeter/CaloGeoHelpers/Root/CaloSampling.cxx.

33 {
34  for (int samp = 0; samp != static_cast<int>(Unknown); ++samp) {
35  if (sample_names[samp] == name) {
36  return static_cast<CaloSample> (samp);
37  }
38  }
39  return Unknown;
40 }

◆ getSamplingName() [1/4]

std::string CaloSampling::getSamplingName ( CaloSample  theSample)
static

Returns a string (name) for each CaloSampling.

Parameters
[in]theSampleCaloSampling::CaloSample enumerator value

Definition at line 18 of file Calorimeter/CaloGeoHelpers/Root/CaloSampling.cxx.

19 {
20  return sample_names[theSample];
21 }

◆ getSamplingName() [2/4]

static std::string CaloSampling::getSamplingName ( CaloSample  theSample)
static

Returns a string (name) for each CaloSampling.

Parameters
[in]theSampleCaloSampling::CaloSample enumerator value

◆ getSamplingName() [3/4]

std::string CaloSampling::getSamplingName ( unsigned int  theSample)
static

Returns a string (name) for each CaloSampling.

Parameters
[in]theSampleCaloSampling::CaloSample enumerator value

Definition at line 24 of file Calorimeter/CaloGeoHelpers/Root/CaloSampling.cxx.

25 {
26  if (theSample >= getNumberOfSamplings())
27  return "";
28  return sample_names[theSample];
29 }

◆ getSamplingName() [4/4]

static std::string CaloSampling::getSamplingName ( unsigned int  theSample)
static

Returns a string (name) for each CaloSampling.

Parameters
[in]theSampleCaloSampling::CaloSample enumerator value

◆ getSamplingPattern() [1/2]

static unsigned int CaloSampling::getSamplingPattern ( const CaloSample  s)
inlinestatic

Get a unsigned with one bit set

Definition at line 33 of file Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/CaloGeoHelpers/CaloSampling.h.

33  {
34  return (0x1U << s);
35  }

◆ getSamplingPattern() [2/2]

static unsigned int CaloSampling::getSamplingPattern ( const CaloSample  s)
inlinestatic

Get a unsigned with one bit set

Definition at line 36 of file Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h.

36  {
37  return (0x1U << s);
38  }

The documentation for this class was generated from the following files:
GetLCDefs::Unknown
@ Unknown
Definition: GetLCDefs.h:21
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
CaloSampling::CaloSample
CaloSample
Definition: Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h:22
CALOSAMPLING
#define CALOSAMPLING(NAME, ISBARREL, ISENDCAP)
Definition: Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h:23
python.Include.include
include
Definition: Include.py:318
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
CaloSampling::getNumberOfSamplings
static constexpr unsigned int getNumberOfSamplings()
Get number of available samplings.
Definition: Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h:30