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

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.

@ BACK
Definition EMBCell.h:33
@ CENTER
Definition EMBCell.h:33
@ FRONT
Definition EMBCell.h:33

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}
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
unsigned int m_clockwork
Definition EMBCell.h:187
const EMBDetDescr * m_embDetDescr
Definition EMBCell.h:175

◆ EMBCell() [2/2]

EMBCell::EMBCell ( const EMBCell & right)
private

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}
std::vector< EMBHVPathologiesConstLink > m_hvPathologies
Definition EMBCell.h:185

◆ 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}
const HVInfo & getHVInfo() const
Definition EMBCell.cxx:40
std::vector< const EMBHVElectrode * > m_electrode
Definition EMBCell.h:180

◆ 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}
unsigned int getEtaIndex() const
The eta index of this cell.
Definition EMBCell.h:215
const EMBDetDescr * getDescriptor() const
Returns a pointer to the descriptor.
Definition EMBCell.h:230
const CellBinning & getEtaBinning() const
The Binning in Eta.

◆ 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}
void initHV(HVInfo &hvinfo) const
Definition EMBCell.cxx:51
CxxUtils::CachedValue< HVInfo > m_hvinfo
Definition EMBCell.h:183

◆ 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}
unsigned int getPhiIndex() const
The Phi Index of this Cell.
Definition EMBCell.h:205
const CellBinning & getPhiBinning() const
The Binning in Phi.

◆ 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}
double getPhiLocalLower() const
Gets the phi value at the "lower" edge of a cell.
Definition EMBCell.h:259

◆ 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}
double getPhiLocalUpper() const
Gets the phi value at the "upper" edge of a cell.
Definition EMBCell.h:264

◆ 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}
#define M_PI
unsigned int getEndcapIndex() const
The Side Index of this Cell (0=negatiive, 1=positive)
Definition EMBCell.h:210

◆ 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 {
37}
const EMBPresamplerHVModule * m_presamplerModule
Definition EMBCell.h:181

◆ 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}
unsigned int getRegionIndex() const
The region index.

◆ 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:
242 case BACK:
244 default :
245 return 0;
246 };
247}
double getOffset(unsigned int etaIndex) const
Gets the offset position (cell centers with respect to the position of the front of the active volume...
double getHalfLength(unsigned int etaIndex) const
gets the cell half-length in z.

◆ getSamplingIndex()

unsigned int EMBCell::getSamplingIndex ( ) const
inline

The sampling index of this cell.

Definition at line 220 of file EMBCell.h.

221{
223}
unsigned int getSamplingIndex() const
The sampling index.

◆ 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}
double getEtaMax() const
Maximum Eta.
Definition EMBCell.h:284
double getRLocal(CELLPOS position) const
Z for the cell at (FRONT,CENTER,BACK)
Definition EMBCell.h:235

◆ 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}
double getEtaMin() const
Minimum Eta.
Definition EMBCell.h:279

◆ 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}
double getPhiMinNominal() const
returns a nominal phi min in global coords; assume canonical placement
Definition EMBCell.h:269
unsigned int getSamplingIndex() const
The sampling index of this cell.
Definition EMBCell.h:220
double getPhiMaxNominal() const
returns a nominal phi max in global coords; assume canonical placement
Definition EMBCell.h:274
const EMBDetectorManager * getManager() const
The manager.
const EMBPresamplerHVManager & getPresamplerHVManager() const
Get the HV Manager (Presampler)
const EMBHVManager & getHVManager() const
Get the HV Manager.
const CellBinning & getEtaBinning() const
const CellBinning & getPhiBinning() const
const EMBHVDescriptor & getDescriptor() const
const EMBHVModule & getHVModule(unsigned int iSide, unsigned int iEta, unsigned int iPhi, unsigned int iSector) const
const EMBHVElectrode & getElectrode(unsigned int iElectrode) const
double getPhiMin() const
const CellPartitioning & getEtaPartitioning() const
const CellBinning & getPhiBinning() const
const EMBPresamplerHVModule & getHVModule(unsigned int iSide, unsigned int iEta, unsigned int iPhi) const
const EMBPresamplerHVDescriptor * getDescriptor() const
bool dPhi(const xAOD::TauJet &tau, const xAOD::CaloVertexedTopoCluster &cluster, float &out)
@ iPhi
Definition ParamDefs.h:47
setScale setgFexType iEta

◆ operator=()

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

◆ ~EMBCell()

EMBCell::~EMBCell ( )
privatevirtualdefault

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