ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigT1
TrigT1TGC
src
TGCGoodMF.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
TrigT1TGC/TGCGoodMF.h
"
6
#include "
TrigT1TGC/TGCNumbering.h
"
7
#include "
PathResolver/PathResolver.h
"
8
9
#include "GaudiKernel/ISvcLocator.h"
10
#include "GaudiKernel/Bootstrap.h"
11
#include "GaudiKernel/MsgStream.h"
12
#include "GaudiKernel/IMessageSvc.h"
13
14
#include "
TrigT1TGC/TGCArguments.h
"
15
16
#include <iostream>
17
#include <fstream>
18
#include <sstream>
19
#include <string>
20
21
namespace
LVL1TGC
{
22
23
TGCGoodMF::TGCGoodMF
(
LVL1TGCTrigger::TGCArguments
* tgcargs,
const
std::string& version)
24
:
AthMessaging
(
"LVL1TGC::TGCGoodMF"
),
25
m_tgcArgs
(tgcargs),
26
m_verName
(version)
27
{
28
if
(this->
readBadMFList
()) {
29
ATH_MSG_INFO
(
"LVL1TGC Hot-ROI mask version of "
<<
m_verName
<<
" is selected"
);
30
}
else
{
31
ATH_MSG_INFO
(
"LVL1TGC Hot-ROI mask NOT defined"
);
32
}
33
34
}
35
36
const
TGCGoodMF
&
TGCGoodMF::operator=
(
const
TGCGoodMF
& right)
37
{
38
if
(
this
!= &right){
39
m_tgcArgs
=right.
m_tgcArgs
;
40
m_verName
=right.
m_verName
;
41
this->
readBadMFList
();
42
}
43
44
return
*
this
;
45
}
46
47
bool
TGCGoodMF::readBadMFList
()
48
{
49
//initialize
50
std::string buf;
51
std::string fullName, tag;
char
delimiter
=
'\n'
;
52
std::string fn =
"/HotRoI/HotRoI."
+
m_verName
+
".db"
;
53
54
fullName =
PathResolver::FindCalibDirectory
(
"dev"
)+
"/TrigT1TGC"
+fn;
55
int
mod,maxssc;
56
std::ifstream
file
(fullName.c_str(),std::ios::in);
57
while
(getline(
file
,buf,
delimiter
)) {
58
std::istringstream
header
(buf);
59
header
>>tag;
60
if
(tag ==
"#"
){
// read header part.
61
header
>>mod>>maxssc;
62
63
// get BadMF list
64
getline(
file
,buf,
delimiter
);
65
std::istringstream cont(buf);
66
std::map<int,int>& mapssc =
m_mapisgoodMF
[mod];
// mapssc = <SSCId,badMFId>, m_mapisgoodMF = <ModuleId,<~>>
67
int
badMFId;
68
//coverity[TAINTED_SCALAR]
69
for
(
int
i=0; i<=maxssc; i++) {
70
cont>>badMFId;
71
if
(badMFId < 0)
continue
;
72
mapssc[i] = badMFId;
73
}
74
}
75
}
76
return
true
;
77
}
78
79
bool
TGCGoodMF::test_GoodMF
(
int
moduleId,
int
sscId,
int
RoI)
const
80
{
81
std::map<int, std::map<int, int> >
::const_iterator
itModule=
m_mapisgoodMF
.find(moduleId);
82
if
(itModule==
m_mapisgoodMF
.end())
return
true
;
83
84
const
std::map<int, int> &mapssc = itModule->second;
85
std::map<int, int>::const_iterator itSSC=mapssc.find(sscId);
86
if
(itSSC==mapssc.end())
return
true
;
87
88
int
badMFId = itSSC->second;
89
if
(badMFId==0){
return
true
; }
90
91
std::bitset<kNRoiInSSC> bs(badMFId);
92
93
int
RoIId;
94
if
(RoI %
kNRoiInSSC
>= 4){ RoIId = RoI %
kNRoiInSSC
- 4; }
95
else
{ RoIId = RoI %
kNRoiInSSC
+ 4; }
96
97
return
!bs[RoIId];
98
}
99
100
101
}
//end of namespace bracket
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
PathResolver.h
TGCArguments.h
TGCGoodMF.h
TGCNumbering.h
AthMessaging::AthMessaging
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
Definition
AthMessaging.cxx:13
const_iterator
LVL1TGCTrigger::TGCArguments
Definition
TGCArguments.h:12
LVL1TGC::TGCGoodMF::TGCGoodMF
TGCGoodMF(LVL1TGCTrigger::TGCArguments *, const std::string &version)
Definition
TGCGoodMF.cxx:23
LVL1TGC::TGCGoodMF::m_mapisgoodMF
std::map< int, std::map< int, int > > m_mapisgoodMF
Definition
TGCGoodMF.h:34
LVL1TGC::TGCGoodMF::operator=
const TGCGoodMF & operator=(const TGCGoodMF &right)
Definition
TGCGoodMF.cxx:36
LVL1TGC::TGCGoodMF::test_GoodMF
bool test_GoodMF(int moduleId, int sscId, int subsector) const
Definition
TGCGoodMF.cxx:79
LVL1TGC::TGCGoodMF::m_tgcArgs
LVL1TGCTrigger::TGCArguments * m_tgcArgs
Definition
TGCGoodMF.h:35
LVL1TGC::TGCGoodMF::readBadMFList
bool readBadMFList()
Definition
TGCGoodMF.cxx:47
LVL1TGC::TGCGoodMF::m_verName
std::string m_verName
Definition
TGCGoodMF.h:36
PathResolver::FindCalibDirectory
static std::string FindCalibDirectory(const std::string &logical_file_name)
Definition
PathResolver.h:64
header
Definition
hcg.cxx:529
delimiter
static const std::string delimiter("/")
LVL1TGC
Definition
BigWheelCoincidenceLUT.cxx:20
LVL1TGC::kNRoiInSSC
static constexpr unsigned int kNRoiInSSC
The default number of ROIs in SSC.
Definition
TGCNumbering.h:29
file
TFile * file
Definition
tile_monitor.h:29
Generated on
for ATLAS Offline Software by
1.17.0