ATLAS Offline Software
sTgcIdHelper.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
7 #include "IdDict/IdDictField.h"
8 #include "IdDict/IdDictGroup.h"
9 #include "IdDict/IdDictMgr.h"
10 #include "IdDict/IdDictRegion.h"
12 
13 /*******************************************************************************/
14 // Constructor/Destructor
15 sTgcIdHelper::sTgcIdHelper() : MuonIdHelper("sTgcIdHelper", "stgc") {
16  m_module_hashes.fill(-1);
17  m_detectorElement_hashes.fill(-1);
18 }
19 /*******************************************************************************/
20 // Initialize dictionary
22  int status = 0;
23 
24  // Check whether this helper should be reinitialized
25  if (!reinitialize(dict_mgr)) {
26  ATH_MSG_INFO("Request to reinitialize not satisfied - tags have not changed");
27  return (0);
28  } else {
29  ATH_MSG_DEBUG("(Re)initialize ");
30  }
31 
32  // init base object
33  if (AtlasDetectorID::initialize_from_dictionary(dict_mgr)) return 1;
34 
35  // Register version of the MuonSpectrometer dictionary
36  if (register_dict_tag(dict_mgr, "MuonSpectrometer")) return 1;
37 
38  m_dict = dict_mgr.find_dictionary("MuonSpectrometer");
39  if (!m_dict) {
40  ATH_MSG_ERROR(" initialize_from_dict - cannot access MuonSpectrometer dictionary ");
41  return 1;
42  }
43 
44  // Initialize some of the field indices
45  if (initLevelsFromDict()) return 1;
46 
47  int index = technologyIndex("STGC");
48  if (index == -1) {
49  ATH_MSG_DEBUG("initLevelsFromDict - there are no sTGC entries in the dictionary! ");
50  return 0;
51  }
52 
53  IdDictField* field = m_dict->find_field("stgcMultilayer");
54  if (field) {
55  m_DETECTORELEMENT_INDEX = field->index();
56  } else {
57  ATH_MSG_ERROR("initLevelsFromDict - unable to find 'stgcMultilayer' field ");
58  status = 1;
59  }
60 
61  field = m_dict->find_field("stgcGasGap");
62  if (field) {
63  m_GASGAP_INDEX = field->index();
64  } else {
65  ATH_MSG_ERROR("initLevelsFromDict - unable to find 'stgcGasGap' field ");
66  status = 1;
67  }
68 
69  field = m_dict->find_field("stgcChannelType");
70  if (field) {
71  m_CHANNELTYPE_INDEX = field->index();
72  } else {
73  ATH_MSG_ERROR("initLevelsFromDict - unable to find 'channelType' field ");
74  status = 1;
75  }
76 
77  field = m_dict->find_field("stgcChannel");
78  if (field) {
79  m_CHANNEL_INDEX = field->index();
80  } else {
81  ATH_MSG_ERROR("initLevelsFromDict - unable to find 'channel' field ");
82  status = 1;
83  }
84 
85  // reinitialize the module ndex
86  // m_DETECTORELEMENT_INDEX = m_MODULE_INDEX;
87 
88  // save an index to the first region of tgc
89  IdDictGroup* stgcGroup = m_dict->find_group("stgc");
90  if (!stgcGroup) {
91  ATH_MSG_ERROR("Cannot find stgc group");
92  } else {
93  m_GROUP_INDEX = stgcGroup->regions()[0]->index();
94  }
95 
96  const IdDictRegion& region = m_dict->region(m_GROUP_INDEX);
104 
105  ATH_MSG_DEBUG(" sTGC decode index and bit fields for each level: " << std::endl
106  << " muon " << m_muon_impl.show_to_string() << std::endl
107  << " station " << m_sta_impl.show_to_string() << std::endl
108  << " eta " << m_eta_impl.show_to_string() << std::endl
109  << " phi " << m_phi_impl.show_to_string() << std::endl
110  << " technology " << m_tec_impl.show_to_string() << std::endl
111  << " multilayer " << m_mplet_impl.show_to_string() << std::endl
112  << " gasgap " << m_gap_impl.show_to_string() << std::endl
113  << " channelType " << m_typ_impl.show_to_string() << std::endl
114  << " channel " << m_cha_impl.show_to_string());
115 
116  //
117  // Build multirange for the valid set of identifiers
118  //
119 
120  // Find value for the field MuonSpectrometer
121  int muonField = -1;
122  const IdDictDictionary* atlasDict = dict_mgr.find_dictionary("ATLAS");
123  if (atlasDict->get_label_value("subdet", "MuonSpectrometer", muonField)) {
124  ATH_MSG_ERROR("Could not get value for label 'MuonSpectrometer' of field 'subdet' in dictionary " << atlasDict->name());
125  return 1;
126  }
127 
128  // Build MultiRange down to "technology" for all (muon) regions
130  region_id.add(muonField);
131  Range prefix;
132  MultiRange muon_range = m_dict->build_multirange(region_id, prefix, "technology");
133  if (muon_range.size() > 0) {
134  ATH_MSG_INFO("MultiRange built successfully to Technology: "
135  << "MultiRange size is " << muon_range.size());
136  } else {
137  ATH_MSG_ERROR("Muon sTGC detector element MultiRange is empty");
138  }
139 
140  // Build MultiRange down to "detector element" for all sTGC regions
141  ExpandedIdentifier detectorElement_region;
142  detectorElement_region.add(muonField);
143  Range detectorElement_prefix;
144  MultiRange muon_detectorElement_range = m_dict->build_multirange(detectorElement_region, detectorElement_prefix, "stgcMultilayer");
145  if (muon_detectorElement_range.size() > 0) {
146  ATH_MSG_INFO("MultiRange built successfully to detector element: "
147  << "Multilayer MultiRange size is " << muon_detectorElement_range.size());
148  } else {
149  ATH_MSG_ERROR("Muon sTGC detector element MultiRange is empty");
150  }
151 
152  // Build MultiRange down to "channel" for all sTGC regions
153  ExpandedIdentifier stgc_region;
154  stgc_region.add(muonField);
155  Range stgc_prefix;
156  MultiRange muon_channel_range = m_dict->build_multirange(stgc_region, stgc_prefix, "stgcChannel");
157  if (muon_channel_range.size() > 0) {
158  ATH_MSG_INFO("MultiRange built successfully to channel: "
159  << "MultiRange size is " << muon_channel_range.size());
160  } else {
161  ATH_MSG_ERROR("Muon sTGC detector MultiRange is empty for channels");
162  }
163 
164  // build sTGC module ranges
165  // Find the regions that have a "technology field" that matches the sTGC and save them
166  int stgcField = -1;
167  status = m_dict->get_label_value("technology", "STGC", stgcField);
168 
169  for (int i = 0; i < (int)muon_range.size(); ++i) {
170  const Range& range = muon_range[i];
171  if (range.fields() > m_TECHNOLOGY_INDEX) {
173  if (field.match((ExpandedIdentifier::element_type)stgcField)) {
175  ATH_MSG_DEBUG("field size is " << (int)range.cardinality() << " field index = " << i);
176  }
177  }
178  }
179 
180  for (int j = 0; j < (int)muon_detectorElement_range.size(); ++j) {
181  const Range& range = muon_detectorElement_range[j];
182  if (range.fields() > m_TECHNOLOGY_INDEX) {
184  if (field.match((ExpandedIdentifier::element_type)stgcField)) {
186  ATH_MSG_DEBUG("detector element field size is " << (int)range.cardinality() << " field index = " << j);
187  }
188  }
189  }
190 
191  for (int j = 0; j < (int)muon_channel_range.size(); ++j) {
192  const Range& range = muon_channel_range[j];
193  if (range.fields() > m_TECHNOLOGY_INDEX) {
195  if (field.match((ExpandedIdentifier::element_type)stgcField)) {
197  ATH_MSG_DEBUG("channel field size is " << (int)range.cardinality() << " field index = " << j);
198  }
199  }
200  }
201 
202  // test to see that the multi range is not empty
203  if (m_full_module_range.size() == 0) {
204  ATH_MSG_ERROR("sTGC MultiRange ID is empty for modules");
205  status = 1;
206  }
207 
208  // test to see that the detector element multi range is not empty
209  if (m_full_detectorElement_range.size() == 0) {
210  ATH_MSG_ERROR("sTGC MultiRange ID is empty for detector elements");
211  status = 1;
212  }
213 
214  // test to see that the multi range is not empty
215  if (m_full_channel_range.size() == 0) {
216  ATH_MSG_ERROR("sTGC MultiRange ID is empty for channels");
217  status = 1;
218  }
219 
220  // Setup the hash tables for sTGC
221  ATH_MSG_INFO("Initializing sTGC hash indices ... ");
222  status = init_hashes();
223  status = init_detectorElement_hashes(); // same as module hash
225 
226  /*
227  //comment out this bit to test the identifiers
228 
229  status = init_channel_hashes();
230  std::cout << " looping over identifiers " << std::endl;
231  const_id_iterator it = channel_begin();
232  const_id_iterator it_end = channel_end();
233  for( ;it!=it_end;++it ){
234  if( !is_stgc(*it) ) (*m_Log) << MSG::DEBUG << "BadStgc: not sTGC " << print_to_string(*it) << endmsg;
235  if( !valid(*it) ) (*m_Log) << MSG::DEBUG << "BadStgc: not valid " << print_to_string(*it) << endmsg;
236  }
237 
238  */
239 
240  // Setup hash tables for finding neighbors
241  ATH_MSG_INFO("Initializing sTGC hash indices for finding neighbors ... ");
243 
244  m_init = true;
245  return (status);
246 } // end sTgcIdHelper::initialize_from_dictionary
247 /*******************************************************************************/
248 inline unsigned int sTgcIdHelper::moduleHashIdx(const Identifier& id) const{
251  constexpr unsigned int C = s_phiDim;
252  constexpr unsigned int BxC = C*s_etaDim;
253  const int stEta = stationEta(id);
254  return (stationName(id) - m_stationShift)*BxC + (stEta + s_etaDim/2 - (stEta>0))*C + (stationPhi(id) -1);
255 }
256 inline unsigned int sTgcIdHelper::detEleHashIdx(const Identifier& id) const{
257  return moduleHashIdx(id) *s_mlDim + (multilayer(id) -1);
258 }
259 
262  unsigned int hash_max = module_hash_max();
263  for (unsigned int i = 0; i < hash_max; ++i) {
264  const Identifier& id = m_module_vec[i];
265  const unsigned idx = moduleHashIdx(id);
266  if (idx >= m_module_hashes.size() || m_module_hashes[idx] < hash_max){
267  ATH_MSG_FATAL("Failed to assign module hash to "<<show_to_string(id));
268  return 1;
269  }
270  m_module_hashes[idx] = i;
271  }
272 
273  hash_max = detectorElement_hash_max();
274  for (unsigned int i = 0; i < hash_max; ++i) {
275  const Identifier& id = m_detectorElement_vec[i];
276  const unsigned idx = detEleHashIdx(id);
277  if (idx >= m_detectorElement_hashes.size() || m_detectorElement_hashes[idx] < hash_max){
278  ATH_MSG_FATAL("Failed to assign detector hash to "<<show_to_string(id));
279  return 1;
280  }
282  }
283  return 0;
284 } // end sTgcIdHelper::init_id_to_hashes()
285 /*******************************************************************************/
287  const unsigned int idx = moduleHashIdx(id);
288  if (idx >= m_module_hashes.size()) return 1;
289  hash_id = m_module_hashes[idx];
290  return 0;
291 } // end sTgcIdHelper::get_module_hash
292 /*******************************************************************************/
294  const unsigned int idx = detEleHashIdx(id);
295  if (idx >= m_detectorElement_hashes.size()) return 1;
296  hash_id = m_detectorElement_hashes[idx];
297  return 0;
298  // return get_module_hash(id, hash_id);
299 }
300 
301 /*******************************************************************************/
303  assert(is_stgc(channelID));
308  return result;
309 }
310 /*******************************************************************************/
311 Identifier sTgcIdHelper::multilayerID(const Identifier& moduleID, int multilayer) const {
312  Identifier result(moduleID);
314  return result;
315 }
316 Identifier sTgcIdHelper::multilayerID(const Identifier& moduleID, int multilayer, bool& isValid) const {
317  try {
318  const Identifier result = multilayerID(moduleID, multilayer);
320  return result;
321  } catch (const std::out_of_range&) { isValid = false; }
322  return Identifier{0};
323 }
324 /*******************************************************************************/
325 
326 // febID constructs an identifier that can be associcate with a region of the detector that is read out by the same front end board
327 Identifier sTgcIdHelper::febID(int stationName, int stationEta, int stationPhi, int multilayer, int gasGap, int channelType) const{
328  return channelID(stationName,stationEta,stationPhi,multilayer,gasGap,(channelType==sTgcChannelTypes::Strip ? sTgcChannelTypes::Strip : sTgcChannelTypes::Pad), 1);
329 }
330 Identifier sTgcIdHelper::febID(int stationName, int stationEta, int stationPhi, int multilayer, int gasGap, int channelType, bool& isValid) const{
331  return channelID(stationName,stationEta,stationPhi,multilayer,gasGap, (channelType==sTgcChannelTypes::Strip ? sTgcChannelTypes::Strip : sTgcChannelTypes::Pad), 1, isValid);
332 }
333 Identifier sTgcIdHelper::febID(const std::string& stationName, int stationEta, int stationPhi, int multilayer, int gasGap, int channelType) const{
334  return channelID(stationName,stationEta,stationPhi,multilayer,gasGap,(channelType==sTgcChannelTypes::Strip ? sTgcChannelTypes::Strip : sTgcChannelTypes::Pad), 1);
335 }
336 Identifier sTgcIdHelper::febID(const std::string& stationName, int stationEta, int stationPhi, int multilayer, int gasGap, int channelType, bool& isValid) const{
337  return channelID(stationName,stationEta,stationPhi,multilayer,gasGap,(channelType==sTgcChannelTypes::Strip ? sTgcChannelTypes::Strip : sTgcChannelTypes::Pad), 1, isValid);
338 }
340  return channelID(channelId, multilayer(channelId), gasGap(channelId),(int)(channelType(channelId) ==sTgcChannelTypes::Strip ? sTgcChannelTypes::Strip : sTgcChannelTypes::Pad), 1);
341 }
342 
343 
344 Identifier sTgcIdHelper::hvID(int stationName, int stationEta, int stationPhi, int multilayer, int gasGap, bool isInnerQ1)const{
345  int channel = 1;
346  if(!isInnerQ1 && std::abs(stationEta)==1) channel = 100;
347  return channelID(stationName, stationEta, stationPhi, multilayer, gasGap, sTgcChannelTypes::Strip, channel);
348 }
349 
350 Identifier sTgcIdHelper::hvID(int stationName, int stationEta, int stationPhi, int multilayer, int gasGap, bool isInnerQ1, bool& isValid)const{
351  int channel = 1;
352  if(!isInnerQ1 && std::abs(stationEta)==1) channel = 100;
353  return channelID(stationName, stationEta, stationPhi, multilayer, gasGap, sTgcChannelTypes::Strip, channel, isValid);
354 }
355 
356 Identifier sTgcIdHelper::hvID(const std::string& stationName, int stationEta, int stationPhi, int multilayer, int gasGap, bool isInnerQ1)const{
357  int channel = 1;
358  if(!isInnerQ1 && std::abs(stationEta)==1) channel = 100;
359  return channelID(stationName, stationEta, stationPhi, multilayer, gasGap, sTgcChannelTypes::Strip, channel);
360 }
361 
362 Identifier sTgcIdHelper::hvID(const std::string& stationName, int stationEta, int stationPhi, int multilayer, int gasGap, bool isInnerQ1, bool& isValid)const{
363  int channel = 1;
364  if(!isInnerQ1 && std::abs(stationEta)==1) channel = 100;
365  return channelID(stationName, stationEta, stationPhi, multilayer, gasGap, sTgcChannelTypes::Strip, channel, isValid);
366 }
367 
368 Identifier sTgcIdHelper::hvID(const Identifier& channelId, bool isInnerQ1)const{
369  int channel = 1;
370  if(std::abs(stationEta(channelId))==1 && !isInnerQ1) channel = 100;
371  return channelID(channelId, multilayer(channelId), gasGap(channelId), sTgcChannelTypes::Strip, channel);
372 }
373 
374 
375 Identifier sTgcIdHelper::hvID(const Identifier& channelId, bool isInnerQ1, bool& isValid)const{
376  int channel = 1;
377  if(std::abs(stationEta(channelId))==1 && !isInnerQ1) channel = 100;
378  return channelID(channelId, multilayer(channelId), gasGap(channelId), sTgcChannelTypes::Strip, channel, isValid);
379 }
380 
381 
382 
383 
384 
385 
386 
387 
388 
389 /*******************************************************************************/
390 void sTgcIdHelper::idChannels(const Identifier& id, std::vector<Identifier>& vect) const {
391  vect.clear();
392  Identifier parent = parentID(id);
393  for (unsigned int i = 0; i < m_full_channel_range.size(); ++i) {
394  const Range& range = m_full_channel_range[i];
396  for (const auto & expId:rit) {
397  Identifier child;
398  get_id(expId, child);
399  if (parentID(child) == parent) vect.push_back(child);
400  }
401  }
402 }
403 /*******************************************************************************/
405  ExpandedIdentifier expId;
406  IdContext eta_context(expId, 0, m_ETA_INDEX);
407  if (!get_expanded_id(id, expId, &eta_context)) {
408  int result = -999;
409  for (unsigned int i = 0; i < m_full_module_range.size(); ++i) {
410  const Range& range = m_full_module_range[i];
411  if (range.match(expId)) {
412  const Range::field& eta_field = range[m_ETA_INDEX];
413  if (not eta_field.empty()) {
414  int etamin = eta_field.get_minimum();
415  if (-999 == result) {
416  result = etamin;
417  } else {
418  if (etamin < result) result = etamin;
419  }
420  }
421  }
422  }
423  return result;
424  }
425  return 999; // default
426 } // end TgcIdHelper::stationEtaMin
427 /*******************************************************************************/
429  ExpandedIdentifier expId;
430  IdContext eta_context(expId, 0, m_ETA_INDEX);
431  if (!get_expanded_id(id, expId, &eta_context)) {
432  int result = -999;
433  for (unsigned int i = 0; i < m_full_module_range.size(); ++i) {
434  const Range& range = m_full_module_range[i];
435  if (range.match(expId)) {
436  const Range::field& eta_field = range[m_ETA_INDEX];
437  if (not eta_field.empty()) {
438  int etamax = eta_field.get_maximum();
439  if (result < etamax) result = etamax;
440  }
441  }
442  }
443  return result;
444  }
445  return -999;
446 } // end TgcIdHelper::stationEtaMax
447 /*******************************************************************************/
449  ExpandedIdentifier expId;
450  IdContext phi_context(expId, 0, m_PHI_INDEX);
451 
452  if (!get_expanded_id(id, expId, &phi_context)) {
453  for (unsigned int i = 0; i < m_full_module_range.size(); ++i) {
454  const Range& range = m_full_module_range[i];
455  if (range.match(expId)) {
456  const Range::field& phi_field = range[m_PHI_INDEX];
457  if (not phi_field.empty()) { return (phi_field.get_minimum()); }
458  }
459  }
460  }
461  // Failed to find the min
462  return 999;
463 }
464 /*******************************************************************************/
466  ExpandedIdentifier expId;
467  IdContext phi_context(expId, 0, m_PHI_INDEX);
468 
469  if (!get_expanded_id(id, expId, &phi_context)) {
470  for (unsigned int i = 0; i < m_full_module_range.size(); ++i) {
471  const Range& range = m_full_module_range[i];
472  if (range.match(expId)) {
473  const Range::field& phi_field = range[m_PHI_INDEX];
474  if (not phi_field.empty()) { return (phi_field.get_maximum()); }
475  }
476  }
477  }
478  // Failed to find the max
479  return -999;
480 }
481 /*******************************************************************************/
483  ExpandedIdentifier expId;
484  IdContext context = technology_context();
485  if (!get_expanded_id(id, expId, &context)) {
486  int result = -999;
487  for (unsigned int i = 0; i < m_full_channel_range.size(); ++i) {
488  const Range& range = m_full_channel_range[i];
489  if (range.match(expId)) {
490  const Range::field& multilayer_field = range[m_DETECTORELEMENT_INDEX];
491  if (not multilayer_field.empty()) {
492  int multilayermax = multilayer_field.get_maximum();
493  if (result < multilayermax) result = multilayermax;
494  }
495  }
496  }
497  return result;
498  }
499  return -999;
500 }
501 /*******************************************************************************/
503  ExpandedIdentifier expId;
504  IdContext multilayer_context(expId, 0, m_DETECTORELEMENT_INDEX);
505  if (!get_expanded_id(id, expId, &multilayer_context)) {
506  int result = -999;
507  for (unsigned int i = 0; i < m_full_channel_range.size(); ++i) {
508  const Range& range = m_full_channel_range[i];
509  if (range.match(expId)) {
510  const Range::field& multilayer_field = range[m_DETECTORELEMENT_INDEX];
511  if (not multilayer_field.empty()) {
512  int multilayermin = multilayer_field.get_minimum();
513  if (-999 == result) {
514  result = multilayermin;
515  } else {
516  if (multilayermin < result) result = multilayermin;
517  }
518  }
519  }
520  }
521  return result;
522  }
523  return 999;
524 }
525 /*******************************************************************************/
527  ExpandedIdentifier expId;
528  IdContext multilayer_context(expId, 0, m_DETECTORELEMENT_INDEX);
529  if (!get_expanded_id(id, expId, &multilayer_context)) {
530  int result = -999;
531  for (unsigned int i = 0; i < m_full_channel_range.size(); ++i) {
532  const Range& range = m_full_channel_range[i];
533  if (range.match(expId)) {
534  const Range::field& multilayer_field = range[m_DETECTORELEMENT_INDEX];
535  if (not multilayer_field.empty()) {
536  int multilayermax = multilayer_field.get_maximum();
537  if (result < multilayermax) result = multilayermax;
538  }
539  }
540  }
541  return result;
542  }
543  return -999;
544 }
545 /*******************************************************************************/
546 int sTgcIdHelper::gasGapMin(const Identifier& id) const {
547  ExpandedIdentifier expId;
548  IdContext gasgap_context(expId, 0, m_GASGAP_INDEX);
549  if (!get_expanded_id(id, expId, &gasgap_context)) {
550  int result = -999;
551  for (unsigned int i = 0; i < m_full_channel_range.size(); ++i) {
552  const Range& range = m_full_channel_range[i];
553  if (range.match(expId)) {
554  const Range::field& gasgap_field = range[m_GASGAP_INDEX];
555  if (not gasgap_field.empty()) {
556  int gasgapmin = gasgap_field.get_minimum();
557  if (-999 == result) {
558  result = gasgapmin;
559  } else {
560  if (gasgapmin < result) result = gasgapmin;
561  }
562  }
563  }
564  }
565  return result;
566  }
567  return 999;
568 }
569 /*******************************************************************************/
570 int sTgcIdHelper::gasGapMax(const Identifier& id) const {
571  ExpandedIdentifier expId;
572  IdContext gasgap_context(expId, 0, m_GASGAP_INDEX);
573  if (!get_expanded_id(id, expId, &gasgap_context)) {
574  for (unsigned int i = 0; i < m_full_channel_range.size(); ++i) {
575  const Range& range = m_full_channel_range[i];
576  if (range.match(expId)) {
577  const Range::field& gasgap_field = range[m_GASGAP_INDEX];
578  if (not gasgap_field.empty()) { return (gasgap_field.get_maximum()); }
579  }
580  }
581  }
582  // Failed to find the max
583  return -999;
584 }
585 /*******************************************************************************/
587  ExpandedIdentifier expId;
588  IdContext channeltype_context(expId, 0, m_CHANNELTYPE_INDEX);
589  if (!get_expanded_id(id, expId, &channeltype_context)) {
590  int result = -999;
591  for (unsigned int i = 0; i < m_full_channel_range.size(); ++i) {
592  const Range& range = m_full_channel_range[i];
593  if (range.match(expId)) {
594  const Range::field& channeltype_field = range[m_CHANNELTYPE_INDEX];
595  if (not channeltype_field.empty()) {
596  int channeltypemin = channeltype_field.get_minimum();
597  if (-999 == result) {
598  result = channeltypemin;
599  } else {
600  if (channeltypemin < result) result = channeltypemin;
601  }
602  }
603  }
604  }
605  return result;
606  }
607  return 999;
608 }
609 /*******************************************************************************/
611  ExpandedIdentifier expId;
612  IdContext channeltype_context(expId, 0, m_CHANNELTYPE_INDEX);
613  if (!get_expanded_id(id, expId, &channeltype_context)) {
614  int result = -999;
615  for (unsigned int i = 0; i < m_full_channel_range.size(); ++i) {
616  const Range& range = m_full_channel_range[i];
617  if (range.match(expId)) {
618  const Range::field& channeltype_field = range[m_CHANNELTYPE_INDEX];
619  if (not channeltype_field.empty()) {
620  int channeltypemax = channeltype_field.get_maximum();
621  if (result < channeltypemax) result = channeltypemax;
622  }
623  }
624  }
625  return result;
626  }
627  return -999;
628 }
629 /*******************************************************************************/
630 int sTgcIdHelper::channelMin(const Identifier& id) const {
631  ExpandedIdentifier expId;
633  if (!get_expanded_id(id, expId, &channel_context)) {
634  int result = -999;
635  for (unsigned int i = 0; i < m_full_channel_range.size(); ++i) {
636  const Range& range = m_full_channel_range[i];
637  if (range.match(expId)) {
638  const Range::field& channel_field = range[m_CHANNEL_INDEX];
639  if (not channel_field.empty()) {
640  int channelmin = channel_field.get_minimum();
641  if (-999 == result) {
642  result = channelmin;
643  } else {
644  if (channelmin < result) result = channelmin;
645  }
646  }
647  }
648  }
649  return result;
650  }
651  return 999;
652 }
653 /*******************************************************************************/
654 int sTgcIdHelper::channelMax(const Identifier& id) const {
655  ExpandedIdentifier expId;
657  if (!get_expanded_id(id, expId, &channel_context)) {
658  int result = -999;
659  for (unsigned int i = 0; i < m_full_channel_range.size(); ++i) {
660  const Range& range = m_full_channel_range[i];
661  if (range.match(expId)) {
662  const Range::field& channel_field = range[m_CHANNEL_INDEX];
663  if (not channel_field.empty()) {
664  int channelmax = channel_field.get_maximum();
665  if (result < channelmax) result = channelmax;
666  }
667  }
668  }
669  return result;
670  }
671  return -999;
672 }
673 /*******************************************************************************/
674 int sTgcIdHelper::padEta(const Identifier& id) const {
675  int ChannelType = channelType(id);
676  int PadEta = 0;
677  if (ChannelType == Pad) {
678  int Channel = channel(id);
679  PadEta = ((Channel - 1) % PadEtaMax) + 1;
680  }
681  return PadEta;
682 }
683 /*******************************************************************************/
684 int sTgcIdHelper::padPhi(const Identifier& id) const {
685  int ChannelType = channelType(id);
686  int PadPhi = 0;
687  if (ChannelType == Pad) {
688  int Channel = channel(id);
689  PadPhi = ((Channel - 1) / PadEtaMax) + 1;
690  }
691  return PadPhi;
692 }
693 /*******************************************************************************/
694 // validation of levels
695 bool sTgcIdHelper::valid(const Identifier& id) const {
696  if (!validElement(id)) return false;
697 
698  int mplet = multilayer(id);
699  if ((mplet < multilayerMin(id)) || (mplet > multilayerMax(id))) {
700  ATH_MSG_DEBUG("Invalid multilayer=" << mplet << " multilayerMin=" << multilayerMin(id) << " multilayerMax=" << multilayerMax(id));
701  return false;
702  }
703 
704  int gasG = gasGap(id);
705  if (gasG < gasGapMin(id) || gasG > gasGapMax(id)) {
706  ATH_MSG_DEBUG("Invalid gasGap=" << gasG << " gasGapMin=" << gasGapMin(id) << " gasGapMax=" << gasGapMax(id));
707  return false;
708  }
709 
710  int channeltype = channelType(id);
711  if (channeltype < channelTypeMin(id) || channeltype > channelTypeMax(id)) {
712  ATH_MSG_DEBUG("Invalid channelType=" << channeltype << " channelTypeMin=" << channelTypeMin(id)
713  << " channelTypeMax=" << channelTypeMax(id));
714  return false;
715  }
716 
717  int element = channel(id);
718  if (element < channelMin(id) || element > channelMax(id)) {
719  ATH_MSG_DEBUG("Invalid channel=" << element << " channelMin=" << channelMin(id) << " channelMax=" << channelMax(id));
720  return false;
721  }
722 
723  if (channeltype == Pad) {
724  int PadEta = padEta(id);
725  int PadPhi = padPhi(id);
726  if (PadEta < PadEtaMin || PadEta > PadEtaMax) {
727  ATH_MSG_DEBUG("Invalid padEta=" << PadEta << " padEtaMin=" << PadEtaMin << " padEtaMax=" << PadEtaMax);
728  return false;
729  }
730  if (PadPhi < PadPhiMin || PadPhi > PadPhiMax) {
731  ATH_MSG_DEBUG("Invalid padEPhi" << PadPhi << " padPhiMin=" << PadPhiMin << " padPhiMax=" << PadPhiMax);
732  return false;
733  }
734  }
735 
736  return true;
737 } // end sTgcIdHelper::valid
738 /*******************************************************************************/
739 bool sTgcIdHelper::isStNameInTech(const std::string& name) const { return 'S' == name[0] && 'T' == name[1]; }
740 bool sTgcIdHelper::validElement(const Identifier& id) const {
741  int station = stationName(id);
742  if (!validStation(station)) {
743  ATH_MSG_DEBUG("Invalid stationName=" << stationNameString(station));
744  return false;
745  }
746 
747  int eta = stationEta(id);
748  if (eta < stationEtaMin(id) || eta > stationEtaMax(id)) {
749  ATH_MSG_DEBUG("Invalid stationEta=" << eta << " for stationName=" << stationNameString(station) << " stationIndex=" << station
750  << " stationEtaMin=" << stationEtaMin(id) << " stationEtaMax=" << stationEtaMax(id));
751  return false;
752  }
753 
754  int phi = stationPhi(id);
755  if (phi < stationPhiMin(id) || phi > stationPhiMax(id)) {
756  ATH_MSG_DEBUG("Invalid stationPhi=" << phi << " for stationName=" << stationNameString(station) << " stationIndex=" << station
757  << " stationPhiMin=" << stationPhiMin(id) << " stationPhiMax=" << stationPhiMax(id));
758  return false;
759  }
760  return true;
761 
762 } // end sTgcIdHelper::validElement
763 /*******************************************************************************/
764 // Private validation of levels
766  if (!validStation(stationName)) {
767  ATH_MSG_DEBUG("Invalid stationName=" << stationNameString(stationName));
768  return false;
769  }
770  if (stationEta < stationEtaMin(id) || stationEta > stationEtaMax(id)) {
771  ATH_MSG_DEBUG("Invalid stationEta=" << stationEta << " for stationName=" << stationNameString(stationName)
772  << " stationIndex=" << stationName << " stationEtaMin=" << stationEtaMin(id)
773  << " stationEtaMax=" << stationEtaMax(id));
774  return false;
775  }
776  if (stationPhi < stationPhiMin(id) || stationPhi > stationPhiMax(id)) {
777  ATH_MSG_DEBUG("Invalid stationPhi=" << stationPhi << " for stationName=" << stationNameString(stationName)
778  << " stationIndex=" << stationName << " stationPhiMin=" << stationPhiMin(id)
779  << " stationPhiMax=" << stationPhiMax(id));
780  return false;
781  }
782  return true;
783 } // end sTgcIdHelper::validElement
784 /*******************************************************************************/
785 // Check values down to readout channel level
786 bool sTgcIdHelper::validChannel(const Identifier& id, int stationName, int stationEta, int stationPhi, int multilayer, int gasGap,
787  int channelType, int channel) const {
788  if (!validElement(id, stationName, stationEta, stationPhi)) return false;
789 
790  if ((multilayer < multilayerMin(id)) || (multilayer > multilayerMax(id))) {
791  ATH_MSG_DEBUG("Invalid multilayer=" << multilayer << " multilayerMin=" << multilayerMin(id)
792  << " multilayerMax=" << multilayerMax(id));
793  return false;
794  }
795 
796  if (gasGap < gasGapMin(id) || gasGap > gasGapMax(id)) {
797  ATH_MSG_DEBUG("Invalid gasGap=" << gasGap << " gasGapMin=" << gasGapMin(id) << " gasGapMax=" << gasGapMax(id));
798  return false;
799  }
801  ATH_MSG_DEBUG("Invalid channelType=" << channelType << " channelTypeMin=" << channelTypeMin(id)
802  << " channelTypeMax=" << channelTypeMax(id));
803  return false;
804  }
805  if (channel < channelMin(id) || channel > channelMax(id)) {
806  ATH_MSG_DEBUG("Invalid channel=" << channel << " channelMin=" << channelMin(id) << " channelMax=" << channelMax(id));
807  return false;
808  }
809  if (channelType == Pad) {
810  int PadEta = padEta(id);
811  int PadPhi = padPhi(id);
812  if (PadEta < PadEtaMin || PadEta > PadEtaMax) {
813  ATH_MSG_DEBUG("Invalid padEta=" << PadEta << " padEtaMin=" << PadEtaMin << " padEtaMax=" << PadEtaMax);
814  return false;
815  }
816  if (PadPhi < PadPhiMin || PadPhi > PadPhiMax) {
817  ATH_MSG_DEBUG("Invalid padEPhi" << PadPhi << " padPhiMin=" << PadPhiMin << " padPhiMax=" << PadPhiMax);
818  return false;
819  }
820  }
821  return true;
822 } // end sTgcIdHelper::validChannel
823 /*******************************************************************************/
824 // Check values down to readout channel level
825 bool sTgcIdHelper::validChannel(const Identifier& id, int stationName, int stationEta, int stationPhi, int multilayer, int gasGap,
826  int channelType, int padEta, int padPhi) const {
827  if (!validElement(id, stationName, stationEta, stationPhi)) return false;
828 
829  if ((multilayer < multilayerMin(id)) || (multilayer > multilayerMax(id))) {
830  ATH_MSG_DEBUG("Invalid multilayer=" << multilayer << " multilayerMin=" << multilayerMin(id)
831  << " multilayerMax=" << multilayerMax(id));
832  return false;
833  }
834 
835  if (gasGap < gasGapMin(id) || gasGap > gasGapMax(id)) {
836  ATH_MSG_DEBUG("Invalid gasGap=" << gasGap << " gasGapMin=" << gasGapMin(id) << " gasGapMax=" << gasGapMax(id));
837  return false;
838  }
839  if (channelType != Pad) {
840  ATH_MSG_DEBUG("Invalid channelType=" << channelType << " channelType must be " << Pad << " when specifying padEta and padPhi");
841  return false;
842  }
843  int channel = (padPhi - 1) * PadEtaMax + padEta;
844  if (channel < channelMin(id) || channel > channelMax(id)) {
845  ATH_MSG_DEBUG("Invalid channel=" << channel << " channelMin=" << channelMin(id) << " channelMax=" << channelMax(id)
846  << " for given padEta=" << padEta << " and padPhi=" << padPhi);
847  return false;
848  }
849  if (padEta < PadEtaMin || padEta > PadEtaMax) {
850  ATH_MSG_DEBUG("Invalid padEta=" << padEta << " padEtaMin=" << PadEtaMin << " padEtaMax=" << PadEtaMax);
851  return false;
852  }
853  if (padPhi < PadPhiMin || padPhi > PadPhiMax) {
854  ATH_MSG_DEBUG("Invalid padEPhi" << padPhi << " padPhiMin=" << PadPhiMin << " padPhiMax=" << PadPhiMax);
855  return false;
856  }
857  return true;
858 } // end sTgcIdHelper::validChannel
859  /*******************************************************************************/
860  // Construct ID from components
862  // pack fields independently
869  return result;
870 }
872  try {
875  return result;
876  } catch (const std::out_of_range&) { isValid = false; }
877  return Identifier{0};
878 }
879 
880 /*******************************************************************************/
881 Identifier sTgcIdHelper::elementID(const std::string& stationNameStr, int stationEta, int stationPhi, bool& isValid) const {
882  return elementID(stationNameIndex(stationNameStr), stationEta, stationPhi, isValid);
883 }
884 Identifier sTgcIdHelper::elementID(const std::string& stationNameStr, int stationEta, int stationPhi) const {
885  return elementID(stationNameIndex(stationNameStr), stationEta, stationPhi);
886 }
887 
888 /*******************************************************************************/
889 Identifier sTgcIdHelper::elementID(const Identifier& id) const { return parentID(id); }
890 /*******************************************************************************/
891 Identifier sTgcIdHelper::channelID(int stationName, int stationEta, int stationPhi, int multilayer, int gasGap, int channelType,
892  int channel) const {
893  // pack fields independently
904 
905  return result;
906 }
907 Identifier sTgcIdHelper::channelID(int stationName, int stationEta, int stationPhi, int multilayer, int gasGap, int channelType,
908  int channel, bool& isValid) const {
909  try {
912  return result;
913  } catch (const std::out_of_range&) { isValid = false; }
914  return Identifier{0};
915 }
916 /*******************************************************************************/
917 Identifier sTgcIdHelper::channelID(const std::string& stationNameStr, int stationEta, int stationPhi, int multilayer, int gasGap,
918  int channelType, int channel) const {
920 }
921 Identifier sTgcIdHelper::channelID(const std::string& stationNameStr, int stationEta, int stationPhi, int multilayer, int gasGap,
922  int channelType, int channel, bool& isValid) const {
924 }
925 
926 /*******************************************************************************/
927 Identifier sTgcIdHelper::channelID(const Identifier& id, int multilayer, int gasGap, int channelType, int channel) const {
928  Identifier result = parentID(id);
933  return result;
934 }
935 Identifier sTgcIdHelper::channelID(const Identifier& id, int multilayer, int gasGap, int channelType, int channel, bool& isValid) const {
936  try{
938  isValid = valid(result);
939  return result;
940  } catch (const std::out_of_range&) { isValid = false; }
941  return Identifier{0};
942 }
943 /*******************************************************************************/
944 Identifier sTgcIdHelper::padID(int stationName, int stationEta, int stationPhi, int multilayer, int gasGap, int channelType, int padEta,
945  int padPhi) const {
946  int channel = -1;
947  if (channelType == Pad) {
948  channel = (padPhi - 1) * PadEtaMax + padEta;
949  } else {
950  return Identifier{-1};
951  }
952  // pack fields independently
962 
964 
965  return result;
966 }
967 Identifier sTgcIdHelper::padID(int stationName, int stationEta, int stationPhi, int multilayer, int gasGap, int channelType, int padEta,
968  int padPhi, bool& isValid) const {
969  try {
971  isValid = (channelType) == Pad &&
973  return result;
974  } catch (const std::out_of_range&) { isValid = false; }
975  return Identifier{0};
976 }
977 /*******************************************************************************/
978 Identifier sTgcIdHelper::padID(const std::string& stationNameStr, int stationEta, int stationPhi, int multilayer, int gasGap,
979  int channelType, int padEta, int padPhi) const {
981 }
982 
983 Identifier sTgcIdHelper::padID(const std::string& stationNameStr, int stationEta, int stationPhi, int multilayer, int gasGap,
984  int channelType, int padEta, int padPhi, bool& isValid) const {
986 }
987 
988 /*******************************************************************************/
989 Identifier sTgcIdHelper::padID(const Identifier& id, int multilayer, int gasGap, int channelType, int padEta, int padPhi) const {
990  Identifier result(id);
991  if (channelType != Pad) return result;
995  int channel = (padPhi - 1) * PadEtaMax + padEta;
997 
998  return result;
999 }
1000 Identifier sTgcIdHelper::padID(const Identifier& id, int multilayer, int gasGap, int channelType, int padEta, int padPhi,
1001  bool& isValid) const {
1002  try {
1004  isValid = (channelType == Pad) && valid(result);
1005  return result;
1006  } catch (const std::out_of_range&) { isValid = false; }
1007  return Identifier{0};
1008 }
1009 /*******************************************************************************/
1010 // get parent id from strip or gang identifier
1012  assert(is_stgc(id));
1013  Identifier result(id);
1018  return result;
1019 }
1020 /*******************************************************************************/
1021 // Access to components of the ID
1022 int sTgcIdHelper::multilayer(const Identifier& id) const { return m_mplet_impl.unpack(id); }
1023 /*******************************************************************************/
1024 // Access to components of the ID
1025 int sTgcIdHelper::gasGap(const Identifier& id) const { return m_gap_impl.unpack(id); }
1026 /*******************************************************************************/
1027 int sTgcIdHelper::channelType(const Identifier& id) const { return m_typ_impl.unpack(id); }
1028 /*******************************************************************************/
1030 bool sTgcIdHelper::measuresPhi(const Identifier& id) const { return (channelType(id) == Strip) ? 0 : 1; }
1031 /*******************************************************************************/
1032 int sTgcIdHelper::channel(const Identifier& id) const { return m_cha_impl.unpack(id); }
1033 /*******************************************************************************/
1034 // Access to min and max of level ranges
1036 /*******************************************************************************/
1038 /*******************************************************************************/
1040 /*******************************************************************************/
1042 /*******************************************************************************/
1044 /*******************************************************************************/
1046 /*******************************************************************************/
1048 /*******************************************************************************/
1050 /*******************************************************************************/
1052 /*******************************************************************************/
1054 /*******************************************************************************/
1056 /*******************************************************************************/
1058 /*******************************************************************************/
1060 /*******************************************************************************/
1062 /*******************************************************************************/
1064 /*******************************************************************************/
1066 /*******************************************************************************/
1069  int stgcField = technologyIndex("STGC");
1070  if (m_dict) { stgcField = stgc_field_value(); }
1071  return stgcField;
1072 }
1073 /*******************************************************************************/
1074 bool sTgcIdHelper::LargeSector(int stationName) const { return ('L' == stationNameString(stationName)[2]); }
1075 /*******************************************************************************/
1076 bool sTgcIdHelper::SmallSector(int stationName) const { return ('S' == stationNameString(stationName)[2]); }
1077 
1078 /*******************************************************************************/
IdDictMgr.h
MuonIdHelper::validStation
bool validStation(int stationName, int technology) const
Definition: MuonIdHelper.cxx:777
MuonIdHelper::stationNameIndex
int stationNameIndex(const std::string &name) const
Definition: MuonIdHelper.cxx:852
sTgcIdHelper::multilayer
int multilayer(const Identifier &id) const
Definition: sTgcIdHelper.cxx:1022
ConstRangeIterator
Definition: RangeIterator.h:46
Muon::nsw::STGTPSegments::moduleIDBits::stationPhi
constexpr uint8_t stationPhi
station Phi 1 to 8
Definition: NSWSTGTPDecodeBitmaps.h:161
IdDictDictionary::build_multirange
MultiRange build_multirange() const
Get MultiRange for full dictionary.
Definition: IdDictDictionary.cxx:290
dumpTgcDigiDeadChambers.gasGap
list gasGap
Definition: dumpTgcDigiDeadChambers.py:33
MuonIdHelper::initLevelsFromDict
int initLevelsFromDict()
Definition: MuonIdHelper.cxx:249
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
AtlasDetectorID::initialize_from_dictionary
virtual int initialize_from_dictionary(const IdDictMgr &dict_mgr) override
Initialization from the identifier dictionary.
Definition: AtlasDetectorID.cxx:255
MuonIdHelper::m_init
bool m_init
Definition: MuonIdHelper.h:339
sTgcIdHelper::m_detectorElement_hashes
std::array< unsigned int, s_detHashDim > m_detectorElement_hashes
Definition: sTgcIdHelper.h:210
sTgcIdHelper::m_mplet_impl
IdDictFieldImplementation m_mplet_impl
Definition: sTgcIdHelper.h:225
get_generator_info.result
result
Definition: get_generator_info.py:21
IdDictGroup
Definition: IdDictGroup.h:25
sTgcIdHelper.h
plotting.yearwise_efficiency.channel
channel
Definition: yearwise_efficiency.py:24
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
MuonIdHelper::get_id
virtual int get_id(const IdentifierHash &hash_id, Identifier &id, const IdContext *context=0) const override
Create compact id from hash id (return == 0 for OK)
Definition: MuonIdHelper.cxx:74
MuonIdHelper::technologyIndex
int technologyIndex(const std::string &name) const
Definition: MuonIdHelper.cxx:858
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
sTgcIdHelper::detEleHashIdx
unsigned int detEleHashIdx(const Identifier &id) const
Definition: sTgcIdHelper.cxx:256
LArBadChanBlobUtils::Channel
Identifier32::value_type Channel
Definition: LArBadChanBlobUtils.h:24
IdDictFieldImplementation::show_to_string
std::string show_to_string(void) const
Definition: IdDictFieldImplementation.cxx:32
sTgcIdHelper::initialize_from_dictionary
virtual int initialize_from_dictionary(const IdDictMgr &dict_mgr) override
Initialization from the identifier dictionary.
Definition: sTgcIdHelper.cxx:21
AtlasDetectorID::muon_field_value
int muon_field_value() const
Definition: AtlasDetectorID.h:615
dumpTgcDigiDeadChambers.stationName
dictionary stationName
Definition: dumpTgcDigiDeadChambers.py:30
sTgcIdHelper::gasGapMax
static int gasGapMax()
Definition: sTgcIdHelper.cxx:1049
MuonIdHelper::channel_context
IdContext channel_context() const
id for channel
Definition: MuonIdHelper.cxx:751
sTgcIdHelper::LargeSector
bool LargeSector(int stationName) const
Definition: sTgcIdHelper.cxx:1074
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
sTgcIdHelper::stationPhiMin
static int stationPhiMin()
Definition: sTgcIdHelper.cxx:1039
index
Definition: index.py:1
sTgcIdHelper::m_stationShift
unsigned int m_stationShift
Minimal station index found.
Definition: sTgcIdHelper.h:215
IdDictDictionary::region
const IdDictRegion & region(size_t i) const
Region at index i.
Definition: IdDictDictionary.h:350
sTgcIdHelper::channelID
Identifier channelID(int stationName, int stationEta, int stationPhi, int multilayer, int gasGap, int channelType, int channel) const
Definition: sTgcIdHelper.cxx:891
MuonIdHelper::detectorElement_hash_max
size_type detectorElement_hash_max() const
Definition: MuonIdHelper.h:183
MultiRange::add
void add(const Range &range)
Definition: MultiRange.cxx:22
IdentifierField::get_minimum
element_type get_minimum() const
Query the values.
Definition: IdentifierField.h:121
min
constexpr double min()
Definition: ap_fixedTest.cxx:26
IdDictDictionary.h
sTgcIdHelper::measuresPhi
bool measuresPhi(const Identifier &id) const override
returns measuresPhi
Definition: sTgcIdHelper.cxx:1030
MuonIdHelper::m_sta_impl
IdDictFieldImplementation m_sta_impl
Definition: MuonIdHelper.h:286
sTgcIdHelper::gasGapMin
static int gasGapMin()
Definition: sTgcIdHelper.cxx:1047
DMTest::C
C_v1 C
Definition: C.h:26
sTgcIdHelper::s_etaDim
static constexpr unsigned int s_etaDim
-3, -2, -1, 1, 2, 3
Definition: sTgcIdHelper.h:200
sTgcIdHelper::GasGapMin
@ GasGapMin
Definition: sTgcIdHelper.h:250
ExpandedIdentifier::add
void add(element_type value)
Append a value into a new field.
ExpandedIdentifier
Definition: DetectorDescription/Identifier/Identifier/ExpandedIdentifier.h:102
IdDictFieldImplementation::pack
void pack(int value, Identifier &id) const
Definition: IdDictFieldImplementation.h:173
sTgcIdHelper::Strip
@ Strip
Definition: sTgcIdHelper.h:190
sTgcIdHelper::multilayerMin
static int multilayerMin()
Definition: sTgcIdHelper.cxx:1043
IdentifierField::get_maximum
element_type get_maximum() const
Definition: IdentifierField.h:130
sTgcIdHelper::numberOfMultilayers
int numberOfMultilayers(const Identifier &id) const
Definition: sTgcIdHelper.cxx:482
AtlasDetectorID::stgc_field_value
int stgc_field_value() const
Definition: AtlasDetectorID.h:660
ReadOfcFromCool.field
field
Definition: ReadOfcFromCool.py:48
MuonIdHelper::stationName
int stationName(const Identifier &id) const
Definition: MuonIdHelper.cxx:810
IdDictDictionary::name
const std::string & name() const
Dictionary name.
Definition: IdDictDictionary.h:332
isValid
bool isValid(const T &p)
Av: we implement here an ATLAS-sepcific convention: all particles which are 99xxxxx are fine.
Definition: AtlasPID.h:872
MuonIdHelper::m_phi_impl
IdDictFieldImplementation m_phi_impl
Definition: MuonIdHelper.h:288
IdDictFieldImplementation::unpack
int unpack(Identifier id) const
Identifier manipulation methods.
Definition: IdDictFieldImplementation.h:147
MuonIdHelper::m_full_channel_range
MultiRange m_full_channel_range
Definition: MuonIdHelper.h:271
sTgcIdHelper::PadPhiMin
@ PadPhiMin
Definition: sTgcIdHelper.h:256
IdDictGroup.h
Trk::u
@ u
Enums for curvilinear frames.
Definition: ParamDefs.h:77
sTgcIdHelper::PadPhiMax
@ PadPhiMax
Definition: sTgcIdHelper.h:257
sTgcIdHelper::MultilayerMin
@ MultilayerMin
Definition: sTgcIdHelper.h:248
IdDictDictionary::find_field
IdDictField * find_field(const std::string &name) const
Definition: IdDictDictionary.cxx:47
CalibDbCompareRT.region_id
region_id
Definition: CalibDbCompareRT.py:67
IdDictRegion
Definition: IdDictRegion.h:20
sTgcIdHelper::MultilayerMax
@ MultilayerMax
Definition: sTgcIdHelper.h:249
sTgcIdHelper::StationPhiMax
@ StationPhiMax
Definition: sTgcIdHelper.h:247
IdDictFieldImplementation::reset
void reset(Identifier &id) const
Definition: IdDictFieldImplementation.h:183
MuonIdHelper::is_stgc
bool is_stgc(const Identifier &id) const
Definition: MuonIdHelper.cxx:804
sTgcIdHelper::StationEtaMax
@ StationEtaMax
Definition: sTgcIdHelper.h:245
sTgcIdHelper::StationEtaMin
@ StationEtaMin
Definition: sTgcIdHelper.h:244
IdDictRegion::implementation
const IdDictFieldImplementation & implementation(size_t i) const
Definition: IdDictRegion.cxx:34
sTgcIdHelper::PadEtaMin
@ PadEtaMin
Definition: sTgcIdHelper.h:258
IdDictMgr
Definition: IdDictMgr.h:14
sTgcIdHelper::stationEtaMin
static int stationEtaMin()
Definition: sTgcIdHelper.cxx:1035
IdDictDictionary::find_group
IdDictGroup * find_group(const std::string &group_name) const
Definition: IdDictDictionary.cxx:115
sTgcIdHelper::m_typ_impl
IdDictFieldImplementation m_typ_impl
Definition: sTgcIdHelper.h:223
IdDictMgr::find_dictionary
IdDictDictionary * find_dictionary(const std::string &name) const
Access dictionary by name.
Definition: IdDictMgr.cxx:114
sTgcIdHelper::channelMax
static int channelMax()
Definition: sTgcIdHelper.cxx:1057
MuonIdHelper
Definition: MuonIdHelper.h:77
sTgcIdHelper::channel
int channel(const Identifier &id) const override
Definition: sTgcIdHelper.cxx:1032
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
IdentifierField::empty
bool empty() const
If true, this field does not have any constraints, and may hold any value representable by element_ty...
Definition: IdentifierField.h:182
sTgcIdHelper::stationPhiMax
static int stationPhiMax()
Definition: sTgcIdHelper.cxx:1041
sTgcIdHelper::ChannelMin
@ ChannelMin
Definition: sTgcIdHelper.h:254
lumiFormat.i
int i
Definition: lumiFormat.py:85
MuonIdHelper::m_module_vec
id_vec m_module_vec
Definition: MuonIdHelper.h:268
sTgcIdHelper::s_mlDim
static constexpr unsigned int s_mlDim
2 multilayer
Definition: sTgcIdHelper.h:204
sTgcIdHelper::padPhiMax
static int padPhiMax()
Definition: sTgcIdHelper.cxx:1065
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
sTgcIdHelper::validElement
bool validElement(const Identifier &id) const
Definition: sTgcIdHelper.cxx:740
sTgcIdHelper::channelTypeMax
static int channelTypeMax()
Definition: sTgcIdHelper.cxx:1053
sTgcIdHelper::gasGap
int gasGap(const Identifier &id) const override
get the hashes
Definition: sTgcIdHelper.cxx:1025
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:194
checkCorrelInHIST.prefix
dictionary prefix
Definition: checkCorrelInHIST.py:391
test_pyathena.parent
parent
Definition: test_pyathena.py:15
sTgcIdHelper::sTgcIdHelper
sTgcIdHelper()
Definition: sTgcIdHelper.cxx:15
sTgcIdHelper::PadEtaMax
@ PadEtaMax
Definition: sTgcIdHelper.h:259
MuonIdHelper::m_full_detectorElement_range
MultiRange m_full_detectorElement_range
Definition: MuonIdHelper.h:276
sTgcIdHelper::stationEtaMax
static int stationEtaMax()
Definition: sTgcIdHelper.cxx:1037
sTgcIdHelper::ChannelTypeMax
@ ChannelTypeMax
Definition: sTgcIdHelper.h:253
MuonIdHelper::m_full_module_range
MultiRange m_full_module_range
Definition: MuonIdHelper.h:266
sTgcIdHelper::idChannels
void idChannels(const Identifier &id, std::vector< Identifier > &vect) const
Definition: sTgcIdHelper.cxx:390
MuonIdHelper::get_expanded_id
int get_expanded_id(const Identifier &id, ExpandedIdentifier &exp_id, const IdContext *context) const
Create expanded id from compact id (return == 0 for OK)
Definition: MuonIdHelper.cxx:164
CaloCondBlobAlgs_fillNoiseFromASCII.channelId
channelId
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:121
IdDictGroup::regions
const std::vector< IdDictRegion * > & regions()
Definition: IdDictGroup.cxx:46
MuonIdHelper::m_eta_impl
IdDictFieldImplementation m_eta_impl
Definition: MuonIdHelper.h:287
sTgcIdHelper::padEtaMin
static int padEtaMin()
Definition: sTgcIdHelper.cxx:1059
MuonIdHelper::init_hashes
int init_hashes()
Definition: MuonIdHelper.cxx:356
MuonIdHelper::m_muon_impl
IdDictFieldImplementation m_muon_impl
Definition: MuonIdHelper.h:285
MuonIdHelper::m_GROUP_INDEX
size_t m_GROUP_INDEX
Definition: MuonIdHelper.h:255
AtlasDetectorID::register_dict_tag
int register_dict_tag(const IdDictMgr &dict_mgr, const std::string &dict_name)
Register the file and tag names for a particular IdDict dictionary.
Definition: AtlasDetectorID.cxx:201
sTgcIdHelper::m_module_hashes
std::array< unsigned int, s_modHashDim > m_module_hashes
Definition: sTgcIdHelper.h:209
MuonIdHelper::stationPhi
int stationPhi(const Identifier &id) const
Definition: MuonIdHelper.cxx:820
sTgcIdHelper::m_GASGAP_INDEX
size_type m_GASGAP_INDEX
Definition: sTgcIdHelper.h:219
sTgcIdHelper::m_CHANNELTYPE_INDEX
size_type m_CHANNELTYPE_INDEX
Definition: sTgcIdHelper.h:220
sTgcIdHelper::stgcTechnology
int stgcTechnology() const
Utility methods.
Definition: sTgcIdHelper.cxx:1068
IdDictDictionary::get_label_value
int get_label_value(const std::string &field, const std::string &label, int &value) const
Definition: IdDictDictionary.cxx:75
MuonIdHelper::stationNameString
const std::string & stationNameString(const int &index) const
Definition: MuonIdHelper.cxx:864
MuonIdHelper::init_neighbors
int init_neighbors()
Definition: MuonIdHelper.cxx:528
sTgcIdHelper::padPhiMin
static int padPhiMin()
Definition: sTgcIdHelper.cxx:1063
sTgcIdHelper::multilayerMax
static int multilayerMax()
Definition: sTgcIdHelper.cxx:1045
MultiRange
A MultiRange combines several Ranges.
Definition: MultiRange.h:17
sTgcIdHelper::channelMin
static int channelMin()
Definition: sTgcIdHelper.cxx:1055
sTgcIdHelper::padEtaMax
static int padEtaMax()
Definition: sTgcIdHelper.cxx:1061
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
sTgcIdHelper::init_id_to_hashes
int init_id_to_hashes()
Definition: sTgcIdHelper.cxx:260
sTgcIdHelper::padID
Identifier padID(int stationName, int stationEta, int stationPhi, int multilayer, int gasGap, int channelType, int padEta, int padPhi) const
Definition: sTgcIdHelper.cxx:944
sTgcIdHelper::valid
bool valid(const Identifier &id) const
Definition: sTgcIdHelper.cxx:695
RangeIterator.h
MuonIdHelper::m_detectorElement_vec
id_vec m_detectorElement_vec
Definition: MuonIdHelper.h:278
sTgcIdHelper::m_cha_impl
IdDictFieldImplementation m_cha_impl
Definition: sTgcIdHelper.h:224
MuonIdHelper::stationEta
int stationEta(const Identifier &id) const
Definition: MuonIdHelper.cxx:815
Range
A Range describes the possible ranges for the field values of an ExpandedIdentifier.
Definition: DetectorDescription/Identifier/Identifier/Range.h:29
sTgcIdHelper::get_detectorElement_hash
virtual int get_detectorElement_hash(const Identifier &id, IdentifierHash &hash_id) const override
Definition: sTgcIdHelper.cxx:293
sTgcIdHelper::parentID
Identifier parentID(const Identifier &id) const
Definition: sTgcIdHelper.cxx:1011
MuonIdHelper::module_hash_max
size_type module_hash_max() const
the maximum hash value
Definition: MuonIdHelper.cxx:758
IdDictDictionary
Definition: IdDictDictionary.h:30
MuonIdHelper::m_ETA_INDEX
size_type m_ETA_INDEX
Definition: MuonIdHelper.h:257
sTgcIdHelper::s_phiDim
static constexpr unsigned int s_phiDim
8 phi station
Definition: sTgcIdHelper.h:202
sTgcIdHelper::validChannel
bool validChannel(const Identifier &id, int stationName, int stationEta, int stationPhi, int multilayer, int gasGap, int channelType, int channel) const
Definition: sTgcIdHelper.cxx:786
sTgcIdHelper::m_gap_impl
IdDictFieldImplementation m_gap_impl
Definition: sTgcIdHelper.h:222
MuonIdHelper::init_detectorElement_hashes
virtual int init_detectorElement_hashes()
Definition: MuonIdHelper.cxx:402
sTgcIdHelper::ChannelMax
@ ChannelMax
Definition: sTgcIdHelper.h:255
sTgcIdHelper::elementID
Identifier elementID(int stationName, int stationEta, int stationPhi) const
Definition: sTgcIdHelper.cxx:861
sTgcIdHelper::padPhi
int padPhi(const Identifier &id) const
Definition: sTgcIdHelper.cxx:684
AtlasDetectorID::reinitialize
bool reinitialize(const IdDictMgr &dict_mgr)
Test whether an idhelper should be reinitialized based on the change of tags.
Definition: AtlasDetectorID.cxx:221
IdDictField.h
MuonIdHelper::m_TECHNOLOGY_INDEX
size_type m_TECHNOLOGY_INDEX
Definition: MuonIdHelper.h:259
sTgcIdHelper::get_module_hash
virtual int get_module_hash(const Identifier &id, IdentifierHash &hash_id) const override
Definition: sTgcIdHelper.cxx:286
sTgcIdHelper::StationPhiMin
@ StationPhiMin
Definition: sTgcIdHelper.h:246
python.CaloAddPedShiftConfig.int
int
Definition: CaloAddPedShiftConfig.py:45
AtlasDetectorID::show_to_string
std::string show_to_string(Identifier id, const IdContext *context=0, char sep='.') const
or provide the printout in string form
Definition: AtlasDetectorID.cxx:365
sTgcIdHelper::Pad
@ Pad
Definition: sTgcIdHelper.h:190
sTgcIdHelper::GasGapMax
@ GasGapMax
Definition: sTgcIdHelper.h:251
MultiRange::size
size_type size() const
Definition: MultiRange.cxx:70
sTgcIdHelper::isStNameInTech
bool isStNameInTech(const std::string &stationName) const override
The valid element checks converted the identifier to a stationName string in order to assess whether ...
Definition: sTgcIdHelper.cxx:739
IdentifierField
This is the individual specification for the range of one ExpandedIdentifier IdentifierField.
Definition: IdentifierField.h:83
MuonIdHelper::resetAndSet
void resetAndSet(const IdDictFieldImplementation &dict, const int new_val, Identifier &id) const
Definition: MuonIdHelper.h:306
LArNewCalib_DelayDump_OFC_Cali.idx
idx
Definition: LArNewCalib_DelayDump_OFC_Cali.py:69
MuonIdHelper::m_DETECTORELEMENT_INDEX
size_type m_DETECTORELEMENT_INDEX
Definition: MuonIdHelper.h:261
sTgcIdHelper::channelTypeMin
static int channelTypeMin()
Definition: sTgcIdHelper.cxx:1051
sTgcIdHelper::SmallSector
bool SmallSector(int stationName) const
Definition: sTgcIdHelper.cxx:1076
MuonIdHelper::m_tec_impl
IdDictFieldImplementation m_tec_impl
Definition: MuonIdHelper.h:289
Pad
Definition: Pad.h:10
sTgcIdHelper::multilayerID
Identifier multilayerID(const Identifier &channeldID) const
Definition: sTgcIdHelper.cxx:302
sTgcIdHelper::padEta
int padEta(const Identifier &id) const
Definition: sTgcIdHelper.cxx:674
Identifier::value_type
unsigned long long value_type
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:27
sTgcIdHelper::febID
Identifier febID(int stationName, int stationEta, int stationPhi, int multilayer, int gasGap, int channelType) const
Definition: sTgcIdHelper.cxx:327
merge.status
status
Definition: merge.py:16
sTgcIdHelper::moduleHashIdx
unsigned int moduleHashIdx(const Identifier &id) const
Definition: sTgcIdHelper.cxx:248
IdDictRegion.h
IdDictField
Definition: IdDictField.h:15
Muon::nsw::STGTPSegments::moduleIDBits::stationEta
constexpr uint8_t stationEta
1 to 3
Definition: NSWSTGTPDecodeBitmaps.h:159
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
sTgcIdHelper::hvID
Identifier hvID(int stationName, int stationEta, int stationPhi, int multilayer, int gasGap, bool isInnerQ1) const
Definition: sTgcIdHelper.cxx:344
LArCellBinning.etamin
etamin
Definition: LArCellBinning.py:137
ExpandedIdentifier::element_type
int element_type
Definition: DetectorDescription/Identifier/Identifier/ExpandedIdentifier.h:106
sTgcIdHelper::channelType
int channelType(const Identifier &id) const
Definition: sTgcIdHelper.cxx:1027
IdContext
This class saves the "context" of an expanded identifier (ExpandedIdentifier) for compact or hash ver...
Definition: IdContext.h:26
MuonIdHelper::m_PHI_INDEX
size_type m_PHI_INDEX
Definition: MuonIdHelper.h:258
MuonIdHelper::technology_context
IdContext technology_context() const
access to IdContext's which define which levels or fields are contained in the Muon id
Definition: MuonIdHelper.cxx:736
sTgcIdHelper::ChannelTypeMin
@ ChannelTypeMin
Definition: sTgcIdHelper.h:252
MuonIdHelper::m_CHANNEL_INDEX
size_type m_CHANNEL_INDEX
Definition: MuonIdHelper.h:262
Identifier
Definition: IdentifierFieldParser.cxx:14
MuonIdHelper::m_dict
const IdDictDictionary * m_dict
Definition: MuonIdHelper.h:263