ATLAS Offline Software
Loading...
Searching...
No Matches
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 {
67 AthenaAttributeList* attrList = new AthenaAttributeList(spec);
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
This file defines the class for a collection of AttributeLists where each one is associated with a ch...
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
An AttributeList represents a logical row of attributes in a metadata table.
This class is a collection of AttributeLists where each one is associated with a channel number.
unsigned int value_type
std::pair< HWIdentifier, LArBadFeb > BadFebEntry
std::vector< BadChanEntry > BadChanVec
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,...
Identifier32::value_type Channel
std::pair< HWIdentifier, LArBadChannel > BadChanEntry
std::vector< BadFebEntry > BadFebVec
coral::AttributeListSpecification * createCoolSpec()
creates the AttributeListSpecification for the LArBadChannel DB
CondAttrListCollection * createCoolCollection(const LArBadChannelState &bcState)
unsigned int badChanVersion()
Version of the BLOB encoding, to be incremented each time the BLOB format changes.
CondAttrListCollection * createEmptyCoolCollection()
Create an empty collection with no bad channels, e.g. for MC.
std::vector< BadChanEntry > readBadChan(const coral::AttributeList &attrList, MsgStream &log)
AthenaAttributeList * createPayload(const std::vector< Entry > &data, const coral::AttributeListSpecification &spec)
AthenaAttributeList * createFebPayloadV1(const std::vector< HWIdentifier32 > &data)
void fillControlInfo(AthenaAttributeList *attrList, unsigned int wordSize, unsigned int vers)
std::vector< BadFebEntry > readBadFeb(const coral::AttributeList &attrList, MsgStream &log)
AthenaAttributeList * createFebPayload(const BadFebVec &data)
MsgStream getDefaultMsgStream()
used to get default msg stream
AthenaAttributeList * createChanPayload(const BadChanVec &data, const coral::AttributeListSpecification &spec)