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

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

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 }

◆ EMECCell() [2/2]

EMECCell::EMECCell ( const EMECCell right)
private

◆ ~EMECCell()

EMECCell::~EMECCell ( )
privatevirtualdefault

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 }

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

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

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

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

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

◆ getPresamplerHVModule()

const EMECPresamplerHVModule & EMECCell::getPresamplerHVModule ( ) const

@Get HVModule (presampler cells)

Definition at line 25 of file EMECCell.cxx.

25  {
26  return *getHVInfo().m_presamplerModule;
27 }

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

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

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

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

◆ getSamplingIndex()

unsigned int EMECCell::getSamplingIndex ( ) const
inline

The sampling index of this cell.

Definition at line 208 of file EMECCell.h.

209 {
210 
211  return getDescriptor()->getSamplingIndex();
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:
243  return getDescriptor()->getOffset(getEtaIndex());
244  case BACK:
246  default :
247  return 0;
248  };
249 
250 }

◆ initHV()

void EMECCell::initHV ( HVInfo hvinfo) const
private

Definition at line 41 of file EMECCell.cxx.

42 {
43  if (getSamplingIndex()==0) {
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 }

◆ operator=()

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

Friends And Related Function Documentation

◆ 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:
EMECDetDescr::getManager
const EMECDetectorManager * getManager() const
The manager.
Definition: EMECDetDescr.h:142
EMECPresamplerHVManager
This class provides direct access to information on the HV electrodes within the EMEC....
Definition: EMECPresamplerHVManager.h:36
EMECDetDescr::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: EMECDetDescr.h:124
EMECHVManager::getHVModule
const EMECHVModule & getHVModule(unsigned int iSide, unsigned int iEta, unsigned int iPhi, unsigned int iSector) const
Definition: EMECHVManager.cxx:222
EMECCell::getPhiMaxNominal
double getPhiMaxNominal() const
returns a nominal phi max in global coords; assume canonical placement
Definition: EMECCell.h:288
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:64
EMECCell::getPhiIndex
unsigned int getPhiIndex() const
The Phi Index of this Cell.
Definition: EMECCell.h:187
EMECCell::HVInfo::m_electrode
std::vector< const EMECHVElectrode * > m_electrode
Definition: EMECCell.h:160
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
EMECHVModule::getElectrode
const EMECHVElectrode & getElectrode(unsigned int iElectrode) const
Definition: EMECHVModule.cxx:81
InDetAccessor::phi0
@ phi0
Definition: InDetAccessor.h:33
EMECDetDescr::getPhiBinning
const CellBinning & getPhiBinning() const
The Binning in Phi.
Definition: EMECDetDescr.h:170
M_PI
#define M_PI
Definition: ActiveFraction.h:11
JetTiledMap::N
@ N
Definition: TiledEtaPhiMap.h:44
EMECHVDescriptor::getPhiBinning
const CellBinning & getPhiBinning() const
Definition: EMECHVDescriptor.h:21
EMECCell::m_hvinfo
CxxUtils::CachedValue< HVInfo > m_hvinfo
Definition: EMECCell.h:163
EMECCell::getEtaMin
double getEtaMin() const
Minimum Eta.
Definition: EMECCell.h:293
EMECCell::m_clockwork
unsigned int m_clockwork
Definition: EMECCell.h:165
EMECCell::getDescriptor
const EMECDetDescr * getDescriptor() const
Returns a pointer to the descriptor.
Definition: EMECCell.h:229
EMECCell::FRONT
@ FRONT
Definition: EMECCell.h:36
EMECCell::getEndcapIndex
unsigned int getEndcapIndex() const
The EndcapIndex of this Cell (0=negatiive, 1=positive)
Definition: EMECCell.h:194
EMECPresamplerHVManager::getHVModule
const EMECPresamplerHVModule & getHVModule(unsigned int iSide, unsigned int iPhi) const
Definition: EMECPresamplerHVManager.cxx:152
EMECHVModule
Definition: EMECHVModule.h:20
EMECDetDescr::getHalfLength
double getHalfLength(unsigned int etaIndex) const
gets the cell half-length in z.
Definition: EMECDetDescr.h:132
EMECDetectorManager::getRefToPresampler
double getRefToPresampler() const
This provides the distance in CLHEP::mm from the Active Endcap Presampler volume (center) to the refe...
Definition: EMECDetectorManager.h:306
EMECHVModule::INNER
@ INNER
Definition: EMECHVModule.h:22
EMECCell::CENTER
@ CENTER
Definition: EMECCell.h:36
EMECCell::getPhiLocalUpper
double getPhiLocalUpper() const
Gets the phi value at the "lower" edge of a cell.
Definition: EMECCell.h:275
lumiFormat.i
int i
Definition: lumiFormat.py:92
TauGNNUtils::Variables::Track::dPhi
bool dPhi(const xAOD::TauJet &tau, const xAOD::TauTrack &track, double &out)
Definition: TauGNNUtils.cxx:530
EMECCell::BACK
@ BACK
Definition: EMECCell.h:36
EMECDetectorManager::getHVManager
const EMECHVManager & getHVManager(EMECHVManager::IOType io) const
Get the HV Managers.
Definition: EMECDetectorManager.cxx:139
EMECCell::getHVInfo
const HVInfo & getHVInfo() const
Definition: EMECCell.cxx:30
EMECPresamplerHVManager::getPhiBinning
const CellBinning * getPhiBinning() const
Definition: EMECPresamplerHVManager.cxx:137
EMECDetectorManager::getRefToActive
double getRefToActive() const
This provides the distance in CLHEP::mm from the Active EMEC volume to the reference plane.
Definition: EMECDetectorManager.h:292
EMECCell::m_emecDetDescr
const EMECDetDescr * m_emecDetDescr
Definition: EMECCell.h:155
EMECDetDescr::getRegionIndex
unsigned int getRegionIndex() const
The region index.
Definition: EMECDetDescr.h:156
EMECDetDescr::getEtaBinning
const CellBinning & getEtaBinning() const
The Binning in Eta.
Definition: EMECDetDescr.h:177
EMECCell::HVInfo::m_presamplerModule
const EMECPresamplerHVModule * m_presamplerModule
Definition: EMECCell.h:161
EMECDetDescr::getRadialIndex
unsigned int getRadialIndex() const
The radial index of this cell (0=Outer Wheel, 1=Inner Wheel).
Definition: EMECDetDescr.h:163
EMECCell::getEtaIndex
unsigned int getEtaIndex() const
The eta index of this cell.
Definition: EMECCell.h:201
EMECCell::CELLPOS
CELLPOS
Definition: EMECCell.h:36
Trk::iPhi
@ iPhi
Definition: ParamDefs.h:53
EMECHVModule::OUTER
@ OUTER
Definition: EMECHVModule.h:22
EMECDetectorManager::getPresamplerHVManager
const EMECPresamplerHVManager & getPresamplerHVManager() const
Get the HV Manager (presampler)
Definition: EMECDetectorManager.cxx:153
EMECHVModule::IOType
IOType
Definition: EMECHVModule.h:22
EMECDetDescr::getSamplingIndex
unsigned int getSamplingIndex() const
The sampling index.
Definition: EMECDetDescr.h:149
EMECHVManager::getDescriptor
const EMECHVDescriptor & getDescriptor() const
Definition: EMECHVManager.cxx:197
JetTiledMap::NE
@ NE
Definition: TiledEtaPhiMap.h:44
EMECHVDescriptor::getEtaBinning
const CellPartitioning & getEtaBinning() const
Definition: EMECHVDescriptor.h:16
EMECCell::getEtaMax
double getEtaMax() const
Maximum Eta.
Definition: EMECCell.h:300
EMECHVElectrode
Definition: EMECHVElectrode.h:15
python.CaloScaleNoiseConfig.default
default
Definition: CaloScaleNoiseConfig.py:79
EMECHVManager
This class provides direct access to information on the HV electrodes within the EMEC....
Definition: EMECHVManager.h:36
EMECCell::initHV
void initHV(HVInfo &hvinfo) const
Definition: EMECCell.cxx:41
xAOD::iEta
setScale setgFexType iEta
Definition: gFexJetRoI_v1.cxx:74
EMECCell::getPhiLocalLower
double getPhiLocalLower() const
Gets the phi value at the "lower" edge of a cell.
Definition: EMECCell.h:268
EMECHVDescriptor::getSectorBinning
const CellBinning & getSectorBinning() const
Definition: EMECHVDescriptor.h:26
EMECCell::getSamplingIndex
unsigned int getSamplingIndex() const
The sampling index of this cell.
Definition: EMECCell.h:208
EMECCell::getZLocal
double getZLocal(CELLPOS position) const
Z for the cell at (FRONT,CENTER,BACK)
Definition: EMECCell.h:236
EMECCell::getPhiMinNominal
double getPhiMinNominal() const
returns a nominal phi min in global coords; assume canonical placement
Definition: EMECCell.h:283