ATLAS Offline Software
LArBadChannelDBTools.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef LArBadChannelDBTools_H
6 #define LArBadChannelDBTools_H
7 
8 #include "CoolKernel/types.h"
9 #include "CoolKernel/Record.h"
10 #include "CoralBase/AttributeListSpecification.h"
13 
21 
22 #include "GaudiKernel/MsgStream.h"
23 
24 #include <vector>
25 
27 
28  typedef std::pair<HWIdentifier, LArBadChannel> BadChanEntry;
29  typedef std::pair<HWIdentifier, LArBadFeb> BadFebEntry;
30  typedef std::vector<BadChanEntry> BadChanVec;
31  typedef std::vector<BadFebEntry> BadFebVec;
33 
35  MsgStream getDefaultMsgStream();
36 
38  coral::AttributeListSpecification* createCoolSpec();
39 
40  template <class Entry>
41  AthenaAttributeList* createPayload( const std::vector<Entry>& data,
42  const coral::AttributeListSpecification& spec );
43 
45 
47  const coral::AttributeListSpecification& spec);
48 
50 
51  AthenaAttributeList* createFebPayloadV1( const std::vector<HWIdentifier32>& data);
52 
55 
57  inline unsigned int badChanVersion() {return 1;}
58  inline unsigned int badFebVersion() {return 2;}
59 
60  void fillControlInfo( AthenaAttributeList* attrList, unsigned int wordSize, unsigned int vers);
61 
62  template <class T>
63  AthenaAttributeList* createPayload( const std::vector< std::pair<HWIdentifier,T> >& data,
64  const coral::AttributeListSpecification& spec,
65  unsigned int vers)
66  {
68  fillControlInfo(attrList, sizeof( typename T::BitWord), vers);
69  coral::Blob& blob=(*attrList)["Blob"].data<coral::Blob>();
71  return attrList;
72  }
73 
74  std::vector<BadChanEntry>
75  readBadChan( const coral::AttributeList& attrList, MsgStream& log);
76 
77  std::vector<BadFebEntry>
78  readBadFeb( const coral::AttributeList& attrList, MsgStream& log);
79 }
80 
81 #endif
LArBadChannelState.h
LArBadChannelState
Definition: LArBadChannelState.h:15
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
LArBadChannelDBTools::createCoolSpec
coral::AttributeListSpecification * createCoolSpec()
creates the AttributeListSpecification for the LArBadChannel DB
Definition: LArBadChannelDBTools.cxx:35
LArBadChannelDBTools
Definition: LArBadChannelDBTools.h:26
CondAttrListCollection.h
This file defines the class for a collection of AttributeLists where each one is associated with a ch...
CaloCondBlobAlgs_fillNoiseFromASCII.spec
spec
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:47
LArBadChannel.h
LArBadChannelDBTools::createFebPayload
AthenaAttributeList * createFebPayload(const BadFebVec &data)
Definition: LArBadChannelDBTools.cxx:65
LArBadChanBlobUtils::BadChanVec
std::vector< BadChanEntry > BadChanVec
Definition: LArBadChanBlobUtils.h:22
python.subdetectors.tile.Blob
Blob
Definition: tile.py:17
LArBadChannelDBTools::createFebPayloadV1
AthenaAttributeList * createFebPayloadV1(const std::vector< HWIdentifier32 > &data)
python.PyKernel.AttributeList
AttributeList
Definition: PyKernel.py:36
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,...
LArBadChannelDBTools::readBadFeb
std::vector< BadFebEntry > readBadFeb(const coral::AttributeList &attrList, MsgStream &log)
Definition: LArBadChannelDBTools.cxx:133
CondAttrListCollection
This class is a collection of AttributeLists where each one is associated with a channel number....
Definition: CondAttrListCollection.h:52
AthenaAttributeList.h
LArBadChannelDBTools::Channel
HWIdentifier32::value_type Channel
Definition: LArBadChannelDBTools.h:32
LArBadChanBlobUtils::BadFebVec
std::vector< BadFebEntry > BadFebVec
Definition: LArBadChanBlobUtils.h:23
LArBadChannelDBTools::createCoolCollection
CondAttrListCollection * createCoolCollection(const LArBadChannelState &bcState)
Definition: LArBadChannelDBTools.cxx:82
LArBadChannelDBTools::createPayload
AthenaAttributeList * createPayload(const std::vector< Entry > &data, const coral::AttributeListSpecification &spec)
LArBadChannelDBTools::readBadChan
std::vector< BadChanEntry > readBadChan(const coral::AttributeList &attrList, MsgStream &log)
Definition: LArBadChannelDBTools.cxx:119
LArBadChannelDBTools::fillControlInfo
void fillControlInfo(AthenaAttributeList *attrList, unsigned int wordSize, unsigned int vers)
Definition: LArBadChannelDBTools.cxx:50
LArBadChanBlobUtils.h
LArBadFeb.h
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
HWIdentifier.h
LArBadChannelDBTools::BadFebEntry
std::pair< HWIdentifier, LArBadFeb > BadFebEntry
Definition: LArBadChannelDBTools.h:29
LArBadChannelDBTools::badChanVersion
unsigned int badChanVersion()
Version of the BLOB encoding, to be incremented each time the BLOB format changes.
Definition: LArBadChannelDBTools.h:57
LArBadChannelDBTools::BadFebVec
std::vector< BadFebEntry > BadFebVec
Definition: LArBadChannelDBTools.h:31
HWIdentifier32.h
LArBadChannelDBTools::createEmptyCoolCollection
CondAttrListCollection * createEmptyCoolCollection()
Create an empty collection with no bad channels, e.g. for MC.
Definition: LArBadChannelDBTools.cxx:102
LArBadChannelDBTools::badFebVersion
unsigned int badFebVersion()
Definition: LArBadChannelDBTools.h:58
LArBadChannelDBTools::BadChanEntry
std::pair< HWIdentifier, LArBadChannel > BadChanEntry
Definition: LArBadChannelDBTools.h:28
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
LArBadChannelDBTools::BadChanVec
std::vector< BadChanEntry > BadChanVec
Definition: LArBadChannelDBTools.h:30
LArBadFebBitPacking.h
LArBadChannelDBTools::getDefaultMsgStream
MsgStream getDefaultMsgStream()
used to get default msg stream
Definition: LArBadChannelDBTools.cxx:28
CaloCondBlobAlgs_fillNoiseFromASCII.blob
blob
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:96
Identifier32::value_type
unsigned int value_type
Definition: Identifier32.h:28