7 #include "GeoModelKernel/CellBinning.h"
8 #include "GeoModelKernel/CellPartitioning.h"
15 #include "GaudiKernel/ISvcLocator.h"
16 #include "GaudiKernel/IToolSvc.h"
17 #include "GaudiKernel/Bootstrap.h"
18 #include "GaudiKernel/ServiceHandle.h"
26 #ifndef SIMULATIONBASE
27 #ifndef GENERATIONBASE
40 CellPartitioning etaPartitioning;
41 for (
unsigned int i= 0;
i<4;
i++) etaPartitioning.addValue(
i*0.4);
42 etaPartitioning.addValue(1.525);
43 descriptor = std::make_unique<EMBPresamplerHVDescriptor>(etaPartitioning,CellBinning(0.0, 2*
M_PI, 32));
45 for(
int iSide=0; iSide<2; ++iSide) {
54 if (StatusCode::SUCCESS!=
detStore->retrieve(
elecId,
"LArElectrodeID")) {
55 throw std::runtime_error(
"EMBPresamplerHVManager failed to retrieve LArElectrodeID");
58 if (StatusCode::SUCCESS!=
detStore->retrieve(
hvId,
"LArHVLineID")) {
59 throw std::runtime_error(
"EMBPresamplerHVManager failed to retrieve LArHVLineID");
64 std::unique_ptr<const EMBPresamplerHVModule>
moduleArray[2][4][32];
81 (std::unique_ptr<Payload>
payload)
82 : m_payload (std::move (
payload))
90 m_payload = std::move (
other.m_payload);
110 return m_payload->m_payloadArray[
index(
module)].voltage[iGap];
117 return m_payload->m_payloadArray[
index(
module)].current[iGap];
124 return m_payload->m_payloadArray[
index(
module)].hvLineNo[iGap];
131 unsigned int sideIndex =
module.getSideIndex();
133 unsigned int etaIndex =
module.getEtaIndex();
149 return m_c->descriptor.get();
154 return m_c->descriptor->getPhiBinning().getFirstDivisionNumber();
159 return m_c->descriptor->getPhiBinning().getFirstDivisionNumber() +
m_c->descriptor->getPhiBinning().getNumDivisions();
164 return m_c->descriptor->getEtaPartitioning().getFirstDivisionNumber();
169 return m_c->descriptor->getEtaPartitioning().getFirstDivisionNumber() +
m_c->descriptor->getEtaPartitioning().getNumDivisions();
190 const std::vector<const CondAttrListCollection*>& attrLists)
const
192 auto payload = std::make_unique<EMBPresamplerHVData::Payload>();
193 payload->m_payloadArray.reserve(2*4*32);
195 for (
int i=0;
i<256;
i++) {
206 unsigned int chanID = (*citr).first;
207 int cannode = chanID/1000;
208 int line = chanID%1000;
213 std::vector<HWIdentifier> electrodeIdVec = idfunc(
id);
216 for(
size_t i=0;
i<electrodeIdVec.size();
i++)
224 unsigned int sideIndex=1-
m_c->elecId->zside(elecHWID);
226 unsigned int etaIndex=
m_c->elecId->hv_eta(elecHWID)-1;
246 int imodule=
m_c->elecId->module(elecHWID);
247 if (imodule<16)
phiIndex = 15 - imodule;
253 unsigned int gapIndex=
m_c->elecId->gap(elecHWID);
254 if (sideIndex==0) gapIndex=1-gapIndex;
258 if (!((*citr).second)[
"R_VMEAS"].isNull()) voltage = ((*citr).second)[
"R_VMEAS"].data<float>();
260 if (!((*citr).second)[
"R_IMEAS"].isNull())
current = ((*citr).second)[
"R_IMEAS"].data<
float>();
262 payload->m_payloadArray[
index].voltage[gapIndex]=voltage;
264 payload->m_payloadArray[
index].hvLineNo[gapIndex]=chanID;
273 #ifndef SIMULATIONBASE
274 #ifndef GENERATIONBASE
277 const std::vector<const CondAttrListCollection*>& attrLists)
const
280 return getData (idfunc, attrLists);
289 int sideIndex =
module.getSideIndex();
291 int etaIndex =
module.getEtaIndex();
295 int id_zside = 1 - sideIndex;
309 int id_hv_eta = etaIndex + 1;
310 int id_gap = sideIndex==0 ? 1-
gap :
gap;
325 if(hvlId) *hvlId =
id;
328 return m_c->hvId->can_node(
id)*1000 +
m_c->hvId->hv_line(
id);