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

This class provides direct access to information on the HV electrodes within the barrels. The information may be accessed either directly or iteratively. Direct access is provided by the getHVModule() method. Iterative access is by looping over valid side, eta, phi, and sector indices to retrieve a HV module. From the high voltage modules one can obtain a list of electrodes (iteratively or directly). More...

#include <EMBPresamplerHVManager.h>

Collaboration diagram for EMBPresamplerHVManager:

Classes

class  Clockwork
 
class  EMBPresamplerHVData
 

Public Member Functions

 EMBPresamplerHVManager ()
 
 ~EMBPresamplerHVManager ()
 
const EMBPresamplerHVDescriptorgetDescriptor () const
 
unsigned int beginPhiIndex () const
 
unsigned int endPhiIndex () const
 
unsigned int beginEtaIndex () const
 
unsigned int endEtaIndex () const
 
const EMBPresamplerHVModulegetHVModule (unsigned int iSide, unsigned int iEta, unsigned int iPhi) const
 
EMBPresamplerHVData getData (const LArHVIdMapping &hvIdMapping, const std::vector< const CondAttrListCollection * > &attrLists) const
 
int hvLineNo (const EMBPresamplerHVModule &module, int gap, const LArHVIdMapping *hvIdMapping) const
 

Static Public Member Functions

static unsigned int beginSideIndex ()
 
static unsigned int endSideIndex ()
 

Private Types

using idfunc_t = std::function< std::vector< HWIdentifier >(HWIdentifier)>
 

Private Member Functions

EMBPresamplerHVData getData (const idfunc_t &idfunc, const std::vector< const CondAttrListCollection * > &attrLists) const
 
 EMBPresamplerHVManager (const EMBPresamplerHVManager &right)=delete
 
EMBPresamplerHVManageroperator= (const EMBPresamplerHVManager &right)=delete
 

Private Attributes

std::unique_ptr< const Clockworkm_c
 

Friends

class ImaginaryFriend
 

Detailed Description

This class provides direct access to information on the HV electrodes within the barrels. The information may be accessed either directly or iteratively. Direct access is provided by the getHVModule() method. Iterative access is by looping over valid side, eta, phi, and sector indices to retrieve a HV module. From the high voltage modules one can obtain a list of electrodes (iteratively or directly).

The manager owns the pointers to the HV Modules.

Definition at line 36 of file EMBPresamplerHVManager.h.

Member Typedef Documentation

◆ idfunc_t

using EMBPresamplerHVManager::idfunc_t = std::function<std::vector<HWIdentifier>(HWIdentifier)>
private

Definition at line 87 of file EMBPresamplerHVManager.h.

Constructor & Destructor Documentation

◆ EMBPresamplerHVManager() [1/2]

EMBPresamplerHVManager::EMBPresamplerHVManager ( )

Definition at line 139 of file EMBPresamplerHVManager.cxx.

140  : m_c (std::make_unique<Clockwork> (this))
141 {
142 }

◆ ~EMBPresamplerHVManager()

EMBPresamplerHVManager::~EMBPresamplerHVManager ( )
default

◆ EMBPresamplerHVManager() [2/2]

EMBPresamplerHVManager::EMBPresamplerHVManager ( const EMBPresamplerHVManager right)
privatedelete

Member Function Documentation

◆ beginEtaIndex()

unsigned int EMBPresamplerHVManager::beginEtaIndex ( ) const

Definition at line 162 of file EMBPresamplerHVManager.cxx.

163 {
164  return m_c->descriptor->getEtaPartitioning().getFirstDivisionNumber();
165 }

◆ beginPhiIndex()

unsigned int EMBPresamplerHVManager::beginPhiIndex ( ) const

Definition at line 152 of file EMBPresamplerHVManager.cxx.

153 {
154  return m_c->descriptor->getPhiBinning().getFirstDivisionNumber();
155 }

◆ beginSideIndex()

unsigned int EMBPresamplerHVManager::beginSideIndex ( )
static

Definition at line 177 of file EMBPresamplerHVManager.cxx.

178 {
179  return 0;
180 }

◆ endEtaIndex()

unsigned int EMBPresamplerHVManager::endEtaIndex ( ) const

Definition at line 167 of file EMBPresamplerHVManager.cxx.

168 {
169  return m_c->descriptor->getEtaPartitioning().getFirstDivisionNumber() + m_c->descriptor->getEtaPartitioning().getNumDivisions();
170 }

◆ endPhiIndex()

unsigned int EMBPresamplerHVManager::endPhiIndex ( ) const

Definition at line 157 of file EMBPresamplerHVManager.cxx.

158 {
159  return m_c->descriptor->getPhiBinning().getFirstDivisionNumber() + m_c->descriptor->getPhiBinning().getNumDivisions();
160 }

◆ endSideIndex()

unsigned int EMBPresamplerHVManager::endSideIndex ( )
static

Definition at line 182 of file EMBPresamplerHVManager.cxx.

183 {
184  return 2;
185 }

◆ getData() [1/2]

EMBPresamplerHVManager::EMBPresamplerHVData EMBPresamplerHVManager::getData ( const idfunc_t idfunc,
const std::vector< const CondAttrListCollection * > &  attrLists 
) const
private

Definition at line 189 of file EMBPresamplerHVManager.cxx.

191 {
192  auto payload = std::make_unique<EMBPresamplerHVData::Payload>();
193  payload->m_payloadArray.reserve(2*4*32);
194 
195  for (int i=0;i<256;i++) {
196  payload->m_payloadArray[i].voltage[0] = EMBPresamplerHVData::INVALID;
197  payload->m_payloadArray[i].voltage[1] = EMBPresamplerHVData::INVALID;
198  }
199 
200  for (const CondAttrListCollection* atrlistcol : attrLists) {
201 
202  for (CondAttrListCollection::const_iterator citr=atrlistcol->begin(); citr!=atrlistcol->end();++citr) {
203 
204  // Construct HWIdentifier
205  // 1. decode COOL Channel ID
206  unsigned int chanID = (*citr).first;
207  int cannode = chanID/1000;
208  int line = chanID%1000;
209 
210  // 2. Construct the identifier
211  HWIdentifier id = m_c->hvId->HVLineId(1,1,cannode,line);
212 
213  std::vector<HWIdentifier> electrodeIdVec = idfunc(id);
214 
215 
216  for(size_t i=0;i<electrodeIdVec.size();i++)
217  {
218  HWIdentifier& elecHWID = electrodeIdVec[i];
219  int detector = m_c->elecId->detector(elecHWID);
220  if (detector==1) {
221 
222 // side in standard offline 0 for z<0 (C) 1 for z>0 (A)
223 // in electrode numbering, this is the opposite (0 for A and 1 for C)
224  unsigned int sideIndex=1-m_c->elecId->zside(elecHWID);
225 // eta index, no trouble
226  unsigned int etaIndex=m_c->elecId->hv_eta(elecHWID)-1;
227 // phi index
228 // offline 0 to 2pi in 2pi/32 bins (2 presampler cells per phi_HV)
229 // module from elecID : 0 to 31
230 // phi 0 pi 2pi
231 // M0 M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 M12 M13 M14 M15 M0
232 // FT 0 -1 0 -1 0 -1
233 // Module 0 1 2 3 4 5 6 7 9 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 39 30 31
234 // offline phi 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
235  unsigned int phiIndex;
236  if (sideIndex==1) {
237  phiIndex=m_c->elecId->module(elecHWID);
238  }
239 // module numbering on the C side 0 around phi=pi, running backwards
240 // phi 0 pi 2pi
241 // P8 P7 P6 P5 P4 P3 P2 P1 P0 P15 P14 P13 P12 P11 P10 P9 P8
242 // FT -1 0 0 -1 0 -1 0
243 // Module 15 14 9 8 7 6 5 4 3 2 1 0 31 30 29 38 27 26 25 24 23 22 21 20 19 18 17 16
244 // offline phi 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
245  else {
246  int imodule=m_c->elecId->module(elecHWID);
247  if (imodule<16) phiIndex = 15 - imodule;
248  else phiIndex = 47 - imodule;
249  }
250 
251  unsigned int index = 128*sideIndex+32*etaIndex+phiIndex;
252 
253  unsigned int gapIndex=m_c->elecId->gap(elecHWID);
254  if (sideIndex==0) gapIndex=1-gapIndex;
255 
256 
257  float voltage = EMBPresamplerHVData::INVALID;
258  if (!((*citr).second)["R_VMEAS"].isNull()) voltage = ((*citr).second)["R_VMEAS"].data<float>();
259  float current = 0.;
260  if (!((*citr).second)["R_IMEAS"].isNull()) current = ((*citr).second)["R_IMEAS"].data<float>();
261 
262  payload->m_payloadArray[index].voltage[gapIndex]=voltage;
263  payload->m_payloadArray[index].current[gapIndex]=current;
264  payload->m_payloadArray[index].hvLineNo[gapIndex]=chanID;
265  }
266  }
267  }
268  }
269 
270  return {std::move (payload)};
271 }

◆ getData() [2/2]

EMBPresamplerHVManager::EMBPresamplerHVData EMBPresamplerHVManager::getData ( const LArHVIdMapping hvIdMapping,
const std::vector< const CondAttrListCollection * > &  attrLists 
) const

Definition at line 276 of file EMBPresamplerHVManager.cxx.

278 {
279  auto idfunc = [&] (HWIdentifier id) { return hvIdMapping.getLArElectrodeIDvec(id); };
280  return getData (idfunc, attrLists);
281 }

◆ getDescriptor()

const EMBPresamplerHVDescriptor * EMBPresamplerHVManager::getDescriptor ( ) const

Definition at line 147 of file EMBPresamplerHVManager.cxx.

148 {
149  return m_c->descriptor.get();
150 }

◆ getHVModule()

const EMBPresamplerHVModule & EMBPresamplerHVManager::getHVModule ( unsigned int  iSide,
unsigned int  iEta,
unsigned int  iPhi 
) const

Definition at line 172 of file EMBPresamplerHVManager.cxx.

173 {
174  return *(m_c->moduleArray[iSide][iEta][iPhi]);
175 }

◆ hvLineNo()

int EMBPresamplerHVManager::hvLineNo ( const EMBPresamplerHVModule module,
int  gap,
const LArHVIdMapping hvIdMapping 
) const

Definition at line 284 of file EMBPresamplerHVManager.cxx.

286  {
287  int sideIndex = module.getSideIndex();
288  int phiIndex = module.getPhiIndex();
289  int etaIndex = module.getEtaIndex();
290 
291  // ________________________ Construct ElectrodeID ________________________________
292  int id_detector = 1;
293  int id_zside = 1 - sideIndex;
294  int id_module{0};
295  if(sideIndex==1){
296  id_module = phiIndex;
297  }
298  else {
299  if(phiIndex<16) {
300  id_module = 15 - phiIndex;
301  }
302  else {
303  id_module = 47 - phiIndex;
304  }
305  }
306  int id_hv_phi{0};
307  int id_hv_eta = etaIndex + 1;
308  int id_gap = sideIndex==0 ? 1-gap : gap;
309  int id_electrode{0};
310 
311  HWIdentifier elecHWID = m_c->elecId->ElectrodeId(id_detector
312  ,id_zside
313  ,id_module
314  ,id_hv_phi
315  ,id_hv_eta
316  ,id_gap
317  ,id_electrode);
318  // ________________________ ________________________________
319 
320  // Get LArHVLineID corresponding to a given LArElectrodeId
321  HWIdentifier id = hvIdMapping->getLArHVLineID(elecHWID);
322 
323  // Extract HV Line No
324  return m_c->hvId->can_node(id)*1000 + m_c->hvId->hv_line(id);
325 }

◆ operator=()

EMBPresamplerHVManager& EMBPresamplerHVManager::operator= ( const EMBPresamplerHVManager right)
privatedelete

Friends And Related Function Documentation

◆ ImaginaryFriend

friend class ImaginaryFriend
friend

Definition at line 95 of file EMBPresamplerHVManager.h.

Member Data Documentation

◆ m_c

std::unique_ptr<const Clockwork> EMBPresamplerHVManager::m_c
private

Definition at line 97 of file EMBPresamplerHVManager.h.


The documentation for this class was generated from the following files:
fillPileUpNoiseLumi.current
current
Definition: fillPileUpNoiseLumi.py:52
checkFileSG.line
line
Definition: checkFileSG.py:75
index
Definition: index.py:1
TRTCalib_cfilter.detector
detector
Definition: TRTCalib_cfilter.py:241
EMBPresamplerHVManager::m_c
std::unique_ptr< const Clockwork > m_c
Definition: EMBPresamplerHVManager.h:96
LArHVIdMapping::getLArHVLineID
const HWIdentifier getLArHVLineID(HWIdentifier &electrodeId) const
Return the LArHVLineID corresponding to a given LArElectrodeId.
Definition: LArHVIdMapping.cxx:22
HWIdentifier
Definition: HWIdentifier.h:13
CondAttrListCollection
This class is a collection of AttributeLists where each one is associated with a channel number....
Definition: CondAttrListCollection.h:52
CaloSwCorrections.gap
def gap(flags, cells_name, *args, **kw)
Definition: CaloSwCorrections.py:212
python.PyAthena.module
module
Definition: PyAthena.py:131
lumiFormat.i
int i
Definition: lumiFormat.py:85
EMBPresamplerHVManager::getData
EMBPresamplerHVData getData(const LArHVIdMapping &hvIdMapping, const std::vector< const CondAttrListCollection * > &attrLists) const
Definition: EMBPresamplerHVManager.cxx:276
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:220
PixelModuleFeMask_create_db.payload
string payload
Definition: PixelModuleFeMask_create_db.py:69
Trk::iPhi
@ iPhi
Definition: ParamDefs.h:47
eflowRec::phiIndex
unsigned int phiIndex(float phi, float binsize)
calculate phi index for a given phi
Definition: EtaPhiLUT.cxx:23
DeMoScan.index
string index
Definition: DeMoScan.py:364
CondAttrListCollection::const_iterator
ChanAttrListMap::const_iterator const_iterator
Definition: CondAttrListCollection.h:63
EMBPresamplerHVManager::EMBPresamplerHVData::INVALID
static constexpr double INVALID
Definition: EMBPresamplerHVManager.h:42
xAOD::iEta
setScale setgFexType iEta
Definition: gFexJetRoI_v1.cxx:74
LArHVIdMapping::getLArElectrodeIDvec
const std::vector< HWIdentifier > & getLArElectrodeIDvec(HWIdentifier &hvlineId) const
Return a vector of LArElectrodeID corresponding to a given LArHVLineID.
Definition: LArHVIdMapping.cxx:83