|
ATLAS Offline Software
|
Go to the documentation of this file.
14 #include "GaudiKernel/ISvcLocator.h"
15 #include "GaudiKernel/IToolSvc.h"
16 #include "GaudiKernel/Bootstrap.h"
17 #include "GaudiKernel/ServiceHandle.h"
26 #if !(defined(SIMULATIONBASE) || defined(GENERATIONBASE))
39 std::vector<HWIdentifier> operator()(
HWIdentifier id)
const
41 return m_cablingTool->getLArElectrodeIDvec (
id);
47 SimIdFunc::SimIdFunc()
49 ToolHandle<LArHVCablingSimTool>
tool (
"LArHVCablingSimTool");
50 if (!
tool.retrieve().isSuccess()) {
53 m_cablingTool =
tool.get();
64 for(
int iSide=0; iSide<2; ++iSide) {
66 for(
int iSampling=0; iSampling<4; ++iSampling) {
73 if (StatusCode::SUCCESS!=
detStore->retrieve(
elecId,
"LArElectrodeID")) {
74 throw std::runtime_error(
"HECHVManager failed to retrieve LArElectrodeID");
77 if (StatusCode::SUCCESS!=
detStore->retrieve(
hvId,
"LArHVLineID")) {
78 throw std::runtime_error(
"HECHVManager failed to retrieve LArHVLineID");
100 : m_payload (std::move (
payload))
107 if (
this != &
other) {
108 m_payload = std::move (
other.m_payload);
120 return voltage (subgap) >
INVALID;
126 return m_payload->m_payloadArray[
index(subgap)].voltage;
132 return m_payload->m_payloadArray[
index(subgap)].current;
138 return m_payload->m_payloadArray[
index(subgap)].hvLineNo;
147 unsigned int samplingIndex =
module.getSamplingIndex();
148 unsigned int sideIndex =
module.getSideIndex();
149 unsigned int index = 512*sideIndex+16*
phiIndex+4*samplingIndex+subgapIndex;
161 return m_c->descriptor;
196 ,
unsigned int iSampling)
const
198 return *(
m_c->moduleArray[iSide][
iPhi][iSampling]);
206 const std::vector<const CondAttrListCollection*>& attrLists)
const
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++) {
220 unsigned int chanID = (*citr).first;
221 int cannode = chanID/1000;
222 int line = chanID%1000;
227 std::vector<HWIdentifier> electrodeIdVec = idfunc(
id);
229 for(
size_t i=0;
i<electrodeIdVec.size();
i++) {
240 if (!((*citr).second)[
"R_VMEAS"].isNull()) voltage = ((*citr).second)[
"R_VMEAS"].data<float>();
242 if (!((*citr).second)[
"R_IMEAS"].isNull())
current = ((*citr).second)[
"R_IMEAS"].data<
float>();
245 unsigned int sideIndex=1-
m_c->elecId->zside(elecHWID);
246 unsigned int phiIndex=
m_c->elecId->module(elecHWID);
247 unsigned int samplingIndex=
m_c->elecId->hv_eta(elecHWID)-1;
248 unsigned int subgapIndex=
m_c->elecId->gap(elecHWID);
250 unsigned int index = 512*sideIndex+16*
phiIndex+4*samplingIndex+subgapIndex;
255 msg << MSG::ERROR <<
"invalid index " <<
index <<
" side,phi,sampling,gap " << sideIndex <<
" " <<
phiIndex <<
" " << samplingIndex
256 <<
" " << subgapIndex <<
endmsg;
274 std::vector<const CondAttrListCollection*> attrLists;
278 if (
detStore->retrieve(atrlistcol,
"/LAR/DCS/HV/BARREl/I16").isSuccess()) {
279 attrLists.push_back (atrlistcol);
281 if (
detStore->retrieve(atrlistcol,
"/LAR/DCS/HV/BARREL/I8").isSuccess()) {
282 attrLists.push_back (atrlistcol);
284 return getData (SimIdFunc(), attrLists);
288 #if !(defined(SIMULATIONBASE) || defined(GENERATIONBASE))
291 const std::vector<const CondAttrListCollection*>& attrLists)
const
294 return getData (idfunc, attrLists);
303 int sideIndex =
module.getSideIndex();
305 int samplingIndex =
module.getSamplingIndex();
310 int id_zside = 1-sideIndex;
313 int id_hv_eta = samplingIndex+1;
314 int id_gap = subgapIndex;
317 switch(samplingIndex) {
331 throw std::runtime_error(
"Unexpected value for samplingIndex in HEC: " +
std::to_string(samplingIndex));
349 return m_c->hvId->can_node(
id)*1000 +
m_c->hvId->hv_line(
id);
std::unique_ptr< const Clockwork > m_c
Describes one HV Module within the HEC.
static unsigned int beginSideIndex()
This file defines the class for a collection of AttributeLists where each one is associated with a ch...
singleton-like access to IMessageSvc via open function and helper
HECHVData getDataSim() const
static unsigned int beginPhiIndex()
Helper for the Liquid Argon Calorimeter cell at the electrode level.
HECHVData getData(const LArHVIdMapping &hvIdMapping, const std::vector< const CondAttrListCollection * > &attrLists) const
static int index(const HECHVSubgap &subgap)
const HWIdentifier getLArHVLineID(HWIdentifier &electrodeId) const
Return the LArHVLineID corresponding to a given LArElectrodeId.
int hvLineNo(const HECHVSubgap &subgap) const
HECHVData & operator=(HECHVData &&other) noexcept
This class is a collection of AttributeLists where each one is associated with a channel number....
std::vector< HECHVPayload > m_payloadArray
IMessageSvc * getMessageSvc(bool quiet=false)
static unsigned int endSideIndex()
std::function< std::vector< HWIdentifier >(HWIdentifier)> idfunc_t
double voltage(const HECHVSubgap &subgap) const
static unsigned int endSamplingIndex()
const HECHVDescriptor & getDescriptor() const
double current(const HECHVSubgap &subgap) const
HECHVDescriptor descriptor
const HECHVModule & getModule() const
unsigned int getSubgapIndex() const
std::string to_string(const DetectorType &type)
unsigned int phiIndex(float phi, float binsize)
calculate phi index for a given phi
This class provides direct access to information on the HV electrodes within the barrels....
bool hvOn(const HECHVSubgap &subgap) const
ChanAttrListMap::const_iterator const_iterator
static unsigned int endPhiIndex()
const LArElectrodeID * elecId
Clockwork(const HECHVManager *manager)
std::unique_ptr< const HECHVModule > moduleArray[2][32][4]
static unsigned int beginSamplingIndex()
int hvLineNo(const HECHVSubgap &subgap, const LArHVIdMapping *hvIdMapping, HWIdentifier *hvlId=nullptr) const
const std::vector< HWIdentifier > & getLArElectrodeIDvec(HWIdentifier &hvlineId) const
Return a vector of LArElectrodeID corresponding to a given LArHVLineID.
static constexpr double INVALID
const HECHVModule & getHVModule(unsigned int iSide, unsigned int iPhi, unsigned int iSampling) const
Helper for the Liquid Argon Calorimeter High-Voltage identifiers.