ATLAS Offline Software
Loading...
Searching...
No Matches
TGCBIS78CoincidenceMap.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
5
6#include <fstream>
7#include <sstream>
8#include <string>
9
14
16
17namespace LVL1TGC {
18
20: AthMessaging("TGCBIS78CoincidenceMap"),
21 m_verName(version),
22 m_tgcArgs(tgcargs)
23{
24 setLevel(tgcArgs()->MSGLEVEL());
25
26 if(!tgcArgs()->USE_BIS78()){return;}
27
28 // initialize map
29 for (size_t sec=0; sec < kNEndcapTrigSector; sec++){
30 for (size_t ssc=0; ssc < kNMaxSSC; ssc++){
31 for (size_t pos=0; pos < kNRoiInSSC; pos++){
32 m_flagROI[pos][ssc][sec] = 1;
33 }
34 }
35 }
36
37 for (size_t dr=0; dr!=N_DETA; dr++) {
38 for (size_t dphi=0; dphi!=N_DPHI; dphi++) {
39 m_CW[dr][dphi].resize(kNumberOfEndcapRoI);
40 std::fill(m_CW[dr][dphi].begin(), m_CW[dr][dphi].end(), 0);
41 }
42 }
43
44 //---------Read out CW data---------
45 if (!this->readMap()) {
46 // BIS78 trigger flag is set to false when the map reading failed.
47 tgcArgs()->set_USE_BIS78(false);
48 ATH_MSG_INFO("NOT using BIS78");
49 } else {
50 ATH_MSG_INFO("TGC BIS78 CW version of " << m_verName << " is selected");
51 }
52}
53
54
55//TGC-BIS78 Eta-Phi Coincidence
56int TGCBIS78CoincidenceMap::TGCBIS78_pt(const BIS78TrigOut *bis78Out,int /*roi*/) const
57{
58 std::vector<uint8_t> bis78Eta_vec=bis78Out->getBIS78eta();
59 std::vector<uint8_t> bis78Phi_vec=bis78Out->getBIS78phi();
60 std::vector<uint8_t> bis78Deta_vec=bis78Out->getBIS78Deta();
61 std::vector<uint8_t> bis78Dphi_vec=bis78Out->getBIS78Dphi();
62 std::vector<uint8_t> bis78flag3over3eta_vec=bis78Out->getBIS78flag3over3eta();
63 std::vector<uint8_t> bis78flag3over3phi_vec=bis78Out->getBIS78flag3over3phi();
64
65 int pt=0;
66 // temporal algorithm
67 for(unsigned int bis78hit_id=0; bis78hit_id!=bis78Eta_vec.size(); bis78hit_id++){
68 // calculate dR, dPhi bin # from eta/phiIndex?
69 // for now, if there is a hit at BIS78, it returns true always
70 pt=1;
71 }
72
73 return pt;
74}
75
76int TGCBIS78CoincidenceMap::getFlagROI(const unsigned int roi,
77 const unsigned int ssc,
78 const unsigned int sec,
79 const unsigned int side) const
80{
81 if (side != TGCSide::ASIDE) return 0; // BIS78 only in A side
82
83 if (roi >= kNRoiInSSC) return -1;
84 if (ssc >= kNMaxSSC) return 0;
85 if (sec >= kNEndcapTrigSector) return -1;
86
87 // which inner LUT will be implemented
88 return m_flagROI[roi][ssc][sec];
89}
90
92{
93 // no LUT available for TGC-BIS78 coincidence
94 // just return true for now
95
96 return true;
97}
98
99} // end of namespace
#define ATH_MSG_INFO(x)
void setLevel(MSG::Level lvl)
Change the current logging level.
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
const std::vector< uint8_t > & getBIS78Deta() const
const std::vector< uint8_t > & getBIS78phi() const
const std::vector< uint8_t > & getBIS78flag3over3phi() const
const std::vector< uint8_t > & getBIS78Dphi() const
const std::vector< uint8_t > & getBIS78eta() const
const std::vector< uint8_t > & getBIS78flag3over3eta() const
int getFlagROI(const unsigned int roi, const unsigned int ssc, const unsigned int sec, const unsigned int side) const
int m_flagROI[kNRoiInSSC][kNMaxSSC][kNEndcapTrigSector]
static constexpr unsigned int N_DPHI
LVL1TGCTrigger::TGCArguments * tgcArgs()
LVL1TGCTrigger::TGCArguments * m_tgcArgs
int TGCBIS78_pt(const BIS78TrigOut *bis78Out, int) const
std::vector< short int > m_CW[N_DETA][N_DPHI]
static constexpr unsigned int N_DETA
static constexpr unsigned int kNEndcapTrigSector
The number of endcap trigger sectors per side.
static constexpr unsigned int kNumberOfEndcapRoI
The number of ROIs in a endcap trigger sector.
static constexpr unsigned int kNMaxSSC
The maximim number of SubSector-Clusters (SSC) (i.e.
static constexpr unsigned int kNRoiInSSC
The default number of ROIs in SSC.