|
ATLAS Offline Software
|
Go to the documentation of this file.
16 #include "GaudiKernel/ISvcLocator.h"
17 #include "GaudiKernel/MsgStream.h"
18 #include "GaudiKernel/IMessageSvc.h"
27 int type,
int dr,
int dphi)
const {
31 if (moduleId == 2 || moduleId == 5 || moduleId == 8) {
32 int sector = (moduleId-2) / 3 + octantId * 3;
33 phimod2 = (sector%2 == 1) ? 1 : 0;
52 content = readCdo->getBigWheelPt(addr);
57 std::unordered_map<uint32_t, char>::const_iterator
it =
m_lut.find(addr);
59 char pt_char =
it->second;
73 m_readCondKey(readKey) {
75 ISvcLocator* svcLocator = Gaudi::svcLocator();
76 if (svcLocator->service(
"MessageSvc",
msgSvc) == StatusCode::FAILURE) {
79 MsgStream
log(
msgSvc,
"LVL1TGC::BigWheelCoincidenceLUT");
82 <<
" BigWheel LUT version of " <<
m_verName <<
" is selected." <<
endmsg;
95 const uint8_t kNMODULETYPE = 12;
96 const uint8_t modulenumber[kNMODULETYPE] = {0, 1, 2, 2, 3, 4, 5, 5, 6, 7, 8, 8};
97 const std::string
modulename[kNMODULETYPE] = {
"0a",
"1a",
"2a",
"2b",
"3a",
"4a",
"5a",
"5b",
"6a",
"7a",
"8a",
"8b"};
101 const std::string octantName[kNOctant] =
102 {
"0",
"1",
"2",
"3",
"4",
"5",
"6",
"7"};
103 const std::string coincidenceTypeName[
N_COIN_TYPE] = {
"HH",
"HL",
"LH",
"LL"};
106 ISvcLocator* svcLocator = Gaudi::svcLocator();
107 if (svcLocator->service(
"MessageSvc",
msgSvc) == StatusCode::FAILURE) {
110 MsgStream
log(
msgSvc,
"LVL1TGC::BigWheelCoincidenceLUT");
114 std::ifstream tryfile(tryname.c_str(), std::ios::in);
120 tryfile = std::ifstream(tryname.c_str(), std::ios::in);
125 log << MSG::ERROR <<
"Could not found the expected file!" <<
endmsg;
132 for (
uint8_t iside=0; iside < num_sides; iside++) {
133 for (
uint8_t ioctant=0; ioctant < num_octants; ioctant++) {
138 for (
int iModule=0; iModule < kNMODULETYPE; iModule+=1) {
142 if ((ioctant%2 == 0 &&
uint32_t(iModule/4)%2 != phimod2) ||
143 (ioctant%2 == 1 &&
uint32_t(iModule/4)%2 == phimod2)) {
150 for (
int iCoinType=0; iCoinType !=
N_COIN_TYPE; iCoinType++) {
151 std::string
fn =
"/BW/cm_";
153 fn +=
"mod" +
modulename[iModule] + coincidenceTypeName[iCoinType] +
"_" + capitalsidename[iside] + octantName[ioctant] +
"_";
155 fn += sidename[iside] +
modulename[iModule] + coincidenceTypeName[iCoinType] +
"_Octant_";
160 int lDR, hDR, lDPhi, hDPhi;
163 log << MSG::ERROR <<
" Could not found " <<
fn.c_str() <<
endmsg;
173 std::string buf,
tag;
176 std::istringstream
header(buf);
181 header >> roi >> lDR >> hDR >> lDPhi >> hDPhi;
186 <<
" illegal parameter in database header : " <<
header.str() <<
" in file " <<
fn <<
endmsg;
200 uint32_t theaddr = octaddr + modaddr + cwaddr + draddr + iphi;
202 if (
pt ==
'X')
continue;
203 if(
m_lut.count(theaddr)==0){
207 <<
" Problem with loading TGC BW Trigger LUT: duplicated entry at address=" << theaddr <<
" with pt=" <<
pt <<
endmsg;
static constexpr uint8_t PHIMOD2_MASK
Mask for extracting the phi(F or B) from the GLOBALADDR.
This file defines the class for a collection of AttributeLists where each one is associated with a ch...
static constexpr uint8_t DPHI_SHIFT
Bit position of the deltaPhi bits in the GLOBALADDR.
const LVL1TGCTrigger::TGCArguments * tgcArgs() const
std::map< char, int8_t > m_pTdef
static std::string FindCalibDirectory(const std::string &logical_file_name)
static constexpr uint8_t ROI_SHIFT
Bit position of the module number bits in the GLOBALADDR.
static constexpr uint32_t N_COIN_TYPE
static constexpr uint8_t TYPE_SHIFT
Bit position of the octant bits in the GLOBALADDR.
static constexpr uint8_t DPHI_MASK
Mask for extracting the deltaPhi from the GLOBALADDR.
int getTYPE(int lDR, int hDR, int lDPhi, int hDPhi) const
const SG::ReadCondHandleKey< TGCTriggerLUTs > & m_readCondKey
static constexpr uint8_t DR_MASK
Mask for extracting the deltaR from the GLOBALADDR.
virtual ~BigWheelCoincidenceLUT()
static constexpr uint8_t DPHI_HIGH_RANGE
Range of DPhi in the BW coincidence window for 3-station.
msgSvc
Provide convenience handles for various services.
static constexpr uint8_t OCTANT_MASK
Mask for extracting the octant from the GLOBALADDR.
static constexpr uint8_t DR_HIGH_RANGE
Range of DR in the BW coincidence window for 3-station.
static constexpr uint8_t DR_SHIFT
Bit position of the deltaR bits in the GLOBALADDR.
static constexpr uint8_t OCTANT_SHIFT
Bit position of the octant bits in the GLOBALADDR.
int8_t test(int sideId, int octantId, int moduleId, int subsector, int type, int dr, int dphi) const
static constexpr uint8_t MODULE_MASK
Mask for extracting the module number from the GLOBALADDR.
static constexpr uint8_t SIDE_SHIFT
Bit position of the side bit in the GLOBALADDR.
int ir
counter of the current depth
std::unordered_map< uint32_t, char > m_lut
static constexpr uint8_t TYPE_MASK
Mask for extracting the octant from the GLOBALADDR.
BigWheelCoincidenceLUT()=delete
static constexpr uint8_t MODULE_SHIFT
Bit position of the module number bits in the GLOBALADDR.
static constexpr uint8_t ROI_MASK
Mask for extracting the module number from the GLOBALADDR.
static constexpr uint8_t PHIMOD2_SHIFT
Bit position of the module number bits in the GLOBALADDR.