ATLAS Offline Software
Loading...
Searching...
No Matches
CaloEvent/src/CaloSamplingHelper.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
5//*****************************************************************************
6//
7// DESCRIPTION:
8// Implementation comments only. Class level comments go in .h file.
9//
10// HISTORY:
11//
12// BUGS:
13// See also .h file.
14//
15// Updated May 25, 2001 HMA
16// LAr Sampling bug fix.
17//
18// FCAL Sampling bug fix (sam = 1-3, not 0-2)
19// Feb 20, 2002, HMA
20// fix for EM endcap inner wheel (SR)
21// Oct 2003: use caloDDE (DR)
22//*****************************************************************************
23
25#include "CaloEvent/CaloCell.h"
26#include "CaloDetDescr/CaloDetDescrElement.h"
27#include "Identifier/Identifier.h"
29
30const unsigned int CaloSamplingHelper::m_EMMask = 0x000000ff;
31const unsigned int CaloSamplingHelper::m_HADMask = 0x00ffff00;
32const unsigned int CaloSamplingHelper::m_BarrelMask = 0x001ff00f;
33const unsigned int CaloSamplingHelper::m_EndCapMask = 0x00e00ff0;
34const unsigned int CaloSamplingHelper::m_LArMask = 0x00e00fff;
35const unsigned int CaloSamplingHelper::m_TileMask = 0x001ff000;
36
37
40
41 const CaloDetDescrElement * theCaloDDE= cell.caloDDE() ;
42 if (theCaloDDE!=nullptr) {
43 return (CaloSamplingHelper::CaloSample) theCaloDDE->getSampling();
44 }
45 else{
46 return Unknown;
47
48 }
49}
50
52{
53 return getSamplingBit(getSampling(rCell));
54}
55
56
58{
59 return matchPattern(rSample,m_EMMask);
60}
61
63{
64 return matchPattern(rSample,m_HADMask);
65}
66
68{
69 return matchPattern(rSample,m_BarrelMask);
70}
71
73{
74 return matchPattern(rSample,m_EndCapMask);
75}
76
78{
79 return matchPattern(rSample,m_LArMask);
80}
81
83{
84 return matchPattern(rSample,m_TileMask);
85}
86
88 const unsigned int& mask)
89{
90 unsigned int bitPattern = getSamplingBit(rSample);
91 return ( bitPattern & mask ) == bitPattern;
92}
93
@ Unknown
Definition TruthClasses.h:9
Data object for each calorimeter readout cell.
Definition CaloCell.h:57
This class groups all DetDescr information related to a CaloCell.
CaloCell_ID::CaloSample getSampling() const
cell sampling
static bool isLArSampling(const CaloSample &rSample)
static bool isEMSampling(const CaloSample &rSample)
Get sampling characteristics.
static unsigned int getSamplingBit(const CaloSample &rSample)
Return a unique bit set for a given sampling.
static bool matchPattern(const CaloSample &rSample, const unsigned int &mask)
static bool isBarrelSampling(const CaloSample &rSample)
static bool isHADSampling(const CaloSample &rSample)
static CaloSample getSampling(const CaloCell &c)
Retrieves the sampling indicator for a cell.
static bool isEndCapSampling(const CaloSample &rSample)
static bool isTileSampling(const CaloSample &rSample)