291 std::vector< std::vector< double > > aw, bw;
292 std::vector< double > clearRoad;
297 if ( (*clusterPatFinder)->findPatternEta(aw, bw, rpcLayerClusters) ) {
298 for(
unsigned int iClus = 0; iClus < aw[1].size(); iClus++){
300 clusFitResult.
Clear();
308 ATH_MSG_DEBUG(
"==========================================================");
315 clusterFitResults.push_back(clusFitResult);
317 ATH_MSG_DEBUG(
"==========================================================");
320 clusFitResult.
Clear();
322 clusterFitResults.push_back(clusFitResult);
326 std::vector<double> phi_middle, phi_outer;
327 phi_middle.clear(); phi_outer.clear();
328 if ( (*clusterPatFinder)->findPatternPhi(phi_middle, phi_outer, rpcLayerClusters) ){
329 double phi_middle_tot = 0;
330 double phi_outer_tot = 0;
331 size_t npatternPhi = phi_middle.size();
333 for(
double& phi : phi_middle){
334 phi_middle_tot = phi_middle_tot +
phi;
336 for(
double& phi : phi_outer){
337 phi_outer_tot = phi_outer_tot +
phi;
339 double phi_middle_center = phi_middle_tot/npatternPhi;
340 double phi_outer_center = phi_outer_tot/npatternPhi;
341 ATH_MSG_DEBUG(
"center of phi middle/outer = " << phi_middle_center <<
"/" << phi_outer_center);
342 for(
unsigned int iClus_fit = 0; iClus_fit < clusterFitResults.size(); iClus_fit++){
343 clusterFitResults.at(iClus_fit).phi = phi_middle_center;
344 clusterFitResults.at(iClus_fit).phi_middle = phi_middle_center;
345 clusterFitResults.at(iClus_fit).phi_outer = phi_outer_center;
348 for(
unsigned int iClus_fit = 0; iClus_fit < clusterFitResults.size(); iClus_fit++){
349 clusterFitResults.at(iClus_fit).phi = p_roi->
phi();
350 clusterFitResults.at(iClus_fit).phi_middle = p_roi->
phi();
351 clusterFitResults.at(iClus_fit).phi_outer = p_roi->
phi();
355 for(
unsigned int iClus_fit = 0; iClus_fit < clusterFitResults.size(); iClus_fit++){
356 clusterFitResults.at(iClus_fit).phi = p_roi->
phi();
360 if(clusterFitResults.empty()){
362 clusFitResult.
Clear();
364 clusFitResult.
phi = p_roi->
phi();
365 clusterFitResults.push_back(clusFitResult);
368 ATH_MSG_DEBUG(
"stored cluster eta/phi pattern to clusterRoad");
369 for(
unsigned int iClus_fit = 0; iClus_fit < clusterFitResults.size(); iClus_fit++){
375 muonRoad.
phiMiddle = clusterFitResults.at(iClus_fit).phi;
377 muonRoad.
side = (p_roi->
phi()<0.)? 0 : 1;
380 int PhysicsSector = ((p_roi->
getSectorID() + 1)/4 )%8 + 1;
383 if (muonRoad.
LargeSmall == 0 && (PhysicsSector == 6 || PhysicsSector == 8 ))
385 else if (muonRoad.
LargeSmall == 1 && (PhysicsSector == 6 || PhysicsSector == 7 ))
389 for (
int i_station=0; i_station<6; i_station++) {
390 for (
int i_layer=0; i_layer<8; i_layer++) {
391 if(!clusterFitResults.at(iClus_fit).isSuccess) {
392 if (i_station==0) muonRoad.
rWidth[i_station][i_layer] = 500;
393 else if (i_station==1) muonRoad.
rWidth[i_station][i_layer] = 650;
394 else if (i_station==2) muonRoad.
rWidth[i_station][i_layer] = 800;
395 else if (i_station==3) muonRoad.
rWidth[i_station][i_layer] = 500;
396 else if (i_station==4) muonRoad.
rWidth[9][i_layer] = 650;
397 else if (i_station==5) muonRoad.
rWidth[10][i_layer] = 650;
401 if (i_station==0) muonRoad.
rWidth[i_station][i_layer] = 400;
402 else if (i_station==1) muonRoad.
rWidth[i_station][i_layer] = 200;
403 else if (i_station==2) muonRoad.
rWidth[i_station][i_layer] = 400;
404 else if (i_station==3) muonRoad.
rWidth[i_station][i_layer] = 400;
411 int sector_trigger = 99;
412 int sector_overlap = 99;
413 std::vector<Identifier> stationList;
414 std::vector<IdentifierHash> mdtHashList;
423 if(phiMax >
M_PI) phiMax -=
M_PI*2.;
424 if(phiMin <
M_PI*-1) phiMin +=
M_PI*2.;
430 if (iroi)
m_regionSelector->lookup( Gaudi::Hive::currentContext() )->HashIDList(*iroi, mdtHashList);
433 m_regionSelector->lookup( Gaudi::Hive::currentContext() )->HashIDList(fullscan_roi, mdtHashList);
449 if (
name[1]==
'M' &&
name[2]==
'E' )
continue;
450 else if (
name[1]==
'M' &&
name[2]==
'G' )
continue;
453 if(
name[2]==
'S' ||
name[2]==
'F' ||
name[2]==
'G' ) LargeSmall = 1;
455 if(sector_trigger == 99)
456 sector_trigger = sector;
457 else if(sector_trigger != sector)
458 sector_overlap = sector;
461 int MDT_tr = (PhysicsSector - 1)*2 + muonRoad.
LargeSmall;
462 if (MDT_tr == sector_overlap) {
463 sector_overlap = sector_trigger;
464 sector_trigger = MDT_tr;
470 if (clusterFitResults.at(iClus_fit).isSuccess) {
471 for (
int i_sector=0; i_sector<
N_SECTOR; i_sector++) {
472 muonRoad.
aw[0][i_sector] = clusterFitResults.at(iClus_fit).slope_inner;
473 muonRoad.
bw[0][i_sector] = clusterFitResults.at(iClus_fit).offset_inner;
474 muonRoad.
aw[1][i_sector] = clusterFitResults.at(iClus_fit).slope_middle;
475 muonRoad.
bw[1][i_sector] = clusterFitResults.at(iClus_fit).offset_middle;
476 muonRoad.
aw[2][i_sector] = clusterFitResults.at(iClus_fit).slope_outer;
477 muonRoad.
bw[2][i_sector] = clusterFitResults.at(iClus_fit).offset_outer;
478 muonRoad.
aw[3][i_sector] = clusterFitResults.at(iClus_fit).slope_inner;
479 muonRoad.
bw[3][i_sector] = clusterFitResults.at(iClus_fit).offset_inner;
480 muonRoad.
aw[9][i_sector] = clusterFitResults.at(iClus_fit).slope_middle;
481 muonRoad.
bw[9][i_sector] = clusterFitResults.at(iClus_fit).offset_middle;
482 muonRoad.
aw[10][i_sector] = clusterFitResults.at(iClus_fit).slope_middle;
483 muonRoad.
bw[10][i_sector] = clusterFitResults.at(iClus_fit).offset_middle;
486 double roiEtaLow = (roiEtaMinLow + roiEtaMaxLow) * 0.5;
487 double roiEtaHigh = (roiEtaMinHigh + roiEtaMaxHigh) * 0.5;
490 double awLow = (std::abs(roiEtaLow) >
ZERO_LIMIT)?
std::tan(thetaLow)*(std::abs(roiEtaLow)/roiEtaLow): 0.;
491 double awHigh = (std::abs(roiEtaHigh) >
ZERO_LIMIT)?
std::tan(thetaHigh)*(std::abs(roiEtaHigh)/roiEtaHigh): 0.;
493 for (
int i_station=0; i_station<
N_LAYER; i_station++) {
494 for (
int i_sector=0; i_sector<
N_SECTOR; i_sector++) {
495 muonRoad.
aw[i_station][i_sector] = awLow;
496 muonRoad.
bw[i_station][i_sector] = 0;
497 if (i_station==2) muonRoad.
aw[i_station][i_sector] = awHigh;
498 else if (i_station==3) muonRoad.
aw[i_station][i_sector] = awLow;
499 else if (i_station==4) muonRoad.
aw[9][i_sector] = awLow;
500 else if (i_station==5) muonRoad.
aw[10][i_sector] = awLow;
504 clusterRoad.push_back(muonRoad);
506 ATH_MSG_DEBUG(
"finished ClusterRoadDefiner algorithm... leave");
507 return StatusCode::SUCCESS;