ATLAS Offline Software
MMRawDataUtils.cxx
Go to the documentation of this file.
1 /*
2 
3 
4 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
5 
6 */
8 //Utils for the main MMRawDataMonAlg.cxx
9 
10 //Part of MMRawDataMonAlg.h
11 
12 //Authors
13 
14 // see MMRawDataMonAlg.cxx
15 
17 
18 
19 #include "MMRawDataMonAlg.h"
20 #include <string>
21 #include <stdexcept>
22 
24 
25  if (channel>0 && channel<=1024) return 1;
26  if (channel>1024 && channel<=2048) return 2;
27  if (channel>2048 && channel<=3072) return 3;
28  if (channel>3072 && channel<=4096) return 4;
29  if (channel>4096 && channel<=5120) return 5;
30 
31  throw std::invalid_argument( "channel is not valid!" );
32 }
33 
35 
36  if(fabs(stEta)==1){
37  if (channel>0 && channel<=512) return 1;
38  if (channel>512 && channel<=1024) return 2;
39 
40  if (channel>1024 && channel<=1536) return 3;
41  if (channel>1536 && channel<=2048) return 4;
42 
43  if (channel>2048 && channel<=2560) return 5;
44  if (channel>2560 && channel<=3072) return 6;
45 
46  if (channel>3072 && channel<=3584) return 7;
47  if (channel>3584 && channel<=4096) return 8;
48 
49  if (channel>4096 && channel<=4608) return 9;
50  if (channel>4608 && channel<=5120) return 10;
51  }else if(fabs(stEta)==2){
52  if (channel>0 && channel<=512) return 11;
53  if (channel>512 && channel<=1024) return 12;
54 
55  if (channel>1024 && channel<=1536) return 13;
56  if (channel>1536 && channel<=2048) return 14;
57 
58  if (channel>2048 && channel<=2560) return 15;
59  if (channel>2560 && channel<=3072) return 16;
60  }
61  throw std::invalid_argument( "channel is not valid!" );
62 }
63 
64 int MMRawDataMonAlg::get_sectorPhi_from_stationPhi_stName(int stationPhi,const std::string & stName) const {
65 
66  if (stationPhi==1 && stName=="MML") return 1;
67  if (stationPhi==1 && stName=="MMS") return 2;
68  if (stationPhi==2 && stName=="MML") return 3;
69  if (stationPhi==2 && stName=="MMS") return 4;
70  if (stationPhi==3 && stName=="MML") return 5;
71  if (stationPhi==3 && stName=="MMS") return 6;
72  if (stationPhi==4 && stName=="MML") return 7;
73  if (stationPhi==4 && stName=="MMS") return 8;
74  if (stationPhi==5 && stName=="MML") return 9;
75  if (stationPhi==5 && stName=="MMS") return 10;
76  if (stationPhi==6 && stName=="MML") return 11;
77  if (stationPhi==6 && stName=="MMS") return 12;
78  if (stationPhi==7 && stName=="MML") return 13;
79  if (stationPhi==7 && stName=="MMS") return 14;
80  if (stationPhi==8 && stName=="MML") return 15;
81  if (stationPhi==8 && stName=="MMS") return 16;
82 
83  throw std::invalid_argument( "stationPhi and stName are not valid!" );
84 
85 }
86 
88 
89  // 1<-0 0-> 1
90  if (std::abs(stationEta)==1) return 0;
91  if (std::abs(stationEta)==2) return 1;
92 
93  return -1;
94 
95 }
96 
97 int MMRawDataMonAlg::get_bin_for_occ_CSide_hist(int stationEta, int multiplet, int gas_gap) const {
98 
99  static const int max_gas_gap = 4;
100  static const int max_multiplet = 2;
101 
102  return (stationEta+2)*(max_gas_gap*max_multiplet)+(multiplet-1)*max_gas_gap +(gas_gap-1);
103 
104 }
105 
106 int MMRawDataMonAlg::get_bin_for_occ_ASide_hist(int stationEta, int multiplet, int gas_gap) const {
107 
108  static const int max_gas_gap = 4;
109  static const int max_multiplet = 2;
110 
111  return (stationEta-1)*(max_gas_gap*max_multiplet)+(multiplet-1)*max_gas_gap +(gas_gap-1);
112 
113 }
114 
115 
116 int MMRawDataMonAlg::get_bin_for_occ_CSide_pcb_eta2_hist(int stationEta, int multiplet, int gas_gap, int PCB) const {
117 
118  static const int max_pcb = 3;
119  static const int max_gas_gap = 4;
120  if (stationEta != -2) return -1;
121 
122  return (multiplet-1)*max_gas_gap*max_pcb+ (gas_gap-1)*max_pcb + (PCB-1);
123 
124 }
125 
126 
127 
128 int MMRawDataMonAlg::get_bin_for_occ(int gas_gap, int PCB) const {
129 
130  static const int max_pcb = 8;
131 
132  return (gas_gap-1)*max_pcb + (PCB-1);
133 
134 }
135 
136 int MMRawDataMonAlg::get_bin_for_feb_occ(int gas_gap, int FEB) const {
137 
138  static const int max_feb = 16;
139 
140  return (gas_gap-1)*max_feb + (FEB-1);
141 
142 }
143 
144 
145 int MMRawDataMonAlg::get_bin_for_occ_CSide_pcb_eta1_hist(int stationEta, int multiplet, int gas_gap, int PCB) const {
146 
147  static const int max_pcb = 5;
148  static const int max_gas_gap = 4;
149  if (stationEta != -1) return -1;
150 
151  return (multiplet-1)*max_gas_gap*max_pcb+ (gas_gap-1)*max_pcb + (PCB-1);
152 
153 }
154 
155 
156 int MMRawDataMonAlg::get_bin_for_occ_ASide_pcb_eta2_hist(int stationEta, int multiplet, int gas_gap, int PCB) const {
157 
158  static const int max_pcb = 3;
159  static const int max_gas_gap = 4;
160  if (stationEta != 2) return -1;
161 
162  return (multiplet-1)*max_gas_gap*max_pcb+ (gas_gap-1)*max_pcb + (PCB-1);
163 
164 }
165 
166 
167 int MMRawDataMonAlg::get_bin_for_occ_ASide_pcb_eta1_hist(int stationEta, int multiplet, int gas_gap, int PCB) const {
168 
169  static const int max_pcb = 5;
170  static const int max_gas_gap = 4;
171  if (stationEta != 1) return -1;
172 
173  return (multiplet-1)*max_gas_gap*max_pcb+ (gas_gap-1)*max_pcb + (PCB-1);
174 }
175 
176 
177 int MMRawDataMonAlg::get_bin_for_occ_lb_CSide_pcb_eta2_hist(int stationEta, int multiplet, int gas_gap, int PCB,int isector) const {
178 
179  static const int max_pcb = 3;
180  static const int max_gas_gap = 4;
181  static const int max_isector = 2;
182  if (stationEta != -2) return -1;
183 
184  return (multiplet-1)*max_gas_gap*max_pcb*max_isector+ (gas_gap-1)*max_pcb*max_isector + isector*max_pcb+ (PCB-1);
185 
186 }
187 
188 
189 int MMRawDataMonAlg::get_bin_for_occ_lb_CSide_pcb_eta1_hist(int stationEta, int multiplet, int gas_gap, int PCB,int isector) const {
190 
191  static const int max_pcb = 5;
192  static const int max_gas_gap = 4;
193  static const int max_isector = 2;
194  if (stationEta != -1) return -1;
195 
196  return (multiplet-1)*max_gas_gap*max_pcb*max_isector+ (gas_gap-1)*max_pcb*max_isector + isector*max_pcb + (PCB-1);
197 
198 }
199 
200 int MMRawDataMonAlg::get_bin_for_occ_lb_ASide_pcb_eta1_hist(int stationEta, int multiplet, int gas_gap, int PCB,int isector) const {
201 
202  static const int max_pcb = 5;
203  static const int max_gas_gap = 4;
204  static const int max_isector = 2;
205  if (stationEta != 1) return -1;
206 
207  return (multiplet-1)*max_gas_gap*max_pcb*max_isector+ (gas_gap-1)*max_pcb*max_isector + isector*max_pcb + (PCB-1);
208 }
209 
210 
211 int MMRawDataMonAlg::get_bin_for_occ_lb_ASide_pcb_eta2_hist(int stationEta, int multiplet, int gas_gap, int PCB,int isector) const {
212 
213  static const int max_pcb = 3;
214  static const int max_gas_gap = 4;
215  static const int max_isector = 2;
216  if (stationEta != 2) return -1;
217 
218  return (multiplet-1)*max_gas_gap*max_pcb*max_isector+ (gas_gap-1)*max_pcb*max_isector + isector*max_pcb + (PCB-1);
219 
220 }
221 
222 int MMRawDataMonAlg::get_bin_for_occ_lb_pcb_hist(int multiplet, int gas_gap, int PCB) const {
223 
224  static const int max_pcb = 8;
225  static const int max_gas_gap = 4;
226 
227  return (multiplet-1)*max_gas_gap*max_pcb + (gas_gap-1)*max_pcb + (PCB-1);
228 
229 }
230 
MMRawDataMonAlg::get_bin_for_occ_ASide_pcb_eta2_hist
int get_bin_for_occ_ASide_pcb_eta2_hist(const int stationEta, const int multiplet, const int gas_gap, const int PCB) const
Definition: MMRawDataUtils.cxx:156
MMRawDataMonAlg::get_bin_for_occ_ASide_hist
int get_bin_for_occ_ASide_hist(const int stationEta, const int multiplet, const int gas_gap) const
Definition: MMRawDataUtils.cxx:106
Muon::nsw::STGTPSegments::moduleIDBits::stationPhi
constexpr uint8_t stationPhi
station Phi 1 to 8
Definition: NSWSTGTPDecodeBitmaps.h:158
plotting.yearwise_efficiency.channel
channel
Definition: yearwise_efficiency.py:24
MMRawDataMonAlg::get_bin_for_occ_lb_CSide_pcb_eta2_hist
int get_bin_for_occ_lb_CSide_pcb_eta2_hist(const int stationEta, const int multiplet, const int gas_gap, const int PCB, const int isector) const
Definition: MMRawDataUtils.cxx:177
MMRawDataMonAlg::get_bin_for_feb_occ
int get_bin_for_feb_occ(const int gas_gap, const int FEB) const
Definition: MMRawDataUtils.cxx:136
MMRawDataMonAlg::get_PCB_from_channel
int get_PCB_from_channel(const int channel) const
Definition: MMRawDataUtils.cxx:23
MMRawDataMonAlg::get_bin_for_occ_CSide_pcb_eta2_hist
int get_bin_for_occ_CSide_pcb_eta2_hist(const int stationEta, const int multiplet, const int gas_gap, const int PCB) const
Definition: MMRawDataUtils.cxx:116
MMRawDataMonAlg.h
MMRawDataMonAlg::get_bin_for_occ_ASide_pcb_eta1_hist
int get_bin_for_occ_ASide_pcb_eta1_hist(const int stationEta, const int multiplet, const int gas_gap, const int PCB) const
Definition: MMRawDataUtils.cxx:167
MMRawDataMonAlg::get_bin_for_occ_CSide_hist
int get_bin_for_occ_CSide_hist(const int stationEta, const int multiplet, const int gas_gap) const
Definition: MMRawDataUtils.cxx:97
MMRawDataMonAlg::get_FEB_from_channel
int get_FEB_from_channel(const int channel, const int stEta) const
Definition: MMRawDataUtils.cxx:34
MMRawDataMonAlg::get_sectorEta_from_stationEta
int get_sectorEta_from_stationEta(const int stationEta) const
Definition: MMRawDataUtils.cxx:87
MMRawDataMonAlg::get_sectorPhi_from_stationPhi_stName
int get_sectorPhi_from_stationPhi_stName(const int stationPhi, const std::string &stName) const
Definition: MMRawDataUtils.cxx:64
MMRawDataMonAlg::get_bin_for_occ_lb_pcb_hist
int get_bin_for_occ_lb_pcb_hist(const int multiplet, const int gas_gap, const int PCB) const
Definition: MMRawDataUtils.cxx:222
MMRawDataMonAlg::get_bin_for_occ_lb_CSide_pcb_eta1_hist
int get_bin_for_occ_lb_CSide_pcb_eta1_hist(const int stationEta, const int multiplet, const int gas_gap, const int PCB, int isector) const
Definition: MMRawDataUtils.cxx:189
MMRawDataMonAlg::get_bin_for_occ_lb_ASide_pcb_eta1_hist
int get_bin_for_occ_lb_ASide_pcb_eta1_hist(const int stationEta, const int multiplet, const int gas_gap, const int PCB, int isector) const
Definition: MMRawDataUtils.cxx:200
MMRawDataMonAlg::get_bin_for_occ
int get_bin_for_occ(const int gas_gap, const int PCB) const
Definition: MMRawDataUtils.cxx:128
Muon::nsw::STGTPSegments::moduleIDBits::stationEta
constexpr uint8_t stationEta
1 to 3
Definition: NSWSTGTPDecodeBitmaps.h:156
MMRawDataMonAlg::get_bin_for_occ_lb_ASide_pcb_eta2_hist
int get_bin_for_occ_lb_ASide_pcb_eta2_hist(const int stationEta, const int multiplet, const int gas_gap, const int PCB, const int isector) const
Definition: MMRawDataUtils.cxx:211
MMRawDataMonAlg::get_bin_for_occ_CSide_pcb_eta1_hist
int get_bin_for_occ_CSide_pcb_eta1_hist(const int stationEta, const int multiplet, const int gas_gap, const int PCB) const
Definition: MMRawDataUtils.cxx:145