ATLAS Offline Software
Loading...
Searching...
No Matches
EMECCell Class Reference

A Cell of the electromagnetic endcap calorimeter readout geometry This class represents a single EMEC Cell. More...

#include <EMECCell.h>

Inheritance diagram for EMECCell:
Collaboration diagram for EMECCell:

Classes

struct  HVInfo

Public Types

enum  CELLPOS { FRONT , CENTER , BACK }

Public Member Functions

 EMECCell (unsigned int endcap, const EMECDetDescr *emecDescriptor, unsigned int eta, unsigned int phi)
 Constructor.
unsigned int getPhiIndex () const
 The Phi Index of this Cell.
unsigned int getEndcapIndex () const
 The EndcapIndex 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.
unsigned int getRadialIndex () const
 The radial index of this cell (0=Outer Wheel, 1=Inner Wheel).
const EMECDetDescrgetDescriptor () const
 Returns a pointer to the descriptor.
double getZLocal (CELLPOS position) const
 Z for the cell at (FRONT,CENTER,BACK)
double getRMinLocal (CELLPOS position) const
 RMin for the cell at (FRONT,CENTER,BACK)
double getRMaxLocal (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 "lower" 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.
unsigned int getNumElectrodes () const
 @Get num electrodes
const EMECHVElectrodegetElectrode (unsigned int i) const
 @Get electrode
const EMECPresamplerHVModulegetPresamplerHVModule () const
 @Get HVModule (presampler cells)

Private Member Functions

 EMECCell (const EMECCell &right)
virtual ~EMECCell ()
EMECCelloperator= (const EMECCell &right)
const HVInfogetHVInfo () const
void initHV (HVInfo &hvinfo) const

Private Attributes

const EMECDetDescrm_emecDetDescr
CxxUtils::CachedValue< HVInfom_hvinfo
unsigned int m_clockwork

Friends

class ImaginaryFriend

Detailed Description

A Cell of the electromagnetic endcap calorimeter readout geometry This class represents a single EMEC Cell.

These cells are specified by phi and eta boundaries, the latter which corresponds to an inner and outer radius computed from and effective focal length. Those numbers come from the database via the EMEC DetectorManager

Use the EMEC Cells through EMEC Cell Links please!!! This will free the memory used by the cell when the last link to the cell disappears.

Definition at line 31 of file EMECCell.h.

Member Enumeration Documentation

◆ CELLPOS

Enumerator
FRONT 
CENTER 
BACK 

Definition at line 36 of file EMECCell.h.

Constructor & Destructor Documentation

◆ EMECCell() [1/2]

EMECCell::EMECCell ( unsigned int endcap,
const EMECDetDescr * emecDescriptor,
unsigned int eta,
unsigned int phi )
inline

Constructor.

Definition at line 177 of file EMECCell.h.

179 :m_emecDetDescr(emecDescriptor),m_clockwork(phi | (eta<<8) | (endcap <<15) )
180{
181
182}
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
const EMECDetDescr * m_emecDetDescr
Definition EMECCell.h:155
unsigned int m_clockwork
Definition EMECCell.h:165

◆ EMECCell() [2/2]

EMECCell::EMECCell ( const EMECCell & right)
private

Member Function Documentation

◆ getDescriptor()

const EMECDetDescr * EMECCell::getDescriptor ( ) const
inline

Returns a pointer to the descriptor.

Definition at line 229 of file EMECCell.h.

230{
231
232 return m_emecDetDescr;
233
234}

◆ getElectrode()

const EMECHVElectrode & EMECCell::getElectrode ( unsigned int i) const

@Get electrode

Definition at line 21 of file EMECCell.cxx.

21 {
22 return *getHVInfo().m_electrode[i];
23}
const HVInfo & getHVInfo() const
Definition EMECCell.cxx:30
std::vector< const EMECHVElectrode * > m_electrode
Definition EMECCell.h:160

◆ getEndcapIndex()

unsigned int EMECCell::getEndcapIndex ( ) const
inline

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

Definition at line 194 of file EMECCell.h.

195{
196
197 return (m_clockwork & 0x00008000) >> 15;
198
199}

◆ getEtaIndex()

unsigned int EMECCell::getEtaIndex ( ) const
inline

The eta index of this cell.

Definition at line 201 of file EMECCell.h.

202{
203
204 return (m_clockwork & 0x00007F00) >> 8;
205
206}

◆ getEtaMax()

double EMECCell::getEtaMax ( ) const
inline

Maximum Eta.

Definition at line 300 of file EMECCell.h.

301{
302
303 return getDescriptor()->getEtaBinning().binUpper(getEtaIndex());
304
305}
const EMECDetDescr * getDescriptor() const
Returns a pointer to the descriptor.
Definition EMECCell.h:229
unsigned int getEtaIndex() const
The eta index of this cell.
Definition EMECCell.h:201
const CellBinning & getEtaBinning() const
The Binning in Eta.

◆ getEtaMin()

double EMECCell::getEtaMin ( ) const
inline

Minimum Eta.

Definition at line 293 of file EMECCell.h.

294{
295
296 return getDescriptor()->getEtaBinning().binLower(getEtaIndex());
297
298}

◆ getHVInfo()

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

Definition at line 30 of file EMECCell.cxx.

31{
32 if (!m_hvinfo.isValid()) {
33 HVInfo hvinfo;
34 initHV (hvinfo);
35 m_hvinfo.set (std::move (hvinfo));
36 }
37 return *m_hvinfo.ptr();
38}
CxxUtils::CachedValue< HVInfo > m_hvinfo
Definition EMECCell.h:163
void initHV(HVInfo &hvinfo) const
Definition EMECCell.cxx:41

◆ getNumElectrodes()

unsigned int EMECCell::getNumElectrodes ( ) const

@Get num electrodes

Definition at line 17 of file EMECCell.cxx.

17 {
18 return getHVInfo().m_electrode.size();
19}

◆ getPhiIndex()

unsigned int EMECCell::getPhiIndex ( ) const
inline

The Phi Index of this Cell.

Definition at line 187 of file EMECCell.h.

188{
189
190 return m_clockwork & 0x000000FF;
191
192}

◆ getPhiLocalLower()

double EMECCell::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 268 of file EMECCell.h.

269{
270
271 return getDescriptor()->getPhiBinning().binLower(getPhiIndex());
272
273}
unsigned int getPhiIndex() const
The Phi Index of this Cell.
Definition EMECCell.h:187
const CellBinning & getPhiBinning() const
The Binning in Phi.

◆ getPhiLocalUpper()

double EMECCell::getPhiLocalUpper ( ) 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 275 of file EMECCell.h.

276{
277
278 return getDescriptor()->getPhiBinning().binUpper(getPhiIndex());
279
280}

◆ getPhiMaxNominal()

double EMECCell::getPhiMaxNominal ( ) const
inline

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

Definition at line 288 of file EMECCell.h.

289{
291}
#define M_PI
unsigned int getEndcapIndex() const
The EndcapIndex of this Cell (0=negatiive, 1=positive)
Definition EMECCell.h:194
double getPhiLocalUpper() const
Gets the phi value at the "lower" edge of a cell.
Definition EMECCell.h:275

◆ getPhiMinNominal()

double EMECCell::getPhiMinNominal ( ) const
inline

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

Definition at line 283 of file EMECCell.h.

284{
286}
double getPhiLocalLower() const
Gets the phi value at the "lower" edge of a cell.
Definition EMECCell.h:268

◆ getPresamplerHVModule()

const EMECPresamplerHVModule & EMECCell::getPresamplerHVModule ( ) const

@Get HVModule (presampler cells)

Definition at line 25 of file EMECCell.cxx.

25 {
27}
const EMECPresamplerHVModule * m_presamplerModule
Definition EMECCell.h:161

◆ getRadialIndex()

unsigned int EMECCell::getRadialIndex ( ) const
inline

The radial index of this cell (0=Outer Wheel, 1=Inner Wheel).

Definition at line 222 of file EMECCell.h.

223{
224
225 return getDescriptor()->getRadialIndex();
226
227}
unsigned int getRadialIndex() const
The radial index of this cell (0=Outer Wheel, 1=Inner Wheel).

◆ getRegionIndex()

unsigned int EMECCell::getRegionIndex ( ) const
inline

The region index of this cell.

Definition at line 215 of file EMECCell.h.

216{
217
218 return getDescriptor()->getRegionIndex();
219
220}
unsigned int getRegionIndex() const
The region index.

◆ getRMaxLocal()

double EMECCell::getRMaxLocal ( CELLPOS position) const
inline

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

Definition at line 260 of file EMECCell.h.

261{
262
264 return (getDescriptor()->getManager()->getFocalToRef()+toActive+getZLocal(position))/sinh(getEtaMin());
265
266}
double getEtaMin() const
Minimum Eta.
Definition EMECCell.h:293
double getZLocal(CELLPOS position) const
Z for the cell at (FRONT,CENTER,BACK)
Definition EMECCell.h:236
unsigned int getSamplingIndex() const
The sampling index.
const EMECDetectorManager * getManager() const
The manager.
double getRefToActive() const
This provides the distance in CLHEP::mm from the Active EMEC volume to the reference plane.
double getRefToPresampler() const
This provides the distance in CLHEP::mm from the Active Endcap Presampler volume (center) to the refe...

◆ getRMinLocal()

double EMECCell::getRMinLocal ( CELLPOS position) const
inline

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

Definition at line 252 of file EMECCell.h.

253{
254
256 return (getDescriptor()->getManager()->getFocalToRef()+toActive+getZLocal(position))/sinh(getEtaMax());
257
258}
double getEtaMax() const
Maximum Eta.
Definition EMECCell.h:300

◆ getSamplingIndex()

unsigned int EMECCell::getSamplingIndex ( ) const
inline

The sampling index of this cell.

Definition at line 208 of file EMECCell.h.

209{
210
212
213}

◆ getZLocal()

double EMECCell::getZLocal ( CELLPOS position) const
inline

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

Definition at line 236 of file EMECCell.h.

237{
238
239 switch (position) {
240 case FRONT:
242 case CENTER:
244 case BACK:
246 default :
247 return 0;
248 };
249
250}
double getHalfLength(unsigned int etaIndex) const
gets the cell half-length in z.
double getOffset(unsigned int etaIndex) const
Gets the offset position (cell centers with respect to the position of the front of the active volume...

◆ initHV()

void EMECCell::initHV ( HVInfo & hvinfo) const
private

Definition at line 41 of file EMECCell.cxx.

42{
43 if (getSamplingIndex()==0) {
44 const EMECPresamplerHVManager& presamplerHVManager=getDescriptor()->getManager()->getPresamplerHVManager();
45 double phiUpper = getPhiMaxNominal();
46 double phiLower = getPhiMinNominal();
47 double phi=fabs(phiUpper+phiLower)/2.0;
48
49 const CellBinning * phiBinning=presamplerHVManager.getPhiBinning();
50 unsigned int iPhi = int((phi - phiBinning->getStart())/phiBinning->getDelta()) + phiBinning->getFirstDivisionNumber();
51 unsigned int iSide=getEndcapIndex();
52 hvinfo.m_presamplerModule = &(presamplerHVManager.getHVModule(iSide,iPhi));
53
54 }
55 else {
56
57 double eta=fabs(getEtaMax()+getEtaMin())/2.0;
59 //std::cout << "in EMECCell::initHV() eta,type " << eta << " " << iotype << std::endl;
60
61 const EMECHVManager& hvManager=getDescriptor()->getManager()->getHVManager(iotype);
62 double phiLower = getPhiMinNominal();
63 double phiUpper = getPhiMaxNominal();
64 double phiMid=(phiLower+phiUpper)/2.0;
65
66 const CellPartitioning & etaBinning=hvManager.getDescriptor().getEtaBinning();
67 const CellBinning & phiBinning=hvManager.getDescriptor().getPhiBinning();
68 const CellBinning & sectorBinning=hvManager.getDescriptor().getSectorBinning();
69 unsigned int iEta=0;
70 for (unsigned int i=etaBinning.getFirstDivisionNumber();i<=etaBinning.getFirstDivisionNumber()+etaBinning.getNumDivisions();i++) {
71 if (eta>=etaBinning.binLower(i) && eta<=etaBinning.binUpper(i)) {
72 iEta=i;
73 }
74 }
75 unsigned int iPhi = int((phiMid - phiBinning.getStart())/phiBinning.getDelta()) + phiBinning.getFirstDivisionNumber();
76
77 double N = iotype==EMECHVModule::OUTER ? 768:256;
78
79 unsigned int iSector = int((phiMid - phiBinning.binLower(iPhi) - sectorBinning.getStart())/sectorBinning.getDelta()) + sectorBinning.getFirstDivisionNumber();
80 double phiSectorStart = phiBinning.binLower(iPhi) +iSector*sectorBinning.getDelta();
81
82 unsigned int iSide=getEndcapIndex();
83
84 double phi0 = (iSide==1) ? M_PI/N : -(M_PI)/N; // delta phi between first absorber and electrode at phi=0
85
86 const double inv_2pi = M_1_PI/2;
87 unsigned int iOffset = int(N*(phiLower-phiSectorStart + phi0)*inv_2pi +0.5);
88 double dPhi = fabs((phiUpper-phiLower));
89 unsigned int NE =int(dPhi*inv_2pi*N+0.5);
90
91 //std::cout << " iSide,iEta,iPhi,iSector " << iSide << " " << iEta << " " << iPhi << " " << iSector << std::endl;
92 //std::cout << " phi1,phi2 cell, phi1 sector " << phiLower << " " << phiUpper << " " << phiSectorStart << std::endl;
93 //std::cout << " first electrode " << iOffset << " " << " Nelectrodes " << NE << std::endl;
94
95
96
97 const EMECHVModule& hvMod = hvManager.getHVModule(iSide,iEta,iPhi,iSector);
98 //std::cout << " hvMod << " << hvMod << std::endl;
99 for (unsigned int iElectrode=iOffset;iElectrode<iOffset+NE;iElectrode++) {
100 const EMECHVElectrode& hvElec = hvMod.getElectrode(iElectrode);
101 hvinfo.m_electrode.push_back(&hvElec);
102 }
103
104 }
105}
double getPhiMaxNominal() const
returns a nominal phi max in global coords; assume canonical placement
Definition EMECCell.h:288
unsigned int getSamplingIndex() const
The sampling index of this cell.
Definition EMECCell.h:208
double getPhiMinNominal() const
returns a nominal phi min in global coords; assume canonical placement
Definition EMECCell.h:283
const EMECPresamplerHVManager & getPresamplerHVManager() const
Get the HV Manager (presampler)
const EMECHVManager & getHVManager(EMECHVManager::IOType io) const
Get the HV Managers.
const CellPartitioning & getEtaBinning() const
const CellBinning & getSectorBinning() const
const CellBinning & getPhiBinning() const
const EMECHVDescriptor & getDescriptor() const
const EMECHVModule & getHVModule(unsigned int iSide, unsigned int iEta, unsigned int iPhi, unsigned int iSector) const
const EMECHVElectrode & getElectrode(unsigned int iElectrode) const
const CellBinning * getPhiBinning() const
const EMECPresamplerHVModule & getHVModule(unsigned int iSide, unsigned int iPhi) const
bool dPhi(const xAOD::TauJet &tau, const xAOD::CaloVertexedTopoCluster &cluster, float &out)
@ iPhi
Definition ParamDefs.h:47
setScale setgFexType iEta

◆ operator=()

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

◆ ~EMECCell()

EMECCell::~EMECCell ( )
privatevirtualdefault

◆ ImaginaryFriend

friend class ImaginaryFriend
friend

Definition at line 168 of file EMECCell.h.

Member Data Documentation

◆ m_clockwork

unsigned int EMECCell::m_clockwork
private

Definition at line 165 of file EMECCell.h.

◆ m_emecDetDescr

const EMECDetDescr* EMECCell::m_emecDetDescr
private

Definition at line 155 of file EMECCell.h.

◆ m_hvinfo

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

Definition at line 163 of file EMECCell.h.


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