ATLAS Offline Software
Functions
MuonDQA/MuonDQAUtils/MuonDQAUtils/MuonChamberNameConverter.h File Reference
#include <string>
#include <sstream>
#include <vector>
#include <iostream>
Include dependency graph for MuonDQA/MuonDQAUtils/MuonDQAUtils/MuonChamberNameConverter.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

std::string convertChamberName (int, int, int, const std::string &)
 

Function Documentation

◆ convertChamberName()

std::string convertChamberName ( int  ,
int  ,
int  ,
const std::string &   
)

Definition at line 10 of file MuonDQA/MuonDQAUtils/src/MuonChamberNameConverter.cxx.

10  {
11 
12  //Input values
13  int Name_int = ChamberName;
14  int Eta_int = ChamberEta;
15  int Phi_int = ChamberPhi;
16  //add type
17  //"MDT","CSC","TGC" go in the same loop while
18  //"RPC" go to a different loop due to the same
19  //naming with "MDT"
20  const std::string& Type=ChamberType;
21 
22 
23  //Set string variables
24  std::string Name_string;
25  std::string Eta_string;
26  std::string Phi_string;
27 
28  //Vector setting the chamber eta, phi range
29  //Elements:
30  // limit eta , forbiden eta , min phi , max phi , allowed phi1 , allowed phi2
31  std::vector<int> limits;
32 
33 
34  if (Type=="MDT" || Type=="CSC" || Type=="TGC"){
35  //Switch from ATHENA int name to Hardware string name
36  switch (Name_int)
37  {
38  // identifier : harware name : limit eta : forbiden eta : min phi : max phi : allowed phi1 : allowed phi2 : long/short
39  case 0 : Name_string = "BIL"; limits.push_back(6); limits.push_back(0); limits.push_back(1); limits.push_back(5); limits.push_back(7); limits.push_back(-100); limits.push_back(1); break;
40  case 1 : Name_string = "BIS"; limits.push_back(8); limits.push_back(0); limits.push_back(1); limits.push_back(8); limits.push_back(-100); limits.push_back(-100); limits.push_back(-1); break;
41  case 2 : Name_string = "BML"; limits.push_back(6); limits.push_back(0); limits.push_back(1); limits.push_back(8); limits.push_back(-100); limits.push_back(-100); limits.push_back(1); break;
42  case 3 : Name_string = "BMS"; limits.push_back(6); limits.push_back(0); limits.push_back(1); limits.push_back(5); limits.push_back(8); limits.push_back(-100); limits.push_back(-1); break;
43  case 4 : Name_string = "BOL"; limits.push_back(7); limits.push_back(0); limits.push_back(1); limits.push_back(8); limits.push_back(-100); limits.push_back(-100); limits.push_back(1); break;
44  case 5 : Name_string = "BOS"; limits.push_back(6); limits.push_back(0); limits.push_back(1); limits.push_back(5); limits.push_back(8); limits.push_back(-100); limits.push_back(-1); break;
45  case 6 : Name_string = "BEE"; limits.push_back(2); limits.push_back(0); limits.push_back(1); limits.push_back(8); limits.push_back(-100); limits.push_back(-100); limits.push_back(-1); break;
46  case 7 : Name_string = "BIR"; limits.push_back(6); limits.push_back(0); limits.push_back(100); limits.push_back(-100); limits.push_back(6); limits.push_back(8); limits.push_back(1); break;
47  case 8 : Name_string = "BMF"; limits.push_back(3); limits.push_back(0); limits.push_back(100); limits.push_back(-100); limits.push_back(6); limits.push_back(7); limits.push_back(-1); break;
48  case 9 : Name_string = "BOF"; limits.push_back(4); limits.push_back(0); limits.push_back(100); limits.push_back(-100); limits.push_back(6); limits.push_back(7); limits.push_back(-1); break;
49  case 10 : Name_string = "BOG"; limits.push_back(4); limits.push_back(-100); limits.push_back(100); limits.push_back(-100); limits.push_back(6); limits.push_back(7); limits.push_back(-1); break;
50  case 11 : Name_string = "BOH_DOES_NOT_EXIST!"; limits.push_back(-100); limits.push_back(-100); limits.push_back(-100); limits.push_back(-100); limits.push_back(-100); limits.push_back(-100); limits.push_back(-1); break;
51  case 12 : Name_string = "EIC_DOES_NOT_EXIST!"; limits.push_back(-100); limits.push_back(-100); limits.push_back(-100); limits.push_back(-100); limits.push_back(-100); limits.push_back(-100); limits.push_back(-1); break;
52  case 13 : Name_string = "EIL"; limits.push_back(5); limits.push_back(0); limits.push_back(1); limits.push_back(8); limits.push_back(-100); limits.push_back(-100); limits.push_back(1); break;
53  case 14 : Name_string = "EEL"; limits.push_back(2); limits.push_back(0); limits.push_back(1); limits.push_back(8); limits.push_back(-100); limits.push_back(-100); limits.push_back(1); break;
54  case 15 : Name_string = "EES"; limits.push_back(2); limits.push_back(0); limits.push_back(1); limits.push_back(8); limits.push_back(-100); limits.push_back(-100); limits.push_back(-1); break;
55  case 16 : Name_string = "EMC_DOES_NOT_EXIST!"; limits.push_back(-100); limits.push_back(-100); limits.push_back(-100); limits.push_back(-100); limits.push_back(-100); limits.push_back(-100); limits.push_back(-1); break;
56  case 17 : Name_string = "EML"; limits.push_back(5); limits.push_back(0); limits.push_back(1); limits.push_back(8); limits.push_back(-100); limits.push_back(-100); limits.push_back(1); break;
57  case 18 : Name_string = "EMS"; limits.push_back(5); limits.push_back(0); limits.push_back(1); limits.push_back(8); limits.push_back(-100); limits.push_back(-100); limits.push_back(-1); break;
58  case 19 : Name_string = "EOC_DOES_NOT_EXIST!"; limits.push_back(-100); limits.push_back(-100); limits.push_back(-100); limits.push_back(-100); limits.push_back(-100); limits.push_back(-100); limits.push_back(-1); break;
59  case 20 : Name_string = "EOL"; limits.push_back(6); limits.push_back(0); limits.push_back(1); limits.push_back(8); limits.push_back(-100); limits.push_back(-100); limits.push_back(1); break;
60  case 21 : Name_string = "EOS"; limits.push_back(6); limits.push_back(0); limits.push_back(1); limits.push_back(8); limits.push_back(-100); limits.push_back(-100); limits.push_back(-1); break;
61 
62  // TGC part implemented by Masaya Ishino (Masaya.Ishino@cern.ch)
63  // TGC start ; harware name ; limit eta ; forbiden eta ; min phi ; max phi ; allowed phi1 ; allowed phi2 ; long/short
64  case 41 : Name_string = "T1F"; limits.push_back(1); limits.push_back(0); limits.push_back(1); limits.push_back(24); limits.push_back(-100); limits.push_back(-100); limits.push_back(-1); break;
65  case 42 : Name_string = "T1E"; limits.push_back(4); limits.push_back(0); limits.push_back(1); limits.push_back(48); limits.push_back(-100); limits.push_back(-100); limits.push_back(-1); break;
66  case 43 : Name_string = "T2F"; limits.push_back(1); limits.push_back(0); limits.push_back(1); limits.push_back(24); limits.push_back(-100); limits.push_back(-100); limits.push_back(-1); break;
67  case 44 : Name_string = "T2E"; limits.push_back(5); limits.push_back(0); limits.push_back(1); limits.push_back(48); limits.push_back(-100); limits.push_back(-100); limits.push_back(-1); break;
68  case 45 : Name_string = "T3F"; limits.push_back(1); limits.push_back(0); limits.push_back(1); limits.push_back(24); limits.push_back(-100); limits.push_back(-100); limits.push_back(-1); break;
69  case 46 : Name_string = "T3E"; limits.push_back(5); limits.push_back(0); limits.push_back(1); limits.push_back(48); limits.push_back(-100); limits.push_back(-100); limits.push_back(-1); break;
70  case 47 : Name_string = "T4F"; limits.push_back(1); limits.push_back(0); limits.push_back(1); limits.push_back(24); limits.push_back(-100); limits.push_back(-100); limits.push_back(-1); break;
71  case 48 : Name_string = "T4E"; limits.push_back(1); limits.push_back(0); limits.push_back(1); limits.push_back(21); limits.push_back(-100); limits.push_back(-100); limits.push_back(-1); break;
72  // TGC end
73 
74  case 49 : Name_string = "EIS"; limits.push_back(2); limits.push_back(0); limits.push_back(1); limits.push_back(8); limits.push_back(-100); limits.push_back(-100); limits.push_back(-1); break;
75  case 50 : Name_string = "CSS"; limits.push_back(1); limits.push_back(0); limits.push_back(1); limits.push_back(8); limits.push_back(-100); limits.push_back(-100); limits.push_back(-1); break;
76  case 51 : Name_string = "CSL"; limits.push_back(1); limits.push_back(0); limits.push_back(1); limits.push_back(8); limits.push_back(-100); limits.push_back(-100); limits.push_back(1); break;
77  case 52 : Name_string = "BIM"; limits.push_back(5); limits.push_back(0); limits.push_back(100); limits.push_back(-100); limits.push_back(6); limits.push_back(8); limits.push_back(1); break;
78  case 53 : Name_string = "BME"; limits.push_back(1); limits.push_back(0); limits.push_back(100); limits.push_back(-100); limits.push_back(7); limits.push_back(7); limits.push_back(-1); break;
79  case 54 : Name_string = "BMG"; limits.push_back(3); limits.push_back(0); limits.push_back(100); limits.push_back(-100); limits.push_back(6); limits.push_back(7); limits.push_back(-1); break;
80  default : Name_string = "WrongName"; limits.push_back(-100); limits.push_back(-100); limits.push_back(-100); limits.push_back(-100); limits.push_back(-100); limits.push_back(-100);
81  }
82  } else if (Type=="RPC") {
83  switch (Name_int)
84  {
85  case 2 : Name_string = "BML"; limits.push_back(7); limits.push_back(0); limits.push_back(1); limits.push_back(8); limits.push_back(-100); limits.push_back(-100); limits.push_back(1); break;
86  case 3 : Name_string = "BMS"; limits.push_back(6); limits.push_back(0); limits.push_back(1); limits.push_back(5); limits.push_back(8); limits.push_back(-100); limits.push_back(-1); break;
87  case 4 : Name_string = "BOL"; limits.push_back(6); limits.push_back(0); limits.push_back(1); limits.push_back(8); limits.push_back(-100); limits.push_back(-100); limits.push_back(1); break;
88  case 5 : Name_string = "BOS"; limits.push_back(6); limits.push_back(0); limits.push_back(1); limits.push_back(5); limits.push_back(8); limits.push_back(-100); limits.push_back(-1); break;
89  case 8 : Name_string = "BMF"; limits.push_back(3); limits.push_back(0); limits.push_back(100); limits.push_back(-100); limits.push_back(6); limits.push_back(7); limits.push_back(-1); break;
90  case 9 : Name_string = "BOF"; limits.push_back(4); limits.push_back(0); limits.push_back(100); limits.push_back(-100); limits.push_back(6); limits.push_back(7); limits.push_back(-1); break;
91  case 10 : Name_string = "BOG"; limits.push_back(4); limits.push_back(-100); limits.push_back(100); limits.push_back(-100); limits.push_back(6); limits.push_back(7); limits.push_back(-1); break;
92  default : Name_string = "WrongName"; limits.push_back(-100); limits.push_back(-100); limits.push_back(-100); limits.push_back(-100); limits.push_back(-100); limits.push_back(-100);
93  }
94  } else {Name_string = "WrongName";}
95 
96  //Convert ATHENA int eta to correct side and eta Hardware index
97  if (Eta_int>=-limits[0] && Eta_int<=limits[0] && Eta_int!=limits[1]){
98  if(Eta_int>0){
99  if (Name_int==9){//exception of the BOG,BOF alternating eta
100  Eta_int=(2*Eta_int)-1;
101  }
102  if (Name_int==10){//exception of the BOG,BOF alternating eta
103  Eta_int=2*Eta_int;
104  }
105  if (Name_int==54){//exception of the BMG
106  Eta_int=2*Eta_int;
107  }
108  std::stringstream eta_inttostring;
109  std::string eta_str;
110  eta_inttostring << Eta_int;
111  eta_inttostring >> eta_str;
112  Eta_string += eta_str;
113  Eta_string += "A";
114  }
115 
116  if (Eta_int<0){
117  if (Name_int==9){//exception of the BOG,BOF alternating eta
118  Eta_int=(2*Eta_int)+1;
119  }
120  if (Name_int==10){//exception of the BOG,BOF alternating eta
121  Eta_int=2*Eta_int;
122  }
123  if (Name_int==54){//exception of the BMG alternating eta
124  Eta_int=2*Eta_int;
125  }
126  std::stringstream eta_inttostring;
127  std::string eta_str;
128  eta_inttostring << std::abs(Eta_int);
129  eta_inttostring >> eta_str;
130  Eta_string += eta_str;
131  Eta_string += "C";
132 
133  }
134 
135  if (Eta_int==0) {
136  std::stringstream eta_inttostring;
137  std::string eta_str;
138  eta_inttostring << Eta_int;
139  eta_inttostring >> eta_str;
140  Eta_string += eta_str;
141  Eta_string += "B";
142  }
143  } else {Eta_string="WrongEta";}
144 
145  //Convert ATHENA int phi to correct phi Hardware index (taking into account Long/Short case)
146  // check correct phi_index
147  if ((Phi_int>=limits[2] && Phi_int<=limits[3]) || Phi_int==limits[4] || Phi_int==limits[5]) {
148  if (Type=="TGC") {
149  std::stringstream phi_inttostring;
150  std::string phi_str;
151  phi_inttostring << Phi_int;
152  phi_inttostring >> phi_str;
153  Phi_string = phi_str ;
154  } else { // for Type ==TGC
155  if (limits[6]==1) {//Long chamber
156  Phi_int = (2*Phi_int)-1;
157  std::stringstream phi_inttostring;
158  std::string phi_str;
159  phi_inttostring << Phi_int;
160  phi_inttostring >> phi_str;
161  if (Phi_int<10) {
162  Phi_string = "0"+phi_str;
163  } else {
164  Phi_string = phi_str;
165  }
166  }
167  if (limits[6]==-1) {//Short chamber
168  Phi_int = 2*Phi_int;
169  std::stringstream phi_inttostring;
170  std::string phi_str;
171  phi_inttostring << Phi_int;
172  phi_inttostring >> phi_str;
173  if (Phi_int<10){
174  Phi_string = "0"+phi_str;
175  } else {Phi_string = phi_str;}
176  }
177  } // end of else ; MDT / RPC
178  } else {
179  Phi_string="WrongPhi";
180  }
181 
182  //Return full Hardware name
183  Name_string += Eta_string;
184  Name_string += Phi_string;
185  limits.clear();
186  return Name_string;
187 }
xAODType
Definition: ObjectType.h:13
python.CaloScaleNoiseConfig.default
default
Definition: CaloScaleNoiseConfig.py:79