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

#include <TGCTriggerBWCWReader.h>

Inheritance diagram for TGCTriggerBWCWReader:
Collaboration diagram for TGCTriggerBWCWReader:

Public Member Functions

 TGCTriggerBWCWReader (int lutType)
 
 ~TGCTriggerBWCWReader ()=default
 
bool readLUT (TGCTriggerLUTs *writeCdo) override
 
bool loadParameters (TGCTriggerLUTs *writeCdo, const CondAttrListCollection *readKey) override
 
bool msgLvl (const MSG::Level lvl) const
 Test the output level. More...
 
MsgStream & msg () const
 The standard message stream. More...
 
MsgStream & msg (const MSG::Level lvl) const
 The standard message stream. More...
 
void setLevel (MSG::Level lvl)
 Change the current logging level. More...
 

Protected Attributes

int m_lutType {0}
 

Private Types

enum  {
  TMap_HH =0, TMap_HL, TMap_LH, TMap_LL,
  N_TMap
}
 

Private Member Functions

int getType (int lDR, int hDR, int lDPhi, int hDPhi) const
 
int subSectorAdd (int ssid, int modid, int phimod2, int type) const
 
void initMessaging () const
 Initialize our message level and MessageSvc. More...
 

Private Attributes

std::string m_nm
 Message source name. More...
 
boost::thread_specific_ptr< MsgStream > m_msg_tls
 MsgStream instance (a std::cout like with print-out levels) More...
 
std::atomic< IMessageSvc * > m_imsg { nullptr }
 MessageSvc pointer. More...
 
std::atomic< MSG::Level > m_lvl { MSG::NIL }
 Current logging level. More...
 
std::atomic_flag m_initialized ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
 Messaging initialized (initMessaging) More...
 

Detailed Description

Definition at line 14 of file TGCTriggerBWCWReader.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private
Enumerator
TMap_HH 
TMap_HL 
TMap_LH 
TMap_LL 
N_TMap 

Definition at line 24 of file TGCTriggerBWCWReader.h.

Constructor & Destructor Documentation

◆ TGCTriggerBWCWReader()

TGCTriggerBWCWReader::TGCTriggerBWCWReader ( int  lutType)

Definition at line 10 of file TGCTriggerBWCWReader.cxx.

10  :
11  TGCTriggerLUTReader(lutType),
12  AthMessaging("TGCTriggerBWCWReader")
13 {
14 }

◆ ~TGCTriggerBWCWReader()

TGCTriggerBWCWReader::~TGCTriggerBWCWReader ( )
default

Member Function Documentation

◆ getType()

int TGCTriggerBWCWReader::getType ( int  lDR,
int  hDR,
int  lDPhi,
int  hDPhi 
) const
private

Definition at line 149 of file TGCTriggerBWCWReader.cxx.

149  {
150  int type = -1;
151  if ( (lDR==-15) && (hDR==15) && (lDPhi==-7) && (hDPhi==7)) type = TGCTriggerBWCWReader::TMap_HH;
152  else if ( (lDR==-15) && (hDR==15) && (lDPhi==-3) && (hDPhi==3)) type = TGCTriggerBWCWReader::TMap_HL;
153  else if ( (lDR==-7) && (hDR==7) && (lDPhi==-7) && (hDPhi==7)) type = TGCTriggerBWCWReader::TMap_LH;
154  else if ( (lDR==-7) && (hDR==7) && (lDPhi==-3) && (hDPhi==3)) type = TGCTriggerBWCWReader::TMap_LL;
155  return type;
156 }

◆ initMessaging()

void AthMessaging::initMessaging ( ) const
privateinherited

Initialize our message level and MessageSvc.

This method should only be called once.

Definition at line 39 of file AthMessaging.cxx.

40 {
42  m_lvl = m_imsg ?
43  static_cast<MSG::Level>( m_imsg.load()->outputLevel(m_nm) ) :
44  MSG::INFO;
45 }

◆ loadParameters()

bool TGCTriggerBWCWReader::loadParameters ( TGCTriggerLUTs writeCdo,
const CondAttrListCollection readKey 
)
overridevirtual

Implements TGCTriggerLUTReader.

Definition at line 18 of file TGCTriggerBWCWReader.cxx.

19  {
20 
21  CondAttrListCollection::const_iterator itr = readCdo->begin();
22  CondAttrListCollection::const_iterator itr_e = readCdo->end();
23 
24  for(; itr!=itr_e; ++itr) {
25  const unsigned int channel = (*itr).first;
26  const coral::AttributeList& atr = (*itr).second;
27 
28  ATH_MSG_DEBUG("channel: " << channel);
29  std::string file = *(static_cast<const std::string*>((atr["file"]).addressOfData()));
30  std::string data = *(static_cast<const std::string*>((atr["data"]).addressOfData()));
31  std::string version = *(static_cast<const std::string*>((atr["version"]).addressOfData()));
32  std::string type = *(static_cast<const std::string*>((atr["type"]).addressOfData()));
33 
34  writeCdo->m_datamap[m_lutType][file] = data;
35  writeCdo->m_data[m_lutType].push_back(data);
36  writeCdo->m_file[m_lutType].push_back(file);
37  writeCdo->m_version[m_lutType].push_back(version);
38  writeCdo->m_type[m_lutType].push_back(type);
39 
40  ATH_MSG_INFO("file: " <<file);
41  ATH_MSG_DEBUG("data: " << data);
42 
43  }
44  return true;
45 }

◆ msg() [1/2]

MsgStream & AthMessaging::msg ( ) const
inlineinherited

The standard message stream.

Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.

Definition at line 164 of file AthMessaging.h.

165 {
166  MsgStream* ms = m_msg_tls.get();
167  if (!ms) {
168  if (!m_initialized.test_and_set()) initMessaging();
169  ms = new MsgStream(m_imsg,m_nm);
170  m_msg_tls.reset( ms );
171  }
172 
173  ms->setLevel (m_lvl);
174  return *ms;
175 }

◆ msg() [2/2]

MsgStream & AthMessaging::msg ( const MSG::Level  lvl) const
inlineinherited

The standard message stream.

Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.

Definition at line 179 of file AthMessaging.h.

180 { return msg() << lvl; }

◆ msgLvl()

bool AthMessaging::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Test the output level.

Parameters
lvlThe message level to test against
Returns
boolean Indicating if messages at given level will be printed
Return values
trueMessages at level "lvl" will be printed

Definition at line 151 of file AthMessaging.h.

152 {
153  if (!m_initialized.test_and_set()) initMessaging();
154  if (m_lvl <= lvl) {
155  msg() << lvl;
156  return true;
157  } else {
158  return false;
159  }
160 }

◆ readLUT()

bool TGCTriggerBWCWReader::readLUT ( TGCTriggerLUTs writeCdo)
overridevirtual

Implements TGCTriggerLUTReader.

Definition at line 54 of file TGCTriggerBWCWReader.cxx.

54  {
55 
56  const int numberOfCoincidenceType = 4;
57 
58  const int moduleNumber[TGCTriggerLUTs::N_MODULETYPE] =
59  { 0, 1, 2, 2, 3, 4, 5, 5, 6, 7, 8, 8 };
60  const std::string moduleName[TGCTriggerLUTs::N_MODULETYPE]=
61  {"0a","1a","2a","2b","3a","4a","5a","5b","6a","7a","8a","8b"};
62  const std::string sideName[TGCTriggerLUTs::N_SIDE] = {"a","c"};
63  const std::string octantName[TGCTriggerLUTs::N_OCTANT] =
64  { "0", "1", "2", "3", "4", "5", "6", "7"};
65  const std::string coincidenceTypeName[numberOfCoincidenceType] = {"HH","HL","LH","LL"};
66 
67 
68  // initialize
69  bool fullCW = (writeCdo->getType(TGCTriggerLUTs::CW_BW) == "full" );
70  // loop over all files...
71  for(int iSide = 0; iSide<TGCTriggerLUTs::N_SIDE; iSide++){
72  for(int iOctant = 0; iOctant < TGCTriggerLUTs::N_OCTANT; iOctant++) {
73 
76 
77  for(int iModule=0; iModule<TGCTriggerLUTs::N_MODULETYPE; iModule+=1) {
78 
79  uint32_t phimod2 = moduleName[iModule].find('b') != std::string::npos ? 1 : 0;
80  uint32_t modaddr = ((moduleNumber[iModule] & TGCTriggerLUTs::MODULE_MASK)<<TGCTriggerLUTs::MODULE_SHIFT) +
82 
83  for(int iCoinType=0; iCoinType!=numberOfCoincidenceType; iCoinType++){
84 
85  std::string fn;
86  if (fullCW) {
87  fn = "RPhiCoincidenceMapRun3_" + sideName[iSide] + octantName[iOctant]
88  + moduleName[iModule] + coincidenceTypeName[iCoinType] + ".db";
89  } else{
90  fn = "RPhiCoincidenceMapRun3_" + moduleName[iModule] + coincidenceTypeName[iCoinType] + ".db";
91  }
92 
93  bool Forward_type1=(moduleName[iModule]=="2b"||moduleName[iModule]=="5a"||moduleName[iModule]=="8b");
94  bool Forward_type2=(moduleName[iModule]=="2a"||moduleName[iModule]=="5b"||moduleName[iModule]=="8a");
95 
96  if(iOctant%2==0 && Forward_type1){continue;}
97  if(iOctant%2==1 && Forward_type2){continue;}
98  int type = -1;
99  int lDR, hDR, lDPhi, hDPhi;
100 
101  std::string data = writeCdo->getData(TGCTriggerLUTs::CW_BW, fn);
102  std::istringstream stream(data);
103 
104  std::string buf,tag;
105  char delimiter = '\n';
106  int roi;
107 
108  while(getline(stream,buf,delimiter)){
109  std::istringstream header(buf);
110  header>>tag;
111  if(tag=="#") { // read header part.
112  header >> roi >> lDR >> hDR >> lDPhi >> hDPhi;
113  type = getType( lDR, hDR, lDPhi, hDPhi );
114  if( type<0 ) {
115  break;
116  }
117 
120 
121  for(uint8_t ir=lDR+TGCTriggerLUTs::DR_HIGH_RANGE; ir <= hDR+TGCTriggerLUTs::DR_HIGH_RANGE; ir++) { // 0...31 or 7...23
123 
124  // get window data
125  getline(stream, buf, delimiter);
126 
127  for(uint8_t iphi=lDPhi+TGCTriggerLUTs::DPHI_HIGH_RANGE; iphi <= hDPhi+TGCTriggerLUTs::DPHI_HIGH_RANGE; iphi++) {
128  uint32_t theaddr = octaddr + modaddr + cwaddr + draddr + iphi;
129  char pt = buf[iphi-lDPhi-TGCTriggerLUTs::DPHI_HIGH_RANGE];
130  if (pt == 'X') continue; // not opened
131  writeCdo->m_ptmap_bw[theaddr] = pt;
132  }
133  }
134 
135  }
136  }
137 
138  }// coincidence type
139  }// module
140  }// octant
141  }// side
142 
143  return true;
144 }

◆ setLevel()

void AthMessaging::setLevel ( MSG::Level  lvl)
inherited

Change the current logging level.

Use this rather than msg().setLevel() for proper operation with MT.

Definition at line 28 of file AthMessaging.cxx.

29 {
30  m_lvl = lvl;
31 }

◆ subSectorAdd()

int TGCTriggerBWCWReader::subSectorAdd ( int  ssid,
int  modid,
int  phimod2,
int  type 
) const
private

Definition at line 158 of file TGCTriggerBWCWReader.cxx.

158  {
159  return (ssid+(modid<<8)+(phimod2<<12) + (type<<16) );
160 }

Member Data Documentation

◆ ATLAS_THREAD_SAFE

std::atomic_flag m_initialized AthMessaging::ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
mutableprivateinherited

Messaging initialized (initMessaging)

Definition at line 141 of file AthMessaging.h.

◆ m_imsg

std::atomic<IMessageSvc*> AthMessaging::m_imsg { nullptr }
mutableprivateinherited

MessageSvc pointer.

Definition at line 135 of file AthMessaging.h.

◆ m_lutType

int TGCTriggerLUTReader::m_lutType {0}
protectedinherited

Definition at line 23 of file TGCTriggerLUTReader.h.

◆ m_lvl

std::atomic<MSG::Level> AthMessaging::m_lvl { MSG::NIL }
mutableprivateinherited

Current logging level.

Definition at line 138 of file AthMessaging.h.

◆ m_msg_tls

boost::thread_specific_ptr<MsgStream> AthMessaging::m_msg_tls
mutableprivateinherited

MsgStream instance (a std::cout like with print-out levels)

Definition at line 132 of file AthMessaging.h.

◆ m_nm

std::string AthMessaging::m_nm
privateinherited

Message source name.

Definition at line 129 of file AthMessaging.h.


The documentation for this class was generated from the following files:
AthMessaging::m_lvl
std::atomic< MSG::Level > m_lvl
Current logging level.
Definition: AthMessaging.h:138
TGCTriggerLUTs::PHIMOD2_MASK
static constexpr uint8_t PHIMOD2_MASK
Mask for extracting the phi(F or B) from the GLOBALADDR.
Definition: TGCTriggerLUTs.h:36
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
TGCTriggerLUTReader::TGCTriggerLUTReader
TGCTriggerLUTReader(int lutType)
Definition: TGCTriggerLUTReader.cxx:9
TGCTriggerLUTs::m_file
std::vector< std::string > m_file[LUT_NUM]
Definition: TGCTriggerLUTs.h:86
header
Definition: hcg.cxx:526
plotting.yearwise_efficiency.channel
channel
Definition: yearwise_efficiency.py:24
TGCTriggerBWCWReader::TMap_LH
@ TMap_LH
Definition: TGCTriggerBWCWReader.h:24
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:557
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
TGCTriggerLUTReader::m_lutType
int m_lutType
Definition: TGCTriggerLUTReader.h:23
TGCTriggerLUTs::m_ptmap_bw
std::unordered_map< uint32_t, int8_t > m_ptmap_bw
Definition: TGCTriggerLUTs.h:90
test_pyathena.pt
pt
Definition: test_pyathena.py:11
TGCTriggerLUTs::N_SIDE
@ N_SIDE
Definition: TGCTriggerLUTs.h:68
python.PyKernel.AttributeList
AttributeList
Definition: PyKernel.py:36
TGCTriggerLUTs::getData
std::string getData(int cwtype, std::string file) const
Definition: TGCTriggerLUTs.cxx:18
AthMessaging::m_imsg
std::atomic< IMessageSvc * > m_imsg
MessageSvc pointer.
Definition: AthMessaging.h:135
python.SystemOfUnits.ms
int ms
Definition: SystemOfUnits.py:132
TGCTriggerLUTs::ROI_SHIFT
static constexpr uint8_t ROI_SHIFT
Bit position of the module number bits in the GLOBALADDR.
Definition: TGCTriggerLUTs.h:46
AthenaPoolTestWrite.stream
string stream
Definition: AthenaPoolTestWrite.py:12
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition: getMessageSvc.cxx:20
TGCTriggerLUTs::TYPE_SHIFT
static constexpr uint8_t TYPE_SHIFT
Bit position of the octant bits in the GLOBALADDR.
Definition: TGCTriggerLUTs.h:34
TGCTriggerLUTs::CW_BW
@ CW_BW
Definition: TGCTriggerLUTs.h:66
TGCTriggerBWCWReader::TMap_HH
@ TMap_HH
Definition: TGCTriggerBWCWReader.h:24
TGCTriggerLUTs::getType
std::string getType(int cwtype, int channel=0) const
Definition: TGCTriggerLUTs.cxx:41
TGCTriggerBWCWReader::getType
int getType(int lDR, int hDR, int lDPhi, int hDPhi) const
Definition: TGCTriggerBWCWReader.cxx:149
TGCTriggerLUTs::DR_MASK
static constexpr uint8_t DR_MASK
Mask for extracting the deltaR from the GLOBALADDR.
Definition: TGCTriggerLUTs.h:48
TGCTriggerLUTs::N_MODULETYPE
@ N_MODULETYPE
Definition: TGCTriggerLUTs.h:70
AthMessaging::AthMessaging
AthMessaging()
Default constructor:
python.AthDsoLogger.delimiter
delimiter
Definition: AthDsoLogger.py:71
TGCTriggerLUTs::DPHI_HIGH_RANGE
static constexpr uint8_t DPHI_HIGH_RANGE
Range of DPhi in the BW coincidence window for 3-station.
Definition: TGCTriggerLUTs.h:61
python.getCurrentFolderTag.fn
fn
Definition: getCurrentFolderTag.py:65
TrigConf::MSGTC::Level
Level
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:21
TGCTriggerLUTs::OCTANT_MASK
static constexpr uint8_t OCTANT_MASK
Mask for extracting the octant from the GLOBALADDR.
Definition: TGCTriggerLUTs.h:28
python.DecayParser.buf
buf
print ("=> [%s]"cmd)
Definition: DecayParser.py:27
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
file
TFile * file
Definition: tile_monitor.h:29
TGCTriggerLUTs::DR_HIGH_RANGE
static constexpr uint8_t DR_HIGH_RANGE
Range of DR in the BW coincidence window for 3-station.
Definition: TGCTriggerLUTs.h:57
TGCTriggerLUTs::m_type
std::vector< std::string > m_type[LUT_NUM]
Definition: TGCTriggerLUTs.h:88
TGCTriggerLUTs::m_data
std::vector< std::string > m_data[LUT_NUM]
Definition: TGCTriggerLUTs.h:85
TGCTriggerBWCWReader::TMap_HL
@ TMap_HL
Definition: TGCTriggerBWCWReader.h:24
TGCTriggerLUTs::DR_SHIFT
static constexpr uint8_t DR_SHIFT
Bit position of the deltaR bits in the GLOBALADDR.
Definition: TGCTriggerLUTs.h:50
TGCTriggerLUTs::OCTANT_SHIFT
static constexpr uint8_t OCTANT_SHIFT
Bit position of the octant bits in the GLOBALADDR.
Definition: TGCTriggerLUTs.h:30
AthMessaging::msg
MsgStream & msg() const
The standard message stream.
Definition: AthMessaging.h:164
TGCTriggerLUTs::N_OCTANT
@ N_OCTANT
Definition: TGCTriggerLUTs.h:69
TGCTriggerLUTs::m_version
std::vector< std::string > m_version[LUT_NUM]
Definition: TGCTriggerLUTs.h:87
TGCTriggerBWCWReader::N_TMap
@ N_TMap
Definition: TGCTriggerBWCWReader.h:24
TGCTriggerLUTs::MODULE_MASK
static constexpr uint8_t MODULE_MASK
Mask for extracting the module number from the GLOBALADDR.
Definition: TGCTriggerLUTs.h:40
TGCTriggerLUTs::SIDE_SHIFT
static constexpr uint8_t SIDE_SHIFT
Bit position of the side bit in the GLOBALADDR.
Definition: TGCTriggerLUTs.h:26
ir
int ir
counter of the current depth
Definition: fastadd.cxx:49
get_generator_info.version
version
Definition: get_generator_info.py:33
CondAttrListCollection::const_iterator
ChanAttrListMap::const_iterator const_iterator
Definition: CondAttrListCollection.h:63
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
AthMessaging::m_nm
std::string m_nm
Message source name.
Definition: AthMessaging.h:129
TGCTriggerLUTs::TYPE_MASK
static constexpr uint8_t TYPE_MASK
Mask for extracting the octant from the GLOBALADDR.
Definition: TGCTriggerLUTs.h:32
TGCTriggerLUTs::SIDE_MASK
static constexpr uint8_t SIDE_MASK
Mask for extracting the side from the GLOBALADDR.
Definition: TGCTriggerLUTs.h:24
CaloCondBlobAlgs_fillNoiseFromASCII.tag
string tag
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:24
AthMessaging::initMessaging
void initMessaging() const
Initialize our message level and MessageSvc.
Definition: AthMessaging.cxx:39
makeTOC.header
header
Definition: makeTOC.py:28
AthMessaging::m_msg_tls
boost::thread_specific_ptr< MsgStream > m_msg_tls
MsgStream instance (a std::cout like with print-out levels)
Definition: AthMessaging.h:132
TGCTriggerLUTs::MODULE_SHIFT
static constexpr uint8_t MODULE_SHIFT
Bit position of the module number bits in the GLOBALADDR.
Definition: TGCTriggerLUTs.h:42
TGCTriggerLUTs::m_datamap
std::map< std::string, std::string > m_datamap[LUT_NUM]
Definition: TGCTriggerLUTs.h:84
TGCTriggerLUTs::ROI_MASK
static constexpr uint8_t ROI_MASK
Mask for extracting the module number from the GLOBALADDR.
Definition: TGCTriggerLUTs.h:44
TGCTriggerBWCWReader::TMap_LL
@ TMap_LL
Definition: TGCTriggerBWCWReader.h:24
TGCTriggerLUTs::PHIMOD2_SHIFT
static constexpr uint8_t PHIMOD2_SHIFT
Bit position of the module number bits in the GLOBALADDR.
Definition: TGCTriggerLUTs.h:38