ATLAS Offline Software
HECCell.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 #include "LArHV/HECHVManager.h"
7 #include "LArHV/HECHVModule.h"
9 
11 = default;
12 
13 
14 unsigned int HECCell::getNumSubgaps() const {
15  return getSubgaps().size();
16 }
17 
18 const HECHVSubgap& HECCell::getSubgap (unsigned int i) const {
19  return *getSubgaps()[i];
20 }
21 
22 
23 const std::vector<const HECHVSubgap*>&
25 {
26  if (!m_subgaps.isValid()) {
27  std::vector<const HECHVSubgap*> subgaps;
28  initHV (subgaps);
29  m_subgaps.set (std::move (subgaps));
30  }
31  return *m_subgaps.ptr();
32 }
33 
34 
35 void HECCell::initHV (std::vector<const HECHVSubgap*>& subgaps) const
36 {
37  const HECHVManager& hvManager=getDescriptor()->getManager()->getHVManager();
38 
39 
40  unsigned int iSide=getEndcapIndex();
41 
42  double phiUpper = getPhiMaxNominal();
43  double phiLower = getPhiMinNominal();
44  double phi=fabs(phiUpper+phiLower)/2.0;
45  const CellBinning & phiBinning=hvManager.getDescriptor().getPhiBinning();
46  unsigned int iPhi = int((phi - phiBinning.getStart())/phiBinning.getDelta()) + phiBinning.getFirstDivisionNumber();
47 
48  unsigned int iSampling=getSamplingIndex();
49 
50  const HECHVModule& hvMod = hvManager.getHVModule(iSide,iPhi,iSampling);
51  for (unsigned int iSubgap=0;iSubgap<4;iSubgap++) {
52  const HECHVSubgap& hvElec = hvMod.getSubgap(iSubgap);
53  subgaps.push_back(&hvElec);
54  }
55 }
56 
57 
HECHVModule
Describes one HV Module within the HEC.
Definition: HECHVModule.h:21
CxxUtils::CachedValue::ptr
const T * ptr() const
Return a pointer to the cached value.
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:64
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
CxxUtils::CachedValue::isValid
bool isValid() const
Test to see if the value is valid.
HECCell::getDescriptor
const HECDetDescr * getDescriptor() const
Returns a pointer to the descriptor.
Definition: HECCell.h:372
HECHVDescriptor.h
HECHVManager.h
HECCell::~HECCell
virtual ~HECCell()
HECCell::getEndcapIndex
unsigned int getEndcapIndex() const
The EndcapIndex of this Cell (0=negative, 1=positive)
Definition: HECCell.h:233
HECCell::getPhiMinNominal
double getPhiMinNominal() const
returns a nominal phi min in global coords; assume canonical placement
Definition: HECCell.h:387
lumiFormat.i
int i
Definition: lumiFormat.py:92
HECHVModule::getSubgap
const HECHVSubgap & getSubgap(unsigned int iElectrode) const
Definition: HECHVModule.cxx:69
HECCell::m_subgaps
CxxUtils::CachedValue< std::vector< const HECHVSubgap * > > m_subgaps
Cache of subgaps.
Definition: HECCell.h:197
HECCell::getSubgap
const HECHVSubgap & getSubgap(unsigned int i) const
@Get subgap
Definition: HECCell.cxx:18
HECDetDescr::getManager
const HECDetectorManager * getManager() const
The manager.
Definition: HECDetDescr.h:194
HECHVManager::getDescriptor
const HECHVDescriptor & getDescriptor() const
Definition: HECHVManager.cxx:159
HECCell::getSamplingIndex
unsigned int getSamplingIndex() const
The sampling index of this cell.
Definition: HECCell.h:248
HECCell::getPhiMaxNominal
double getPhiMaxNominal() const
returns a nominal phi max in global coords; assume canonical placement
Definition: HECCell.h:392
HECCell::getSubgaps
const std::vector< const HECHVSubgap * > & getSubgaps() const
Definition: HECCell.cxx:24
CxxUtils::CachedValue::set
void set(const T &val) const
Set the value, assuming it is currently invalid.
HECCell::initHV
void initHV(std::vector< const HECHVSubgap * > &subgaps) const
Definition: HECCell.cxx:35
Trk::iPhi
@ iPhi
Definition: ParamDefs.h:53
HECHVManager
This class provides direct access to information on the HV electrodes within the barrels....
Definition: HECHVManager.h:36
HECHVModule.h
HECHVDescriptor::getPhiBinning
const CellBinning & getPhiBinning() const
Definition: HECHVDescriptor.h:16
HECDetectorManager::getHVManager
const HECHVManager & getHVManager() const
Get the HV Manager.
Definition: HECDetectorManager.cxx:181
HECCell::getNumSubgaps
unsigned int getNumSubgaps() const
@Get num subgaps
Definition: HECCell.cxx:14
HECCell.h
HECHVSubgap
Definition: HECHVSubgap.h:15
HECHVManager::getHVModule
const HECHVModule & getHVModule(unsigned int iSide, unsigned int iPhi, unsigned int iSampling) const
Definition: HECHVManager.cxx:194