ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | List of all members
LArSamples::CellInfo Class Referencefinal

#include <CellInfo.h>

Collaboration diagram for LArSamples::CellInfo:

Public Member Functions

 CellInfo ()
 Constructor
More...
 
 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. More...
 
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.

20  : m_calo(UNKNOWN_CALO), m_layer(-1),
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 }

◆ 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.

33  : m_calo(calo), m_layer(layer),
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 }

◆ 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 }

◆ ~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 }

◆ 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 }

◆ 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 }

◆ 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 }

◆ 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 }

◆ 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 }

◆ 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;
82  case CaloGain::LARMEDIUMGAIN : return m_shapeM;
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:
LArG4FSStartPointFilter.part
part
Definition: LArG4FSStartPointFilter.py:21
beamspotman.r
def r
Definition: beamspotman.py:676
LArSamples::CellInfo::feb
short feb() const
Definition: CellInfo.cxx:102
LArSamples::HEC_C_PARTITION
@ HEC_C_PARTITION
Definition: CaloId.h:31
LArSamples::CellInfo::m_layer
short m_layer
Definition: CellInfo.h:101
LArSamples::CellInfo::slot
short slot() const
Definition: CellInfo.h:68
LArSamples::CellInfo::calo
CaloId calo() const
Definition: CellInfo.h:50
PowhegControl_ttHplus_NLO.ss
ss
Definition: PowhegControl_ttHplus_NLO.py:83
LArSamples::Id::partition
static PartitionId partition(CaloId id)
Definition: CaloId.cxx:157
LArSamples::CellInfo::m_onlid
ULong64_t m_onlid
Definition: CellInfo.h:104
LArSamples::CellInfo::m_eta
double m_eta
Definition: CellInfo.h:103
LArSamples::CellInfo::m_iPhi
short m_iPhi
Definition: CellInfo.h:101
LArSamples::Geo::nRegions
static short nRegions(CaloId calo, short layer)
Definition: Geometry.cxx:124
CaloCondBlobAlgs_fillNoiseFromASCII.gain
gain
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:110
LArSamples::CellInfo::feedThrough
short feedThrough() const
Definition: CellInfo.h:65
LArSamples::Id::str
static TString str(CaloId id)
Definition: CaloId.cxx:15
LArSamples::FCAL_C
@ FCAL_C
Definition: CaloId.h:22
LArSamples::EMEC_A_PARTITION
@ EMEC_A_PARTITION
Definition: CaloId.h:30
UploadAMITag.l
list l
Definition: UploadAMITag.larcaf.py:158
LArSamples::CellInfo::phi
double phi() const
Definition: CellInfo.h:94
LArSamples::CellInfo::iEta
short iEta() const
Definition: CellInfo.h:56
LArSamples::HEC_A
@ HEC_A
Definition: CaloId.h:24
LArSamples::EMB_A_PARTITION
@ EMB_A_PARTITION
Definition: CaloId.h:30
LArSamples::FCAL_A
@ FCAL_A
Definition: CaloId.h:24
LArSamples::ShapeInfo
Definition: ShapeInfo.h:24
LArSamples::Geo::nSlots
static short nSlots(PartitionId part)
Definition: Geometry.cxx:59
LArSamples::EMEC_OUTER_C
@ EMEC_OUTER_C
Definition: CaloId.h:22
LArSamples::CellInfo::partition
PartitionId partition() const
Definition: CellInfo.cxx:198
LArSamples::FCAL_A_PARTITION
@ FCAL_A_PARTITION
Definition: CaloId.h:31
LArSamples::CellInfo::onlid
ULong64_t onlid() const
Definition: CellInfo.h:90
LArSamples::CellInfo::position
TVector3 position() const
Definition: CellInfo.cxx:204
LArSamples::EMB_C
@ EMB_C
Definition: CaloId.h:22
LArSamples::FCAL_C_PARTITION
@ FCAL_C_PARTITION
Definition: CaloId.h:31
LArSamples::CellInfo::m_shapeL
ShapeInfo * m_shapeL
Definition: CellInfo.h:102
LArSamples::CellInfo::shape
const ShapeInfo * shape(CaloGain::CaloGain gain) const
Definition: CellInfo.cxx:78
LArSamples::CellInfo::m_feedThrough
short m_feedThrough
Definition: CellInfo.h:101
LArSamples::ClassCounts::decrementInstanceCount
void decrementInstanceCount() const
Definition: LArCafJobs/LArCafJobs/ClassCounts.h:33
LArSamples::EMEC_C_PARTITION
@ EMEC_C_PARTITION
Definition: CaloId.h:30
LArSamples::PartitionId
PartitionId
Definition: CaloId.h:29
LArSamples::EMB_C_PARTITION
@ EMB_C_PARTITION
Definition: CaloId.h:30
WriteCalibToCool.swap
swap
Definition: WriteCalibToCool.py:94
LArSamples::Geo::nLayers
static short nLayers(CaloId calo)
Definition: Geometry.cxx:114
LArSamples::CellInfo::m_rt
double m_rt
Definition: CellInfo.h:103
LArSamples::UNKNOWN_CALO
@ UNKNOWN_CALO
Definition: CaloId.h:23
LArSamples::EMEC_OUTER_A
@ EMEC_OUTER_A
Definition: CaloId.h:24
LArSamples::CellInfo::m_calo
unsigned int m_calo
Definition: CellInfo.h:100
LArSamples::CellInfo::m_slot
short m_slot
Definition: CellInfo.h:101
LArSamples::Geo::firstLayer
static short firstLayer(CaloId calo)
Definition: Geometry.cxx:104
LArSamples::ClassCounts::incrementInstanceCount
void incrementInstanceCount() const
Definition: LArCafJobs/LArCafJobs/ClassCounts.h:32
LArSamples::HEC_A_PARTITION
@ HEC_A_PARTITION
Definition: CaloId.h:31
CaloGain::LARHIGHGAIN
@ LARHIGHGAIN
Definition: CaloGain.h:18
LArSamples::CellInfo::m_shapeH
ShapeInfo * m_shapeH
Definition: CellInfo.h:102
LArSamples::CaloId
CaloId
Definition: CaloId.h:21
LArSamples::CellInfo::m_channel
short m_channel
Definition: CellInfo.h:101
LArSamples::CellInfo::iPhi
short iPhi() const
Definition: CellInfo.h:62
LArSamples::CellInfo::m_phi
double m_phi
Definition: CellInfo.h:103
LArSamples::CellInfo::m_iEta
short m_iEta
Definition: CellInfo.h:101
LArSamples::CellInfo::channel
short channel() const
Definition: CellInfo.h:76
python.PyAthena.v
v
Definition: PyAthena.py:154
LArSamples::CellInfo::m_shapeM
ShapeInfo * m_shapeM
Definition: CellInfo.h:102
CaloGain::LARMEDIUMGAIN
@ LARMEDIUMGAIN
Definition: CaloGain.h:18
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
python.TriggerHandler.verbose
verbose
Definition: TriggerHandler.py:297
LArSamples::ShapeInfo::footprint
double footprint() const
Definition: ShapeInfo.h:55
LArSamples::CellInfo::region
short region() const
Definition: CellInfo.h:59
convertTimingResiduals.offset
offset
Definition: convertTimingResiduals.py:71
LArSamples::EMEC_INNER_C
@ EMEC_INNER_C
Definition: CaloId.h:22
LArSamples::Geo::nEta
static short nEta(CaloId calo, short layer, short region, short iPhi=1)
Definition: Geometry.cxx:169
LArSamples::HEC_C
@ HEC_C
Definition: CaloId.h:22
LArSamples::EMB_A
@ EMB_A
Definition: CaloId.h:24
LArSamples::EMEC_INNER_A
@ EMEC_INNER_A
Definition: CaloId.h:24
LArSamples::CellInfo::eta
double eta() const
Definition: CellInfo.h:93
python.CaloScaleNoiseConfig.default
default
Definition: CaloScaleNoiseConfig.py:79
CaloGain::LARLOWGAIN
@ LARLOWGAIN
Definition: CaloGain.h:18
python.compressB64.c
def c
Definition: compressB64.py:93
LArSamples::CellInfo::layer
short layer() const
Definition: CellInfo.h:53
LArSamples::Geo::firstEta
static short firstEta(CaloId calo, short layer, short region=0)
Definition: Geometry.cxx:146