ATLAS Offline Software
Classes | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
EMECPresamplerHVManager Class Reference

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). 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) 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 }

◆ ~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  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 }

◆ 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) { return hvIdMapping.getLArElectrodeIDvec(id); };
245  return getData (idfunc, attrLists);
246 }

◆ 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 }

◆ 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 
) const

Definition at line 249 of file EMECPresamplerHVManager.cxx.

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

◆ 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:
fillPileUpNoiseLumi.current
current
Definition: fillPileUpNoiseLumi.py:52
checkFileSG.line
line
Definition: checkFileSG.py:75
index
Definition: index.py:1
EMECPresamplerHVManager::getData
EMECPresamplerHVData getData(const LArHVIdMapping &hvIdMapping, const std::vector< const CondAttrListCollection * > &attrLists) const
Definition: EMECPresamplerHVManager.cxx:241
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
TRT::Hit::detector
@ detector
Definition: HitInfo.h:78
python.PyAthena.module
module
Definition: PyAthena.py:134
lumiFormat.i
int i
Definition: lumiFormat.py:92
EMECPresamplerHVManager::EMECPresamplerHVData::INVALID
static constexpr double INVALID
Definition: EMECPresamplerHVManager.h: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
Trk::iPhi
@ iPhi
Definition: ParamDefs.h:53
eflowRec::phiIndex
unsigned int phiIndex(float phi, float binsize)
calculate phi index for a given phi
Definition: EtaPhiLUT.cxx:23
DeMoScan.index
string index
Definition: DeMoScan.py:362
EMECPresamplerHVManager::m_c
std::unique_ptr< const Clockwork > m_c
Definition: EMECPresamplerHVManager.h:88
CondAttrListCollection::const_iterator
ChanAttrListMap::const_iterator const_iterator
Definition: CondAttrListCollection.h:63
LArHVIdMapping::getLArElectrodeIDvec
const std::vector< HWIdentifier > & getLArElectrodeIDvec(HWIdentifier &hvlineId) const
Return a vector of LArElectrodeID corresponding to a given LArHVLineID.
Definition: LArHVIdMapping.cxx:83