ATLAS Offline Software
Loading...
Searching...
No Matches
EMECPresamplerHVManager Class Reference

This class provides direct access to information on the HV electrodes within the EMEC. More...

#include <EMECPresamplerHVManager.h>

Collaboration diagram for EMECPresamplerHVManager:

Classes

class  Clockwork
class  EMECPresamplerHVData

Public Member Functions

 EMECPresamplerHVManager ()
 ~EMECPresamplerHVManager ()
const CellBinning * getPhiBinning () const
unsigned int beginPhiIndex () const
unsigned int endPhiIndex () const
const EMECPresamplerHVModulegetHVModule (unsigned int iSide, unsigned int iPhi) const
EMECPresamplerHVData getData (const LArHVIdMapping &hvIdMapping, const std::vector< const CondAttrListCollection * > &attrLists) const
int hvLineNo (const EMECPresamplerHVModule &module, const LArHVIdMapping *hvIdMapping, HWIdentifier *hvlineId=nullptr) const

Static Public Member Functions

static unsigned int beginSideIndex ()
static unsigned int endSideIndex ()

Private Types

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

Private Member Functions

EMECPresamplerHVData getData (const idfunc_t &idfunc, const std::vector< const CondAttrListCollection * > &attrLists) const
EMECPresamplerHVManageroperator= (const EMECPresamplerHVManager &right)=delete
 EMECPresamplerHVManager (const EMECPresamplerHVManager &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 EMEC.

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 EMECPresamplerHVManager.h.

Member Typedef Documentation

◆ idfunc_t

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

Definition at line 80 of file EMECPresamplerHVManager.h.

Constructor & Destructor Documentation

◆ EMECPresamplerHVManager() [1/2]

EMECPresamplerHVManager::EMECPresamplerHVManager ( )

Definition at line 129 of file EMECPresamplerHVManager.cxx.

130 : m_c (std::make_unique<Clockwork> (this))
131{
132}
std::unique_ptr< const Clockwork > m_c

◆ ~EMECPresamplerHVManager()

EMECPresamplerHVManager::~EMECPresamplerHVManager ( )
default

◆ EMECPresamplerHVManager() [2/2]

EMECPresamplerHVManager::EMECPresamplerHVManager ( const EMECPresamplerHVManager & right)
privatedelete

Member Function Documentation

◆ beginPhiIndex()

unsigned int EMECPresamplerHVManager::beginPhiIndex ( ) const

Definition at line 142 of file EMECPresamplerHVManager.cxx.

143{
144 return m_c->phiBinning.getFirstDivisionNumber();
145}

◆ beginSideIndex()

unsigned int EMECPresamplerHVManager::beginSideIndex ( )
static

Definition at line 157 of file EMECPresamplerHVManager.cxx.

158{
159 return 0;
160}

◆ endPhiIndex()

unsigned int EMECPresamplerHVManager::endPhiIndex ( ) const

Definition at line 147 of file EMECPresamplerHVManager.cxx.

148{
149 return m_c->phiBinning.getFirstDivisionNumber() + m_c->phiBinning.getNumDivisions();
150}

◆ endSideIndex()

unsigned int EMECPresamplerHVManager::endSideIndex ( )
static

Definition at line 162 of file EMECPresamplerHVManager.cxx.

163{
164 return 2;
165}

◆ getData() [1/2]

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

Definition at line 168 of file EMECPresamplerHVManager.cxx.

170{
171 auto payload = std::make_unique<EMECPresamplerHVData::Payload>();
172 payload->m_payloadArray.reserve(2*64);
173 for (unsigned int i=0;i<64;i++) {
174 payload->m_payloadArray[i].voltage = EMECPresamplerHVData::INVALID;
175 }
176
177 for (const CondAttrListCollection* atrlistcol : attrLists) {
178
179 for (CondAttrListCollection::const_iterator citr=atrlistcol->begin(); citr!=atrlistcol->end();++citr) {
180
181 // Construct HWIdentifier
182 // 1. decode COOL Channel ID
183 unsigned int chanID = (*citr).first;
184 int cannode = chanID/1000;
185 int line = chanID%1000;
186
187 // 2. Construct the identifier
188 HWIdentifier id = m_c->hvId->HVLineId(1,1,cannode,line);
189
190
191 const std::vector<HWIdentifier>& electrodeIdVec = idfunc(id);
192
193 for(size_t i=0;i<electrodeIdVec.size();i++) {
194 HWIdentifier elecHWID = electrodeIdVec[i];
195 int detector = m_c->elecId->detector(elecHWID);
196 // check we are in EMECPresampler
197 if (detector==3) {
198
199
200 unsigned int sideIndex=1-m_c->elecId->zside(elecHWID);
201 unsigned int phiIndex=m_c->elecId->module(elecHWID); // from 0 to 31
202// rotation for C side
203 if (sideIndex==0) {
204 if (phiIndex<16) phiIndex=15-phiIndex;
205 else phiIndex=47-phiIndex;
206 }
207
208// GU January 2017 - fix for HV EMEC PS distribution
209// 0-31 in phi module
210// each module has 2 cell in phi, in the mapping database this is referred by "gapIndex"
211// 0 is on the low phi side (in the ATLAS frame)
212// 1 in on the high phi side
213// so in total 64 sectors in phi given by 2*phiIndex+gapIndex
214// the two gap of these sectors are powered by the same line and have the same HV
215
216 unsigned int gapIndex=m_c->elecId->gap(elecHWID);
217
218 unsigned int index = 64*sideIndex+2*phiIndex+gapIndex;
219
220
221 float voltage = EMECPresamplerHVData::INVALID;
222 if (!((*citr).second)["R_VMEAS"].isNull()) voltage = ((*citr).second)["R_VMEAS"].data<float>();
223 float current = 0.;
224 if (!((*citr).second)["R_IMEAS"].isNull()) current = ((*citr).second)["R_IMEAS"].data<float>();
225
226
227 payload->m_payloadArray[index].voltage=voltage;
228 payload->m_payloadArray[index].current=current;
229 payload->m_payloadArray[index].hvLineNo=chanID;
230 } // for (electrodeIdVec)
231 } // is EMECPresampler
232 } // for (atrlistcol)
233 }
234
235 return {std::move (payload)};
236}
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
ChanAttrListMap::const_iterator const_iterator
str index
Definition DeMoScan.py:362
unsigned int phiIndex(float phi, float binsize)
calculate phi index for a given phi
Definition EtaPhiLUT.cxx:23

◆ getData() [2/2]

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

Definition at line 241 of file EMECPresamplerHVManager.cxx.

243{
244 auto idfunc = [&] (HWIdentifier id) -> const std::vector<HWIdentifier>
245 { return hvIdMapping.getLArElectrodeIDvec(id); };
246 return getData (idfunc, attrLists);
247}
EMECPresamplerHVData getData(const LArHVIdMapping &hvIdMapping, const std::vector< const CondAttrListCollection * > &attrLists) const
const std::vector< HWIdentifier > & getLArElectrodeIDvec(HWIdentifier &hvlineId) const
Return a vector of LArElectrodeID corresponding to a given LArHVLineID.

◆ getHVModule()

const EMECPresamplerHVModule & EMECPresamplerHVManager::getHVModule ( unsigned int iSide,
unsigned int iPhi ) const

Definition at line 152 of file EMECPresamplerHVManager.cxx.

153{
154 return *(m_c->moduleArray[iSide][iPhi]);
155}
@ iPhi
Definition ParamDefs.h:47

◆ getPhiBinning()

const CellBinning * EMECPresamplerHVManager::getPhiBinning ( ) const

Definition at line 137 of file EMECPresamplerHVManager.cxx.

138{
139 return &(m_c->phiBinning);
140}

◆ hvLineNo()

int EMECPresamplerHVManager::hvLineNo ( const EMECPresamplerHVModule & module,
const LArHVIdMapping * hvIdMapping,
HWIdentifier * hvlineId = nullptr ) const

Definition at line 250 of file EMECPresamplerHVManager.cxx.

251 {
252 int sideIndex = module.getSideIndex();
253 int phiIndex = module.getPhiIndex()/2;
254
255 // ________________________ Construct ElectrodeID ________________________________
256 int id_detector = 3;
257 int id_zside = 1 - sideIndex;
258 int id_module{0};
259 if(sideIndex==1){
260 id_module = phiIndex;
261 }
262 else {
263 if(phiIndex<16) {
264 id_module = 15 - phiIndex;
265 }
266 else {
267 id_module = 47 - phiIndex;
268 }
269 }
270 int id_hv_phi{0};
271 int id_hv_eta{0};
272 int id_gap = module.getPhiIndex()%2;
273 int id_electrode{0};
274
275 HWIdentifier elecHWID = m_c->elecId->ElectrodeId(id_detector
276 ,id_zside
277 ,id_module
278 ,id_hv_phi
279 ,id_hv_eta
280 ,id_gap
281 ,id_electrode);
282 // ________________________ ________________________________
283
284 // Get LArHVLineID corresponding to a given LArElectrodeId
285 HWIdentifier id = hvIdMapping->getLArHVLineID(elecHWID);
286
287 if(hvlId) *hvlId = id;
288
289 // Extract HV Line No
290 return m_c->hvId->can_node(id)*1000 + m_c->hvId->hv_line(id);
291}
const HWIdentifier getLArHVLineID(HWIdentifier &electrodeId) const
Return the LArHVLineID corresponding to a given LArElectrodeId.

◆ operator=()

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

Member Data Documentation

◆ m_c

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

Definition at line 89 of file EMECPresamplerHVManager.h.


The documentation for this class was generated from the following files: