ATLAS Offline Software
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 
11 #include "TrigT1TGC/BIS78TrigOut.h"
14 
15 #include "TrigT1TGC/TGCArguments.h"
16 
17 namespace 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
56 int 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 
76 int 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
LVL1TGC::TGCBIS78CoincidenceMap::m_flagROI
int m_flagROI[kNRoiInSSC][kNMaxSSC][kNEndcapTrigSector]
Definition: TGCBIS78CoincidenceMap.h:49
LVL1TGC::BIS78TrigOut::getBIS78Deta
const std::vector< uint8_t > & getBIS78Deta() const
Definition: BIS78TrigOut.h:64
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
TGCBIS78CoincidenceMap.h
LVL1TGC::BIS78TrigOut::getBIS78eta
const std::vector< uint8_t > & getBIS78eta() const
Definition: BIS78TrigOut.h:62
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
test_pyathena.pt
pt
Definition: test_pyathena.py:11
LVL1TGC::BIS78TrigOut
Definition: BIS78TrigOut.h:16
LVL1TGC::TGCBIS78CoincidenceMap::readMap
bool readMap()
Definition: TGCBIS78CoincidenceMap.cxx:91
python.TurnDataReader.dr
dr
Definition: TurnDataReader.py:112
TGCDatabaseManager.h
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
TRT::Hit::side
@ side
Definition: HitInfo.h:83
AthMessaging::setLevel
void setLevel(MSG::Level lvl)
Change the current logging level.
Definition: AthMessaging.cxx:28
LVL1TGCTrigger::TGCArguments::set_USE_BIS78
void set_USE_BIS78(bool v)
Definition: TGCArguments.cxx:38
LVL1TGC::BIS78TrigOut::getBIS78Dphi
const std::vector< uint8_t > & getBIS78Dphi() const
Definition: BIS78TrigOut.h:65
LVL1TGC::TGCBIS78CoincidenceMap::N_DETA
static constexpr unsigned int N_DETA
Definition: TGCBIS78CoincidenceMap.h:43
LVL1TGC::TGCBIS78CoincidenceMap::m_verName
std::string m_verName
Definition: TGCBIS78CoincidenceMap.h:52
LVL1TGC
Definition: BigWheelCoincidenceLUT.cxx:20
LVL1TGC::TGCBIS78CoincidenceMap::m_CW
std::vector< short int > m_CW[N_DETA][N_DPHI]
Definition: TGCBIS78CoincidenceMap.h:47
AthMessaging
Class to provide easy MsgStream access and capabilities.
Definition: AthMessaging.h:55
LVL1TGC::TGCBIS78CoincidenceMap::N_DPHI
static constexpr unsigned int N_DPHI
Definition: TGCBIS78CoincidenceMap.h:44
LVL1TGC::BIS78TrigOut::getBIS78flag3over3eta
const std::vector< uint8_t > & getBIS78flag3over3eta() const
Definition: BIS78TrigOut.h:66
fill
void fill(H5::Group &out_file, size_t iterations)
Definition: test-hdf5-writer.cxx:95
LVL1TGC::TGCBIS78CoincidenceMap::getFlagROI
int getFlagROI(const unsigned int roi, const unsigned int ssc, const unsigned int sec, const unsigned int side) const
Definition: TGCBIS78CoincidenceMap.cxx:76
PathResolver.h
BIS78TrigOut.h
LVL1TGC::BIS78TrigOut::getBIS78phi
const std::vector< uint8_t > & getBIS78phi() const
Definition: BIS78TrigOut.h:63
LVL1TGCTrigger::TGCArguments
Definition: TGCArguments.h:12
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
LVL1TGC::ASIDE
@ ASIDE
Definition: TGCNumbering.h:14
LVL1TGC::BIS78TrigOut::getBIS78flag3over3phi
const std::vector< uint8_t > & getBIS78flag3over3phi() const
Definition: BIS78TrigOut.h:67
get_generator_info.version
version
Definition: get_generator_info.py:33
LVL1TGC::TGCBIS78CoincidenceMap::TGCBIS78CoincidenceMap
TGCBIS78CoincidenceMap()=delete
LVL1TGC::TGCBIS78CoincidenceMap::tgcArgs
LVL1TGCTrigger::TGCArguments * tgcArgs()
Definition: TGCBIS78CoincidenceMap.h:36
LVL1TGC::TGCBIS78CoincidenceMap::TGCBIS78_pt
int TGCBIS78_pt(const BIS78TrigOut *bis78Out, int) const
Definition: TGCBIS78CoincidenceMap.cxx:56
TGCArguments.h