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