ATLAS Offline Software
Typedefs | Functions
LArBadChannelDBTools Namespace Reference

Typedefs

typedef std::pair< HWIdentifier, LArBadChannelBadChanEntry
 
typedef std::pair< HWIdentifier, LArBadFebBadFebEntry
 
typedef std::vector< BadChanEntryBadChanVec
 
typedef std::vector< BadFebEntryBadFebVec
 
typedef HWIdentifier32::value_type Channel
 

Functions

MsgStream getDefaultMsgStream ()
 used to get default msg stream More...
 
coral::AttributeListSpecification * createCoolSpec ()
 creates the AttributeListSpecification for the LArBadChannel DB More...
 
template<class Entry >
AthenaAttributeListcreatePayload (const std::vector< Entry > &data, const coral::AttributeListSpecification &spec)
 
CondAttrListCollectioncreateCoolCollection (const LArBadChannelState &bcState)
 
AthenaAttributeListcreateChanPayload (const BadChanVec &data, const coral::AttributeListSpecification &spec)
 
AthenaAttributeListcreateFebPayload (const BadFebVec &data)
 
AthenaAttributeListcreateFebPayloadV1 (const std::vector< HWIdentifier32 > &data)
 
CondAttrListCollectioncreateEmptyCoolCollection ()
 Create an empty collection with no bad channels, e.g. for MC. More...
 
unsigned int badChanVersion ()
 Version of the BLOB encoding, to be incremented each time the BLOB format changes. More...
 
unsigned int badFebVersion ()
 
void fillControlInfo (AthenaAttributeList *attrList, unsigned int wordSize, unsigned int vers)
 
template<class T >
AthenaAttributeListcreatePayload (const std::vector< std::pair< HWIdentifier, T > > &data, const coral::AttributeListSpecification &spec, unsigned int vers)
 
std::vector< BadChanEntryreadBadChan (const coral::AttributeList &attrList, MsgStream &log)
 
std::vector< BadFebEntryreadBadFeb (const coral::AttributeList &attrList, MsgStream &log)
 
AthenaAttributeListcreateFebPayloadV1 (const std::vector< HWIdentifier > &data)
 

Typedef Documentation

◆ BadChanEntry

Definition at line 28 of file LArBadChannelDBTools.h.

◆ BadChanVec

Definition at line 30 of file LArBadChannelDBTools.h.

◆ BadFebEntry

Definition at line 29 of file LArBadChannelDBTools.h.

◆ BadFebVec

Definition at line 31 of file LArBadChannelDBTools.h.

◆ Channel

Definition at line 32 of file LArBadChannelDBTools.h.

Function Documentation

◆ badChanVersion()

unsigned int LArBadChannelDBTools::badChanVersion ( )
inline

Version of the BLOB encoding, to be incremented each time the BLOB format changes.

Definition at line 57 of file LArBadChannelDBTools.h.

57 {return 1;}

◆ badFebVersion()

unsigned int LArBadChannelDBTools::badFebVersion ( )
inline

Definition at line 58 of file LArBadChannelDBTools.h.

58 {return 2;}

◆ createChanPayload()

AthenaAttributeList * LArBadChannelDBTools::createChanPayload ( const BadChanVec data,
const coral::AttributeListSpecification &  spec 
)

Definition at line 59 of file LArBadChannelDBTools.cxx.

61  {
63  }

◆ createCoolCollection()

CondAttrListCollection * LArBadChannelDBTools::createCoolCollection ( const LArBadChannelState bcState)

Definition at line 82 of file LArBadChannelDBTools.cxx.

83  {
84  CondAttrListCollection* attrListColl = new CondAttrListCollection(true);
85 
86  coral::AttributeListSpecification* spec = createCoolSpec();
87 
88  for (int i=0; i<LArBadChannelState::NCoolChannels; i++) {
91  if (!bcState.coolChannel( cc).empty()) {
92  AthenaAttributeList* ilist =
95  attrListColl->add(chanNum, *ilist);
96  }
97  }
98 
99  return attrListColl;
100  }

◆ createCoolSpec()

coral::AttributeListSpecification * LArBadChannelDBTools::createCoolSpec ( )

creates the AttributeListSpecification for the LArBadChannel DB

Definition at line 35 of file LArBadChannelDBTools.cxx.

36  {
37  coral::AttributeListSpecification* spec = new coral::AttributeListSpecification();
38  if (spec == nullptr) {
39  return spec;
40  }
41  spec->extend("ChannelSize", "unsigned int");
42  spec->extend("StatusWordSize", "unsigned int");
43  spec->extend("Endianness", "unsigned int");
44  spec->extend("Version", "unsigned int");
45  spec->extend("Blob", "blob");
46 
47  return spec;
48  }

◆ createEmptyCoolCollection()

CondAttrListCollection * LArBadChannelDBTools::createEmptyCoolCollection ( )

Create an empty collection with no bad channels, e.g. for MC.

Definition at line 102 of file LArBadChannelDBTools.cxx.

103  {
104  CondAttrListCollection* attrListColl = new CondAttrListCollection(true);
105 
106  coral::AttributeListSpecification* spec = createCoolSpec();
107  for (int i=0; i<2; i++) {
111  AthenaAttributeList* ilist = createChanPayload( emptyChan.stateVector(), *spec);
113  attrListColl->add(chanNum, *ilist);
114  }
115  return attrListColl;
116  }

◆ createFebPayload()

AthenaAttributeList * LArBadChannelDBTools::createFebPayload ( const BadFebVec data)

Definition at line 65 of file LArBadChannelDBTools.cxx.

66  {
67  coral::AttributeListSpecification* spec = createCoolSpec();
68  return createPayload( data, *spec, badFebVersion());
69  }

◆ createFebPayloadV1() [1/2]

AthenaAttributeList* LArBadChannelDBTools::createFebPayloadV1 ( const std::vector< HWIdentifier > &  data)

Definition at line 71 of file LArBadChannelDBTools.cxx.

72  {
73  coral::AttributeListSpecification* spec = createCoolSpec();
74 
76  fillControlInfo(attrList, 0, 1);
77  coral::Blob& blob=(*attrList)["Blob"].data<coral::Blob>();
79  return attrList;
80  }

◆ createFebPayloadV1() [2/2]

AthenaAttributeList* LArBadChannelDBTools::createFebPayloadV1 ( const std::vector< HWIdentifier32 > &  data)

◆ createPayload() [1/2]

template<class Entry >
AthenaAttributeList* LArBadChannelDBTools::createPayload ( const std::vector< Entry > &  data,
const coral::AttributeListSpecification &  spec 
)

◆ createPayload() [2/2]

template<class T >
AthenaAttributeList* LArBadChannelDBTools::createPayload ( const std::vector< std::pair< HWIdentifier, T > > &  data,
const coral::AttributeListSpecification &  spec,
unsigned int  vers 
)

Definition at line 63 of file LArBadChannelDBTools.h.

66  {
68  fillControlInfo(attrList, sizeof( typename T::BitWord), vers);
69  coral::Blob& blob=(*attrList)["Blob"].data<coral::Blob>();
71  return attrList;
72  }

◆ fillControlInfo()

void LArBadChannelDBTools::fillControlInfo ( AthenaAttributeList attrList,
unsigned int  wordSize,
unsigned int  vers 
)

Definition at line 50 of file LArBadChannelDBTools.cxx.

51  {
52  (*attrList)["ChannelSize"].setValue( (unsigned int) sizeof(Channel));
53  (*attrList)["StatusWordSize"].setValue( wordSize);
54  (*attrList)["Endianness"].setValue( (unsigned int) machineEndianness());
55  (*attrList)["Version"].setValue( vers);
56  }

◆ getDefaultMsgStream()

MsgStream LArBadChannelDBTools::getDefaultMsgStream ( )

used to get default msg stream

Definition at line 28 of file LArBadChannelDBTools.cxx.

29  {
30  MsgStream log(Athena::getMessageSvc());
31  return log;
32  }

◆ readBadChan()

std::vector< BadChanEntry > LArBadChannelDBTools::readBadChan ( const coral::AttributeList &  attrList,
MsgStream &  log 
)

Definition at line 119 of file LArBadChannelDBTools.cxx.

120  {
121  const coral::Blob& blob = attrList["Blob"].data<coral::Blob>();
122  unsigned int chanSize = attrList["ChannelSize"].data<unsigned int>();
123  unsigned int stateSize = attrList["StatusWordSize"].data<unsigned int>();
124  unsigned int endian = attrList["Endianness"].data<unsigned int>();
125  unsigned int version = attrList["Version"].data<unsigned int>();
126 
127  return
128  LArBadChanBlobUtils::decodeBlob<LArBadChannel>( &blob, chanSize, stateSize, endian,
129  version, log);
130  }

◆ readBadFeb()

std::vector< BadFebEntry > LArBadChannelDBTools::readBadFeb ( const coral::AttributeList &  attrList,
MsgStream &  log 
)

Definition at line 133 of file LArBadChannelDBTools.cxx.

134  {
135  const coral::Blob& blob = attrList["Blob"].data<coral::Blob>();
136  unsigned int chanSize = attrList["ChannelSize"].data<unsigned int>();
137  unsigned int stateSize = attrList["StatusWordSize"].data<unsigned int>();
138  unsigned int endian = attrList["Endianness"].data<unsigned int>();
139  unsigned int version = attrList["Version"].data<unsigned int>();
140 
141  if (version == 1) {
142  // Version 1 nas only HWIdentifier and no LArBadFeb, so we have to add a
143  // LArBadFeb with status "deadAll" by hand
144  std::vector<HWIdentifier> idvec =
145  LArBadChanBlobUtils::decodeFebBlobV1( &blob, chanSize, endian, version, log);
146  std::vector<BadFebEntry> result;
147  result.resize(idvec.size());
148  LArBadFeb missingState;
149  LArBadFebBitPacking febPacking;
150  febPacking.setBit( LArBadFeb::deadAllBit, missingState);
151  for (unsigned int i=0; i<idvec.size(); ++i) {
152  result[i] = BadFebEntry( idvec[i], missingState);
153  }
154  return result;
155  }
156  else {
157  return LArBadChanBlobUtils::decodeBlob<LArBadFeb>( &blob, chanSize, stateSize,
158  endian, version, log);
159  }
160  }
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
get_generator_info.result
result
Definition: get_generator_info.py:21
LArBadChannelDBTools::createCoolSpec
coral::AttributeListSpecification * createCoolSpec()
creates the AttributeListSpecification for the LArBadChannel DB
Definition: LArBadChannelDBTools.cxx:35
LArBadChanBlobUtils::Channel
Identifier32::value_type Channel
Definition: LArBadChanBlobUtils.h:24
CaloCondBlobAlgs_fillNoiseFromASCII.spec
spec
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:47
python.subdetectors.tile.Blob
Blob
Definition: tile.py:17
LArBadChanBlobUtils::decodeFebBlobV1
std::vector< HWIdentifier > decodeFebBlobV1(const coral::Blob *blobp, std::size_t chanSize, int endian, int version, MsgStream &log)
Definition: LArBadChanBlobUtils.cxx:72
LArBadChanBlobUtils::fillBlob
void fillBlob(const std::vector< std::pair< HWIdentifier, T > > &vec, coral::Blob &blob)
Creates a BLOB of the right size and copies the content of the vector of pair<HWIdentifier,...
LArBadChannelState::CoolChannelData::empty
bool empty() const
Definition: LArBadChannelState.h:86
CondAttrListCollection
This class is a collection of AttributeLists where each one is associated with a channel number....
Definition: CondAttrListCollection.h:52
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition: getMessageSvc.cxx:20
LArBadFebEnum::deadAllBit
@ deadAllBit
Definition: LArBadFebEnum.h:16
LArBadChannelDBTools::createPayload
AthenaAttributeList * createPayload(const std::vector< Entry > &data, const coral::AttributeListSpecification &spec)
LArBadChannelState::CoolChannelData
Definition: LArBadChannelState.h:25
LArBadChannelDBTools::fillControlInfo
void fillControlInfo(AthenaAttributeList *attrList, unsigned int wordSize, unsigned int vers)
Definition: LArBadChannelDBTools.cxx:50
LArBadChanBlobUtils::machineEndianness
int machineEndianness()
Definition: LArBadChanBlobUtils.cxx:9
LArBadChanBlobUtils::BadFebEntry
std::pair< HWIdentifier, LArBadFeb > BadFebEntry
Definition: LArBadChanBlobUtils.h:21
checkCoolLatestUpdate.chanNum
chanNum
Definition: checkCoolLatestUpdate.py:27
LArBadChanBlobUtils::fillFebBlobV1
void fillFebBlobV1(const std::vector< HWIdentifier > &vec, coral::Blob &blob)
Definition: LArBadChanBlobUtils.cxx:17
lumiFormat.i
int i
Definition: lumiFormat.py:85
LArBadChannelDBTools::createChanPayload
AthenaAttributeList * createChanPayload(const BadChanVec &data, const coral::AttributeListSpecification &spec)
Definition: LArBadChannelDBTools.cxx:59
AthenaAttributeList
An AttributeList represents a logical row of attributes in a metadata table. The name and type of eac...
Definition: PersistentDataModel/PersistentDataModel/AthenaAttributeList.h:45
LArBadFebBitPacking::setBit
void setBit(ProblemType pb, BitWord &word, bool value=true) const
Definition: LArBadFebBitPacking.cxx:58
CondAttrListCollection::ChanNum
unsigned int ChanNum
Definition: CondAttrListCollection.h:55
LArBadChannelState::coolChannel
const CoolChannelData & coolChannel(CoolChannelEnum chan) const
Definition: LArBadChannelState.h:134
LArBadFeb
Definition: LArBadFeb.h:10
LArBadChannelDBTools::badChanVersion
unsigned int badChanVersion()
Version of the BLOB encoding, to be incremented each time the BLOB format changes.
Definition: LArBadChannelDBTools.h:57
DetDescrDictionaryDict::idvec
DataVector< Identifier > idvec
Definition: DetDescrDictionaryDict.h:14
get_generator_info.version
version
Definition: get_generator_info.py:33
LArBadChannelState::CoolChannelEnum
CoolChannelEnum
Definition: LArBadChannelState.h:23
LArBadFebBitPacking
Definition: LArBadFebBitPacking.h:16
LArBadChannelDBTools::badFebVersion
unsigned int badFebVersion()
Definition: LArBadChannelDBTools.h:58
LArBadChannelState::CoolChannelData::stateVector
const BadChanVec & stateVector() const
Definition: LArBadChannelState.h:90
LArBadChannelState::NCoolChannels
@ NCoolChannels
Definition: LArBadChannelState.h:20
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
CondAttrListCollection::add
bool add(ChanNum chanNum, const AttributeList &attributeList)
Adding in chan/attrList pairs.
Definition: CondAttrListCollection.h:452
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
CaloCondBlobAlgs_fillNoiseFromASCII.blob
blob
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:96
python.handimod.cc
int cc
Definition: handimod.py:523