ATLAS Offline Software
Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
EMBCell Class Reference

A cell of the electromagnetic barrel calorimeter readout geometry This class gives dimensions and positions, and indices of an electromagnetic barrel calorimeter readout cell. Positions are in local coordinates (local to a "big piece", or in this case the EMB half barrel). Use the EMB Cells through EMB Cell Links please!!! This will free the memory used by the cell when the last link to the cell disappears. More...

#include <EMBCell.h>

Inheritance diagram for EMBCell:
Collaboration diagram for EMBCell:

Classes

struct  HVInfo
 

Public Types

enum  CELLPOS { FRONT, CENTER, BACK }
 

Public Member Functions

 EMBCell (unsigned int side, const EMBDetDescr *embDescriptor, unsigned int eta, unsigned int phi)
 Constructor. More...
 
unsigned int getPhiIndex () const
 The Phi Index of this Cell. More...
 
unsigned int getEndcapIndex () const
 The Side Index of this Cell (0=negatiive, 1=positive) More...
 
unsigned int getEtaIndex () const
 The eta index of this cell. More...
 
unsigned int getSamplingIndex () const
 The sampling index of this cell. More...
 
unsigned int getRegionIndex () const
 The region index of this cell. More...
 
const EMBDetDescrgetDescriptor () const
 Returns a pointer to the descriptor. More...
 
double getRLocal (CELLPOS position) const
 Z for the cell at (FRONT,CENTER,BACK) More...
 
double getZMinLocal (CELLPOS position) const
 RMin for the cell at (FRONT,CENTER,BACK) More...
 
double getZMaxLocal (CELLPOS position) const
 RMax for the cell at (FRONT,CENTER,BACK) More...
 
double getPhiLocalLower () const
 Gets the phi value at the "lower" edge of a cell. More...
 
double getPhiLocalUpper () const
 Gets the phi value at the "upper" edge of a cell. More...
 
double getPhiMinNominal () const
 returns a nominal phi min in global coords; assume canonical placement More...
 
double getPhiMaxNominal () const
 returns a nominal phi max in global coords; assume canonical placement More...
 
double getEtaMin () const
 Minimum Eta. More...
 
double getEtaMax () const
 Maximum Eta. More...
 
double getPhiLocalLower (double r) const
 Overloaded. More...
 
double getPhiLocalUpper (double r) const
 Overloaded. More...
 
unsigned int getNumElectrodes () const
 @Get num electrodes More...
 
const EMBHVElectrodegetElectrode (unsigned int i) const
 @Get electrode More...
 
unsigned int getNumHVPathologies () const
 @Get num HVPathologies More...
 
const EMBHVPathologiesConstLinkgetHVPathologies (unsigned int i) const
 @Get HVPathologies More...
 
const EMBPresamplerHVModulegetPresamplerHVModule () const
 @Get HVModule (presampler cells) More...
 
void addHVPathologies (const EMBHVPathologiesConstLink &)
 @Add HVPathologies More...
 

Private Member Functions

 EMBCell (const EMBCell &right)
 
virtual ~EMBCell ()
 
EMBCelloperator= (const EMBCell &right)
 
const HVInfogetHVInfo () const
 
void initHV (HVInfo &hvinfo) const
 

Private Attributes

const EMBDetDescrm_embDetDescr
 
CxxUtils::CachedValue< HVInfom_hvinfo
 
std::vector< EMBHVPathologiesConstLinkm_hvPathologies
 
unsigned int m_clockwork
 

Friends

class ImaginaryFriend
 

Detailed Description

A cell of the electromagnetic barrel calorimeter readout geometry This class gives dimensions and positions, and indices of an electromagnetic barrel calorimeter readout cell. Positions are in local coordinates (local to a "big piece", or in this case the EMB half barrel). Use the EMB Cells through EMB Cell Links please!!! This will free the memory used by the cell when the last link to the cell disappears.

Definition at line 30 of file EMBCell.h.

Member Enumeration Documentation

◆ CELLPOS

Enumerator
FRONT 
CENTER 
BACK 

Definition at line 33 of file EMBCell.h.

Constructor & Destructor Documentation

◆ EMBCell() [1/2]

EMBCell::EMBCell ( unsigned int  side,
const EMBDetDescr embDescriptor,
unsigned int  eta,
unsigned int  phi 
)
inline

Constructor.

Definition at line 198 of file EMBCell.h.

199  :m_embDetDescr(embDescriptor),m_clockwork(phi | (eta<<8) | (side <<17) )
200 {
201 }

◆ EMBCell() [2/2]

EMBCell::EMBCell ( const EMBCell right)
private

◆ ~EMBCell()

EMBCell::~EMBCell ( )
privatevirtualdefault

Member Function Documentation

◆ addHVPathologies()

void EMBCell::addHVPathologies ( const EMBHVPathologiesConstLink pathologies)

@Add HVPathologies

Definition at line 115 of file EMBCell.cxx.

115  {
116  m_hvPathologies.push_back(pathologies);
117 }

◆ getDescriptor()

const EMBDetDescr * EMBCell::getDescriptor ( ) const
inline

Returns a pointer to the descriptor.

Definition at line 230 of file EMBCell.h.

231 {
232  return m_embDetDescr;
233 }

◆ getElectrode()

const EMBHVElectrode & EMBCell::getElectrode ( unsigned int  i) const

@Get electrode

Definition at line 31 of file EMBCell.cxx.

31  {
32  return *getHVInfo().m_electrode[i];
33 }

◆ getEndcapIndex()

unsigned int EMBCell::getEndcapIndex ( ) const
inline

The Side Index of this Cell (0=negatiive, 1=positive)

Definition at line 210 of file EMBCell.h.

211 {
212  return (m_clockwork & 0x00020000) >> 17;
213 }

◆ getEtaIndex()

unsigned int EMBCell::getEtaIndex ( ) const
inline

The eta index of this cell.

Definition at line 215 of file EMBCell.h.

216 {
217  return (m_clockwork & 0x0001FF00) >> 8;
218 }

◆ getEtaMax()

double EMBCell::getEtaMax ( ) const
inline

Maximum Eta.

Definition at line 284 of file EMBCell.h.

285 {
286  return getDescriptor()->getEtaBinning().binUpper(getEtaIndex());
287 }

◆ getEtaMin()

double EMBCell::getEtaMin ( ) const
inline

Minimum Eta.

Definition at line 279 of file EMBCell.h.

280 {
281  return getDescriptor()->getEtaBinning().binLower(getEtaIndex());
282 }

◆ getHVInfo()

const EMBCell::HVInfo & EMBCell::getHVInfo ( ) const
private

Definition at line 40 of file EMBCell.cxx.

41 {
42  if (!m_hvinfo.isValid()) {
43  HVInfo hvinfo;
44  initHV (hvinfo);
45  m_hvinfo.set (std::move (hvinfo));
46  }
47  return *m_hvinfo.ptr();
48 }

◆ getHVPathologies()

const EMBHVPathologiesConstLink & EMBCell::getHVPathologies ( unsigned int  i) const

@Get HVPathologies

Definition at line 123 of file EMBCell.cxx.

123  {
124  return m_hvPathologies[i];
125 }

◆ getNumElectrodes()

unsigned int EMBCell::getNumElectrodes ( ) const

@Get num electrodes

Definition at line 27 of file EMBCell.cxx.

27  {
28  return getHVInfo().m_electrode.size();
29 }

◆ getNumHVPathologies()

unsigned int EMBCell::getNumHVPathologies ( ) const

@Get num HVPathologies

Definition at line 119 of file EMBCell.cxx.

119  {
120  return m_hvPathologies.size();
121 }

◆ getPhiIndex()

unsigned int EMBCell::getPhiIndex ( ) const
inline

The Phi Index of this Cell.

Definition at line 205 of file EMBCell.h.

206 {
207  return m_clockwork & 0x000000FF;
208 }

◆ getPhiLocalLower() [1/2]

double EMBCell::getPhiLocalLower ( ) const
inline

Gets the phi value at the "lower" edge of a cell.

This is a local phi!!! It's useful for constructing exact phi boundaries in the local coordinate system.

Definition at line 259 of file EMBCell.h.

260 {
261  return getDescriptor()->getPhiBinning().binLower(getPhiIndex());
262 }

◆ getPhiLocalLower() [2/2]

double EMBCell::getPhiLocalLower ( double  r) const

Overloaded.

Returns the local lower cell boundaries in phi but they take account of the accordion shape, which undulates in phi, in the barrel.

Definition at line 19 of file EMBCell.cxx.

19  {
20  return getPhiLocalLower();
21 }

◆ getPhiLocalUpper() [1/2]

double EMBCell::getPhiLocalUpper ( ) const
inline

Gets the phi value at the "upper" edge of a cell.

This is a local phi!!! It's useful for constructing exact phi boundaries in the local coordinate system.

Definition at line 264 of file EMBCell.h.

265 {
266  return getDescriptor()->getPhiBinning().binUpper(getPhiIndex());
267 }

◆ getPhiLocalUpper() [2/2]

double EMBCell::getPhiLocalUpper ( double  r) const

Overloaded.

Returns the local upper cell boundaries in phi but they take account of the accordion shape, which undulates in phi, in the barrel.

Definition at line 23 of file EMBCell.cxx.

23  {
24  return getPhiLocalUpper();
25 }

◆ getPhiMaxNominal()

double EMBCell::getPhiMaxNominal ( ) const
inline

returns a nominal phi max in global coords; assume canonical placement

Definition at line 274 of file EMBCell.h.

275 {
277 }

◆ getPhiMinNominal()

double EMBCell::getPhiMinNominal ( ) const
inline

returns a nominal phi min in global coords; assume canonical placement

Definition at line 269 of file EMBCell.h.

270 {
272 }

◆ getPresamplerHVModule()

const EMBPresamplerHVModule & EMBCell::getPresamplerHVModule ( ) const

@Get HVModule (presampler cells)

Definition at line 35 of file EMBCell.cxx.

35  {
36  return *getHVInfo().m_presamplerModule;
37 }

◆ getRegionIndex()

unsigned int EMBCell::getRegionIndex ( ) const
inline

The region index of this cell.

Definition at line 225 of file EMBCell.h.

226 {
227  return getDescriptor()->getRegionIndex();
228 }

◆ getRLocal()

double EMBCell::getRLocal ( CELLPOS  position) const
inline

Z for the cell at (FRONT,CENTER,BACK)

Definition at line 235 of file EMBCell.h.

236 {
237  switch (position) {
238  case FRONT:
240  case CENTER:
241  return getDescriptor()->getOffset(getEtaIndex());
242  case BACK:
244  default :
245  return 0;
246  };
247 }

◆ getSamplingIndex()

unsigned int EMBCell::getSamplingIndex ( ) const
inline

The sampling index of this cell.

Definition at line 220 of file EMBCell.h.

221 {
222  return getDescriptor()->getSamplingIndex();
223 }

◆ getZMaxLocal()

double EMBCell::getZMaxLocal ( CELLPOS  position) const
inline

RMax for the cell at (FRONT,CENTER,BACK)

Definition at line 254 of file EMBCell.h.

255 {
256  return getRLocal(position)*sinh(getEtaMax());
257 }

◆ getZMinLocal()

double EMBCell::getZMinLocal ( CELLPOS  position) const
inline

RMin for the cell at (FRONT,CENTER,BACK)

Definition at line 249 of file EMBCell.h.

250 {
251  return getRLocal(position)*sinh(getEtaMin());
252 }

◆ initHV()

void EMBCell::initHV ( HVInfo hvinfo) const
private

Definition at line 51 of file EMBCell.cxx.

52 {
53  if (getSamplingIndex()==0) {
54  const EMBPresamplerHVManager& presamplerHVManager=getDescriptor()->getManager()->getPresamplerHVManager();
55  double phiUpper = getPhiMaxNominal();
56  double phiLower = getPhiMinNominal();
57  double eta=fabs(getEtaMax()+getEtaMin())/2.0;
58  double phi=fabs(phiUpper+phiLower)/2.0;
59 
60  const CellPartitioning & etaBinning=presamplerHVManager.getDescriptor()->getEtaPartitioning();
61  const CellBinning & phiBinning=presamplerHVManager.getDescriptor()->getPhiBinning();
62 
63  unsigned int iPhi = int((phi - phiBinning.getStart())/phiBinning.getDelta()) + phiBinning.getFirstDivisionNumber();
64  unsigned int iEta = etaBinning.getFirstDivisionNumber();
65  unsigned int lastDivision=etaBinning.getFirstDivisionNumber()+etaBinning.getNumDivisions();
66  while (iEta<lastDivision) {
67  double etaMax=etaBinning.binUpper(iEta);
68  double etaMin=etaBinning.binLower(iEta);
69  if (eta>etaMin && eta<etaMax) break;
70  iEta++;
71  }
72  if (iEta==lastDivision) throw std::runtime_error ("Error in EMBCell: Presampler HV not found");
73 
74  unsigned int iSide=getEndcapIndex();
75  hvinfo.m_presamplerModule = &(presamplerHVManager.getHVModule(iSide,iEta,iPhi));
76 
77  }
78  else {
79  // M_PI - phi for left side
80 
81  const EMBHVManager& hvManager=getDescriptor()->getManager()->getHVManager();
82  double phiUpper = getPhiMaxNominal();
83  double phiLower = getPhiMinNominal();
84 
85 
86 
87  double eta=fabs(getEtaMax()+getEtaMin())/2.0;
88  double phi=fabs(phiUpper+phiLower)/2.0;
89  const CellBinning & etaBinning=hvManager.getDescriptor().getEtaBinning();
90  const CellBinning & phiBinning=hvManager.getDescriptor().getPhiBinning();
91  unsigned int iEta = int((eta - etaBinning.getStart())/etaBinning.getDelta()) + etaBinning.getFirstDivisionNumber();
92  unsigned int iPhi = int((phi - phiBinning.getStart())/phiBinning.getDelta()) + phiBinning.getFirstDivisionNumber();
93  unsigned int iSector = int(2.0*(phi - phiBinning.binLower(iPhi))/phiBinning.getDelta());
94  unsigned int iSide=getEndcapIndex();
95 
96  if (iEta==8) iEta=7;
97 
98  const EMBHVModule& hvMod = hvManager.getHVModule(iSide,iEta,iPhi,iSector);
99  double dPhi = fabs((phiUpper-phiLower));
100  double phi0 = (iSide==1) ? M_PI/1024 : -(M_PI)/1024; // delta phi between first absorber and electrode at phi=0
101  double sPhi = phiLower-hvMod.getPhiMin() + phi0;
102  unsigned int iOffset=int(sPhi*(M_1_PI/2*1024.)+0.5);
103  unsigned int N =int(dPhi*(M_1_PI/2*1024.)+0.5);
104  // std::cout << " EMBCell eta,phi1,phi2 cell, phiMinModule " << eta << " " << phiLower << " " << phiUpper << " " << hvMod->getPhiMin() << std::endl;
105 
106  for (unsigned int iElectrode=iOffset;iElectrode<iOffset+N;iElectrode++) {
107  const EMBHVElectrode& hvElec = hvMod.getElectrode(iElectrode);
108  hvinfo.m_electrode.push_back(&hvElec);
109  }
110 
111  }
112 }

◆ operator=()

EMBCell& EMBCell::operator= ( const EMBCell right)
private

Friends And Related Function Documentation

◆ ImaginaryFriend

friend class ImaginaryFriend
friend

Definition at line 189 of file EMBCell.h.

Member Data Documentation

◆ m_clockwork

unsigned int EMBCell::m_clockwork
private

Definition at line 187 of file EMBCell.h.

◆ m_embDetDescr

const EMBDetDescr* EMBCell::m_embDetDescr
private

Definition at line 175 of file EMBCell.h.

◆ m_hvinfo

CxxUtils::CachedValue<HVInfo> EMBCell::m_hvinfo
private

Definition at line 183 of file EMBCell.h.

◆ m_hvPathologies

std::vector<EMBHVPathologiesConstLink> EMBCell::m_hvPathologies
private

Definition at line 185 of file EMBCell.h.


The documentation for this class was generated from the following files:
EMBCell::getHVInfo
const HVInfo & getHVInfo() const
Definition: EMBCell.cxx:40
EMBHVElectrode
Definition: EMBHVElectrode.h:15
EMBCell::getPhiLocalUpper
double getPhiLocalUpper() const
Gets the phi value at the "upper" edge of a cell.
Definition: EMBCell.h:264
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
InDetAccessor::phi0
@ phi0
Definition: InDetAccessor.h:33
EMBCell::getSamplingIndex
unsigned int getSamplingIndex() const
The sampling index of this cell.
Definition: EMBCell.h:220
M_PI
#define M_PI
Definition: ActiveFraction.h:11
xAOD::etaMax
etaMax
Definition: HIEventShape_v2.cxx:46
JetTiledMap::N
@ N
Definition: TiledEtaPhiMap.h:44
EMBDetectorManager::getHVManager
const EMBHVManager & getHVManager() const
Get the HV Manager.
Definition: EMBDetectorManager.cxx:94
EMBDetDescr::getManager
const EMBDetectorManager * getManager() const
The manager.
Definition: EMBDetDescr.h:156
EMBDetDescr::getPhiBinning
const CellBinning & getPhiBinning() const
The Binning in Phi.
Definition: EMBDetDescr.h:177
EMBCell::initHV
void initHV(HVInfo &hvinfo) const
Definition: EMBCell.cxx:51
EMBCell::HVInfo::m_electrode
std::vector< const EMBHVElectrode * > m_electrode
Definition: EMBCell.h:180
EMBCell::getRLocal
double getRLocal(CELLPOS position) const
Z for the cell at (FRONT,CENTER,BACK)
Definition: EMBCell.h:235
EMBHVManager::getHVModule
const EMBHVModule & getHVModule(unsigned int iSide, unsigned int iEta, unsigned int iPhi, unsigned int iSector) const
Definition: EMBHVManager.cxx:194
TRT::Hit::side
@ side
Definition: HitInfo.h:83
EMBHVManager::getDescriptor
const EMBHVDescriptor & getDescriptor() const
Definition: EMBHVManager.cxx:169
EMBCell::CELLPOS
CELLPOS
Definition: EMBCell.h:33
EMBPresamplerHVManager
This class provides direct access to information on the HV electrodes within the barrels....
Definition: EMBPresamplerHVManager.h:37
EMBCell::m_hvPathologies
std::vector< EMBHVPathologiesConstLink > m_hvPathologies
Definition: EMBCell.h:185
EMBDetDescr::getHalfLength
double getHalfLength(unsigned int etaIndex) const
gets the cell half-length in z.
Definition: EMBDetDescr.h:146
EMBCell::getEtaIndex
unsigned int getEtaIndex() const
The eta index of this cell.
Definition: EMBCell.h:215
lumiFormat.i
int i
Definition: lumiFormat.py:85
TauGNNUtils::Variables::Track::dPhi
bool dPhi(const xAOD::TauJet &tau, const xAOD::TauTrack &track, double &out)
Definition: TauGNNUtils.cxx:538
EMBCell::HVInfo::m_presamplerModule
const EMBPresamplerHVModule * m_presamplerModule
Definition: EMBCell.h:181
EMBCell::m_embDetDescr
const EMBDetDescr * m_embDetDescr
Definition: EMBCell.h:175
EMBCell::getEtaMin
double getEtaMin() const
Minimum Eta.
Definition: EMBCell.h:279
EMBPresamplerHVManager::getDescriptor
const EMBPresamplerHVDescriptor * getDescriptor() const
Definition: EMBPresamplerHVManager.cxx:147
EMBCell::getDescriptor
const EMBDetDescr * getDescriptor() const
Returns a pointer to the descriptor.
Definition: EMBCell.h:230
EMBCell::getPhiMaxNominal
double getPhiMaxNominal() const
returns a nominal phi max in global coords; assume canonical placement
Definition: EMBCell.h:274
EMBHVModule::getPhiMin
double getPhiMin() const
Definition: EMBHVModule.cxx:99
EMBCell::BACK
@ BACK
Definition: EMBCell.h:33
EMBDetDescr::getEtaBinning
const CellBinning & getEtaBinning() const
The Binning in Eta.
Definition: EMBDetDescr.h:184
EMBCell::getPhiMinNominal
double getPhiMinNominal() const
returns a nominal phi min in global coords; assume canonical placement
Definition: EMBCell.h:269
EMBHVManager
This class provides direct access to information on the HV electrodes within the barrels....
Definition: EMBHVManager.h:36
EMBDetectorManager::getPresamplerHVManager
const EMBPresamplerHVManager & getPresamplerHVManager() const
Get the HV Manager (Presampler)
Definition: EMBDetectorManager.cxx:100
EMBPresamplerHVDescriptor::getEtaPartitioning
const CellPartitioning & getEtaPartitioning() const
Definition: EMBPresamplerHVDescriptor.h:17
EMBDetDescr::getOffset
double getOffset(unsigned int etaIndex) const
Gets the offset position (cell centers with respect to the position of the front of the active volume...
Definition: EMBDetDescr.h:138
Trk::iPhi
@ iPhi
Definition: ParamDefs.h:47
EMBHVDescriptor::getEtaBinning
const CellBinning & getEtaBinning() const
Definition: EMBHVDescriptor.h:16
EMBCell::getEndcapIndex
unsigned int getEndcapIndex() const
The Side Index of this Cell (0=negatiive, 1=positive)
Definition: EMBCell.h:210
LArCellBinning.etaMin
etaMin
Definition: LArCellBinning.py:84
EMBDetDescr::getSamplingIndex
unsigned int getSamplingIndex() const
The sampling index.
Definition: EMBDetDescr.h:163
EMBPresamplerHVDescriptor::getPhiBinning
const CellBinning & getPhiBinning() const
Definition: EMBPresamplerHVDescriptor.h:22
EMBHVModule::getElectrode
const EMBHVElectrode & getElectrode(unsigned int iElectrode) const
Definition: EMBHVModule.cxx:69
EMBCell::getEtaMax
double getEtaMax() const
Maximum Eta.
Definition: EMBCell.h:284
EMBCell::CENTER
@ CENTER
Definition: EMBCell.h:33
python.CaloScaleNoiseConfig.default
default
Definition: CaloScaleNoiseConfig.py:79
EMBHVModule
Describes one HV Module within the EMB.
Definition: EMBHVModule.h:20
EMBHVDescriptor::getPhiBinning
const CellBinning & getPhiBinning() const
Definition: EMBHVDescriptor.h:21
EMBPresamplerHVManager::getHVModule
const EMBPresamplerHVModule & getHVModule(unsigned int iSide, unsigned int iEta, unsigned int iPhi) const
Definition: EMBPresamplerHVManager.cxx:172
EMBCell::m_hvinfo
CxxUtils::CachedValue< HVInfo > m_hvinfo
Definition: EMBCell.h:183
xAOD::iEta
setScale setgFexType iEta
Definition: gFexJetRoI_v1.cxx:77
EMBDetDescr::getRegionIndex
unsigned int getRegionIndex() const
The region index.
Definition: EMBDetDescr.h:170
EMBCell::getPhiLocalLower
double getPhiLocalLower() const
Gets the phi value at the "lower" edge of a cell.
Definition: EMBCell.h:259
EMBCell::m_clockwork
unsigned int m_clockwork
Definition: EMBCell.h:187
EMBCell::getPhiIndex
unsigned int getPhiIndex() const
The Phi Index of this Cell.
Definition: EMBCell.h:205
EMBCell::FRONT
@ FRONT
Definition: EMBCell.h:33