ATLAS Offline Software
Classes | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
HECHVManager 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 <HECHVManager.h>

Collaboration diagram for HECHVManager:

Classes

class  Clockwork
 
class  HECHVData
 

Public Member Functions

 HECHVManager ()
 
 ~HECHVManager ()
 
const HECHVDescriptorgetDescriptor () const
 
const HECHVModulegetHVModule (unsigned int iSide, unsigned int iPhi, unsigned int iSampling) const
 
HECHVData getDataSim () const
 
HECHVData getData (const LArHVIdMapping &hvIdMapping, const std::vector< const CondAttrListCollection * > &attrLists) const
 
int hvLineNo (const HECHVSubgap &subgap, const LArHVIdMapping *hvIdMapping) const
 

Static Public Member Functions

static unsigned int beginSideIndex ()
 
static unsigned int endSideIndex ()
 
static unsigned int beginPhiIndex ()
 
static unsigned int endPhiIndex ()
 
static unsigned int beginSamplingIndex ()
 
static unsigned int endSamplingIndex ()
 

Private Types

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

Private Member Functions

HECHVData getData (const idfunc_t &idfunc, const std::vector< const CondAttrListCollection * > &attrLists) const
 
 HECHVManager (const HECHVManager &right)=delete
 
HECHVManageroperator= (const HECHVManager &right)=delete
 

Private Attributes

std::unique_ptr< const Clockworkm_c
 

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 35 of file HECHVManager.h.

Member Typedef Documentation

◆ idfunc_t

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

Definition at line 88 of file HECHVManager.h.

Constructor & Destructor Documentation

◆ HECHVManager() [1/2]

HECHVManager::HECHVManager ( )

Definition at line 154 of file HECHVManager.cxx.

155  : m_c (std::make_unique<Clockwork> (this))
156 {
157 }

◆ ~HECHVManager()

HECHVManager::~HECHVManager ( )
default

◆ HECHVManager() [2/2]

HECHVManager::HECHVManager ( const HECHVManager right)
privatedelete

Member Function Documentation

◆ beginPhiIndex()

unsigned int HECHVManager::beginPhiIndex ( )
static

Definition at line 174 of file HECHVManager.cxx.

175 {
176  return 0;
177 }

◆ beginSamplingIndex()

unsigned int HECHVManager::beginSamplingIndex ( )
static

Definition at line 184 of file HECHVManager.cxx.

185 {
186  return 0;
187 }

◆ beginSideIndex()

unsigned int HECHVManager::beginSideIndex ( )
static

Definition at line 164 of file HECHVManager.cxx.

165 {
166  return 0;
167 }

◆ endPhiIndex()

unsigned int HECHVManager::endPhiIndex ( )
static

Definition at line 179 of file HECHVManager.cxx.

180 {
181  return 32;
182 }

◆ endSamplingIndex()

unsigned int HECHVManager::endSamplingIndex ( )
static

Definition at line 189 of file HECHVManager.cxx.

190 {
191  return 4;
192 }

◆ endSideIndex()

unsigned int HECHVManager::endSideIndex ( )
static

Definition at line 169 of file HECHVManager.cxx.

170 {
171  return 2;
172 }

◆ getData() [1/2]

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

Definition at line 205 of file HECHVManager.cxx.

207 {
208  auto payload = std::make_unique<HECHVData::Payload>();
209  payload->m_payloadArray.reserve(2*32*4*4);
210  for (unsigned int i=0;i<1024;i++) {
211  payload->m_payloadArray[i].voltage = HECHVData::INVALID;
212  }
213 
214  for (const CondAttrListCollection* atrlistcol : attrLists) {
215 
216  for (CondAttrListCollection::const_iterator citr=atrlistcol->begin(); citr!=atrlistcol->end();++citr) {
217 
218  // Construct HWIdentifier
219  // 1. decode COOL Channel ID
220  unsigned int chanID = (*citr).first;
221  int cannode = chanID/1000;
222  int line = chanID%1000;
223 
224  // 2. Construct the identifier
225  HWIdentifier id = m_c->hvId->HVLineId(1,1,cannode,line);
226 
227  std::vector<HWIdentifier> electrodeIdVec = idfunc(id);
228 
229  for(size_t i=0;i<electrodeIdVec.size();i++) {
230  HWIdentifier& elecHWID = electrodeIdVec[i];
231 
232  int detector = m_c->elecId->detector(elecHWID);
233 
234  // check we are in HEC
235  if (detector != 4) {
236  continue;
237  }
238 
239  float voltage = HECHVData::INVALID;
240  if (!((*citr).second)["R_VMEAS"].isNull()) voltage = ((*citr).second)["R_VMEAS"].data<float>();
241  float current = 0.;
242  if (!((*citr).second)["R_IMEAS"].isNull()) current = ((*citr).second)["R_IMEAS"].data<float>();
243 
244 
245  unsigned int sideIndex=1-m_c->elecId->zside(elecHWID); // 0 for C side, 1 for A side, opposite to HV numbering
246  unsigned int phiIndex=m_c->elecId->module(elecHWID); // 0 to 31
247  unsigned int samplingIndex=m_c->elecId->hv_eta(elecHWID)-1; // 0 to 3
248  unsigned int subgapIndex=m_c->elecId->gap(elecHWID); // 0 to 3
249 
250  unsigned int index = 512*sideIndex+16*phiIndex+4*samplingIndex+subgapIndex;
251 
252 
253  if (index>1023) {
254  MsgStream msg (Athena::getMessageSvc(), "EMECHVManager");
255  msg << MSG::ERROR << "invalid index " << index << " side,phi,sampling,gap " << sideIndex << " " << phiIndex << " " << samplingIndex
256  << " " << subgapIndex << endmsg;
257  continue;
258  }
259 
260  payload->m_payloadArray[index].voltage=voltage;
261  payload->m_payloadArray[index].current=current;
262  payload->m_payloadArray[index].hvLineNo=chanID;
263  } // For (electrodeIdVec)
264  } // for (atrlistcol)
265  }
266 
267  return {std::move (payload)};
268 }

◆ getData() [2/2]

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

Definition at line 290 of file HECHVManager.cxx.

292 {
293  auto idfunc = [&] (HWIdentifier id) { return hvIdMapping.getLArElectrodeIDvec(id); };
294  return getData (idfunc, attrLists);
295 }

◆ getDataSim()

HECHVManager::HECHVData HECHVManager::getDataSim ( ) const

Definition at line 272 of file HECHVManager.cxx.

273 {
274  std::vector<const CondAttrListCollection*> attrLists;
275  ServiceHandle<StoreGateSvc> detStore ("DetectorStore", "EMBHVManager");
276  const CondAttrListCollection* atrlistcol = nullptr;
277  // Not a typo --- this folder has a lower-case l in the database...
278  if (detStore->retrieve(atrlistcol, "/LAR/DCS/HV/BARREl/I16").isSuccess()) {
279  attrLists.push_back (atrlistcol);
280  }
281  if (detStore->retrieve(atrlistcol, "/LAR/DCS/HV/BARREL/I8").isSuccess()) {
282  attrLists.push_back (atrlistcol);
283  }
284  return getData (SimIdFunc(), attrLists);
285 }

◆ getDescriptor()

const HECHVDescriptor & HECHVManager::getDescriptor ( ) const

Definition at line 159 of file HECHVManager.cxx.

160 {
161  return m_c->descriptor;
162 }

◆ getHVModule()

const HECHVModule & HECHVManager::getHVModule ( unsigned int  iSide,
unsigned int  iPhi,
unsigned int  iSampling 
) const

Definition at line 194 of file HECHVManager.cxx.

197 {
198  return *(m_c->moduleArray[iSide][iPhi][iSampling]);
199 }

◆ hvLineNo()

int HECHVManager::hvLineNo ( const HECHVSubgap subgap,
const LArHVIdMapping hvIdMapping 
) const

Definition at line 298 of file HECHVManager.cxx.

299  {
300  const HECHVModule& module = subgap.getModule();
301  int sideIndex = module.getSideIndex();
302  int phiIndex = module.getPhiIndex();
303  int samplingIndex = module.getSamplingIndex();
304  int subgapIndex = subgap.getSubgapIndex();
305 
306  // ________________________ Construct ElectrodeID ________________________________
307  int id_detector = 4;
308  int id_zside = 1-sideIndex;
309  int id_module = phiIndex;
310  int id_hv_phi = 0;
311  int id_hv_eta = samplingIndex+1;
312  int id_gap = subgapIndex;
313  int id_electrode{0};
314 
315  switch(samplingIndex) {
316  case 0:
317  id_electrode=1;
318  break;
319  case 1:
320  id_electrode=9;
321  break;
322  case 2:
323  id_electrode=25;
324  break;
325  case 3:
326  id_electrode=33;
327  break;
328  default:
329  throw std::runtime_error("Unexpected value for samplingIndex in HEC: " + std::to_string(samplingIndex));
330  }
331 
332  HWIdentifier elecHWID = m_c->elecId->ElectrodeId(id_detector
333  , id_zside
334  , id_module
335  , id_hv_phi
336  , id_hv_eta
337  , id_gap
338  , id_electrode);
339  // ________________________ ________________________________
340 
341  // Get LArHVLineID corresponding to a given LArElectrodeId
342  HWIdentifier id = hvIdMapping->getLArHVLineID(elecHWID);
343 
344  // Extract HV Line No
345  return m_c->hvId->can_node(id)*1000 + m_c->hvId->hv_line(id);
346 }

◆ operator=()

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

Member Data Documentation

◆ m_c

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

Definition at line 96 of file HECHVManager.h.


The documentation for this class was generated from the following files:
HECHVManager::m_c
std::unique_ptr< const Clockwork > m_c
Definition: HECHVManager.h:95
fillPileUpNoiseLumi.current
current
Definition: fillPileUpNoiseLumi.py:52
HECHVModule
Describes one HV Module within the HEC.
Definition: HECHVModule.h:21
checkFileSG.line
line
Definition: checkFileSG.py:75
index
Definition: index.py:1
HECHVManager::getData
HECHVData getData(const LArHVIdMapping &hvIdMapping, const std::vector< const CondAttrListCollection * > &attrLists) const
Definition: HECHVManager.cxx:290
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
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition: getMessageSvc.cxx:20
TRT::Hit::detector
@ detector
Definition: HitInfo.h:78
python.PyAthena.module
module
Definition: PyAthena.py:134
lumiFormat.i
int i
Definition: lumiFormat.py:92
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
HECHVSubgap::getModule
const HECHVModule & getModule() const
Definition: HECHVSubgap.cxx:34
HECHVSubgap::getSubgapIndex
unsigned int getSubgapIndex() const
Definition: HECHVSubgap.cxx:39
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:194
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
PixelModuleFeMask_create_db.payload
string payload
Definition: PixelModuleFeMask_create_db.py:69
Trk::iPhi
@ iPhi
Definition: ParamDefs.h:53
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:362
CondAttrListCollection::const_iterator
ChanAttrListMap::const_iterator const_iterator
Definition: CondAttrListCollection.h:63
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
LArHVIdMapping::getLArElectrodeIDvec
const std::vector< HWIdentifier > & getLArElectrodeIDvec(HWIdentifier &hvlineId) const
Return a vector of LArElectrodeID corresponding to a given LArHVLineID.
Definition: LArHVIdMapping.cxx:83
HECHVManager::HECHVData::INVALID
static constexpr double INVALID
Definition: HECHVManager.h:41
ServiceHandle< StoreGateSvc >