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

This class provides direct access to information on the HV electrodes within the barrels. 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, HWIdentifier *hvlId=nullptr) 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 88 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}
std::unique_ptr< const Clockwork > m_c

◆ ~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 const 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}
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
ChanAttrListMap::const_iterator const_iterator
str index
Definition DeMoScan.py:362
unsigned int phiIndex(float phi, float binsize)
calculate phi index for a given phi
Definition EtaPhiLUT.cxx:23

◆ 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) -> const std::vector<HWIdentifier>
280 { return hvIdMapping.getLArElectrodeIDvec(id); };
281 return getData (idfunc, attrLists);
282}
EMBPresamplerHVData getData(const LArHVIdMapping &hvIdMapping, const std::vector< const CondAttrListCollection * > &attrLists) const
const std::vector< HWIdentifier > & getLArElectrodeIDvec(HWIdentifier &hvlineId) const
Return a vector of LArElectrodeID corresponding to a given LArHVLineID.

◆ 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}
@ iPhi
Definition ParamDefs.h:47
setScale setgFexType iEta

◆ hvLineNo()

int EMBPresamplerHVManager::hvLineNo ( const EMBPresamplerHVModule & module,
int gap,
const LArHVIdMapping * hvIdMapping,
HWIdentifier * hvlId = nullptr ) const

Definition at line 285 of file EMBPresamplerHVManager.cxx.

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

◆ operator=()

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

◆ ImaginaryFriend

friend class ImaginaryFriend
friend

Definition at line 96 of file EMBPresamplerHVManager.h.

Member Data Documentation

◆ m_c

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

Definition at line 98 of file EMBPresamplerHVManager.h.


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