ATLAS Offline Software
Loading...
Searching...
No Matches
LArBadChanBitPackingBase.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef LArBadChanBitPackingBase_H
6#define LArBadChanBitPackingBase_H
7
9#include <string>
10#include <vector>
11#include <map>
12
13template <class T>
15 public:
16
17 typedef std::vector<LArBadChannel::PosType> PosContainer;
18
20 m_index( 8*sizeof(LArBadChannel::BitWord),-1),
23 m_lowGainMask(0) {};
24
25 const std::string& stringName( typename T::ProblemType pb) const;
26
27 std::pair<bool, typename T::ProblemType> enumName( const std::string& str) const;
28
29 LArBadChannel::PosType bitPosition( typename T::ProblemType pb) const {return m_bitPos[static_cast<LArBadChannel::PosType>(pb)];}
30
32
33 void setBit( typename T::ProblemType pb, LArBadChannel::BitWord& word, bool value=true) const;
34 void setBit( typename T::ProblemType pb, LArBadChannel& word, bool value=true) const;
35
36 bool setBit( const std::string& name, LArBadChannel::BitWord& word, bool value=true) const;
37 bool setBit( const std::string& name, LArBadChannel& word, bool value=true) const;
38
39 std::string stringStatus( const LArBadChannel& bc) const;
40
41 // These LArBadChannel::BitWord masks are used to do gain-dependent masking in LArBadChannelMasker.
45
46 int numberOfProblemTypes() const { return m_nameVec.size();}
47
48 protected:
49
50 // This is used to describe the dependence of each T::ProblemType on LAr gain.
52
54 std::vector<int> m_index;
55 std::vector< std::pair<typename T::ProblemType, GainDependence> > m_enumVec;
56
57 std::vector<std::string> m_nameVec;
58 std::map<std::string, typename T::ProblemType> m_nameMap;
59
60 // These are non-static so that different TLArBadChanBitPackingBase versions can be used simultaneously.
64
65 void addBit( typename T::ProblemType pb, const std::string& name, GainDependence gaindep);
66 int index( typename T::ProblemType pb) const {return m_index[pb];}
67 void initMasks();
68};
69
71
72
73#endif
74
unsigned int BitWord
unsigned int PosType
void setBit(typename T::ProblemType pb, LArBadChannel::BitWord &word, bool value=true) const
const std::string & stringName(typename T::ProblemType pb) const
int index(typename T::ProblemType pb) const
std::vector< std::pair< typename LArBadChannel::LArBadChannelSCEnum::ProblemType, GainDependence > > m_enumVec
LArBadChannel::BitWord lowGainMask() const
LArBadChannel::BitWord highGainMask() const
LArBadChannel::PosType wordSize() const
LArBadChannel::PosType bitPosition(typename T::ProblemType pb) const
bool setBit(const std::string &name, LArBadChannel &word, bool value=true) const
void setBit(typename T::ProblemType pb, LArBadChannel &word, bool value=true) const
bool setBit(const std::string &name, LArBadChannel::BitWord &word, bool value=true) const
LArBadChannel::BitWord mediumGainMask() const
void addBit(typename T::ProblemType pb, const std::string &name, GainDependence gaindep)
std::string stringStatus(const LArBadChannel &bc) const
std::pair< bool, typename T::ProblemType > enumName(const std::string &str) const
std::map< std::string, typename LArBadChannel::LArBadChannelSCEnum::ProblemType > m_nameMap