ATLAS Offline Software
SectorLogicSetup.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef SECTORLOGICSETUP_H
6 #define SECTORLOGICSETUP_H
7 
8 #include <algorithm>
9 #include <list>
10 #include <map>
11 
20 
21 namespace RPC_CondCabling {
22 
23  class SectorLogicSetup : public BaseObject {
24  public:
25  typedef std::multimap<CMAinput, int, std::less<CMAinput> > StationMap;
26  typedef std::map<int, RPCchamber, std::less<int> > RPCmap;
27  typedef std::map<int, WiredOR, std::less<int> > WORmap;
28  typedef std::map<CMAidentity, EtaCMA, std::less<CMAidentity> > EtaCMAmap;
29  typedef std::map<CMAidentity, EvenPhiCMA, std::less<CMAidentity> > EvenPhiCMAmap;
30  typedef std::map<CMAidentity, OddPhiCMA, std::less<CMAidentity> > OddPhiCMAmap;
31 
32  typedef std::list<int> SECTORlist;
33 
34  private:
35  std::string m_positive_sector;
36  std::string m_negative_sector;
37 
40 
42 
48 
49  std::string m_online_database;
50  std::string m_layout;
51  bool m_cosmic;
52 
53  [[nodiscard]] std::string no_elements(const std::string&, int);
54  void get_station(CMAinput, int);
55 
56  EtaCMAmap::const_iterator find_etaCMA(int Eta, int Phi) const;
57  EvenPhiCMAmap::const_iterator find_evenphiCMA(int Eta, int Phi) const;
58  OddPhiCMAmap::const_iterator find_oddphiCMA(int Eta, int Phi) const;
59 
60  EtaCMAmap::iterator find_etaCMA(int Eta, int Phi);
63 
64  const std::map<std::string, std::string>* m_trigroads = nullptr;
65 
66  public:
67  SectorLogicSetup(int, const std::string&, const std::string&, bool);
68  virtual ~SectorLogicSetup() = default;
69 
70  /* Copying of this bag class should not be needed. To prevent the
71  creation of accidental (temporary) copies, we only allow move. */
76 
77  const std::string& positive_sector() const { return m_positive_sector; }
78  const std::string& negative_sector() const { return m_negative_sector; }
79  const std::string& online_database() const { return m_online_database; }
80  const std::string& layout() const { return m_layout; }
81  int sector_type() const { return m_sector_type; }
82  bool cosmic() const { return m_cosmic; }
83  const SECTORlist& sectors() const { return m_sectors; }
84  const StationMap& giveStations() const { return m_stations; }
85 
86  const RPCmap& giveRPC() const { return m_RPCs; }
87  const WORmap& giveWOR() const { return m_WORs; }
88  const EtaCMAmap& giveEtaCMA() const { return m_etaCMAs; }
89  const EvenPhiCMAmap& giveEvenPhiCMA() const { return m_evenphiCMAs; }
90  const OddPhiCMAmap& giveOddPhiCMA() const { return m_oddphiCMAs; }
91 
92  const RPCchamber* find_chamber(int, int) const;
93 
94  RPCchamber* find_chamber(int, int);
95  WiredOR* find_wor(int, int);
96  WiredOR* previousWOR(const WiredOR&);
97  EtaCMA* previousCMA(const EtaCMA&);
100  std::list<const EtaCMA*> find_eta_CMAs_in_PAD(int);
101 
102  bool setup(MsgStream&);
103  bool check();
104 
105  bool global_strip_add(ViewType, HalfType, int, int, int, int&) const;
106  bool local_strip_add(ViewType, int, int, int&, int&) const;
107  bool global_conn_add(ViewType, HalfType, int, int, int, int&, int&, int&) const;
108  bool local_conn_add(ViewType, int, int, int&, int&, int&) const;
109 
110  const CMAparameters::CMAlist give_CMAs(const int, const ViewType, const int, const int) const;
111 
112  bool give_RoI_borders(const CMAidentity& ETA,
113  const CMAidentity& PHI,
114  unsigned int& firstEtaCode, unsigned int& lastEtaCode,
115  unsigned int& firstPhiCode, unsigned int& lastPhiCode) const;
116 
117  bool give_LowPt_borders(const CMAidentity& ETA,
118  const CMAidentity& PHI,
119  unsigned int& firstEtaCode, unsigned int& lastEtaCode,
120  unsigned int& firstPhiCode, unsigned int& lastPhiCode) const;
121 
122  bool give_HighPt_borders(const CMAidentity& ETA,
123  const CMAidentity& PHI,
124  unsigned int& firstEtaCode, unsigned int& lastEtaCode,
125  unsigned int& firstPhiCode, unsigned int& lastPhiCode) const;
126 
127  bool give_LowPt_layout(const CMAidentity& ID, unsigned short int& start_pivot_ch, unsigned int& start_pivot_code,
128  unsigned short int& stop_pivot_ch, unsigned int& stop_pivot_code, unsigned short int& start_confirm_ch,
129  unsigned int& start_confirm_code, unsigned short int& stop_confirm_ch,
130  unsigned int& stop_confirm_code) const;
131 
132  bool give_HighPt_layout(const CMAidentity& ID, unsigned short int& start_pivot_ch, unsigned int& start_pivot_code,
133  unsigned short int& stop_pivot_ch, unsigned int& stop_pivot_code, unsigned short int& start_confirm_ch,
134  unsigned int& start_confirm_code, unsigned short int& stop_confirm_ch,
135  unsigned int& stop_confirm_code) const;
136 
137  const CMAparameters* give_CMA(const CMAidentity& CMA) const;
138 
139  bool correct(const CMAidentity& CMA,
140  L1RPCcabCorrection type, CMAinput it, unsigned int layer, unsigned short int Channel1,
141  unsigned short int Channel2, short int num) const;
142 
143  std::list<unsigned int> give_strip_code(const CMAidentity& CMA,
144  int logic_sector, unsigned short int lh, unsigned short int ijk,
145  unsigned short int Channel) const;
146 
147  bool operator+=(RPCchamberdata&);
148  bool operator+=(WiredORdata&);
149  bool operator+=(CMApivotdata&);
150  bool operator+=(CMAcablingdata&);
151 
152  HalfType side() const;
153 
155 
156  void PrintElement(std::ostream&, int, const std::string&, int, bool) const;
157  friend std::ostream& operator<<(std::ostream&, const SectorLogicSetup&);
158 
159  void SetPtoTrigRoads(const std::map<std::string, std::string>*);
160  const std::map<std::string, std::string>* GetPtoTrigRoads() const { return m_trigroads; } // LBTAG
161  };
162 
163 } // namespace RPC_CondCabling
164 
165 #endif
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
RPC_CondCabling::SectorLogicSetup::online_database
const std::string & online_database() const
Definition: SectorLogicSetup.h:79
RPC_CondCabling::SectorLogicSetup::giveRPC
const RPCmap & giveRPC() const
Definition: SectorLogicSetup.h:86
RPC_CondCabling::SectorLogicSetup::m_trigroads
const std::map< std::string, std::string > * m_trigroads
Definition: SectorLogicSetup.h:64
RPC_CondCabling::SectorLogicSetup::m_sectors
SECTORlist m_sectors
Definition: SectorLogicSetup.h:39
DiTauMassTools::TauTypes::lh
@ lh
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:53
RPC_CondCabling::SectorLogicSetup::give_HighPt_layout
bool give_HighPt_layout(const CMAidentity &ID, unsigned short int &start_pivot_ch, unsigned int &start_pivot_code, unsigned short int &stop_pivot_ch, unsigned int &stop_pivot_code, unsigned short int &start_confirm_ch, unsigned int &start_confirm_code, unsigned short int &stop_confirm_ch, unsigned int &stop_confirm_code) const
Definition: SectorLogicSetup.cxx:456
RPC_CondCabling::SectorLogicSetup::m_WORs
WORmap m_WORs
Definition: SectorLogicSetup.h:44
RPC_CondCabling::SectorLogicSetup::SECTORlist
std::list< int > SECTORlist
Definition: SectorLogicSetup.h:32
L1RPCcabCorrection
L1RPCcabCorrection
Definition: CMAparameters.h:19
ShowRequest.h
RPC_CondCabling::SectorLogicSetup::giveEtaCMA
const EtaCMAmap & giveEtaCMA() const
Definition: SectorLogicSetup.h:88
RPC_CondCabling::SectorLogicSetup::giveOddPhiCMA
const OddPhiCMAmap & giveOddPhiCMA() const
Definition: SectorLogicSetup.h:90
ID
std::vector< Identifier > ID
Definition: CalibHitIDCheck.h:24
LArBadChanBlobUtils::Channel
Identifier32::value_type Channel
Definition: LArBadChanBlobUtils.h:24
RPC_CondCabling::SectorLogicSetup::giveWOR
const WORmap & giveWOR() const
Definition: SectorLogicSetup.h:87
RPC_CondCabling::SectorLogicSetup::find_evenphiCMA
EvenPhiCMAmap::const_iterator find_evenphiCMA(int Eta, int Phi) const
Definition: SectorLogicSetup.cxx:189
RPC_CondCabling::SectorLogicSetup::OddPhiCMAmap
std::map< CMAidentity, OddPhiCMA, std::less< CMAidentity > > OddPhiCMAmap
Definition: SectorLogicSetup.h:30
RPC_CondCabling::SectorLogicSetup::negative_sector
const std::string & negative_sector() const
Definition: SectorLogicSetup.h:78
WiredORdata.h
RPC_CondCabling::SectorLogicSetup::operator=
SectorLogicSetup & operator=(const SectorLogicSetup &)=delete
RPC_CondCabling::CMApivotdata
Definition: CMApivotdata.h:20
RPC_CondCabling::EtaCMA
Definition: EtaCMA.h:20
RPC_CondCabling::SectorLogicSetup::check
bool check()
Definition: SectorLogicSetup.cxx:100
skel.it
it
Definition: skel.GENtoEVGEN.py:396
RPC_CondCabling::SectorLogicSetup::positive_sector
const std::string & positive_sector() const
Definition: SectorLogicSetup.h:77
RPC_CondCabling::SectorLogicSetup::global_strip_add
bool global_strip_add(ViewType, HalfType, int, int, int, int &) const
Definition: SectorLogicSetup.cxx:249
RPC_CondCabling::SectorLogicSetup::m_stations
StationMap m_stations
Definition: SectorLogicSetup.h:41
RPC_CondCabling::SectorLogicSetup::sector_type
int sector_type() const
Definition: SectorLogicSetup.h:81
CMAparameters::CMAlist
std::list< const CMAparameters * > CMAlist
Definition: CMAparameters.h:24
RPC_CondCabling::SectorLogicSetup::layout
const std::string & layout() const
Definition: SectorLogicSetup.h:80
CMApivotdata.h
RPC_CondCabling::SectorLogicSetup::m_sector_type
int m_sector_type
Definition: SectorLogicSetup.h:38
RPC_CondCabling::SectorLogicSetup::m_negative_sector
std::string m_negative_sector
Definition: SectorLogicSetup.h:36
RPC_CondCabling::SectorLogicSetup::side
HalfType side() const
Definition: SectorLogicSetup.cxx:841
RPC_CondCabling::OddPhiCMA
Definition: OddPhiCMA.h:20
RPC_CondCabling
Definition: CMAcablingdata.h:18
RoiUtil::PHI
@ PHI
Definition: RoiSerialise.cxx:31
BaseObject.h
RPC_CondCabling::SectorLogicSetup::SectorLogicSetup
SectorLogicSetup(SectorLogicSetup &&)=default
RPC_CondCabling::RPCchamberdata
Definition: RPCchamberdata.h:17
RPC_CondCabling::SectorLogicSetup::give_HighPt_borders
bool give_HighPt_borders(const CMAidentity &ETA, const CMAidentity &PHI, unsigned int &firstEtaCode, unsigned int &lastEtaCode, unsigned int &firstPhiCode, unsigned int &lastPhiCode) const
Definition: SectorLogicSetup.cxx:381
RPC_CondCabling::SectorLogicSetup::give_LowPt_layout
bool give_LowPt_layout(const CMAidentity &ID, unsigned short int &start_pivot_ch, unsigned int &start_pivot_code, unsigned short int &stop_pivot_ch, unsigned int &stop_pivot_code, unsigned short int &start_confirm_ch, unsigned int &start_confirm_code, unsigned short int &stop_confirm_ch, unsigned int &stop_confirm_code) const
Definition: SectorLogicSetup.cxx:407
RPC_CondCabling::SectorLogicSetup::find_chamber
const RPCchamber * find_chamber(int, int) const
Definition: SectorLogicSetup.cxx:133
RPC_CondCabling::SectorLogicSetup::give_CMAs
const CMAparameters::CMAlist give_CMAs(const int, const ViewType, const int, const int) const
Definition: SectorLogicSetup.cxx:296
RPC_CondCabling::SectorLogicSetup::PrintElement
void PrintElement(std::ostream &, int, const std::string &, int, bool) const
Definition: SectorLogicSetup.cxx:586
RPC_CondCabling::SectorLogicSetup::SetPtoTrigRoads
void SetPtoTrigRoads(const std::map< std::string, std::string > *)
Definition: SectorLogicSetup.cxx:847
RPC_CondCabling::SectorLogicSetup::find_wor
WiredOR * find_wor(int, int)
Definition: SectorLogicSetup.cxx:141
RPC_CondCabling::SectorLogicSetup::cosmic
bool cosmic() const
Definition: SectorLogicSetup.h:82
RPC_CondCabling::SectorLogicSetup::m_cosmic
bool m_cosmic
Definition: SectorLogicSetup.h:51
RPC_CondCabling::SectorLogicSetup::GetPtoTrigRoads
const std::map< std::string, std::string > * GetPtoTrigRoads() const
Definition: SectorLogicSetup.h:160
ViewType
ViewType
Definition: RPCdef.h:8
RPC_CondCabling::CMAcablingdata
Definition: CMAcablingdata.h:20
RPC_CondCabling::SectorLogicSetup::StationMap
std::multimap< CMAinput, int, std::less< CMAinput > > StationMap
Definition: SectorLogicSetup.h:25
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
RPCdecoder.h
RPC_CondCabling::SectorLogicSetup::no_elements
std::string no_elements(const std::string &, int)
Definition: SectorLogicSetup.cxx:24
RPC_CondCabling::WiredORdata
Definition: WiredORdata.h:17
RPC_CondCabling::SectorLogicSetup::~SectorLogicSetup
virtual ~SectorLogicSetup()=default
RPC_CondCabling::SectorLogicSetup::local_strip_add
bool local_strip_add(ViewType, int, int, int &, int &) const
Definition: SectorLogicSetup.cxx:256
RPC_CondCabling::SectorLogicSetup
Definition: SectorLogicSetup.h:23
RPC_CondCabling::SectorLogicSetup::EvenPhiCMAmap
std::map< CMAidentity, EvenPhiCMA, std::less< CMAidentity > > EvenPhiCMAmap
Definition: SectorLogicSetup.h:29
RPC_CondCabling::SectorLogicSetup::give_LowPt_borders
bool give_LowPt_borders(const CMAidentity &ETA, const CMAidentity &PHI, unsigned int &firstEtaCode, unsigned int &lastEtaCode, unsigned int &firstPhiCode, unsigned int &lastPhiCode) const
Definition: SectorLogicSetup.cxx:355
RPC_CondCabling::SectorLogicSetup::find_eta_CMAs_in_PAD
std::list< const EtaCMA * > find_eta_CMAs_in_PAD(int)
Definition: SectorLogicSetup.cxx:178
RPC_CondCabling::SectorLogicSetup::operator+=
bool operator+=(RPCchamberdata &)
Definition: SectorLogicSetup.cxx:722
CMAinput
CMAinput
Definition: CMAparameters.h:18
trigbs_pickEvents.num
num
Definition: trigbs_pickEvents.py:76
RPC_CondCabling::SectorLogicSetup::sectors
const SECTORlist & sectors() const
Definition: SectorLogicSetup.h:83
RPC_CondCabling::SectorLogicSetup::m_layout
std::string m_layout
Definition: SectorLogicSetup.h:50
RPC_CondCabling::SectorLogicSetup::give_RoI_borders
bool give_RoI_borders(const CMAidentity &ETA, const CMAidentity &PHI, unsigned int &firstEtaCode, unsigned int &lastEtaCode, unsigned int &firstPhiCode, unsigned int &lastPhiCode) const
Definition: SectorLogicSetup.cxx:329
RPC_CondCabling::SectorLogicSetup::operator=
SectorLogicSetup & operator=(SectorLogicSetup &&)=default
RPC_CondCabling::SectorLogicSetup::RPCmap
std::map< int, RPCchamber, std::less< int > > RPCmap
Definition: SectorLogicSetup.h:26
RPC_CondCabling::SectorLogicSetup::global_conn_add
bool global_conn_add(ViewType, HalfType, int, int, int, int &, int &, int &) const
Definition: SectorLogicSetup.cxx:272
RPC_CondCabling::SectorLogicSetup::previousWOR
WiredOR * previousWOR(const WiredOR &)
Definition: SectorLogicSetup.cxx:149
BaseObject
Definition: BaseObject.h:13
RPC_CondCabling::SectorLogicSetup::find_etaCMA
EtaCMAmap::const_iterator find_etaCMA(int Eta, int Phi) const
Definition: SectorLogicSetup.cxx:209
RPC_CondCabling::RPCchamber
Definition: RPCchamber.h:23
RoiUtil::ETA
@ ETA
Definition: RoiSerialise.cxx:30
RPC_CondCabling::SectorLogicSetup::giveStations
const StationMap & giveStations() const
Definition: SectorLogicSetup.h:84
RPCchamberdata.h
RPC_CondCabling::SectorLogicSetup::operator<<
SectorLogicSetup & operator<<(int)
Definition: SectorLogicSetup.cxx:571
RPC_CondCabling::SectorLogicSetup::SectorLogicSetup
SectorLogicSetup(int, const std::string &, const std::string &, bool)
Definition: SectorLogicSetup.cxx:13
RPC_CondCabling::SectorLogicSetup::WORmap
std::map< int, WiredOR, std::less< int > > WORmap
Definition: SectorLogicSetup.h:27
RPC_CondCabling::SectorLogicSetup::m_positive_sector
std::string m_positive_sector
Definition: SectorLogicSetup.h:35
RPC_CondCabling::WiredOR
Definition: WiredOR.h:26
CMAidentity
Definition: CMAidentity.h:16
CMAparameters
Definition: CMAparameters.h:21
CMAcablingdata.h
RPC_CondCabling::SectorLogicSetup::previousCMA
EtaCMA * previousCMA(const EtaCMA &)
Definition: SectorLogicSetup.cxx:157
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
RPC_CondCabling::SectorLogicSetup::give_CMA
const CMAparameters * give_CMA(const CMAidentity &CMA) const
Definition: SectorLogicSetup.cxx:505
RPC_CondCabling::EvenPhiCMA
Definition: EvenPhiCMA.h:20
dbline.h
RPC_CondCabling::SectorLogicSetup::local_conn_add
bool local_conn_add(ViewType, int, int, int &, int &, int &) const
Definition: SectorLogicSetup.cxx:279
RPC_CondCabling::SectorLogicSetup::find_oddphiCMA
OddPhiCMAmap::const_iterator find_oddphiCMA(int Eta, int Phi) const
Definition: SectorLogicSetup.cxx:199
RPC_CondCabling::SectorLogicSetup::giveEvenPhiCMA
const EvenPhiCMAmap & giveEvenPhiCMA() const
Definition: SectorLogicSetup.h:89
RPC_CondCabling::SectorLogicSetup::m_oddphiCMAs
OddPhiCMAmap m_oddphiCMAs
Definition: SectorLogicSetup.h:47
RPC_CondCabling::SectorLogicSetup::m_RPCs
RPCmap m_RPCs
Definition: SectorLogicSetup.h:43
RPC_CondCabling::SectorLogicSetup::SectorLogicSetup
SectorLogicSetup(const SectorLogicSetup &)=delete
RPC_CondCabling::SectorLogicSetup::setup
bool setup(MsgStream &)
Definition: SectorLogicSetup.cxx:42
RPC_CondCabling::SectorLogicSetup::correct
bool correct(const CMAidentity &CMA, L1RPCcabCorrection type, CMAinput it, unsigned int layer, unsigned short int Channel1, unsigned short int Channel2, short int num) const
Definition: SectorLogicSetup.cxx:524
RPC_CondCabling::SectorLogicSetup::m_online_database
std::string m_online_database
Definition: SectorLogicSetup.h:49
RPC_CondCabling::SectorLogicSetup::give_strip_code
std::list< unsigned int > give_strip_code(const CMAidentity &CMA, int logic_sector, unsigned short int lh, unsigned short int ijk, unsigned short int Channel) const
Definition: SectorLogicSetup.cxx:544
RPC_CondCabling::SectorLogicSetup::m_etaCMAs
EtaCMAmap m_etaCMAs
Definition: SectorLogicSetup.h:45
HalfType
HalfType
Definition: RPCdef.h:9
Eta
@ Eta
Definition: RPCdef.h:8
RPC_CondCabling::SectorLogicSetup::EtaCMAmap
std::map< CMAidentity, EtaCMA, std::less< CMAidentity > > EtaCMAmap
Definition: SectorLogicSetup.h:28
RPC_CondCabling::SectorLogicSetup::get_station
void get_station(CMAinput, int)
Definition: SectorLogicSetup.cxx:32
RPC_CondCabling::SectorLogicSetup::m_evenphiCMAs
EvenPhiCMAmap m_evenphiCMAs
Definition: SectorLogicSetup.h:46