15 const std::string&
name,
31 return StatusCode::SUCCESS;
42 const ToolHandle<RpcPatFinder>* rpcPatFinder,
47 double roiEtaMaxHigh)
const
55 if (m_use_rpc && !insideOut) {
56 double aw[3]={0.,0.,0.};
57 double bw[3]={0.,0.,0.};
58 unsigned int rpc_pattern;
59 if ( (*rpcPatFinder)->findPatternEta(aw, bw, rpc_pattern, rpcLayerHits) ) {
77 unsigned int phi_pattern;
78 if ( (*rpcPatFinder)->findPatternPhi(phi_middle, phi_outer, phi_pattern, rpcLayerHits)) {
79 rpcFitResult.
phi = phi_middle;
83 rpcFitResult.
phi = p_roi->
phi();
101 muonRoad.
side = (p_roi->
phi()<0.)? 0 : 1;
104 const int PhysicsSector = ((p_roi->
sectorID() + 1)/4 )%8 + 1;
107 if (muonRoad.
LargeSmall == 0 && (PhysicsSector == 6 || PhysicsSector == 8 ))
109 if (muonRoad.
LargeSmall == 1 && (PhysicsSector == 6 || PhysicsSector == 7 ))
113 for (
int i_station=0; i_station<6; i_station++) {
114 for (
int i_layer=0; i_layer<8; i_layer++) {
117 if (i_station==0) muonRoad.
rWidth[i_station][i_layer] = 500;
118 else if (i_station==1) muonRoad.
rWidth[i_station][i_layer] = 650;
119 else if (i_station==2) muonRoad.
rWidth[i_station][i_layer] = 800;
120 else if (i_station==3) muonRoad.
rWidth[i_station][i_layer] = 500;
121 else if (i_station==4) muonRoad.
rWidth[9][i_layer] = 650;
122 else if (i_station==5) muonRoad.
rWidth[10][i_layer] = 650;
123 else muonRoad.
rWidth[i_station][i_layer] = m_rWidth_RPC_Failed;
125 if (i_station==0) muonRoad.
rWidth[i_station][i_layer] = 250;
126 else if (i_station==1) muonRoad.
rWidth[i_station][i_layer] = 400;
127 else if (i_station==2) muonRoad.
rWidth[i_station][i_layer] = 600;
128 else if (i_station==3) muonRoad.
rWidth[i_station][i_layer] = 300;
129 else if (i_station==4) muonRoad.
rWidth[9][i_layer] = 400;
130 else if (i_station==5) muonRoad.
rWidth[10][i_layer] = 400;
131 else muonRoad.
rWidth[i_station][i_layer] = 400;
135 if (i_station==0) muonRoad.
rWidth[i_station][i_layer] = 400;
136 else if (i_station==1) muonRoad.
rWidth[i_station][i_layer] = 200;
137 else if (i_station==2) muonRoad.
rWidth[i_station][i_layer] = 400;
138 else if (i_station==3) muonRoad.
rWidth[i_station][i_layer] = 400;
139 else if (i_station==4) muonRoad.
rWidth[9][i_layer] = m_rWidth_RPC_Failed;
140 else if (i_station==5) muonRoad.
rWidth[10][i_layer] = m_rWidth_RPC_Failed;
141 else muonRoad.
rWidth[i_station][i_layer] = m_rWidth_RPC_Failed;
146 int sector_trigger = 99;
147 int sector_overlap = 99;
148 std::vector<Identifier> stationList;
149 std::vector<IdentifierHash> mdtHashList;
152 IdContext context = m_idHelperSvc->mdtIdHelper().module_context();
158 if(phiMax >
M_PI) phiMax -=
M_PI*2.;
159 if(phiMin <
M_PI*-1) phiMin +=
M_PI*2.;
165 if (iroi) m_regionSelector->lookup( Gaudi::Hive::currentContext() )->HashIDList(*iroi, mdtHashList);
168 m_regionSelector->lookup( Gaudi::Hive::currentContext() )->HashIDList(fullscan_roi, mdtHashList);
176 const int convert = m_idHelperSvc->mdtIdHelper().get_id(
hash,
id, &context);
181 const int stationPhi = m_idHelperSvc->mdtIdHelper().stationPhi(
id);
182 std::string
name = m_idHelperSvc->mdtIdHelper().stationNameString(m_idHelperSvc->mdtIdHelper().stationName(
id));
184 if (
name[1]==
'M' &&
name[2]==
'E' )
continue;
185 if (
name[1]==
'M' &&
name[2]==
'G' )
continue;
188 if(
name[2]==
'S' ||
name[2]==
'F' ||
name[2]==
'G' ) LargeSmall = 1;
189 const int sector = (stationPhi-1)*2 + LargeSmall;
190 if(sector_trigger == 99)
191 sector_trigger = sector;
192 else if(sector_trigger != sector)
193 sector_overlap = sector;
196 const int MDT_tr = (PhysicsSector - 1)*2 + muonRoad.
LargeSmall;
197 if (MDT_tr == sector_overlap) {
198 sector_overlap = sector_trigger;
199 sector_trigger = MDT_tr;
206 for (
int i_sector=0; i_sector<
N_SECTOR; i_sector++) {
222 const double roiEtaLow = (roiEtaMinLow + roiEtaMaxLow) * 0.5;
223 const double roiEtaHigh = (roiEtaMinHigh + roiEtaMaxHigh) * 0.5;
226 const double awLow = (std::abs(roiEtaLow) >
ZERO_LIMIT)?
std::tan(thetaLow)*(std::abs(roiEtaLow)/roiEtaLow): 0.;
227 const double awHigh = (std::abs(roiEtaHigh) >
ZERO_LIMIT)?
std::tan(thetaHigh)*(std::abs(roiEtaHigh)/roiEtaHigh): 0.;
229 for (
int i_station=0; i_station<
N_LAYER; i_station++) {
230 for (
int i_sector=0; i_sector<
N_SECTOR; i_sector++) {
231 muonRoad.
aw[i_station][i_sector] = awLow;
232 muonRoad.
bw[i_station][i_sector] = 0;
233 if (i_station==2) muonRoad.
aw[i_station][i_sector] = awHigh;
234 if (i_station==3) muonRoad.
aw[i_station][i_sector] = awLow;
235 if (i_station==4) muonRoad.
aw[9][i_sector] = awLow;
236 if (i_station==5) muonRoad.
aw[10][i_sector] = awLow;
242 for (
int i_sector=0; i_sector<
N_SECTOR; i_sector++) {
244 muonRoad.
aw[0][i_sector] = muonRoad.
aw_ftf[0][0];
245 muonRoad.
bw[0][i_sector] = muonRoad.
bw_ftf[0][0];
246 muonRoad.
aw[1][i_sector] = muonRoad.
aw_ftf[1][0];
247 muonRoad.
bw[1][i_sector] = muonRoad.
bw_ftf[1][0];
248 muonRoad.
aw[2][i_sector] = muonRoad.
aw_ftf[2][0];
249 muonRoad.
bw[2][i_sector] = muonRoad.
bw_ftf[2][0];
250 muonRoad.
aw[3][i_sector] = muonRoad.
aw_ftf[3][0];
251 muonRoad.
bw[3][i_sector] = muonRoad.
bw_ftf[3][0];
252 muonRoad.
aw[9][i_sector] = muonRoad.
aw_ftf[9][0];
253 muonRoad.
bw[9][i_sector] = muonRoad.
bw_ftf[9][0];
254 muonRoad.
aw[10][i_sector] = muonRoad.
aw_ftf[10][0];
255 muonRoad.
bw[10][i_sector] = muonRoad.
bw_ftf[10][0];
260 return StatusCode::SUCCESS;
267 const bool insideOut,
271 const ToolHandle<RpcPatFinder>* rpcPatFinder,
275 double roiEtaMinHigh,
276 double roiEtaMaxHigh)
const
284 if (m_use_rpc && !insideOut) {
285 double aw[3]={0.,0.,0.};
286 double bw[3]={0.,0.,0.};
287 unsigned int rpc_pattern;
288 if ( (*rpcPatFinder)->findPatternEta(aw, bw, rpc_pattern, rpcLayerHits) ) {
297 for(
int i=0;
i<3;
i++){
306 unsigned int phi_pattern;
307 if ( (*rpcPatFinder)->findPatternPhi(phi_middle, phi_outer, phi_pattern, rpcLayerHits)) {
308 rpcFitResult.
phi = phi_middle;
312 rpcFitResult.
phi = p_roi->
phi();
330 muonRoad.
side = (p_roi->
phi()<0.)? 0 : 1;
333 const int PhysicsSector = ((p_roi->
getSectorID() + 1)/4 )%8 + 1;
336 if (muonRoad.
LargeSmall == 0 && (PhysicsSector == 6 || PhysicsSector == 8 ))
338 if (muonRoad.
LargeSmall == 1 && (PhysicsSector == 6 || PhysicsSector == 7 ))
342 for (
int i_station=0; i_station<6; i_station++) {
343 for (
int i_layer=0; i_layer<8; i_layer++) {
346 if (i_station==0) muonRoad.
rWidth[i_station][i_layer] = 500;
347 else if (i_station==1) muonRoad.
rWidth[i_station][i_layer] = 650;
348 else if (i_station==2) muonRoad.
rWidth[i_station][i_layer] = 800;
349 else if (i_station==3) muonRoad.
rWidth[i_station][i_layer] = 500;
350 else if (i_station==4) muonRoad.
rWidth[9][i_layer] = 650;
351 else if (i_station==5) muonRoad.
rWidth[10][i_layer] = 650;
352 else muonRoad.
rWidth[i_station][i_layer] = m_rWidth_RPC_Failed;
354 if (i_station==0) muonRoad.
rWidth[i_station][i_layer] = 250;
355 else if (i_station==1) muonRoad.
rWidth[i_station][i_layer] = 400;
356 else if (i_station==2) muonRoad.
rWidth[i_station][i_layer] = 600;
357 else if (i_station==3) muonRoad.
rWidth[i_station][i_layer] = 300;
358 else if (i_station==4) muonRoad.
rWidth[9][i_layer] = 400;
359 else if (i_station==5) muonRoad.
rWidth[10][i_layer] = 400;
360 else muonRoad.
rWidth[i_station][i_layer] = 400;
364 if (i_station==0) muonRoad.
rWidth[i_station][i_layer] = 400;
365 else if (i_station==1) muonRoad.
rWidth[i_station][i_layer] = 200;
366 else if (i_station==2) muonRoad.
rWidth[i_station][i_layer] = 400;
367 else if (i_station==3) muonRoad.
rWidth[i_station][i_layer] = 400;
368 else if (i_station==4) muonRoad.
rWidth[9][i_layer] = m_rWidth_RPC_Failed;
369 else if (i_station==5) muonRoad.
rWidth[10][i_layer] = m_rWidth_RPC_Failed;
370 else muonRoad.
rWidth[i_station][i_layer] = m_rWidth_RPC_Failed;
375 int sector_trigger = 99;
376 int sector_overlap = 99;
377 std::vector<Identifier> stationList;
378 std::vector<IdentifierHash> mdtHashList;
381 IdContext context = m_idHelperSvc->mdtIdHelper().module_context();
387 if(phiMax >
M_PI) phiMax -=
M_PI*2.;
388 if(phiMin <
M_PI*-1) phiMin +=
M_PI*2.;
394 if (iroi) m_regionSelector->lookup( Gaudi::Hive::currentContext() )->HashIDList(*iroi, mdtHashList);
397 m_regionSelector->lookup( Gaudi::Hive::currentContext() )->HashIDList(fullscan_roi, mdtHashList);
405 const int convert = m_idHelperSvc->mdtIdHelper().get_id(
hash,
id, &context);
410 const int stationPhi = m_idHelperSvc->mdtIdHelper().stationPhi(
id);
411 std::string
name = m_idHelperSvc->mdtIdHelper().stationNameString(m_idHelperSvc->mdtIdHelper().stationName(
id));
413 if (
name[1]==
'M' &&
name[2]==
'E' )
continue;
414 if (
name[1]==
'M' &&
name[2]==
'G' )
continue;
417 if(
name[2]==
'S' ||
name[2]==
'F' ||
name[2]==
'G' ) LargeSmall = 1;
418 const int sector = (stationPhi-1)*2 + LargeSmall;
419 if(sector_trigger == 99)
420 sector_trigger = sector;
421 else if(sector_trigger != sector)
422 sector_overlap = sector;
425 const int MDT_tr = (PhysicsSector - 1)*2 + muonRoad.
LargeSmall;
426 if (MDT_tr == sector_overlap) {
427 sector_overlap = sector_trigger;
428 sector_trigger = MDT_tr;
435 for (
int i_sector=0; i_sector<
N_SECTOR; i_sector++) {
451 const double roiEtaLow = (roiEtaMinLow + roiEtaMaxLow) * 0.5;
452 const double roiEtaHigh = (roiEtaMinHigh + roiEtaMaxHigh) * 0.5;
455 const double awLow = (std::abs(roiEtaLow) >
ZERO_LIMIT)?
std::tan(thetaLow)*(std::abs(roiEtaLow)/roiEtaLow): 0.;
456 const double awHigh = (std::abs(roiEtaHigh) >
ZERO_LIMIT)?
std::tan(thetaHigh)*(std::abs(roiEtaHigh)/roiEtaHigh): 0.;
458 for (
int i_station=0; i_station<
N_LAYER; i_station++) {
459 for (
int i_sector=0; i_sector<
N_SECTOR; i_sector++) {
460 muonRoad.
aw[i_station][i_sector] = awLow;
461 muonRoad.
bw[i_station][i_sector] = 0;
462 if (i_station==2) muonRoad.
aw[i_station][i_sector] = awHigh;
463 if (i_station==3) muonRoad.
aw[i_station][i_sector] = awLow;
464 if (i_station==4) muonRoad.
aw[9][i_sector] = awLow;
465 if (i_station==5) muonRoad.
aw[10][i_sector] = awLow;
471 for (
int i_sector=0; i_sector<
N_SECTOR; i_sector++) {
473 muonRoad.
aw[0][i_sector] = muonRoad.
aw_ftf[0][0];
474 muonRoad.
bw[0][i_sector] = muonRoad.
bw_ftf[0][0];
475 muonRoad.
aw[1][i_sector] = muonRoad.
aw_ftf[1][0];
476 muonRoad.
bw[1][i_sector] = muonRoad.
bw_ftf[1][0];
477 muonRoad.
aw[2][i_sector] = muonRoad.
aw_ftf[2][0];
478 muonRoad.
bw[2][i_sector] = muonRoad.
bw_ftf[2][0];
479 muonRoad.
aw[3][i_sector] = muonRoad.
aw_ftf[3][0];
480 muonRoad.
bw[3][i_sector] = muonRoad.
bw_ftf[3][0];
481 muonRoad.
aw[9][i_sector] = muonRoad.
aw_ftf[9][0];
482 muonRoad.
bw[9][i_sector] = muonRoad.
bw_ftf[9][0];
483 muonRoad.
aw[10][i_sector] = muonRoad.
aw_ftf[10][0];
484 muonRoad.
bw[10][i_sector] = muonRoad.
bw_ftf[10][0];
489 return StatusCode::SUCCESS;