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

Collaboration diagram for FCALHVManager:

Classes

class  Clockwork
 
class  FCALHVData
 

Public Member Functions

 FCALHVManager ()
 
 ~FCALHVManager ()
 
const FCALHVModulegetHVModule (unsigned int iSide, unsigned int iSector, unsigned int iSampling) const
 
FCALHVData getDataSim () const
 
FCALHVData getData (const LArHVIdMapping &hvIdMapping, const std::vector< const CondAttrListCollection * > &attrLists) const
 
int hvLineNo (const FCALHVLine &line, const LArHVIdMapping *hvIdMapping) const
 

Static Public Member Functions

static unsigned int beginSideIndex ()
 
static unsigned int endSideIndex ()
 
static unsigned int beginSectorIndex (unsigned int iSampling)
 
static unsigned int endSectorIndex (unsigned int iSampling)
 
static unsigned int beginSamplingIndex ()
 
static unsigned int endSamplingIndex ()
 

Private Types

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

Private Member Functions

FCALHVData getData (const idfunc_t &idfunc, const std::vector< const CondAttrListCollection * > &attrLists) const
 
 FCALHVManager (const FCALHVManager &right)=delete
 
FCALHVManageroperator= (const FCALHVManager &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 34 of file FCALHVManager.h.

Member Typedef Documentation

◆ idfunc_t

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

Definition at line 85 of file FCALHVManager.h.

Constructor & Destructor Documentation

◆ FCALHVManager() [1/2]

FCALHVManager::FCALHVManager ( )

Definition at line 149 of file FCALHVManager.cxx.

150  : m_c (std::make_unique<Clockwork> (this))
151 {
152 }

◆ ~FCALHVManager()

FCALHVManager::~FCALHVManager ( )
default

◆ FCALHVManager() [2/2]

FCALHVManager::FCALHVManager ( const FCALHVManager right)
privatedelete

Member Function Documentation

◆ beginSamplingIndex()

unsigned int FCALHVManager::beginSamplingIndex ( )
static

Definition at line 180 of file FCALHVManager.cxx.

181 {
182  return 0;
183 }

◆ beginSectorIndex()

unsigned int FCALHVManager::beginSectorIndex ( unsigned int  iSampling)
static

Definition at line 167 of file FCALHVManager.cxx.

168 {
169  return 0;
170 }

◆ beginSideIndex()

unsigned int FCALHVManager::beginSideIndex ( )
static

Definition at line 157 of file FCALHVManager.cxx.

158 {
159  return 0;
160 }

◆ endSamplingIndex()

unsigned int FCALHVManager::endSamplingIndex ( )
static

Definition at line 185 of file FCALHVManager.cxx.

186 {
187  return 3;
188 }

◆ endSectorIndex()

unsigned int FCALHVManager::endSectorIndex ( unsigned int  iSampling)
static

Definition at line 172 of file FCALHVManager.cxx.

173 {
174  if (iSampling==0) return 16;
175  if (iSampling==1) return 8;
176  if (iSampling==2) return 4;
177  return 0;
178 }

◆ endSideIndex()

unsigned int FCALHVManager::endSideIndex ( )
static

Definition at line 162 of file FCALHVManager.cxx.

163 {
164  return 2;
165 }

◆ getData() [1/2]

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

Definition at line 196 of file FCALHVManager.cxx.

198 {
199  auto payload = std::make_unique<FCALHVData::Payload>();
200  payload->m_payloadArray.reserve(2*16*3*4);
201  for (unsigned int i=0;i<384;i++) {
202  payload->m_payloadArray[i].voltage = FCALHVData::INVALID;
203  }
204 
205  for (const CondAttrListCollection* atrlistcol : attrLists) {
206 
207  for (CondAttrListCollection::const_iterator citr=atrlistcol->begin(); citr!=atrlistcol->end();++citr) {
208 
209  // 1. decode COOL Channel ID
210  unsigned int chanID = (*citr).first;
211  int cannode = chanID/1000;
212  int line = chanID%1000;
213 
214  // 2. Construct the identifier
215  HWIdentifier id = m_c->hvId->HVLineId(1,1,cannode,line);
216 
217  std::vector<HWIdentifier> electrodeIdVec = idfunc(id);
218 
219  for(size_t i=0;i<electrodeIdVec.size();i++) {
220 
221  HWIdentifier& elecHWID = electrodeIdVec[i];
222  int detector = m_c->elecId->detector(elecHWID);
223  if (detector==5) {
224 
225  float voltage = FCALHVData::INVALID;;
226  if (!((*citr).second)["R_VMEAS"].isNull()) voltage = ((*citr).second)["R_VMEAS"].data<float>();
227  float current = 0.;
228  if (!((*citr).second)["R_IMEAS"].isNull()) current = ((*citr).second)["R_IMEAS"].data<float>();
229 
230  unsigned int sideIndex=1-m_c->elecId->zside(elecHWID); // 0 C side, 1 A side (unline HV numbering)
231  unsigned int samplingIndex=m_c->elecId->hv_eta(elecHWID)-1; // 0 to 2 for the FCAL modules 1-2-3
232  unsigned int sectorIndex=m_c->elecId->module(elecHWID); // 0-15 FCAL1, 0-7 FCAl2, 0-3 FCAL3
233  unsigned int lineIndex=m_c->elecId->gap(elecHWID); // 0-3
234 
235  // do we have to worry about phi sector numbering running backwards in phi for z<0 like in EM/HEC ????
236 
237  unsigned int index = 192*sideIndex+12*sectorIndex+4*samplingIndex+lineIndex;
238 
239  if (index>384) {
240  MsgStream msg (Athena::getMessageSvc(), "EMECHVManager");
241  msg << MSG::ERROR << " invalid index for FCAL " << sideIndex << " " << samplingIndex << " " << sectorIndex << " " << lineIndex << endmsg;
242  continue;
243  }
244 
245 
246  payload->m_payloadArray[index].voltage=voltage;
247  payload->m_payloadArray[index].current=current;
248  payload->m_payloadArray[index].hvLineNo=chanID;
249  } // if FCAL
250  } // loop over electrodes
251  } // loop over collection
252  } // loop over folders
253 
254  return {std::move (payload)};
255 }

◆ getData() [2/2]

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

Definition at line 276 of file FCALHVManager.cxx.

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

◆ getDataSim()

FCALHVManager::FCALHVData FCALHVManager::getDataSim ( ) const

Definition at line 258 of file FCALHVManager.cxx.

259 {
260  std::vector<const CondAttrListCollection*> attrLists;
261  ServiceHandle<StoreGateSvc> detStore ("DetectorStore", "EMBHVManager");
262  const CondAttrListCollection* atrlistcol = nullptr;
263  // Not a typo --- this folder has a lower-case l in the database...
264  if (detStore->retrieve(atrlistcol, "/LAR/DCS/HV/BARREl/I16").isSuccess()) {
265  attrLists.push_back (atrlistcol);
266  }
267  if (detStore->retrieve(atrlistcol, "/LAR/DCS/HV/BARREL/I8").isSuccess()) {
268  attrLists.push_back (atrlistcol);
269  }
270  return getData (SimIdFunc(), attrLists);
271 }

◆ getHVModule()

const FCALHVModule & FCALHVManager::getHVModule ( unsigned int  iSide,
unsigned int  iSector,
unsigned int  iSampling 
) const

Definition at line 190 of file FCALHVManager.cxx.

191 {
192  return *(m_c->moduleArray[iSide][iSector][iSampling]);
193 }

◆ hvLineNo()

int FCALHVManager::hvLineNo ( const FCALHVLine line,
const LArHVIdMapping hvIdMapping 
) const

Definition at line 284 of file FCALHVManager.cxx.

286 {
287  const FCALHVModule& module = line.getModule();
288  int sideIndex = module.getSideIndex();
289  int sectorIndex = module.getSectorIndex();
290  int samplingIndex = module.getSamplingIndex();
291  int lineIndex = line.getLineIndex();
292 
293  // ________________________ Construct ElectrodeID ________________________________
294  int id_detector = 5;
295  int id_zside = 1-sideIndex;
296  int id_module = sectorIndex;
297  int id_hv_phi{0};
298  int id_hv_eta = samplingIndex + 1;
299  int id_gap = lineIndex;
300  int id_electrode{0};
301 
302  HWIdentifier elecHWID = m_c->elecId->ElectrodeId(id_detector
303  , id_zside
304  , id_module
305  , id_hv_phi
306  , id_hv_eta
307  , id_gap
308  , id_electrode);
309  // ________________________ ________________________________
310 
311  // Get LArHVLineID corresponding to a given LArElectrodeId
312  HWIdentifier id = hvIdMapping->getLArHVLineID(elecHWID);
313 
314  // Extract HV Line No
315  return m_c->hvId->can_node(id)*1000 + m_c->hvId->hv_line(id);
316 }

◆ operator=()

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

Member Data Documentation

◆ m_c

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

Definition at line 93 of file FCALHVManager.h.


The documentation for this class was generated from the following files:
FCALHVManager::getData
FCALHVData getData(const LArHVIdMapping &hvIdMapping, const std::vector< const CondAttrListCollection * > &attrLists) const
Definition: FCALHVManager.cxx:276
fillPileUpNoiseLumi.current
current
Definition: fillPileUpNoiseLumi.py:52
checkFileSG.line
line
Definition: checkFileSG.py:75
FCALHVManager::m_c
std::unique_ptr< const Clockwork > m_c
Definition: FCALHVManager.h:92
index
Definition: index.py:1
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
FCALHVManager::FCALHVData::INVALID
static constexpr double INVALID
Definition: FCALHVManager.h:40
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:194
PixelModuleFeMask_create_db.payload
string payload
Definition: PixelModuleFeMask_create_db.py:69
DeMoScan.index
string index
Definition: DeMoScan.py:362
CondAttrListCollection::const_iterator
ChanAttrListMap::const_iterator const_iterator
Definition: CondAttrListCollection.h:63
FCALHVModule
Describes one HV Module within the FCAL.
Definition: FCALHVModule.h:20
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
ServiceHandle< StoreGateSvc >