11 #include "GaudiKernel/ISvcLocator.h"
12 #include "GaudiKernel/IToolSvc.h"
13 #include "GaudiKernel/Bootstrap.h"
14 #include "GaudiKernel/ServiceHandle.h"
23 #if !(defined(SIMULATIONBASE) || defined(GENERATIONBASE))
38 return m_cablingTool->getLArElectrodeIDvec (
id);
44 SimIdFunc::SimIdFunc()
46 ToolHandle<LArHVCablingSimTool>
tool (
"LArHVCablingSimTool");
47 if (!
tool.retrieve().isSuccess()) {
50 m_cablingTool =
tool.get();
61 for(
int iSide=0; iSide<2; ++iSide) {
62 for(
int iSector=0; iSector<16; ++iSector) {
63 for(
int iSampling=0; iSampling<3; ++iSampling) {
64 moduleArray[iSide][iSector][iSampling] = std::make_unique<FCALHVModule>(
manager,iSide,iSector,iSampling);
70 if (StatusCode::SUCCESS!=
detStore->retrieve(
elecId,
"LArElectrodeID")) {
71 throw std::runtime_error(
"FCALHVManager failed to retrieve LArElectrodeID");
74 if (StatusCode::SUCCESS!=
detStore->retrieve(
hvId,
"LArHVLineID")) {
75 throw std::runtime_error(
"FCALHVManager failed to retrieve LArHVLineID");
96 : m_payload (std::move (
payload))
103 if (
this != &
other) {
104 m_payload = std::move (
other.m_payload);
121 return m_payload->m_payloadArray[
index(
line)].voltage;
127 return m_payload->m_payloadArray[
index(
line)].current;
133 return m_payload->m_payloadArray[
index(
line)].hvLineNo;
139 unsigned int lineIndex =
line.getLineIndex();
141 unsigned int sectorIndex =
module.getSectorIndex();
142 unsigned int sideIndex =
module.getSideIndex();
143 unsigned int samplingIndex =
module.getSamplingIndex();
144 unsigned int index = 192*sideIndex+12*sectorIndex+4*samplingIndex+lineIndex;
174 if (iSampling==0)
return 16;
175 if (iSampling==1)
return 8;
176 if (iSampling==2)
return 4;
192 return *(
m_c->moduleArray[iSide][iSector][iSampling]);
197 const std::vector<const CondAttrListCollection*>& attrLists)
const
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++) {
210 unsigned int chanID = (*citr).first;
211 int cannode = chanID/1000;
212 int line = chanID%1000;
217 std::vector<HWIdentifier> electrodeIdVec = idfunc(
id);
219 for(
size_t i=0;
i<electrodeIdVec.size();
i++) {
226 if (!((*citr).second)[
"R_VMEAS"].isNull()) voltage = ((*citr).second)[
"R_VMEAS"].data<float>();
228 if (!((*citr).second)[
"R_IMEAS"].isNull())
current = ((*citr).second)[
"R_IMEAS"].data<
float>();
230 unsigned int sideIndex=1-
m_c->elecId->zside(elecHWID);
231 unsigned int samplingIndex=
m_c->elecId->hv_eta(elecHWID)-1;
232 unsigned int sectorIndex=
m_c->elecId->module(elecHWID);
233 unsigned int lineIndex=
m_c->elecId->gap(elecHWID);
237 unsigned int index = 192*sideIndex+12*sectorIndex+4*samplingIndex+lineIndex;
241 msg << MSG::ERROR <<
" invalid index for FCAL " << sideIndex <<
" " << samplingIndex <<
" " << sectorIndex <<
" " << lineIndex <<
endmsg;
260 std::vector<const CondAttrListCollection*> attrLists;
264 if (
detStore->retrieve(atrlistcol,
"/LAR/DCS/HV/BARREl/I16").isSuccess()) {
265 attrLists.push_back (atrlistcol);
267 if (
detStore->retrieve(atrlistcol,
"/LAR/DCS/HV/BARREL/I8").isSuccess()) {
268 attrLists.push_back (atrlistcol);
270 return getData (SimIdFunc(), attrLists);
274 #if !(defined(SIMULATIONBASE) || defined(GENERATIONBASE))
277 const std::vector<const CondAttrListCollection*>& attrLists)
const
280 return getData (idfunc, attrLists);
289 int sideIndex =
module.getSideIndex();
290 int sectorIndex =
module.getSectorIndex();
291 int samplingIndex =
module.getSamplingIndex();
292 int lineIndex =
line.getLineIndex();
296 int id_zside = 1-sideIndex;
297 int id_module = sectorIndex;
299 int id_hv_eta = samplingIndex + 1;
300 int id_gap = lineIndex;
318 return m_c->hvId->can_node(
id)*1000 +
m_c->hvId->hv_line(
id);