42 const int MAX_STATION = 6;
43 const double PHI_RANGE = 12./(
M_PI/8.);
47 float MiddleSlope = 0;
48 float MiddleIntercept = 0;
69 for (
int i_station=0; i_station<MAX_STATION; i_station++) {
80 if ( superPoint->
Npoint > 2 && superPoint->
R > 0.) {
82 InnerSlope = superPoint->
Alin;
83 InnerR = superPoint->
R;
84 InnerZ = superPoint->
Z;
86 MiddleSlope = superPoint->
Alin;
87 MiddleIntercept = superPoint->
R - MiddleSlope*superPoint->
Z;
88 MiddleR = superPoint->
R;
89 MiddleZ = superPoint->
Z;
91 OuterR = superPoint->
R;
92 OuterZ = superPoint->
Z;
101 CSCR = superPoint->
R;
102 CSCZ = superPoint->
Z;
104 phim = superPoint->
Phim;
111 double phi1 = tgcFitResult.
tgcMid1[1];
112 double phi2 = tgcFitResult.
tgcMid2[1];
116 }
else if( phi1*phi2 < 0 && std::abs(phi1)>(
M_PI/2.) ) {
117 double tmp1 = (phi1>0)? phi1 -
M_PI : phi1 +
M_PI;
118 double tmp2 = (phi2>0)? phi2 -
M_PI : phi2 +
M_PI;
119 double tmp = (tmp1+tmp2)/2.;
122 phi = (phi2+phi1)/2.;
134 double etaInner = 0.;
135 double etaMiddle = 0.;
137 double theta = std::atan(MiddleR/std::abs(MiddleZ));
138 etaMiddle = -std::log(std::tan(
theta/2.))*MiddleZ/std::abs(MiddleZ);
142 double theta = std::atan(InnerR/std::abs(InnerZ));
143 etaInner = -std::log(std::tan(
theta/2.))*InnerZ/std::abs(InnerZ);
146 if ( !
isZero(MiddleZ) ) trackPattern.
etaMap = etaMiddle;
147 else if ( !
isZero(InnerZ) ) trackPattern.
etaMap = etaInner;
150 if ( phim >
M_PI+0.1 ) phim = phim - 2*
M_PI;
151 if ( phim >= 0 ) trackPattern.
phiMap = (
phi>=0.)?
phi - phim : phim - std::abs(
phi);
154 int Octant = (int)(tgcFitResult.
tgcMid1[1] / (
M_PI/4.));
155 double PhiInOctant = std::abs(tgcFitResult.
tgcMid1[1] - Octant * (
M_PI/4.));
156 if (PhiInOctant > (
M_PI/8.)) PhiInOctant = (
M_PI/4.) - PhiInOctant;
160 trackPattern.
pt = std::abs(tgcFitResult.
tgcPT);
161 trackPattern.
charge = (tgcFitResult.
tgcPT!=0.0)? tgcFitResult.
tgcPT/std::abs(tgcFitResult.
tgcPT) : +1;
163 trackPattern.
phiBin =
static_cast<int>(PhiInOctant * PHI_RANGE);
164 trackPattern.
etaBin =
static_cast<int>((std::abs(tgcFitResult.
tgcMid1[0])-1.)/0.05);
167 trackPattern.
phiBinEE =
static_cast<int> (phiEE*96/
M_PI);
175 if ( phim >
M_PI+0.1 ) phim = phim - 2*
M_PI;
176 if ( phim >= 0 ) trackPattern.
phiMap = (
phi>=0.)?
phi - phim : phim - std::abs(
phi);
179 int Octant = (int)(p_roids->
phi() / (
M_PI/4.));
180 double PhiInOctant = std::abs(p_roids->
phi() - Octant * (
M_PI/4.));
181 if (PhiInOctant > (
M_PI/8.)) PhiInOctant = (
M_PI/4.) - PhiInOctant;
188 trackPattern.
phiBin =
static_cast<int>(PhiInOctant * PHI_RANGE);
189 trackPattern.
etaBin =
static_cast<int>((std::abs(p_roids->
eta())-1.)/0.05);
191 double phiEE = (p_roids->
phi()>0) ? p_roids->
phi() : p_roids->
phi() + 2*
M_PI;
192 trackPattern.
phiBinEE =
static_cast<int> (phiEE*96/
M_PI);
197 double slope = (OuterR-MiddleR)/(OuterZ-MiddleZ);
198 double inter = MiddleR - slope*MiddleZ;
200 trackPattern.
endcapAlpha = (*m_ptEndcapLUT)->alpha(MiddleZ,MiddleR,OuterZ,OuterR);
201 trackPattern.
slope = slope;
204 trackPattern.
endcapBeta = std::abs( std::atan(InnerSlope) - std::atan(slope) );
205 trackPattern.
deltaR = slope * InnerZ + MiddleIntercept - InnerR;
208 slope, MiddleR, MiddleZ,
213 trackPattern.
cscGamma = std::abs( std::atan( (MiddleR-CSCR)/(MiddleZ-CSCZ) ) - std::atan(MiddleSlope) );
216 double slope_modified=(OuterR_modified-MiddleR)/(OuterZ-MiddleZ);
217 trackPattern.
cscGamma = std::abs( std::atan( (MiddleR-CSCR)/(MiddleZ-CSCZ) ) - std::atan(slope_modified) );
218 ATH_MSG_DEBUG(
"OuterR_modified=" << OuterR_modified <<
" slope_modified=" << slope_modified);
222 if( trackPattern.
pt >= 8. || !tgcFitResult.
isSuccess) {
224 double Ze = MiddleZ+(std::abs(MiddleZ)/MiddleZ)*1000.;
225 double Re = MiddleSlope*(Ze) + MiddleIntercept;
227 trackPattern.
endcapAlpha = (*m_ptEndcapLUT)->alpha(MiddleZ,MiddleR,Ze,Re);
228 trackPattern.
slope = MiddleSlope;
229 trackPattern.
intercept = MiddleIntercept;
234 trackPattern.
endcapBeta = std::abs( std::atan(InnerSlope) - std::atan(MiddleSlope) );
235 trackPattern.
deltaR = MiddleSlope*InnerZ + MiddleIntercept - InnerR;
238 MiddleSlope, MiddleR, MiddleZ,
242 trackPattern.
cscGamma = std::abs( std::atan( (MiddleR-CSCR)/(MiddleZ-CSCZ) ) - std::atan(MiddleSlope) );
246 double distance=9999;
247 if (std::abs(EEZ)>10000 && std::abs(EEZ)<10600){
250 distance =
calcDistance(EBIZ, EBIR, EEZ, EER, MiddleZ, MiddleR);
253 if (std::abs(EEZ)>10600 && std::abs(EEZ)<12000){
256 distance =
calcDistance(InnerZ, InnerR, EEZ, EER, MiddleZ, MiddleR);
261 ATH_MSG_DEBUG(
"... alpha/beta/endcapRadius/cscGamma/charge/s_address="
265 return StatusCode::SUCCESS;