18 PixelROCName::PixelROCName():
30 int blade,
int panel,
int plaquet,
int roc){
32 std::string mthn =
"[PixelROCName::setIdFPix()]\t\t\t\t " ;
43 if (np==
'p')
id_=(
id_|0x40000000);
45 if (LR==
'I')
id_=(
id_|0x20000000);
53 id_=(
id_|((plaquet-1)<<4));
63 int layer,
int ladder,
char HF,
78 if (np==
'p')
id_=(
id_|0x40000000);
80 if (LR==
'I')
id_=(
id_|0x20000000);
84 if (HF==
'F')
id_=(
id_|0x00000800);
101 static std::string mthn =
"[PixelROCName::check()]\t\t\t\t " ;
105 cout << __LINE__ <<
"]\t" << mthn <<
"ERROR tried to parse string:'"<<
name;
106 cout <<
"' as a ROC name. Will terminate."<<endl;
125 check(name[0]==
'F'||name[0]==
'B',name);
128 check(name[0]==
'F',name);
129 check(name[1]==
'P',name);
130 check(name[2]==
'i',name);
131 check(name[3]==
'x',name);
132 check(name[4]==
'_',name);
133 check(name[5]==
'B',name);
134 check((name[6]==
'm')||(name[6]==
'p'),name);
136 check((name[7]==
'I')||(name[7]==
'O'),name);
138 check(name[8]==
'_',name);
139 check(name[9]==
'D',name);
142 int disk=atoi(digit);
143 check(name[11]==
'_',name);
144 check(name[12]==
'B',name);
145 check(name[13]==
'L',name);
146 check(name[14]==
'D',name);
147 check(std::isdigit(name[15]),name);
151 if (std::isdigit(name[16])){
153 bld=10*bld+atoi(digit);
156 check(name[16+offset]==
'_',name);
157 check(name[17+offset]==
'P',name);
158 check(name[18+offset]==
'N',name);
159 check(name[19+offset]==
'L',name);
160 check(std::isdigit(name[20+offset]),name);
163 check(name[21+offset]==
'_',name);
164 check(name[22+offset]==
'P',name);
165 check(name[23+offset]==
'L',name);
166 check(name[24+offset]==
'Q',name);
167 check(std::isdigit(name[25+offset]),name);
170 check(name[26+offset]==
'_',name);
171 check(name[27+offset]==
'R',name);
172 check(name[28+offset]==
'O',name);
173 check(name[29+offset]==
'C',name);
174 check(std::isdigit(name[30+offset]),name);
177 if (name.size()==32+
offset){
179 roc=roc*10+atoi(digit);
185 check(name[0]==
'B',name);
186 check(name[1]==
'P',name);
187 check(name[2]==
'i',name);
188 check(name[3]==
'x',name);
189 check(name[4]==
'_',name);
190 check(name[5]==
'B',name);
191 check((name[6]==
'm')||(name[6]==
'p'),name);
193 check((name[7]==
'I')||(name[7]==
'O'),name);
195 check(name[8]==
'_',name);
196 check(name[9]==
'S',name);
197 check(name[10]==
'E',name);
198 check(name[11]==
'C',name);
202 check(name[13]==
'_',name);
203 check(name[14]==
'L',name);
204 check(name[15]==
'Y',name);
205 check(name[16]==
'R',name);
206 check(std::isdigit(name[17]),name);
208 int layer=atoi(digit);
209 check(name[18]==
'_',name);
210 check(name[19]==
'L',name);
211 check(name[20]==
'D',name);
212 check(name[21]==
'R',name);
213 check(std::isdigit(name[22]),name);
217 if (std::isdigit(name[23])){
220 ladder=10*ladder+atoi(digit);
222 check(name[23+offset]==
'H'||name[23+offset]==
'F',name);
224 check(name[24+offset]==
'_',name);
225 check(name[25+offset]==
'M',name);
226 check(name[26+offset]==
'O',name);
227 check(name[27+offset]==
'D',name);
228 check(std::isdigit(name[28+offset]),name);
231 check(name[29+offset]==
'_',name);
232 check(name[30+offset]==
'R',name);
233 check(name[31+offset]==
'O',name);
234 check(name[32+offset]==
'C',name);
235 check(std::isdigit(name[33+offset]),name);
238 if (name.size()==35+
offset){
240 roc=roc*10+atoi(digit);
243 setIdBPix(np,LR,sec,layer,ladder,HF,module,roc);
263 std::ostringstream s1;
void setIdFPix(char np, char LR, int disk, int blade, int panel, int plaquet, int roc)
const PixelROCName & operator=(const PixelROCName &aROC)
void setIdBPix(char np, char LR, int sec, int layer, int ladder, char HF, int module, int roc)
std::string rocname() const
std::ostream & operator<<(std::ostream &s, const PixelCalibConfiguration &calib)
bool check(const std::string &)
void check(bool check, const std::string &name)
void parsename(std::string name)
std::vector< std::vector< double > > tmp
This class stores the name and related hardware mappings for a ROC.