ATLAS Offline Software
TGCBIS78CoincidenceMap.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 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_condDbTool("TGCTriggerDbTool"),
23  m_tgcArgs(tgcargs)
24 {
25  setLevel(tgcArgs()->MSGLEVEL());
26 
27  if(!tgcArgs()->USE_BIS78()){return;}
28 
29  // initialize map
30  for (size_t sec=0; sec < kNEndcapTrigSector; sec++){
31  for (size_t ssc=0; ssc < kNMaxSSC; ssc++){
32  for (size_t pos=0; pos < kNRoiInSSC; pos++){
33  m_flagROI[pos][ssc][sec] = 1;
34  }
35  }
36  }
37 
38  for (size_t dr=0; dr!=N_DETA; dr++) {
39  for (size_t dphi=0; dphi!=N_DPHI; dphi++) {
40  m_CW[dr][dphi].resize(kNumberOfEndcapRoI);
41  std::fill(m_CW[dr][dphi].begin(), m_CW[dr][dphi].end(), 0);
42  }
43  }
44 
45  //---------Read out CW data---------
46  if (!this->readMap()) {
47  // BIS78 trigger flag is set to false when the map reading failed.
48  tgcArgs()->set_USE_BIS78(false);
49  ATH_MSG_INFO("NOT using BIS78");
50  } else {
51  ATH_MSG_INFO("TGC BIS78 CW version of " << m_verName << " is selected");
52  }
53 }
54 
55 
56 //TGC-BIS78 Eta-Phi Coincidence
57 int TGCBIS78CoincidenceMap::TGCBIS78_pt(const BIS78TrigOut *bis78Out,int /*roi*/) const
58 {
59  std::vector<uint8_t> bis78Eta_vec=bis78Out->getBIS78eta();
60  std::vector<uint8_t> bis78Phi_vec=bis78Out->getBIS78phi();
61  std::vector<uint8_t> bis78Deta_vec=bis78Out->getBIS78Deta();
62  std::vector<uint8_t> bis78Dphi_vec=bis78Out->getBIS78Dphi();
63  std::vector<uint8_t> bis78flag3over3eta_vec=bis78Out->getBIS78flag3over3eta();
64  std::vector<uint8_t> bis78flag3over3phi_vec=bis78Out->getBIS78flag3over3phi();
65 
66  int pt=0;
67  // temporal algorithm
68  for(unsigned int bis78hit_id=0; bis78hit_id!=bis78Eta_vec.size(); bis78hit_id++){
69  // calculate dR, dPhi bin # from eta/phiIndex?
70  // for now, if there is a hit at BIS78, it returns true always
71  pt=1;
72  }
73 
74  return pt;
75 }
76 
77 int TGCBIS78CoincidenceMap::getFlagROI(const unsigned int roi,
78  const unsigned int ssc,
79  const unsigned int sec,
80  const unsigned int side) const
81 {
82  if (side != TGCSide::ASIDE) return 0; // BIS78 only in A side
83 
84  if (roi >= kNRoiInSSC) return -1;
85  if (ssc >= kNMaxSSC) return 0;
86  if (sec >= kNEndcapTrigSector) return -1;
87 
88  // which inner LUT will be implemented
89  return m_flagROI[roi][ssc][sec];
90 }
91 
93 {
94  // no LUT available for TGC-BIS78 coincidence
95  // just return true for now
96 
97  return true;
98 }
99 
100 } // end of namespace
LVL1TGC::TGCBIS78CoincidenceMap::m_flagROI
int m_flagROI[kNRoiInSSC][kNMaxSSC][kNEndcapTrigSector]
Definition: TGCBIS78CoincidenceMap.h:50
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:92
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:44
LVL1TGC::TGCBIS78CoincidenceMap::m_verName
std::string m_verName
Definition: TGCBIS78CoincidenceMap.h:53
LVL1TGC
Definition: BigWheelCoincidenceLUT.cxx:20
LVL1TGC::TGCBIS78CoincidenceMap::m_CW
std::vector< short int > m_CW[N_DETA][N_DPHI]
Definition: TGCBIS78CoincidenceMap.h:48
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:45
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:77
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:37
LVL1TGC::TGCBIS78CoincidenceMap::TGCBIS78_pt
int TGCBIS78_pt(const BIS78TrigOut *bis78Out, int) const
Definition: TGCBIS78CoincidenceMap.cxx:57
TGCArguments.h