ATLAS Offline Software
Loading...
Searching...
No Matches
NSWL1::PAD Namespace Reference

Functions

uint32_t wheelSectorToSourceID (const char wheel, const uint32_t sector)
uint32_t getpFEBAthena (const int gas_gap, const int multiplet, const int stationEta)
std::pair< int, int > getNrowsNcols (const int pfeb, const bool isLarge)
std::pair< int, int > getRowColAthena (const int athenaCh)
uint32_t getPadchAthena (const int athCh, const int pfeb, const int sector, int gasGap)
uint32_t priorityEncoderL (uint32_t bandid)
uint32_t priorityEncoderS (uint32_t bandid)
bool isDummyPad (const uint32_t padchan)
bool contains (const std::string &str, const std::string &substr)
bool contains (const std::vector< std::string > &cont, const std::string &val)
bool contains (const std::vector< uint32_t > &cont, const uint32_t val)
bool contains (const std::set< uint32_t > &cont, const uint32_t val)
std::string replace (std::string subject, const std::string &search, const std::string &replace)
uint32_t parseLineForBandid (const std::string &line)

Variables

const std::string LARGE {"large"}
const std::string SMALL {"small"}
constexpr std::array< uint32_t, NLAYERSLAYERS {0, 1, 2, 3, 4, 5, 6, 7}
constexpr std::array< uint32_t, NSECTORSSECTORS {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}
const std::string PATTERN_TAG {"pad_trigger_pattern_array :="}
const std::string PATTERN_END {"bandid_tds_numbers"}
constexpr size_t PATTERNLEN {17}
constexpr uint32_t DUMMY_BANDID {0xff}
constexpr std::array< uint32_t, 8 > DUMMYPADS {104,105,110,111,112,113,114,115}
 Dummy pads.
constexpr uint32_t PAD_TRIGGER_ROB {0x20}
constexpr uint32_t PAD_TRIGGER_READOUT_NBC {7}
constexpr uint32_t MUON_STGC_ENDCAP_A_SIDE {0x6D}
constexpr uint32_t MUON_STGC_ENDCAP_C_SIDE {0x6E}
constexpr uint32_t NPFEB_PER_RADIUS {NLAYERS}
constexpr size_t I_PFEB0 = 0
constexpr size_t I_PADCHAN0 = 1
constexpr size_t I_PFEB1 = 2
constexpr size_t I_PADCHAN1 = 3
constexpr size_t I_PFEB2 = 4
constexpr size_t I_PADCHAN2 = 5
constexpr size_t I_PFEB3 = 6
constexpr size_t I_PADCHAN3 = 7
constexpr size_t I_PFEB4 = 8
constexpr size_t I_PADCHAN4 = 9
constexpr size_t I_PFEB5 = 10
constexpr size_t I_PADCHAN5 = 11
constexpr size_t I_PFEB6 = 12
constexpr size_t I_PADCHAN6 = 13
constexpr size_t I_PFEB7 = 14
constexpr size_t I_PADCHAN7 = 15
constexpr size_t I_PHIID = 16

Function Documentation

◆ contains() [1/4]

bool NSWL1::PAD::contains ( const std::set< uint32_t > & cont,
const uint32_t val )
inline

Definition at line 269 of file TrigT1NSWSimExtras.h.

269 {
270 return cont.contains(val);
271 }

◆ contains() [2/4]

bool NSWL1::PAD::contains ( const std::string & str,
const std::string & substr )
inline

Definition at line 260 of file TrigT1NSWSimExtras.h.

260 {
261 return str.find(substr) != std::string::npos;
262 }

◆ contains() [3/4]

bool NSWL1::PAD::contains ( const std::vector< std::string > & cont,
const std::string & val )
inline

Definition at line 263 of file TrigT1NSWSimExtras.h.

263 {
264 return std::count(cont.begin(), cont.end(), val);
265 }

◆ contains() [4/4]

bool NSWL1::PAD::contains ( const std::vector< uint32_t > & cont,
const uint32_t val )
inline

Definition at line 266 of file TrigT1NSWSimExtras.h.

266 {
267 return std::count(cont.begin(), cont.end(), val);
268 }

◆ getNrowsNcols()

std::pair< int, int > NSWL1::PAD::getNrowsNcols ( const int pfeb,
const bool isLarge )
inline

Definition at line 101 of file TrigT1NSWSimExtras.h.

101 {
102 if (isLarge) {
103 if(pfeb == 0) return std::make_pair(17, 6);
104 if(pfeb == 1) return std::make_pair(17, 6);
105 if(pfeb == 2) return std::make_pair(16, 7);
106 if(pfeb == 3) return std::make_pair(16, 7);
107 if(pfeb == 4) return std::make_pair(16, 6);
108 if(pfeb == 5) return std::make_pair(16, 6);
109 if(pfeb == 6) return std::make_pair(16, 6);
110 if(pfeb == 7) return std::make_pair(16, 6);
111 if(pfeb == 8) return std::make_pair(14, 4);
112 if(pfeb == 9) return std::make_pair(14, 4);
113 if(pfeb == 10) return std::make_pair(15, 5);
114 if(pfeb == 11) return std::make_pair(15, 5);
115 if(pfeb == 12) return std::make_pair(14, 4);
116 if(pfeb == 13) return std::make_pair(14, 4);
117 if(pfeb == 14) return std::make_pair(14, 4);
118 if(pfeb == 15) return std::make_pair(14, 4);
119 if(pfeb == 16) return std::make_pair(15, 4);
120 if(pfeb == 17) return std::make_pair(15, 4);
121 if(pfeb == 18) return std::make_pair(14, 5);
122 if(pfeb == 19) return std::make_pair(14, 5);
123 if(pfeb == 20) return std::make_pair(13, 4);
124 if(pfeb == 21) return std::make_pair(13, 4);
125 if(pfeb == 22) return std::make_pair(14, 4);
126 if(pfeb == 23) return std::make_pair(14, 4);
127 }
128 else {
129 if(pfeb == 0) return std::make_pair(17, 4);
130 if(pfeb == 1) return std::make_pair(17, 4);
131 if(pfeb == 2) return std::make_pair(18, 4);
132 if(pfeb == 3) return std::make_pair(18, 4);
133 if(pfeb == 4) return std::make_pair(17, 4);
134 if(pfeb == 5) return std::make_pair(17, 4);
135 if(pfeb == 6) return std::make_pair(17, 3);
136 if(pfeb == 7) return std::make_pair(17, 3);
137 if(pfeb == 8) return std::make_pair(16, 3);
138 if(pfeb == 9) return std::make_pair(16, 3);
139 if(pfeb == 10) return std::make_pair(15, 3);
140 if(pfeb == 11) return std::make_pair(15, 3);
141 if(pfeb == 12) return std::make_pair(15, 2);
142 if(pfeb == 13) return std::make_pair(15, 2);
143 if(pfeb == 14) return std::make_pair(15, 3);
144 if(pfeb == 15) return std::make_pair(15, 3);
145 if(pfeb == 16) return std::make_pair(13, 3);
146 if(pfeb == 17) return std::make_pair(13, 3);
147 if(pfeb == 18) return std::make_pair(14, 3);
148 if(pfeb == 19) return std::make_pair(14, 3);
149 if(pfeb == 20) return std::make_pair(12, 2);
150 if(pfeb == 21) return std::make_pair(12, 2);
151 if(pfeb == 22) return std::make_pair(13, 3);
152 if(pfeb == 23) return std::make_pair(13, 3);
153 }
154 return std::make_pair(0,0);
155 }

◆ getPadchAthena()

uint32_t NSWL1::PAD::getPadchAthena ( const int athCh,
const int pfeb,
const int sector,
int gasGap )
inline

Definition at line 163 of file TrigT1NSWSimExtras.h.

163 {
164 bool isLarge = (sector % 2 == 0);
165 const auto [Nrows, Ncols] = getNrowsNcols(pfeb, isLarge);
166 const auto [arow, acol] = getRowColAthena(athCh);
167 //row and column counting all begin at 0
168 const int ABrow = Nrows -1 -arow;
169 const int ABcol = ((gasGap-1)%2 ==0) ? (Ncols-1)-acol : acol;
170 return ABrow*Ncols + ABcol;
171 }
std::pair< int, int > getRowColAthena(const int athenaCh)
std::pair< int, int > getNrowsNcols(const int pfeb, const bool isLarge)

◆ getpFEBAthena()

uint32_t NSWL1::PAD::getpFEBAthena ( const int gas_gap,
const int multiplet,
const int stationEta )
inline

Definition at line 95 of file TrigT1NSWSimExtras.h.

95 {
96 const auto layer = (multiplet-1)*4 + (gas_gap-1);
97 uint32_t pfeb = (std::abs(stationEta)-1)*8 + layer;
98 return pfeb;
99 }

◆ getRowColAthena()

std::pair< int, int > NSWL1::PAD::getRowColAthena ( const int athenaCh)
inline

Definition at line 157 of file TrigT1NSWSimExtras.h.

157 {
158 const int arow = (athenaCh-1)%18;
159 const int acol = int((athenaCh-1)/18);
160 return std::make_pair(arow, acol);
161 }

◆ isDummyPad()

bool NSWL1::PAD::isDummyPad ( const uint32_t padchan)
inline

Definition at line 255 of file TrigT1NSWSimExtras.h.

255 {
256 return std::count(DUMMYPADS.begin(), DUMMYPADS.end(), padchan);
257 }
constexpr std::array< uint32_t, 8 > DUMMYPADS
Dummy pads.

◆ parseLineForBandid()

uint32_t NSWL1::PAD::parseLineForBandid ( const std::string & line)
inline

Definition at line 291 of file TrigT1NSWSimExtras.h.

291 {
292 const auto split = CxxUtils::tokenize(line, SPACE);
293 const auto word = split.at(1);
294 const auto word_split = CxxUtils::tokenize(line, UNDERSCORE);
295 return static_cast<uint32_t>(std::stoul(word_split.at(1)));
296 }
std::vector< std::string > split(const std::string &s, const std::string &t=":")
Definition hcg.cxx:177
std::vector< std::string > tokenize(const std::string &the_str, std::string_view delimiters)
Splits the string into smaller substrings.
const std::string UNDERSCORE
const std::string SPACE

◆ priorityEncoderL()

uint32_t NSWL1::PAD::priorityEncoderL ( uint32_t bandid)
inline

Definition at line 222 of file TrigT1NSWSimExtras.h.

222 {
223 static const std::unordered_map<uint32_t,uint32_t> bandids = {
224 {94,84}, {93,84}, {92,84}, {91,84}, {90,82},
225 {89,80}, {88,80}, {87,77}, {86,76}, {85,76}, {84,74}, {83,74}, {82,72}, {81,72}, {80,70},
226 {79,70}, {78,70}, {77,67}, {76,66}, {75,66}, {74,66}, {73,62}, {72,62}, {71,62}, {70,62},
227 {69,62}, {68,62}, {67,62}, {66,62}, {65,54}, {64,54}, {63,54}, {62,54}, {61,51}, {60,51},
228 {59,51}, {58,51}, {57,51}, {56,46}, {55,45}, {54,44}, {53,44}, {52,43}, {51,41}, {50,41},
229 {49,41}, {48,41}, {47,41}, {46,36}, {45,35}, {44,35}, {43,33}, {42,32}, {41,32}, {40,32},
230 {39,32}, {38,32}, {37,32}, {36,32}, {35,24}, {34,24}, {33,24}, {32,22}, {31,22}, {30,22},
231 {29,22}, {28,22}, {27,22}, {26,22}, {25,22}, {24,14}, {23,14}, {22,12}, {21,12}, {20,12},
232 {19,12}, {18,12}, {17,12}, {16,12}, {15,12}, {14, 6}, {13, 6}, {12, 6}, {11, 6}, {10, 6},
233 { 9, 6}, { 8, 6}, { 7, 6}, { 6, 6}};
234 auto it = bandids.find(bandid);
235 if(it == bandids.end()) return bandid;
236 else return it->second;
237 }

◆ priorityEncoderS()

uint32_t NSWL1::PAD::priorityEncoderS ( uint32_t bandid)
inline

Definition at line 238 of file TrigT1NSWSimExtras.h.

238 {
239 static const std::unordered_map<uint32_t,uint32_t> bandids = {
240 {94,85}, {93,85}, {92,85}, {91,80}, {90,80},
241 {89,80}, {88,80}, {87,80}, {86,76}, {85,74}, {84,74}, {83,74}, {82,74}, {81,69}, {80,69},
242 {79,69}, {78,69}, {77,69}, {76,64}, {75,64}, {74,64}, {73,64}, {72,64}, {71,64}, {70,64},
243 {69,64}, {68,57}, {67,57}, {66,57}, {65,57}, {64,53}, {63,53}, {62,53}, {61,53}, {60,53},
244 {59,53}, {58,47}, {57,46}, {56,46}, {55,44}, {54,44}, {53,43}, {52,43}, {51,43}, {50,43},
245 {49,43}, {48,37}, {47,37}, {46,37}, {45,37}, {44,33}, {43,33}, {42,33}, {41,33}, {40,33},
246 {39,33}, {38,33}, {37,33}, {36,25}, {35,25}, {34,25}, {33,22}, {32,22}, {31,22}, {30,22},
247 {29,22}, {28,22}, {27,22}, {26,22}, {25,14}, {24,14}, {23,12}, {22,12}, {21,12}, {20,12},
248 {19,12}, {18,12}, {17,12}, {16,12}, {15,12}, {14, 6}, {13, 6}, {12, 5}, {11, 5}, {10, 5},
249 { 9, 5}, { 8, 5}, { 7, 5}, { 6, 2}, { 5, 2}, { 4, 2}, { 3, 2}, { 2, 2}};
250 auto it = bandids.find(bandid);
251 if(it == bandids.end()) return bandid;
252 else return it->second;
253 }

◆ replace()

std::string NSWL1::PAD::replace ( std::string subject,
const std::string & search,
const std::string & replace )
inline

Definition at line 274 of file TrigT1NSWSimExtras.h.

274 {
275 if (subject.empty() or search.empty()) return subject;
276
277 size_t pos = 0;
278 while((pos = subject.find(search, pos)) != std::string::npos) {
279 subject.replace(pos, search.length(), replace);
280 pos += replace.length();
281 }
282 return subject;
283 }
void search(TDirectory *td, const std::string &s, std::string cwd, node *n)
recursive directory search for TH1 and TH2 and TProfiles
Definition hcg.cxx:739
std::string replace(std::string subject, const std::string &search, const std::string &replace)

◆ wheelSectorToSourceID()

uint32_t NSWL1::PAD::wheelSectorToSourceID ( const char wheel,
const uint32_t sector )
inline

Definition at line 88 of file TrigT1NSWSimExtras.h.

88 {
89 uint32_t prefix = 0x6d0020;
90 if(wheel == 'C') prefix += (1<<16);
91 return prefix+sector;
92 }

Variable Documentation

◆ DUMMY_BANDID

uint32_t NSWL1::PAD::DUMMY_BANDID {0xff}
constexpr

Definition at line 174 of file TrigT1NSWSimExtras.h.

174{0xff};

◆ DUMMYPADS

std::array<uint32_t,8> NSWL1::PAD::DUMMYPADS {104,105,110,111,112,113,114,115}
constexpr

Dummy pads.

Definition at line 177 of file TrigT1NSWSimExtras.h.

177{104,105,110,111,112,113,114,115};

◆ I_PADCHAN0

size_t NSWL1::PAD::I_PADCHAN0 = 1
constexpr

Definition at line 194 of file TrigT1NSWSimExtras.h.

◆ I_PADCHAN1

size_t NSWL1::PAD::I_PADCHAN1 = 3
constexpr

Definition at line 196 of file TrigT1NSWSimExtras.h.

◆ I_PADCHAN2

size_t NSWL1::PAD::I_PADCHAN2 = 5
constexpr

Definition at line 198 of file TrigT1NSWSimExtras.h.

◆ I_PADCHAN3

size_t NSWL1::PAD::I_PADCHAN3 = 7
constexpr

Definition at line 200 of file TrigT1NSWSimExtras.h.

◆ I_PADCHAN4

size_t NSWL1::PAD::I_PADCHAN4 = 9
constexpr

Definition at line 202 of file TrigT1NSWSimExtras.h.

◆ I_PADCHAN5

size_t NSWL1::PAD::I_PADCHAN5 = 11
constexpr

Definition at line 204 of file TrigT1NSWSimExtras.h.

◆ I_PADCHAN6

size_t NSWL1::PAD::I_PADCHAN6 = 13
constexpr

Definition at line 206 of file TrigT1NSWSimExtras.h.

◆ I_PADCHAN7

size_t NSWL1::PAD::I_PADCHAN7 = 15
constexpr

Definition at line 208 of file TrigT1NSWSimExtras.h.

◆ I_PFEB0

size_t NSWL1::PAD::I_PFEB0 = 0
constexpr

Definition at line 193 of file TrigT1NSWSimExtras.h.

◆ I_PFEB1

size_t NSWL1::PAD::I_PFEB1 = 2
constexpr

Definition at line 195 of file TrigT1NSWSimExtras.h.

◆ I_PFEB2

size_t NSWL1::PAD::I_PFEB2 = 4
constexpr

Definition at line 197 of file TrigT1NSWSimExtras.h.

◆ I_PFEB3

size_t NSWL1::PAD::I_PFEB3 = 6
constexpr

Definition at line 199 of file TrigT1NSWSimExtras.h.

◆ I_PFEB4

size_t NSWL1::PAD::I_PFEB4 = 8
constexpr

Definition at line 201 of file TrigT1NSWSimExtras.h.

◆ I_PFEB5

size_t NSWL1::PAD::I_PFEB5 = 10
constexpr

Definition at line 203 of file TrigT1NSWSimExtras.h.

◆ I_PFEB6

size_t NSWL1::PAD::I_PFEB6 = 12
constexpr

Definition at line 205 of file TrigT1NSWSimExtras.h.

◆ I_PFEB7

size_t NSWL1::PAD::I_PFEB7 = 14
constexpr

Definition at line 207 of file TrigT1NSWSimExtras.h.

◆ I_PHIID

size_t NSWL1::PAD::I_PHIID = 16
constexpr

Definition at line 209 of file TrigT1NSWSimExtras.h.

◆ LARGE

const std::string NSWL1::PAD::LARGE {"large"}

Definition at line 69 of file TrigT1NSWSimExtras.h.

69{"large"};

◆ LAYERS

std::array<uint32_t, NLAYERS> NSWL1::PAD::LAYERS {0, 1, 2, 3, 4, 5, 6, 7}
constexpr

Definition at line 73 of file TrigT1NSWSimExtras.h.

73{0, 1, 2, 3, 4, 5, 6, 7};

◆ MUON_STGC_ENDCAP_A_SIDE

uint32_t NSWL1::PAD::MUON_STGC_ENDCAP_A_SIDE {0x6D}
constexpr

Definition at line 186 of file TrigT1NSWSimExtras.h.

186{0x6D};

◆ MUON_STGC_ENDCAP_C_SIDE

uint32_t NSWL1::PAD::MUON_STGC_ENDCAP_C_SIDE {0x6E}
constexpr

Definition at line 187 of file TrigT1NSWSimExtras.h.

187{0x6E};

◆ NPFEB_PER_RADIUS

uint32_t NSWL1::PAD::NPFEB_PER_RADIUS {NLAYERS}
constexpr

Definition at line 190 of file TrigT1NSWSimExtras.h.

190{NLAYERS};
constexpr uint32_t NLAYERS

◆ PAD_TRIGGER_READOUT_NBC

uint32_t NSWL1::PAD::PAD_TRIGGER_READOUT_NBC {7}
constexpr

Definition at line 183 of file TrigT1NSWSimExtras.h.

183{7};

◆ PAD_TRIGGER_ROB

uint32_t NSWL1::PAD::PAD_TRIGGER_ROB {0x20}
constexpr

Definition at line 180 of file TrigT1NSWSimExtras.h.

180{0x20};

◆ PATTERN_END

const std::string NSWL1::PAD::PATTERN_END {"bandid_tds_numbers"}

Definition at line 82 of file TrigT1NSWSimExtras.h.

82{"bandid_tds_numbers"};

◆ PATTERN_TAG

const std::string NSWL1::PAD::PATTERN_TAG {"pad_trigger_pattern_array :="}

Definition at line 79 of file TrigT1NSWSimExtras.h.

79{"pad_trigger_pattern_array :="};

◆ PATTERNLEN

size_t NSWL1::PAD::PATTERNLEN {17}
constexpr

Definition at line 85 of file TrigT1NSWSimExtras.h.

85{17};

◆ SECTORS

std::array<uint32_t, NSECTORS> NSWL1::PAD::SECTORS {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}
constexpr

Definition at line 76 of file TrigT1NSWSimExtras.h.

76{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15};

◆ SMALL

const std::string NSWL1::PAD::SMALL {"small"}

Definition at line 70 of file TrigT1NSWSimExtras.h.

70{"small"};