ATLAS Offline Software
Loading...
Searching...
No Matches
LArSamples::CellInfo Class Referencefinal

#include <CellInfo.h>

Collaboration diagram for LArSamples::CellInfo:

Public Member Functions

 CellInfo ()
 Constructor.
 CellInfo (CaloId calo, short layer=-1, short iEta=-1, short iPhi=-1, short feedThrough=-1, short slot=-1, short channel=-1, ShapeInfo *shapeL=0, ShapeInfo *shapeM=0, ShapeInfo *shapeH=0, const TVector3 &position=TVector3(0, 0, 0), ULong64_t onlid=-1)
 CellInfo (const CellInfo &other, bool withShapes=true)
 CellInfo (CellInfo &&other) noexcept
 ~CellInfo ()
 Destructor.
CaloId calo () const
short layer () const
short iEta () const
short region () const
short iPhi () const
short feedThrough () const
short slot () const
short feb () const
short globalFeb () const
short globalPhiRing () const
short channel () const
TString location (int verbose=1) const
TVector3 position () const
bool isValid () const
const ShapeInfoshape (CaloGain::CaloGain gain) const
double footprint () const
PartitionId partition () const
ULong64_t onlid () const
double rt () const
double eta () const
double phi () const
bool setShape (CaloGain::CaloGain gain, ShapeInfo *shape)

Private Member Functions

CellInfooperator= (const CellInfo &)

Private Attributes

unsigned int m_calo
short m_layer
short m_iEta
short m_iPhi
short m_feedThrough
short m_slot
short m_channel
ShapeInfom_shapeL
ShapeInfom_shapeM
ShapeInfom_shapeH
double m_rt
double m_eta
double m_phi
ULong64_t m_onlid

Detailed Description

Definition at line 31 of file CellInfo.h.

Constructor & Destructor Documentation

◆ CellInfo() [1/4]

CellInfo::CellInfo ( )

Constructor.

Definition at line 19 of file CellInfo.cxx.

21 m_iEta(-1), m_iPhi(-1), m_feedThrough(-1),
22 m_slot(-1), m_channel(-1), m_shapeL(nullptr), m_shapeM(nullptr), m_shapeH(nullptr),
23 m_rt(0), m_eta(0), m_phi(0), m_onlid(-1)
24{
26}
ShapeInfo * m_shapeM
Definition CellInfo.h:102
ShapeInfo * m_shapeL
Definition CellInfo.h:102
ShapeInfo * m_shapeH
Definition CellInfo.h:102
unsigned int m_calo
Definition CellInfo.h:100
@ UNKNOWN_CALO
Definition CaloId.h:23

◆ CellInfo() [2/4]

CellInfo::CellInfo ( CaloId calo,
short layer = -1,
short iEta = -1,
short iPhi = -1,
short feedThrough = -1,
short slot = -1,
short channel = -1,
ShapeInfo * shapeL = 0,
ShapeInfo * shapeM = 0,
ShapeInfo * shapeH = 0,
const TVector3 & position = TVector3(0,0,0),
ULong64_t onlid = -1 )

Definition at line 29 of file CellInfo.cxx.

36 m_shapeL(shapeL), m_shapeM(shapeM), m_shapeH(shapeH),
37 m_rt(position.Pt()), m_eta(position.Eta()), m_phi(position.Phi()), m_onlid(onlid)
38{
40}
short slot() const
Definition CellInfo.h:68
short layer() const
Definition CellInfo.h:53
TVector3 position() const
Definition CellInfo.cxx:204
short feedThrough() const
Definition CellInfo.h:65
ULong64_t onlid() const
Definition CellInfo.h:90
short iPhi() const
Definition CellInfo.h:62
CaloId calo() const
Definition CellInfo.h:50
short channel() const
Definition CellInfo.h:76
short iEta() const
Definition CellInfo.h:56

◆ CellInfo() [3/4]

CellInfo::CellInfo ( const CellInfo & other,
bool withShapes = true )

Definition at line 42 of file CellInfo.cxx.

43 : m_calo(other.m_calo), m_layer(other.m_layer),
44 m_iEta(other.m_iEta), m_iPhi(other.m_iPhi),
45 m_feedThrough(other.m_feedThrough), m_slot(other.m_slot), m_channel(other.m_channel),
46 m_shapeL(nullptr), m_shapeM(nullptr), m_shapeH(nullptr),
47 m_rt(other.m_rt), m_eta(other.m_eta), m_phi(other.m_phi), m_onlid(other.m_onlid)
48{
50 if (withShapes && other.m_shapeL) m_shapeL = new ShapeInfo(*other.m_shapeL);
51 if (withShapes && other.m_shapeM) m_shapeM = new ShapeInfo(*other.m_shapeM);
52 if (withShapes && other.m_shapeH) m_shapeH = new ShapeInfo(*other.m_shapeH);
53}

◆ CellInfo() [4/4]

CellInfo::CellInfo ( CellInfo && other)
noexcept

Definition at line 55 of file CellInfo.cxx.

55 : m_calo(other.m_calo), m_layer(other.m_layer),
56 m_iEta(other.m_iEta), m_iPhi(other.m_iPhi),
57 m_feedThrough(other.m_feedThrough), m_slot(other.m_slot), m_channel(other.m_channel),
58 m_shapeL(nullptr), m_shapeM(nullptr), m_shapeH(nullptr),
59 m_rt(other.m_rt), m_eta(other.m_eta), m_phi(other.m_phi), m_onlid(other.m_onlid)
60{
62 std::swap(m_shapeL, other.m_shapeL);
63 std::swap(m_shapeM, other.m_shapeM);
64 std::swap(m_shapeH, other.m_shapeH);
65}
void swap(ElementLinkVector< DOBJ > &lhs, ElementLinkVector< DOBJ > &rhs)

◆ ~CellInfo()

CellInfo::~CellInfo ( )

Destructor.

Definition at line 69 of file CellInfo.cxx.

70{
72 if (m_shapeL) delete m_shapeL;
73 if (m_shapeM) delete m_shapeM;
74 if (m_shapeH) delete m_shapeH;
75}

Member Function Documentation

◆ calo()

CaloId LArSamples::CellInfo::calo ( ) const
inline
Returns
calo

Definition at line 50 of file CellInfo.h.

50{ return (CaloId)m_calo; }

◆ channel()

short LArSamples::CellInfo::channel ( ) const
inline
Returns
channel

Definition at line 76 of file CellInfo.h.

76{ return m_channel; }

◆ eta()

double LArSamples::CellInfo::eta ( ) const
inline

Definition at line 93 of file CellInfo.h.

93{ return m_eta; }

◆ feb()

short CellInfo::feb ( ) const
Returns
feedThrough+slot position

Definition at line 102 of file CellInfo.cxx.

103{
104 // slot starts at 1!
105 return slot() - 1 + Geo::nSlots(partition())*feedThrough();
106}
PartitionId partition() const
Definition CellInfo.cxx:198
static short nSlots(PartitionId part)
Definition Geometry.cxx:59

◆ feedThrough()

short LArSamples::CellInfo::feedThrough ( ) const
inline
Returns
feedThrough

Definition at line 65 of file CellInfo.h.

65{ return m_feedThrough; }

◆ footprint()

double CellInfo::footprint ( ) const

Definition at line 189 of file CellInfo.cxx.

190{
191 return sizeof(*this)
192 + (m_shapeL ? m_shapeL->footprint() : 0)
193 + (m_shapeM ? m_shapeM->footprint() : 0)
194 + (m_shapeH ? m_shapeH->footprint() : 0);
195}

◆ globalFeb()

short CellInfo::globalFeb ( ) const

Definition at line 109 of file CellInfo.cxx.

110{
111 short offset = 0;
113 part = EMB_A_PARTITION; if (partition() == part) return offset + feb(); offset += Geo::nSlots(part);
114 part = EMB_C_PARTITION; if (partition() == part) return offset + feb(); offset += Geo::nSlots(part);
115 part = EMEC_A_PARTITION; if (partition() == part) return offset + feb(); offset += Geo::nSlots(part);
116 part = EMEC_C_PARTITION; if (partition() == part) return offset + feb(); offset += Geo::nSlots(part);
117 part = HEC_A_PARTITION; if (partition() == part) return offset + feb(); offset += Geo::nSlots(part);
118 part = HEC_C_PARTITION; if (partition() == part) return offset + feb(); offset += Geo::nSlots(part);
119 part = FCAL_A_PARTITION; if (partition() == part) return offset + feb(); offset += Geo::nSlots(part);
120 part = FCAL_C_PARTITION; if (partition() == part) return offset + feb();
121 return -1;
122}
short feb() const
Definition CellInfo.cxx:102
@ EMEC_A_PARTITION
Definition CaloId.h:30
@ FCAL_C_PARTITION
Definition CaloId.h:31
@ HEC_C_PARTITION
Definition CaloId.h:31
@ EMB_A_PARTITION
Definition CaloId.h:30
@ FCAL_A_PARTITION
Definition CaloId.h:31
@ EMB_C_PARTITION
Definition CaloId.h:30
@ EMEC_C_PARTITION
Definition CaloId.h:30
@ HEC_A_PARTITION
Definition CaloId.h:31

◆ globalPhiRing()

short CellInfo::globalPhiRing ( ) const

Definition at line 125 of file CellInfo.cxx.

126{
127 short offset = 0;
129 for (unsigned int c = 0; c < 10; c++)
130 for (unsigned short l = Geo::firstLayer(cal[c]); l < Geo::firstLayer(cal[c]) + Geo::nLayers(cal[c]); l++)
131 for (unsigned short r = 0; r < Geo::nRegions(cal[c], l); r++) {
132 if (calo() == cal[c] && layer() == l && region() == r) return offset + (iEta() - Geo::firstEta(calo(), layer(), region()));
133 offset += Geo::nEta(cal[c], l, r);
134 }
135
136 return -1;
137}
short region() const
Definition CellInfo.h:59
static short firstEta(CaloId calo, short layer, short region=0)
Definition Geometry.cxx:146
static short firstLayer(CaloId calo)
Definition Geometry.cxx:104
static short nEta(CaloId calo, short layer, short region, short iPhi=1)
Definition Geometry.cxx:169
static short nLayers(CaloId calo)
Definition Geometry.cxx:114
static short nRegions(CaloId calo, short layer)
Definition Geometry.cxx:124
int r
Definition globals.cxx:22
@ EMEC_INNER_C
Definition CaloId.h:22
@ EMEC_INNER_A
Definition CaloId.h:24
@ EMEC_OUTER_C
Definition CaloId.h:22
@ EMEC_OUTER_A
Definition CaloId.h:24
l
Printing final latex table to .tex output file.

◆ iEta()

short LArSamples::CellInfo::iEta ( ) const
inline
Returns
iEta

Definition at line 56 of file CellInfo.h.

56{ return (m_iEta < 0 ? -1 : (m_iEta & 0x3ff)); } // bottom 10 bits

◆ iPhi()

short LArSamples::CellInfo::iPhi ( ) const
inline
Returns
iPhi

Definition at line 62 of file CellInfo.h.

62{ return m_iPhi; }

◆ isValid()

bool CellInfo::isValid ( ) const

Definition at line 173 of file CellInfo.cxx.

174{
175 //if (!m_shape || !m_shape->isValid()) return false;
176
177 if (m_calo == UNKNOWN_CALO) return false;
178 if (m_layer < 0) return false;
179 if (m_iEta < 0) return false;
180 if (m_iPhi < 0) return false;
181 if (m_feedThrough < 0) return false;
182 if (m_slot < 0) return false;
183 if (m_channel < 0) return false;
184
185 return true;
186}

◆ layer()

short LArSamples::CellInfo::layer ( ) const
inline
Returns
layer

Definition at line 53 of file CellInfo.h.

53{ return m_layer; }

◆ location()

TString CellInfo::location ( int verbose = 1) const
Returns
location as a string

Definition at line 139 of file CellInfo.cxx.

140{
141 TString loc = Id::str(calo());
142 if (loc == Id::str(UNKNOWN_CALO)) return loc;
143
144 if (verbose == 0) {
145 std::ostringstream ss;
146 ss << "(" << m_layer << ")";
147 loc += " " + ss.str();
148 return loc;
149 }
150
151 if (verbose == 1) {
152 std::ostringstream ss;
153 ss << "(" << layer() << ")" << " " << feedThrough() << "/" << slot() << "/" << channel();
154 loc += " " + ss.str();
155 return loc;
156 }
157
158 std::ostringstream ss;
159 ss << "layer " << layer() << ", FT " << feedThrough()
160 << ", slot " << slot() << ", channel " << channel()
161 << ", (eta, phi) = " << Form("(%4.2f, %4.2f)", eta(), phi());
162
163 if (verbose == 2) {
164 loc += " " + ss.str();
165 return loc;
166 }
167 ss << ", (iEta, iPhi, region) = (" << iEta() << ", " << iPhi() << ", " << region() << ")";
168 loc += " " + ss.str();
169 return loc;
170}
static Double_t ss
double eta() const
Definition CellInfo.h:93
double phi() const
Definition CellInfo.h:94
static TString str(CaloId id)
Definition CaloId.cxx:15
bool verbose
Definition hcg.cxx:73

◆ onlid()

ULong64_t LArSamples::CellInfo::onlid ( ) const
inline

Definition at line 90 of file CellInfo.h.

90{ return m_onlid; }

◆ operator=()

CellInfo & LArSamples::CellInfo::operator= ( const CellInfo & )
private

◆ partition()

PartitionId CellInfo::partition ( ) const

Definition at line 198 of file CellInfo.cxx.

199{
200 return Id::partition(calo());
201}
static PartitionId partition(CaloId id)
Definition CaloId.cxx:157

◆ phi()

double LArSamples::CellInfo::phi ( ) const
inline

Definition at line 94 of file CellInfo.h.

94{ return m_phi; }

◆ position()

TVector3 CellInfo::position ( ) const

Definition at line 204 of file CellInfo.cxx.

205{
206 TVector3 v;
207 v.SetPtEtaPhi(m_rt, m_eta, m_phi);
208 return v;
209}

◆ region()

short LArSamples::CellInfo::region ( ) const
inline
Returns
iEta

Definition at line 59 of file CellInfo.h.

59{ return (m_iEta < 0 ? -1 : (m_iEta - iEta())>>10); } // top 5 bits (Actually 3 max)

◆ rt()

double LArSamples::CellInfo::rt ( ) const
inline

Definition at line 92 of file CellInfo.h.

92{ return m_rt; }

◆ setShape()

bool CellInfo::setShape ( CaloGain::CaloGain gain,
ShapeInfo * shape )

Definition at line 90 of file CellInfo.cxx.

91{
92 switch (gain) {
93 case CaloGain::LARLOWGAIN : m_shapeL = shape; return true;
94 case CaloGain::LARMEDIUMGAIN : m_shapeM = shape; return true;
95 case CaloGain::LARHIGHGAIN : m_shapeH = shape; return true;
96 default : return false;
97 }
98 return false;
99}
const ShapeInfo * shape(CaloGain::CaloGain gain) const
Definition CellInfo.cxx:78
@ LARMEDIUMGAIN
Definition CaloGain.h:18
@ LARLOWGAIN
Definition CaloGain.h:18
@ LARHIGHGAIN
Definition CaloGain.h:18

◆ shape()

const ShapeInfo * CellInfo::shape ( CaloGain::CaloGain gain) const

Definition at line 78 of file CellInfo.cxx.

79{
80 switch (gain) {
81 case CaloGain::LARLOWGAIN : return m_shapeL;
83 case CaloGain::LARHIGHGAIN : return m_shapeH;
84 default : return nullptr;
85 }
86 return nullptr;
87}

◆ slot()

short LArSamples::CellInfo::slot ( ) const
inline
Returns
slot – starts at 1 !

Definition at line 68 of file CellInfo.h.

68{ return m_slot; }

Member Data Documentation

◆ m_calo

unsigned int LArSamples::CellInfo::m_calo
private

Definition at line 100 of file CellInfo.h.

◆ m_channel

short LArSamples::CellInfo::m_channel
private

Definition at line 101 of file CellInfo.h.

◆ m_eta

double LArSamples::CellInfo::m_eta
private

Definition at line 103 of file CellInfo.h.

◆ m_feedThrough

short LArSamples::CellInfo::m_feedThrough
private

Definition at line 101 of file CellInfo.h.

◆ m_iEta

short LArSamples::CellInfo::m_iEta
private

Definition at line 101 of file CellInfo.h.

◆ m_iPhi

short LArSamples::CellInfo::m_iPhi
private

Definition at line 101 of file CellInfo.h.

◆ m_layer

short LArSamples::CellInfo::m_layer
private

Definition at line 101 of file CellInfo.h.

◆ m_onlid

ULong64_t LArSamples::CellInfo::m_onlid
private

Definition at line 104 of file CellInfo.h.

◆ m_phi

double LArSamples::CellInfo::m_phi
private

Definition at line 103 of file CellInfo.h.

◆ m_rt

double LArSamples::CellInfo::m_rt
private

Definition at line 103 of file CellInfo.h.

◆ m_shapeH

ShapeInfo * LArSamples::CellInfo::m_shapeH
private

Definition at line 102 of file CellInfo.h.

◆ m_shapeL

ShapeInfo* LArSamples::CellInfo::m_shapeL
private

Definition at line 102 of file CellInfo.h.

◆ m_shapeM

ShapeInfo * LArSamples::CellInfo::m_shapeM
private

Definition at line 102 of file CellInfo.h.

◆ m_slot

short LArSamples::CellInfo::m_slot
private

Definition at line 101 of file CellInfo.h.


The documentation for this class was generated from the following files: