ATLAS Offline Software
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
LArConditionsContainerBase Class Reference

This is a non-template implementation base class for LArConditionsContainer. More...

#include <LArConditionsContainerBase.h>

Collaboration diagram for LArConditionsContainerBase:

Public Types

enum  GroupingType {
  Unknown = 0, SingleGroup, SubDetectorGrouping, FeedThroughGrouping,
  ExtendedFTGrouping, ExtendedSubDetGrouping, SuperCells
}
 Grouping type. More...
 
typedef LArCondFEBIdChanMap::FEBIdVector FEBIdVector
 

Public Member Functions

 LArConditionsContainerBase ()
 Default constructor. More...
 
 LArConditionsContainerBase (GroupingType type)
 constructor defining grouping type More...
 
virtual ~LArConditionsContainerBase ()
 destructor More...
 
StatusCode initializeBase ()
 initialize More...
 
void setGroupingType (GroupingType type)
 allow group type to be set externally - need to (re)initialize after setting grouping type More...
 
StatusCode setGroupingType (const std::string &groupingStr, MsgStream &logStr)
 allow group type to be set externally based on a string returns an FAILURE and a message to logStr if unknown string is supplied More...
 
const LArOnlineID_BaseonlineHelper () const
 provide access to online id helper More...
 
const CaloCell_Base_IDofflineHelper () const
 provide access to offline id helper More...
 
const FEBIdVectorfebIdVector (unsigned int gain, unsigned int coolChannel) const
 Access to a FEB ID vector for a given gain and COOL channel. More...
 

Static Public Member Functions

static bool applyCorrectionsAtInit (bool setFlag=false, bool flag=true)
 provide access to flag which determines corrections are applied at initialize, i.e. More...
 

Protected Member Functions

StatusCode initGrouping ()
 
std::string groupingTypeToString () const
 
void correctionIndexAndCoolChannel (HWIdentifier id, unsigned int gain, unsigned int &index, unsigned int &coolChannel)
 

Protected Attributes

GroupingType m_groupType
 
LArCondFEBIdChanMap m_febIdChanMap
 
const LArOnlineID_Basem_onlineHelper
 
const CaloCell_Base_IDm_offlineHelper
 
std::vector< unsigned int > m_channelToMultChanCollIndex
 
bool m_isInitialized
 

Detailed Description

This is a non-template implementation base class for LArConditionsContainer.

This class contains implementation details in a non-template form allowing it code to be compiled into a library.

Definition at line 39 of file LArConditionsContainerBase.h.

Member Typedef Documentation

◆ FEBIdVector

Definition at line 54 of file LArConditionsContainerBase.h.

Member Enumeration Documentation

◆ GroupingType

Grouping type.

Enumerator
Unknown 
SingleGroup 
SubDetectorGrouping 
FeedThroughGrouping 
ExtendedFTGrouping 
ExtendedSubDetGrouping 
SuperCells 

Definition at line 44 of file LArConditionsContainerBase.h.

Constructor & Destructor Documentation

◆ LArConditionsContainerBase() [1/2]

LArConditionsContainerBase::LArConditionsContainerBase ( )

Default constructor.

Definition at line 33 of file LArConditionsContainerBase.cxx.

34  :
36  m_onlineHelper(nullptr),
37  m_offlineHelper(nullptr),
38  m_isInitialized(false)
39 {}

◆ LArConditionsContainerBase() [2/2]

LArConditionsContainerBase::LArConditionsContainerBase ( GroupingType  type)

constructor defining grouping type

Definition at line 41 of file LArConditionsContainerBase.cxx.

42  :
44  m_onlineHelper(nullptr),
45  m_offlineHelper(nullptr),
46  m_isInitialized(false)
47 {}

◆ ~LArConditionsContainerBase()

LArConditionsContainerBase::~LArConditionsContainerBase ( )
virtual

destructor

Definition at line 50 of file LArConditionsContainerBase.cxx.

51 {}

Member Function Documentation

◆ applyCorrectionsAtInit()

bool LArConditionsContainerBase::applyCorrectionsAtInit ( bool  setFlag = false,
bool  flag = true 
)
static

provide access to flag which determines corrections are applied at initialize, i.e.

when conditions are read in. Default is true. This is a class (static) variable which applied to ALL conditions in a job! If one wants to change the value of the flag, pass in arguments:

Definition at line 603 of file LArConditionsContainerBase.cxx.

604 {
605  // If setFlag is true, change the value of static flag, otherwise
606  // return current value
607 
608  // Default value is true
609  static std::atomic<bool> applyCorrs = true;
610 
611  if (setFlag) applyCorrs = flag;
612 
613  return (applyCorrs);
614 }

◆ correctionIndexAndCoolChannel()

void LArConditionsContainerBase::correctionIndexAndCoolChannel ( HWIdentifier  id,
unsigned int  gain,
unsigned int &  index,
unsigned int &  coolChannel 
)
protected

Definition at line 539 of file LArConditionsContainerBase.cxx.

543 {
544  MsgStream log(Athena::getMessageSvc(), "LArConditionsContainerBase");
545 
546  index = 9999;
547  coolChannel = 0;
548  // First get cool channel number
549  if (!m_onlineHelper) {
550  log << MSG::ERROR << "correctionIndex> Could not get online id helper!" << endmsg;
551  return;
552  }
553 
554  int p_n = m_onlineHelper->pos_neg(id);
555  if (m_onlineHelper->isEMBPS(id)) {
556  if (p_n) coolChannel = LArCondFEBIdChanMap::PSBA; // PS Barrel
557  else coolChannel = LArCondFEBIdChanMap::PSBC; // PS Barrel
558  }
559  else if (m_onlineHelper->isEMECPS(id)) {
560  if (p_n) coolChannel = LArCondFEBIdChanMap::PSECA; // PS Endcap
561  else coolChannel = LArCondFEBIdChanMap::PSECC; // PS Endcap
562  }
563  else if (m_onlineHelper->isEMBchannel(id)) {
564  if (p_n) coolChannel = LArCondFEBIdChanMap::EMBA; // EM Barrel
565  else coolChannel = LArCondFEBIdChanMap::EMBC; // EM Barrel
566  }
567  else if (m_onlineHelper->isEMECchannel(id)) {
568  if (p_n) coolChannel = LArCondFEBIdChanMap::EMECA; // EM Endcap
569  else coolChannel = LArCondFEBIdChanMap::EMECC; // EM Endcap
570  }
571  else if (m_onlineHelper->isHECchannel(id)) {
572  if (p_n) coolChannel = LArCondFEBIdChanMap::HECA; // HEC A
573  else coolChannel = LArCondFEBIdChanMap::HECC; // HEC C
574  }
575  else if (m_onlineHelper->isFCALchannel(id)) {
576  if (p_n) coolChannel = LArCondFEBIdChanMap::FCALA; // FCAL A
577  else coolChannel = LArCondFEBIdChanMap::FCALC; // FCAL C
578  }
579 
580  if (!coolChannel) {
581  log << MSG::ERROR << "correctionIndex> coolChannel not found! Online ids: "
582  << " " << m_onlineHelper->show_to_string(id)
583  << endmsg;
584  return;
585  }
586 
587  // add on offset for gain
588  unsigned int gainOffset = (gain - m_febIdChanMap.minGain())*LArCondFEBIdChanMap::NCORRTYPE;
589  coolChannel += gainOffset;
590 
591  // look up the index in the table
592  if (coolChannel >= m_channelToMultChanCollIndex.size()) {
593  log << MSG::ERROR << "correctionIndex> coolChannel larger than lookup table: chan, size "
594  << coolChannel << " " << m_channelToMultChanCollIndex.size()
595  << endmsg;
596  }
597  else {
598  index = m_channelToMultChanCollIndex[coolChannel];
599  }
600 }

◆ febIdVector()

const LArConditionsContainerBase::FEBIdVector & LArConditionsContainerBase::febIdVector ( unsigned int  gain,
unsigned int  coolChannel 
) const

Access to a FEB ID vector for a given gain and COOL channel.

Definition at line 532 of file LArConditionsContainerBase.cxx.

534 {
535  return (m_febIdChanMap.febIdVector(gain, coolChannel));
536 }

◆ groupingTypeToString()

std::string LArConditionsContainerBase::groupingTypeToString ( ) const
protected

Definition at line 496 of file LArConditionsContainerBase.cxx.

497 {
498  // Return grouping type in string form
499  switch (m_groupType){
500  case 0:
501  return ("Unknown");
502  case 1:
503  return ("SingleGroup");
504  case 2:
505  return ("SubDetectorGrouping");
506  case 3:
507  return ("FeedThroughGrouping");
508  case 4:
509  return ("ExtendedFTGrouping");
510  case 5:
511  return ("ExtendedSubDetGrouping");
512  case 6:
513  return ("SuperCells");
514  }
515  return ("Unknown");
516 }

◆ initGrouping()

StatusCode LArConditionsContainerBase::initGrouping ( )
protected

Definition at line 169 of file LArConditionsContainerBase.cxx.

170 {
171  MsgStream log(Athena::getMessageSvc(), "LArConditionsContainerBase");
172  log << MSG::DEBUG << "initGrouping "<< endmsg;
173 
174  // We allow for different groupings
175 
176  if (Unknown == m_groupType) {
177  log << MSG::ERROR << "Unknown grouping "<< endmsg;
178 
179  // Not yet known
180  }
182 
183  log << MSG::DEBUG << "Single group "<< endmsg;
184 
185  // Only one group - add all feb ids to channel 0
186  std::vector<HWIdentifier>::const_iterator febIt = m_onlineHelper->feb_begin();
187  std::vector<HWIdentifier>::const_iterator febEnd = m_onlineHelper->feb_end();
189  for (; febIt != febEnd; ++febIt) {
190  febIds.push_back((*febIt).get_identifier32().get_compact());
191  }
192  // add for LArCondFEBIdChanMap
193  unsigned int nChanPerGain = 1;
194  unsigned int minGain = 0;
195  unsigned int nGains = 3;
196  m_febIdChanMap = LArCondFEBIdChanMap(nChanPerGain, minGain, nGains);
197  m_febIdChanMap.addFEBIdVector(0, febIds);
198  }
199  else if (SubDetectorGrouping == m_groupType) {
200 
201  log << MSG::DEBUG << "Subdetector grouping "<< endmsg;
202 
203  // Set up LArCondFEBIdChanMap for four groups: EM barrel, EMEM, HEC, FCal
204  std::vector<HWIdentifier>::const_iterator febIt = m_onlineHelper->feb_begin();
205  std::vector<HWIdentifier>::const_iterator febEnd = m_onlineHelper->feb_end();
206 
211 
212  for (; febIt != febEnd; ++febIt) {
213  unsigned int febId = (*febIt).get_identifier32().get_compact();
214  if (m_onlineHelper->isEMBchannel(*febIt)) {
215  emBarrel.push_back(febId);
216  }
217  else if (m_onlineHelper->isEMECchannel(*febIt)) {
218  emEndcap.push_back(febId);
219  }
220  else if (m_onlineHelper->isHECchannel(*febIt)) {
221  hec.push_back(febId);
222  }
223  else if (m_onlineHelper->isFCALchannel(*febIt)) {
224  fcal.push_back(febId);
225  }
226  else {
227  log << MSG::DEBUG << "Uassociated FEB id: "
228  << MSG::hex << (febId) << MSG::dec
229  << " isCalib " << m_onlineHelper->isCalibration(*febIt)
230  << " " << m_onlineHelper->show_to_string(*febIt)
231  << endmsg;
232  }
233  }
234  // add for LArCondFEBIdChanMap
235  unsigned int nChanPerGain = 4;
236  unsigned int minGain = 0;
237  unsigned int nGains = 3;
238  m_febIdChanMap = LArCondFEBIdChanMap(nChanPerGain, minGain, nGains);
239  m_febIdChanMap.addFEBIdVector(0, emBarrel);
240  m_febIdChanMap.addFEBIdVector(1, emEndcap);
243 
244 // unsigned int coolChannel;
245 // for (unsigned int gain = 0; gain < nGains; ++gain) {
246 // for (unsigned int i = 0; i < emBarrel.size(); ++i) {
247 // if (!m_febIdChanMap.getChannel(emBarrel[i], gain, coolChannel)) {
248 // log << MSG::DEBUG << "Unable to get cool channel for em barrel - i = "
249 // << i << endmsg;
250 // return (StatusCode::FAILURE);
251 // }
252 // }
253 // for (unsigned int i = 0; i < emEndcap.size(); ++i) {
254 // if (!m_febIdChanMap.getChannel(emEndcap[i], gain, coolChannel)) {
255 // log << MSG::DEBUG << "Unable to get cool channel for em endcap - i = "
256 // << i << endmsg;
257 // return (StatusCode::FAILURE);
258 // }
259 // }
260 // for (unsigned int i = 0; i < hec.size(); ++i) {
261 // if (!m_febIdChanMap.getChannel(hec[i], gain, coolChannel)) {
262 // log << MSG::DEBUG << "Unable to get cool channel for hec - i = "
263 // << i << endmsg;
264 // return (StatusCode::FAILURE);
265 // }
266 // }
267 // for (unsigned int i = 0; i < fcal.size(); ++i) {
268 // if (!m_febIdChanMap.getChannel(fcal[i], gain, coolChannel)) {
269 // log << MSG::DEBUG << "Unable to get cool channel for fcal - i = "
270 // << i << endmsg;
271 // return (StatusCode::FAILURE);
272 // }
273 // }
274 // }
275  }
276  else if (ExtendedSubDetGrouping == m_groupType) {
277  log << MSG::DEBUG << "Extended Subdetector grouping "<< endmsg;
278 
279  // Set up LArCondFEBIdChanMap for four groups: EM barrel, EM barrel PS ,EMEC EMEC PS, HEC, FCal
280  std::vector<HWIdentifier>::const_iterator febIt = m_onlineHelper->feb_begin();
281  std::vector<HWIdentifier>::const_iterator febEnd = m_onlineHelper->feb_end();
282 
284  LArCondFEBIdChanMap::FEBIdVector emBarrelPS[2];
286  LArCondFEBIdChanMap::FEBIdVector emEndcapPS[2];
289 
290  for (; febIt != febEnd; ++febIt) {
291  int iside = m_onlineHelper->pos_neg(*febIt);
292  // Sanity check
293  if(iside <0 || iside > 1) {
294  log << MSG::ERROR << "Wrong side id: "<< iside <<" from: "
295  << MSG::hex << *febIt << MSG::dec << endmsg;
296  return (StatusCode::FAILURE);
297  }
298  unsigned int febId = (*febIt).get_identifier32().get_compact();
299  if (m_onlineHelper->isEMBPS(*febIt)) {
300  emBarrelPS[iside].push_back(febId);
301  }
302  else if (m_onlineHelper->isEMECPS(*febIt)) {
303  emEndcapPS[iside].push_back(febId);
304  }
305  else if (m_onlineHelper->isEMBchannel(*febIt)) {
306  emBarrel[iside].push_back(febId);
307  }
308  else if (m_onlineHelper->isEMECchannel(*febIt)) {
309  emEndcap[iside].push_back(febId);
310  }
311  else if (m_onlineHelper->isHECchannel(*febIt)) {
312  hec[iside].push_back(febId);
313  }
314  else if (m_onlineHelper->isFCALchannel(*febIt)) {
315  fcal[iside].push_back(febId);
316  }
317  else {
318  log << MSG::DEBUG << "Uassociated FEB id: "
319  << MSG::hex << (febId) << MSG::dec
320  << " isCalib " << m_onlineHelper->isCalibration(*febIt)
321  << " " << m_onlineHelper->show_to_string(*febIt)
322  << endmsg;
323  }
324  }
325  // add for LArCondFEBIdChanMap
326  unsigned int nChanPerGain = 12;
327  unsigned int minGain = 0;
328  unsigned int nGains = 3;
329  m_febIdChanMap = LArCondFEBIdChanMap(nChanPerGain, minGain, nGains);
330  for (int iside=0; iside<2; ++iside) {
331  m_febIdChanMap.addFEBIdVector(0+iside*6, emBarrel[iside]);
332  m_febIdChanMap.addFEBIdVector(1+iside*6, emBarrelPS[iside]);
333  m_febIdChanMap.addFEBIdVector(2+iside*6, emEndcap[iside]);
334  m_febIdChanMap.addFEBIdVector(3+iside*6, emEndcapPS[iside]);
335  m_febIdChanMap.addFEBIdVector(4+iside*6, hec[iside]);
336  m_febIdChanMap.addFEBIdVector(5+iside*6, fcal[iside]);
337  }
338 
339  }
340  else if (FeedThroughGrouping == m_groupType) {
341  log << MSG::DEBUG << "FeedThrough grouping "<< endmsg;
342 
343  // Set up LArCondFEBIdChanMap for four groups: EM barrel, EMEM, HEC, FCal
344  std::vector<HWIdentifier>::const_iterator febIt = m_onlineHelper->feb_begin();
345  std::vector<HWIdentifier>::const_iterator febEnd = m_onlineHelper->feb_end();
346 
347  std::vector<LArCondFEBIdChanMap::FEBIdVector> ft(m_onlineHelper->feedthroughHashMax());
348 
349 
350  for (; febIt != febEnd; ++febIt) {
351  // Find the feedthru hash and add to vector
352  HWIdentifier febId = (*febIt);
353  int b_ec = m_onlineHelper->barrel_ec(febId);
354  int p_n = m_onlineHelper->pos_neg(febId);
355  int f_t = m_onlineHelper->feedthrough(febId);
356  HWIdentifier ftid = m_onlineHelper->feedthrough_Id(b_ec, p_n, f_t);
358  if (fthash < ft.size()) {
359  ft[fthash].push_back(febId.get_identifier32().get_compact());
360  }
361  else {
362  log << MSG::ERROR << "Feedthru hash > channel map size: id, hash, size "
363  << MSG::hex << febId << MSG::dec << " "
364  << ftid << " " << ft.size()
365  << endmsg;
366  return (StatusCode::FAILURE);
367  }
368  }
369  // add for LArCondFEBIdChanMap
370  unsigned int nChanPerGain = ft.size();
371  unsigned int minGain = 0;
372  unsigned int nGains = 3;
373  m_febIdChanMap = LArCondFEBIdChanMap(nChanPerGain, minGain, nGains);
374  for (unsigned int i = 0; i < ft.size(); ++i) {
376  }
377  }
378  else if (ExtendedFTGrouping == m_groupType) {
379 
380  log << MSG::DEBUG << "Extended FeedThrough grouping (PS goes seperatly, EMEC in HEC as well)"<< endmsg;
381 
382  // Set up LArCondFEBIdChanMap for four groups: EM barrel, EMEM, HEC, FCal
383  std::vector<HWIdentifier>::const_iterator febIt = m_onlineHelper->feb_begin();
384  std::vector<HWIdentifier>::const_iterator febEnd = m_onlineHelper->feb_end();
385 
386  //Vectors of groups
387  //Standard Febs (one group per FT)
388  std::vector<LArCondFEBIdChanMap::FEBIdVector> ft(m_onlineHelper->feedthroughHashMax());
389  //Presampler FEBs (one group per FT)
390  std::vector<LArCondFEBIdChanMap::FEBIdVector> ftPS(m_onlineHelper->feedthroughHashMax());
391  //EMEC channel in special crate:
392  std::vector<LArCondFEBIdChanMap::FEBIdVector> ftSpecial(8); //How many are there?
393 
394  for (; febIt != febEnd; ++febIt) {
395  // Find the feedthru hash and add to vector
396  HWIdentifier febId = (*febIt);
397  int b_ec = m_onlineHelper->barrel_ec(febId);
398  int p_n = m_onlineHelper->pos_neg(febId);
399  int f_t = m_onlineHelper->feedthrough(febId);
400  HWIdentifier ftid = m_onlineHelper->feedthrough_Id(b_ec, p_n, f_t);
402 
403  //sanity check
404  if (fthash >= ft.size()) {
405  log << MSG::ERROR << "Feedthru hash > channel map size: id, hash, size "
406  << MSG::hex << febId << MSG::dec << " "
407  << ftid << " " << ft.size()
408  << endmsg;
409  return (StatusCode::FAILURE);
410  }
411 
412  //Subdivide into specific cases:
413  if (!m_onlineHelper->isEMECinHECchannel(febId)) { //this is taken care of further down
414  if (m_onlineHelper->isPS(febId))
415  ftPS[fthash].push_back(febId.get_identifier32().get_compact()); //PS goes in separate channels
416  else
417  ft[fthash].push_back(febId.get_identifier32().get_compact());
418  }
419  }
420  //EMEC in HEC crate: Do 'by hand'
421  //FTs: 3,10,16,22 Slots: 1,2
422  //parameters: ec,pn,ft,slot
423  ftSpecial[0].push_back(m_onlineHelper->feb_Id(1,0,3,1).get_identifier32().get_compact());
424  ftSpecial[0].push_back(m_onlineHelper->feb_Id(1,0,3,2).get_identifier32().get_compact());
425 
426  ftSpecial[1].push_back(m_onlineHelper->feb_Id(1,1,3,1).get_identifier32().get_compact());
427  ftSpecial[1].push_back(m_onlineHelper->feb_Id(1,1,3,2).get_identifier32().get_compact());
428 
429  ftSpecial[2].push_back(m_onlineHelper->feb_Id(1,0,10,1).get_identifier32().get_compact());
430  ftSpecial[2].push_back(m_onlineHelper->feb_Id(1,0,10,2).get_identifier32().get_compact());
431 
432  ftSpecial[3].push_back(m_onlineHelper->feb_Id(1,1,10,1).get_identifier32().get_compact());
433  ftSpecial[3].push_back(m_onlineHelper->feb_Id(1,1,10,2).get_identifier32().get_compact());
434 
435  ftSpecial[4].push_back(m_onlineHelper->feb_Id(1,0,16,1).get_identifier32().get_compact());
436  ftSpecial[4].push_back(m_onlineHelper->feb_Id(1,0,16,2).get_identifier32().get_compact());
437 
438  ftSpecial[5].push_back(m_onlineHelper->feb_Id(1,1,16,1).get_identifier32().get_compact());
439  ftSpecial[5].push_back(m_onlineHelper->feb_Id(1,1,16,2).get_identifier32().get_compact());
440 
441  ftSpecial[6].push_back(m_onlineHelper->feb_Id(1,0,22,1).get_identifier32().get_compact());
442  ftSpecial[6].push_back(m_onlineHelper->feb_Id(1,0,22,2).get_identifier32().get_compact());
443 
444  ftSpecial[7].push_back(m_onlineHelper->feb_Id(1,1,22,1).get_identifier32().get_compact());
445  ftSpecial[7].push_back(m_onlineHelper->feb_Id(1,1,22,2).get_identifier32().get_compact());
446 
447 
448  // add for LArCondFEBIdChanMap
449  unsigned int nChanPerGain = ft.size()+ftPS.size()+ftSpecial.size();
450  unsigned int minGain = 0;
451  unsigned int nGains = 3;
452  unsigned int iCoolChannel=0;
453  m_febIdChanMap = LArCondFEBIdChanMap(nChanPerGain, minGain, nGains);
454  for (unsigned int i = 0; i < ft.size(); ++i) {
455  m_febIdChanMap.addFEBIdVector(iCoolChannel++, ft[i]);
456  }
457  for (unsigned int i = 0; i < ftPS.size(); ++i) {
458  m_febIdChanMap.addFEBIdVector(iCoolChannel++, ftPS[i]);
459  }
460  for (unsigned int i = 0; i < ftSpecial.size(); ++i) {
461  m_febIdChanMap.addFEBIdVector(iCoolChannel++, ftSpecial[i]);
462  }
463  } else {
464  log << MSG::ERROR << "Unknown COOL Channel grouping " << m_groupType << endmsg;
465  return StatusCode::FAILURE;
466  }
467  // Resize the vector mapping the COOL channel to the
468  // DataVector.
469  m_channelToMultChanCollIndex = std::vector<unsigned int>(m_febIdChanMap.totalChannels(), 9999);
470 
471  log << MSG::DEBUG << "Number of channels per gain "
473  << endmsg;
474 
475  log << MSG::DEBUG << "Mininum gain value "
476  << m_febIdChanMap.minGain()
477  << endmsg;
478 
479  log << MSG::DEBUG << "Number of gain values "
481  << endmsg;
482 
483  log << MSG::DEBUG << "Number of offset channels "
485  << endmsg;
486 
487  log << MSG::DEBUG << "Total number of channels "
489  << endmsg;
490 
491  return (StatusCode::SUCCESS);
492 
493 }

◆ initializeBase()

StatusCode LArConditionsContainerBase::initializeBase ( )

initialize

Definition at line 56 of file LArConditionsContainerBase.cxx.

57 {
58  MsgStream log(Athena::getMessageSvc(), "LArConditionsContainerBase");
59  log << MSG::DEBUG << "initializeBase "<< endmsg;
60 
61  if (m_isInitialized) {
62  log << MSG::DEBUG << "already initialized - returning "<< endmsg;
63  return (StatusCode::SUCCESS);
64  }
65 
66  //Get LArOnlineID....
67  ISvcLocator* svcLoc = Gaudi::svcLocator( );
69  StatusCode sc = svcLoc->service("DetectorStore",detStore);
70  if (sc.isFailure()) {
71  log << MSG::ERROR << "Cannot get DetectorStore!" << endmsg;
72  return sc;
73  }
74 
76  //Dealing with supercells, need supercell identifier helper
77  const LArOnline_SuperCellID* onlID = nullptr;
78  sc = detStore->retrieve(onlID,"LArOnline_SuperCellID");
79  if (sc.isFailure()) {
80  log << MSG::ERROR << "Cannot get LArOnline_SuperCellID!" << endmsg;
81  return sc;
82  }
83  m_onlineHelper=onlID;//cast to base-class
84 
85  const CaloCell_SuperCell_ID* oflID = nullptr;
86  sc = detStore->retrieve(oflID,"CaloCell_SuperCell_ID");
87  if (sc.isFailure()) {
88  log << MSG::ERROR << "Cannot get CaloCell_SuperCell_ID!" << endmsg;
89  return sc;
90  }
91  m_offlineHelper=oflID; //cast to base-class
92  }
93  else {
94  //Regular readout
95  const LArOnlineID* onlID = nullptr;
96  sc = detStore->retrieve(onlID,"LArOnlineID");
97  if (sc.isFailure()) {
98  log << MSG::ERROR << "Cannot get LArOnlineID!" << endmsg;
99  return sc;
100  }
101  m_onlineHelper=onlID;//cast to base-class
102 
103  const CaloCell_ID* oflID = nullptr;
104  sc = detStore->retrieve(oflID,"CaloCell_ID");
105  if (sc.isFailure()) {
106  log << MSG::ERROR << "Cannot get CaloCell_ID!" << endmsg;
107  return sc;
108  }
109  m_offlineHelper=oflID; //cast to base-class
110  }
111 
112  // initialize the grouping
113  sc = initGrouping();
114  if (sc.isFailure()) {
115  log << MSG::ERROR << "Cannot initialize the Grouping" << endmsg;
116  return sc;
117  }
118 
119  // Set initialized to true
120  m_isInitialized = true;
121  log << MSG::DEBUG << "end initializeBase " << endmsg;
122 
123  return (StatusCode::SUCCESS);
124 }

◆ offlineHelper()

const CaloCell_Base_ID * LArConditionsContainerBase::offlineHelper ( ) const

provide access to offline id helper

Definition at line 525 of file LArConditionsContainerBase.cxx.

526 {
527  return (m_offlineHelper);
528 }

◆ onlineHelper()

const LArOnlineID_Base * LArConditionsContainerBase::onlineHelper ( ) const

provide access to online id helper

Definition at line 519 of file LArConditionsContainerBase.cxx.

520 {
521  return (m_onlineHelper);
522 }

◆ setGroupingType() [1/2]

StatusCode LArConditionsContainerBase::setGroupingType ( const std::string &  groupingStr,
MsgStream &  logStr 
)

allow group type to be set externally based on a string returns an FAILURE and a message to logStr if unknown string is supplied

Definition at line 134 of file LArConditionsContainerBase.cxx.

135 {
136  // Set grouping type - default is SubDet
137  if (groupingStr == "Single")
139  return StatusCode::SUCCESS;
140  }
141  else if (groupingStr == "SubDetector")
143  return StatusCode::SUCCESS;
144  }
145  else if (groupingStr == "ExtendedSubDetector")
147  return StatusCode::SUCCESS;
148  }
149  else if (groupingStr == "FeedThrough")
151  return StatusCode::SUCCESS;
152  }
153  else if (groupingStr == "ExtendedFeedThrough") {
155  return StatusCode::SUCCESS;
156  }
157  else if (groupingStr == "SuperCells") {
159  return StatusCode::SUCCESS;
160  }
161 
162  logStr << MSG::ERROR << "Unknown COOL Channel Grouping '"<< groupingStr <<"'. Allowed values are:" << endmsg;
163  logStr << MSG::ERROR << "'Single','SubDetector', 'ExtendedSubDetector','FeedThrough','ExtendedFeedThrough'" << endmsg;
164  return StatusCode::FAILURE;
165 }

◆ setGroupingType() [2/2]

void LArConditionsContainerBase::setGroupingType ( GroupingType  type)

allow group type to be set externally - need to (re)initialize after setting grouping type

Definition at line 127 of file LArConditionsContainerBase.cxx.

128 {
129  m_groupType = type;
130 }

Member Data Documentation

◆ m_channelToMultChanCollIndex

std::vector<unsigned int> LArConditionsContainerBase::m_channelToMultChanCollIndex
protected

Definition at line 114 of file LArConditionsContainerBase.h.

◆ m_febIdChanMap

LArCondFEBIdChanMap LArConditionsContainerBase::m_febIdChanMap
protected

Definition at line 108 of file LArConditionsContainerBase.h.

◆ m_groupType

GroupingType LArConditionsContainerBase::m_groupType
protected

Definition at line 107 of file LArConditionsContainerBase.h.

◆ m_isInitialized

bool LArConditionsContainerBase::m_isInitialized
protected

Definition at line 115 of file LArConditionsContainerBase.h.

◆ m_offlineHelper

const CaloCell_Base_ID* LArConditionsContainerBase::m_offlineHelper
protected

Definition at line 110 of file LArConditionsContainerBase.h.

◆ m_onlineHelper

const LArOnlineID_Base* LArConditionsContainerBase::m_onlineHelper
protected

Definition at line 109 of file LArConditionsContainerBase.h.


The documentation for this class was generated from the following files:
LArOnlineID_Base::feedthroughHashMax
size_type feedthroughHashMax(void) const
Define feedthrough hash tables max size.
Definition: LArOnlineID_Base.cxx:1891
LArConditionsContainerBase::SuperCells
@ SuperCells
Definition: LArConditionsContainerBase.h:51
LArCondFEBIdChanMap::totalChannels
unsigned int totalChannels() const
Total number of channels for all gains and includes special offset channels.
Definition: LArCondFEBIdChanMap.h:337
PlotCalibFromCool.ft
ft
Definition: PlotCalibFromCool.py:329
LArConditionsContainerBase::setGroupingType
void setGroupingType(GroupingType type)
allow group type to be set externally - need to (re)initialize after setting grouping type
Definition: LArConditionsContainerBase.cxx:127
LArConditionsContainerBase::SingleGroup
@ SingleGroup
Definition: LArConditionsContainerBase.h:46
LArCondFEBIdChanMap::EMBA
@ EMBA
Definition: LArCondFEBIdChanMap.h:65
LArConditionsContainerBase::ExtendedSubDetGrouping
@ ExtendedSubDetGrouping
Definition: LArConditionsContainerBase.h:50
LArConditionsContainerBase::SubDetectorGrouping
@ SubDetectorGrouping
Definition: LArConditionsContainerBase.h:47
index
Definition: index.py:1
LArCondFEBIdChanMap::channelsPerGain
unsigned int channelsPerGain() const
Number of cool channels per gain.
Definition: LArCondFEBIdChanMap.h:308
CaloCondBlobAlgs_fillNoiseFromASCII.gain
gain
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:110
LArCondFEBIdChanMap::EMECC
@ EMECC
Definition: LArCondFEBIdChanMap.h:68
LArOnlineID_Base::feb_begin
id_iterator feb_begin() const
Returns an iterator pointing to a feb identifier collection.
Definition: LArOnlineID_Base.cxx:1910
LArConditionsContainerBase::initGrouping
StatusCode initGrouping()
Definition: LArConditionsContainerBase.cxx:169
LArCondFEBIdChanMap::EMBC
@ EMBC
Definition: LArCondFEBIdChanMap.h:66
LArCondFEBIdChanMap::PSECA
@ PSECA
Definition: LArCondFEBIdChanMap.h:63
HWIdentifier
Definition: HWIdentifier.h:13
LArOnlineID_Base::barrel_ec
int barrel_ec(const HWIdentifier id) const
Return the position barrel or endcap of a hardware cell identifier: barrel_ec = [0,...
Definition: LArOnlineID_Base.cxx:1942
LArCondFEBIdChanMap::nOffsetChannels
unsigned int nOffsetChannels() const
Number of offset channels - i.e. correction channels.
Definition: LArCondFEBIdChanMap.h:329
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition: getMessageSvc.cxx:20
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
LArCondFEBIdChanMap::FCALA
@ FCALA
Definition: LArCondFEBIdChanMap.h:71
LArCondFEBIdChanMap::PSECC
@ PSECC
Definition: LArCondFEBIdChanMap.h:64
LArOnlineID_Base::isFCALchannel
bool isFCALchannel(const HWIdentifier id) const
Definition: LArOnlineID_Base.cxx:1657
LArCondFEBIdChanMap::HECC
@ HECC
Definition: LArCondFEBIdChanMap.h:70
StoreGateSvc
The Athena Transient Store API.
Definition: StoreGateSvc.h:128
LArCondFEBIdChanMap::EMECA
@ EMECA
Definition: LArCondFEBIdChanMap.h:67
LArCondFEBIdChanMap::minGain
unsigned int minGain() const
Mininum gain value.
Definition: LArCondFEBIdChanMap.h:315
LArOnlineID_Base::feedthrough_Hash
IdentifierHash feedthrough_Hash(HWIdentifier feedthroughId) const
Create hash id from feedthrough identifiers.
Definition: LArOnlineID_Base.cxx:1416
Identifier32::get_compact
value_type get_compact(void) const
Get the compact id.
Definition: Identifier32.h:171
CaloCell_SuperCell_ID
Helper class for offline supercell identifiers.
Definition: CaloCell_SuperCell_ID.h:48
lumiFormat.i
int i
Definition: lumiFormat.py:92
LArOnlineID_Base::isHECchannel
virtual bool isHECchannel(const HWIdentifier id) const =0
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
LArOnlineID_Base::isEMECPS
bool isEMECPS(const HWIdentifier id) const
Definition: LArOnlineID_Base.cxx:1675
master.flag
bool flag
Definition: master.py:29
LArCondFEBIdChanMap::HECA
@ HECA
Definition: LArCondFEBIdChanMap.h:69
LArOnlineID_Base::pos_neg
int pos_neg(const HWIdentifier id) const
Return the side of a hardware cell identifier pos_neg = [0,1] positive-side or negative-side Barrel...
Definition: LArOnlineID_Base.cxx:1954
CaloCell_ID
Helper class for offline cell identifiers.
Definition: CaloCell_ID.h:34
LArConditionsContainerBase::m_onlineHelper
const LArOnlineID_Base * m_onlineHelper
Definition: LArConditionsContainerBase.h:109
HLT::setFlag
void setFlag(TrigPassFlags *flags, const T *obj, const CONTAINER *container, const std::vector< bool > &flag)
Set the flag at index position.
Definition: TrigPassFlags.h:121
LArConditionsContainerBase::Unknown
@ Unknown
Definition: LArConditionsContainerBase.h:45
LArCondFEBIdChanMap::febIdVector
const FEBIdVector & febIdVector(unsigned int gain, unsigned int coolChannel) const
Access to a FEB ID vector for a given gain and COOL channel.
Definition: LArCondFEBIdChanMap.h:226
LArOnlineID_Base::feb_Id
HWIdentifier feb_Id(int barrel_ec, int pos_neg, int feedthrough, int slot) const
Create feb_Id from fields.
Definition: LArOnlineID_Base.cxx:1483
LArOnlineID_Base::feb_end
id_iterator feb_end() const
Definition: LArOnlineID_Base.cxx:1915
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
LArConditionsContainerBase::m_channelToMultChanCollIndex
std::vector< unsigned int > m_channelToMultChanCollIndex
Definition: LArConditionsContainerBase.h:114
LArOnlineID_Base::isEMECchannel
virtual bool isEMECchannel(const HWIdentifier id) const =0
LArConditionsContainerBase::m_offlineHelper
const CaloCell_Base_ID * m_offlineHelper
Definition: LArConditionsContainerBase.h:110
LArOnlineID
Definition: LArOnlineID.h:20
LArOnlineID_Base::isCalibration
bool isCalibration(const HWIdentifier id) const
Definition: LArOnlineID_Base.cxx:1787
LArConditionsContainerBase::ExtendedFTGrouping
@ ExtendedFTGrouping
Definition: LArConditionsContainerBase.h:49
LArConditionsContainerBase::m_isInitialized
bool m_isInitialized
Definition: LArConditionsContainerBase.h:115
LArOnlineID_Base::isEMBchannel
bool isEMBchannel(const HWIdentifier id) const
Definition: LArOnlineID_Base.cxx:1652
LArOnline_SuperCellID
Definition: LArOnline_SuperCellID.h:20
LArCondFEBIdChanMap::FEBIdVector
std::vector< FEBId > FEBIdVector
Definition: LArCondFEBIdChanMap.h:54
LArCondFEBIdChanMap::nGains
unsigned int nGains() const
Number of gain values.
Definition: LArCondFEBIdChanMap.h:322
LArOnlineID_Base::feedthrough
int feedthrough(const HWIdentifier id) const
Return the feedthrough of a hardware cell identifier : feedthrough = [0,31] Barrel - A/C side or H/...
Definition: LArOnlineID_Base.cxx:1948
LArCondFEBIdChanMap::PSBA
@ PSBA
Definition: LArCondFEBIdChanMap.h:61
AtlasDetectorID::show_to_string
std::string show_to_string(Identifier id, const IdContext *context=0, char sep='.') const
or provide the printout in string form
Definition: AtlasDetectorID.cxx:574
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
LArCondFEBIdChanMap::addFEBIdVector
void addFEBIdVector(unsigned int channel, const FEBIdVector &febIdVec)
Add in a FEBIdVector - channel number should be from 0 to NChannelsPerGain-1
Definition: LArCondFEBIdChanMap.h:344
LArOnlineID_Base::isEMBPS
bool isEMBPS(const HWIdentifier id) const
Definition: LArOnlineID_Base.cxx:1665
DEBUG
#define DEBUG
Definition: page_access.h:11
LArCondFEBIdChanMap
This class maps FEB IDs to/from COOL channel ids.
Definition: LArCondFEBIdChanMap.h:49
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
LArCondFEBIdChanMap::PSBC
@ PSBC
Definition: LArCondFEBIdChanMap.h:62
LArOnlineID_Base::isPS
bool isPS(const HWIdentifier id) const
Definition: LArOnlineID_Base.cxx:1681
LArCondFEBIdChanMap::NCORRTYPE
@ NCORRTYPE
Definition: LArCondFEBIdChanMap.h:73
LArCondFEBIdChanMap::FCALC
@ FCALC
Definition: LArCondFEBIdChanMap.h:72
LArConditionsContainerBase::m_febIdChanMap
LArCondFEBIdChanMap m_febIdChanMap
Definition: LArConditionsContainerBase.h:108
IdentifierHash
Definition: IdentifierHash.h:38
Identifier::get_identifier32
Identifier32 get_identifier32(void) const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
LArConditionsContainerBase::FeedThroughGrouping
@ FeedThroughGrouping
Definition: LArConditionsContainerBase.h:48
LArConditionsContainerBase::m_groupType
GroupingType m_groupType
Definition: LArConditionsContainerBase.h:107
LArOnlineID_Base::isEMECinHECchannel
bool isEMECinHECchannel(const HWIdentifier id) const
Definition: LArOnlineID_Base.cxx:1877
LArOnlineID_Base::feedthrough_Id
HWIdentifier feedthrough_Id(int barrel_ec, int pos_neg, int feedthrough) const
Create a feedthrough identifier from fields.
Definition: LArOnlineID_Base.cxx:1404