16 const std::string& version)
21 if (!
tgcArgs()->TILE_MU())
return;
22 if (
tgcArgs()->USE_CONDDB())
return;
29 <<
" TGC TileMu CW version of " <<
m_verName <<
" is selected " <<
endmsg;
32 <<
" NOT use TileMu " <<
endmsg;
49 std::string dbname=
"";
50 dbname =
"TileMuCoincidenceMap." +
m_verName +
"._12.db";
56 bool isFound =( fullName.length() > 0 );
59 <<
" Could not found " << dbname <<
endmsg;
63 std::ifstream
file(fullName.c_str(),std::ios::in);
65 static constexpr unsigned int BufferSize = 256;
68 while (
file.getline(buf, BufferSize)) {
71 int16_t sectorId = -1;
74 std::istringstream
header(buf);
78 header >> sideId >> sectorId >> sscId;
86 <<
" illegal parameter in database header : " <<
header.str()
87 <<
" in file " << dbname
93 uint16_t addr = this->
getAddr(sideId, sectorId, sscId);
99 flagpt |= (use&0x1)<<pt;
107 roi |= (use&0x1)<<pos;
112 file.getline(buf,BufferSize);
113 std::istringstream cont(buf);
114 uint16_t trigbit = 0x0;
118 trigbit |= (word & 0xf)<<(pos*4);
132 const int16_t side)
const
142 uint16_t addr = this->
getAddr(side, sec, ssc);
143 std::unordered_map<uint16_t, uint16_t>::const_iterator it =
m_trigbit.find(addr);
144 if(it !=
m_trigbit.end()) mask = it->second;
147 return mask>>(module*4) & 0x7;
153 const int16_t side)
const
157 uint8_t ptmask = 0x0;
163 uint16_t addr = this->
getAddr(side, sec, ssc);
164 std::unordered_map<uint16_t, uint8_t>::const_iterator it =
m_flagpt.find(addr);
165 if(it !=
m_flagpt.end()) ptmask = it->second;
167 return (ptmask>>(pt-1)) & 0x1;
173 const int16_t side)
const
177 uint8_t roimask = 0x0;
183 uint16_t addr = this->
getAddr(side, sec, ssc);
184 std::unordered_map<uint16_t, uint8_t>::const_iterator it =
m_flagroi.find(addr);
185 if(it !=
m_flagroi.end()) roimask = it->second;
187 return (roimask >> roi) & 0x1;
LVL1TGCTrigger::TGCArguments * m_tgcArgs
uint16_t getAddr(int16_t side, int16_t sec, int16_t ssc) const
std::unordered_map< uint16_t, uint8_t > m_flagroi
std::unordered_map< uint16_t, uint16_t > m_trigbit
TGCTileMuCoincidenceLUT(LVL1TGCTrigger::TGCArguments *, const SG::ReadCondHandleKey< TGCTriggerData > &readCondKey, const std::string &version="NA")
int getTrigMask(const int module, const int16_t ssc, const int16_t sec, const int16_t side) const
int getFlagPT(const int pt, const int16_t ssc, const int16_t sec, const int16_t side) const
virtual ~TGCTileMuCoincidenceLUT()
int getFlagROI(const int roi, const int16_t ssc, const int16_t sec, const int16_t side) const
const SG::ReadCondHandleKey< TGCTriggerData > & m_readCondKey
std::unordered_map< uint16_t, uint8_t > m_flagpt
LVL1TGCTrigger::TGCArguments * tgcArgs()
static std::string FindCalibDirectory(const std::string &logical_file_name)
uint8_t getFlagRoiTile(int ssc, int sectorId, int side) const
static constexpr uint8_t SECTOR_MASK
Mask for trigger sector for the (EIFI/TILE) ADDR.
unsigned char getFlagPtTile(int ssc, int sectorId, int side) const
static constexpr uint8_t SIDE_MASK
Mask for extracting the side from the GLOBALADDR.
unsigned short getTrigMaskTile(int ssc, int sectorId, int side) const
static constexpr uint8_t ADDR_SIDE_SHIFT
Bit position of the side bit in the (EIFI/TILE) ADDR.
static constexpr uint8_t SSC_MASK
Mask for SSC for the (EIFI/TILE) ADDR.
static constexpr uint8_t ADDR_SECTOR_SHIFT
Bit position of the trigger sector bit in the (EIFI/TILE) ADDR.
singleton-like access to IMessageSvc via open function and helper
IMessageSvc * getMessageSvc(bool quiet=false)