18 const std::string&
name,
31 return StatusCode::SUCCESS;
55 for(
int i_station=0; i_station<6; i_station++) {
63 for(
int i_sector=0; i_sector<2; i_sector++) {
64 int sector = sectors[i_sector];
67 if( sector==99 )
continue;
88 for(
unsigned int sta_iter=0; sta_iter< muonRoad.
stationList.size(); sta_iter++){
91 int stationPhi = m_idHelperSvc->mdtIdHelper().stationPhi(
id);
92 std::string
name = m_idHelperSvc->mdtIdHelper().stationNameString(m_idHelperSvc->mdtIdHelper().stationName(
id));
93 int chamber_this = 99;
96 find_station_sector(
name, stationPhi, isEndcap, chamber_this, sector_this);
98 if(chamber_this ==
chamber && sector_this == sector ){
100 ty1 = m_idHelperSvc->mdtIdHelper().stationNameIndex(
name)+1;
102 ty2 = m_idHelperSvc->mdtIdHelper().stationNameIndex(
name)+1;
111 tmp_rMin = (trans*OrigOfMdtInAmdbFrame).
perp();
112 tmp_rMax = tmp_rMin+muonStation->
Rsize();
114 if(rMin==0 || tmp_rMin < rMin)rMin = tmp_rMin;
115 if(rMax==0 || tmp_rMax > rMax)rMax = tmp_rMax;
116 if ( chamber_this == endcap_inner ){
117 tmp_zMin = (trans*OrigOfMdtInAmdbFrame).
z();
118 if(tmp_zMin < 0)
sign = -1;
119 else if(tmp_zMin > 0)
sign = 1;
120 tmp_zMax = tmp_zMin +
sign*muonStation->
Zsize();
121 if(zMin==0 || tmp_zMin < zMin)zMin = tmp_zMin;
122 if(zMax==0 || tmp_zMax > zMax)zMax = tmp_zMax;
128 if (
chamber == endcap_inner ){
136 find_barrel_road_dim(max_road,
143 ATH_MSG_DEBUG(
"...zMin/zMax/ty1/ty2=" << zMin <<
"/" << zMax <<
"/" << types[0] <<
"/" << types[1]);
146 find_eta_min_max(zMin, rMin, zMax, rMax,
etaMin,
etaMax);
148 find_phi_min_max(muonRoad.
phiRoI, phiMin, phiMax);
160 for(
int i_type=0; i_type<2; i_type++) {
161 int type = types[i_type];
162 if(
type == -1 )
continue;
168 if (m_use_rpc && rpcFitResult.
isSuccess) {
170 for (
int i=0;
i<6;
i++){
171 for (
int j=0; j<2; j++){
172 if (
i==4) muonRoad.
phi[9][j] = rpcFitResult.
phi;
173 else if (
i==5) muonRoad.
phi[10][j] = rpcFitResult.
phi;
174 else muonRoad.
phi[
i][j] = rpcFitResult.
phi;
179 for (
int i=0;
i<6;
i++){
180 for (
int j=0; j<2; j++){
186 if (
i==4) muonRoad.
phi[9][j] = p_roids->
phi();
187 else if (
i==5) muonRoad.
phi[10][j] = p_roids->
phi();
188 else muonRoad.
phi[
i][j] = p_roids->
phi();
193 return StatusCode::SUCCESS;
218 for(
int i_station=0; i_station<7; i_station++) {
227 for(
int i_sector=0; i_sector<2; i_sector++) {
228 int sector = sectors[i_sector];
230 if( sector==99 )
continue;
253 for(
unsigned int sta_iter=0; sta_iter<muonRoad.
stationList.size(); sta_iter++){
255 int stationPhi = m_idHelperSvc->mdtIdHelper().stationPhi(
id);
256 std::string
name = m_idHelperSvc->mdtIdHelper().stationNameString(m_idHelperSvc->mdtIdHelper().stationName(
id));
257 int chamber_this = 99;
258 int sector_this = 99;
260 find_station_sector(
name, stationPhi, isEndcap, chamber_this, sector_this);
261 ATH_MSG_DEBUG(
"name/stationPhi/isEndcap/chamber_this/sector_this=" <<
262 name <<
"/" << stationPhi <<
"/" << isEndcap <<
"/" << chamber_this <<
"/" << sector_this);
264 if(chamber_this ==
chamber && sector_this == sector){
266 ty1 = m_idHelperSvc->mdtIdHelper().stationNameIndex(
name)+1;
268 ty2 = m_idHelperSvc->mdtIdHelper().stationNameIndex(
name)+1;
279 tmp_zMin = (trans*OrigOfMdtInAmdbFrame).
z();
280 if(tmp_zMin < 0)
sign = -1;
281 else if(tmp_zMin > 0)
sign = 1;
282 tmp_zMax = tmp_zMin +
sign*muonStation->
Zsize();
284 if(sta_zMin==0 || tmp_zMin<sta_zMin) sta_zMin = tmp_zMin;
285 if(sta_zMin==0 || tmp_zMax<sta_zMin) sta_zMin = tmp_zMax;
286 if(sta_zMax==0 || tmp_zMax>sta_zMax) sta_zMax = tmp_zMax;
287 if(sta_zMax==0 || tmp_zMin>sta_zMax) sta_zMax = tmp_zMin;
289 if (chamber_this==barrel_inner){
290 tmp_rMin = (trans*OrigOfMdtInAmdbFrame).
perp()/
scale;
291 tmp_rMax = tmp_rMin+muonStation->
Rsize()/
scale;
292 if(rMin==0 || tmp_rMin < rMin)rMin = tmp_rMin;
293 if(rMax==0 || tmp_rMax > rMax)rMax = tmp_rMax;
296 if (chamber_this==bee){
297 tmp_rMin = (trans*OrigOfMdtInAmdbFrame).
perp()/
scale;
298 tmp_rMax = tmp_rMin+muonStation->
Rsize()/
scale;
299 if(rMin==0 || tmp_rMin < rMin)rMin = tmp_rMin;
300 if(rMax==0 || tmp_rMax > rMax)rMax = tmp_rMax;
310 zMin = tgcFitResult.
tgcMid1[3];
311 zMax = tgcFitResult.
tgcMid2[3];
313 zMin = tgcFitResult.
tgcMid2[3];
314 zMax = tgcFitResult.
tgcMid1[3];
324 float max_road = 50 ;
325 find_barrel_road_dim(max_road,
344 ATH_MSG_DEBUG(
"...zMin/zMax/ty1/ty2=" << zMin <<
"/" << zMax <<
"/" << types[0] <<
"/" << types[1]);
347 find_eta_min_max(zMin, rMin, zMax, rMax,
etaMin,
etaMax);
349 find_phi_min_max(muonRoad.
phiRoI, phiMin, phiMax);
361 for(
int i_type=0; i_type<2; i_type++) {
362 int type = types[i_type];
363 if(
type == -1 )
continue;
369 StatusCode sc = computePhi(p_roids, tgcFitResult, mdtRegion, muonRoad);
370 if (
sc.isFailure()) {
375 return StatusCode::SUCCESS;
389 if(
name[2]==
'S' ||
name[2]==
'F' ||
name[2]==
'G') largeSmall = 1;
390 if (
name[1]==
'E' &&
name[2]==
'E') largeSmall=1;
391 sector = (phi-1)*2 + largeSmall;
424 phiMin = phiMiddle - 0.1;
425 phiMax = phiMiddle + 0.1;
426 if ( phiMin < -1.*
M_PI ) phiMin += 2.*
M_PI;
427 if ( phiMax > 1.*
M_PI ) phiMax -= 2.*
M_PI;
437 const bool doEmulateMuFast =
false;
442 if(rMin > 0 && rMax > 0)
447 theta = (std::abs(zMin)>0.1)?
std::atan(rMin/std::abs(zMin)):
M_PI/2.;
450 theta = (std::abs(zMax)>0.1)?
std::atan(rMin/std::abs(zMax)):
M_PI/2.;
452 if(doEmulateMuFast) eta[1] = eta[0];
454 theta = (std::abs(zMax)>0.1)?
std::atan(rMax/std::abs(zMax)):
M_PI/2.;
457 theta = (std::abs(zMin)>0.1)?
std::atan(rMax/std::abs(zMin)):
M_PI/2.;
459 if(doEmulateMuFast) eta[3] = eta[2];
463 for(
int i=1;
i<4;
i++) {
480 float rMin,
float rMax,
float *zMin,
float *zMax)
const
496 dz = max_road*std::sqrt(1.+iaq);
497 z = (ia)? (rMin-bw)*ia : bw;
500 z = (ia)? (rMax-bw)*ia : bw;
516 float zMax,
float *rMin,
float *rMax)
const
524 if(zMin>=99999. && zMax<=-99999.)
543 if(*rMin<0.) *rMin = 0.;
544 if(*rMax<0.) *rMax = 0.;
554 const double PHI_BOUNDARY = 0.2;
558 for (iHit = 0; iHit < tgcHits.size(); iHit++)
571 double phi = hit.
phi;
572 if( phi < 0 && ( (
M_PI+phi)<PHI_BOUNDARY) ) phi +=
M_PI*2;
573 if ( hit.
sta < 3 ) { m_tgcStripMidPoints.push_back(
TgcFit::Point(iHit + 1, hit.
sta, hit.
z, phi,
w)); }
574 else if ( hit.
sta ==3 ) { m_tgcStripInnPoints.push_back(
TgcFit::Point(iHit + 1, hit.
sta, hit.
z, phi,
w)); }
579 else if ( hit.
sta ==3 ) { m_tgcWireInnPoints.push_back(
TgcFit::Point(iHit + 1, hit.
sta, hit.
z, hit.
r,
w)); }
583 return StatusCode::SUCCESS;
599 for(
int i_station=0; i_station<3; i_station++) {
604 for(
int i_sector=0; i_sector<2; i_sector++) {
617 double MiddleR = std::abs(mdtRegion.
rMin[barrel_middle][i_sector] + mdtRegion.
rMax[barrel_middle][i_sector])/2.;
618 double MiddleZ = MiddleR*muonRoad.
aw[barrel_middle][i_sector] + muonRoad.
bw[barrel_middle][i_sector];
620 double mm = (muonRoad.
aw[barrel_outer][i_sector]!=0)? 1./muonRoad.
aw[barrel_outer][i_sector] : 0.;
621 double OuterR = std::abs(mdtRegion.
rMin[barrel_outer][i_sector]+mdtRegion.
rMax[barrel_outer][i_sector])/2.;
622 double OuterZ = (
mm)? (OuterR-muonRoad.
bw[barrel_outer][i_sector])/
mm : muonRoad.
bw[barrel_outer][i_sector];
623 double DzOuter = std::abs(OuterZ-MiddleZ);
624 dz = std::sqrt((OuterR-MiddleR)*(OuterR-MiddleR) + DzOuter*DzOuter);
625 dz = (OuterR-MiddleR);
627 }
else if (
chamber==barrel_inner) {
632 double mm = (muonRoad.
aw[barrel_inner][i_sector]!=0)? 1./muonRoad.
aw[barrel_inner][i_sector] : 0.;
633 double InnerR = std::abs(mdtRegion.
rMin[barrel_inner][i_sector]+mdtRegion.
rMax[barrel_inner][i_sector])/2.;
634 double InnerZ = (
mm)? (InnerR-muonRoad.
bw[barrel_inner][i_sector])/
mm : muonRoad.
bw[barrel_inner][i_sector];
635 double DzInner = std::abs(InnerZ-MiddleZ);
636 dz = -std::sqrt((InnerR-MiddleR)*(InnerR-MiddleR) + DzInner*DzInner);
637 dz = - std::abs(InnerR-MiddleR);
655 return StatusCode::SUCCESS;
671 for(
int i_station=0; i_station<5; i_station++) {
678 for(
int i_sector=0; i_sector<2; i_sector++) {
691 double MiddleZ = std::abs(mdtRegion.
zMin[endcap_middle][i_sector] + mdtRegion.
zMax[endcap_middle][i_sector])/2.;
692 double MiddleR = MiddleZ*muonRoad.
aw[endcap_middle][i_sector] + muonRoad.
bw[endcap_middle][i_sector];
694 double OuterZ = std::abs(mdtRegion.
zMin[endcap_outer][i_sector] + mdtRegion.
zMax[endcap_outer][i_sector])/2.;
695 double OuterR = OuterZ*muonRoad.
aw[endcap_outer][i_sector] + muonRoad.
bw[endcap_outer][i_sector];
696 double DrOuter = std::abs(OuterR-MiddleR);
697 dz = std::sqrt((OuterZ-MiddleZ)*(OuterZ-MiddleZ) + DrOuter*DrOuter);
698 dz = (OuterZ-MiddleZ);
705 if(tgcFitResult.
tgcInn[2] != 0.) {
709 double InnerZ = std::abs(mdtRegion.
zMin[endcap_inner][i_sector] + mdtRegion.
zMax[endcap_inner][i_sector])/2.;
710 double InnerR = InnerZ*muonRoad.
aw[endcap_inner][i_sector] + muonRoad.
bw[endcap_inner][i_sector];
711 double DrInner = std::abs(InnerR-MiddleR);
712 dz = -std::sqrt((InnerZ-MiddleZ)*(InnerZ-MiddleZ) + DrInner*DrInner);
713 dz = -std::abs(InnerZ-MiddleZ);
726 return StatusCode::SUCCESS;