657 |
|
|
658 |
TrkParams::Set(path,1); |
TrkParams::Set(path,1); |
659 |
TrkParams::Load(1); |
TrkParams::Load(1); |
660 |
|
if( !TrkParams::IsLoaded(1) ){ |
661 |
|
cout << "void TrkTrack::LoadField(TString path) --- ERROR --- m.field not loaded"<<endl; |
662 |
|
} |
663 |
|
|
664 |
}; |
}; |
665 |
|
|
724 |
if( XGood(i) && !YGood(i) ){ |
if( XGood(i) && !YGood(i) ){ |
725 |
track.xm_a[i] = xm[i] - omega * segment; |
track.xm_a[i] = xm[i] - omega * segment; |
726 |
track.ym_a[i] = ym[i] + segment; |
track.ym_a[i] = ym[i] + segment; |
727 |
// track.zm_a[i] = zm[i] + beta * segment;//not used yet |
track.zm_a[i] = zm[i] + beta * segment; |
728 |
track.xm_b[i] = xm[i] + omega * segment; |
track.xm_b[i] = xm[i] + omega * segment; |
729 |
track.ym_b[i] = ym[i] - segment; |
track.ym_b[i] = ym[i] - segment; |
730 |
// track.zm_b[i] = zm[i] - beta * segment;//not used yet |
track.zm_b[i] = zm[i] - beta * segment; |
731 |
}else if( !XGood(i) && YGood(i) ){ |
}else if( !XGood(i) && YGood(i) ){ |
732 |
track.xm_a[i] = xm[i] + segment; |
track.xm_a[i] = xm[i] + segment; |
733 |
track.ym_a[i] = ym[i] + omega * segment; |
track.ym_a[i] = ym[i] + omega * segment; |
734 |
// track.zm_a[i] = zm[i] - gamma * segment;//not used yet |
track.zm_a[i] = zm[i] - gamma * segment; |
735 |
track.xm_b[i] = xm[i] - segment; |
track.xm_b[i] = xm[i] - segment; |
736 |
track.ym_b[i] = ym[i] - omega * segment; |
track.ym_b[i] = ym[i] - omega * segment; |
737 |
// track.zm_b[i] = zm[i] + gamma * segment;//not used yet |
track.zm_b[i] = zm[i] + gamma * segment; |
738 |
} |
} |
739 |
} |
} |
740 |
|
|
801 |
|
|
802 |
// cout << "void TrkTrack::GetClusterositions() "<<endl; |
// cout << "void TrkTrack::GetClusterositions() "<<endl; |
803 |
|
|
804 |
TrkParams::Load( ); |
bool OK=true; |
805 |
if( !TrkParams::IsLoaded() )return false; |
TrkParams::Load(1); if( !TrkParams::IsLoaded(1) )cout << "Bool_t TrkTrack::EvaluateClusterPositions() ---ERROR--- m.field not loaded "<<endl; |
806 |
|
TrkParams::Load(4); if( !TrkParams::IsLoaded(4) )cout << "Bool_t TrkTrack::EvaluateClusterPositions() ---ERROR--- p.f.a. par. not loaded "<<endl; |
807 |
|
TrkParams::Load(5); if( !TrkParams::IsLoaded(5) )cout << "Bool_t TrkTrack::EvaluateClusterPositions() ---ERROR--- alignment par. not loaded "<<endl; |
808 |
|
if(!OK)return false; |
809 |
|
|
810 |
for(int ip=0; ip<6; ip++){ |
for(int ip=0; ip<6; ip++){ |
811 |
// cout << ip<<" ** "<<xm[ip]<<" / "<<ym[ip]<<endl;; |
// cout << ip<<" ** "<<xm[ip]<<" / "<<ym[ip]<<endl;; |
812 |
int icx = GetClusterX_ID(ip)+1; |
int icx = GetClusterX_ID(ip)+1; |
858 |
*/ |
*/ |
859 |
void TrkTrack::Fit(double pfixed, int& fail, int iprint, int froml1){ |
void TrkTrack::Fit(double pfixed, int& fail, int iprint, int froml1){ |
860 |
|
|
861 |
float al_ini[] = {0.,0.,0.,0.,0.}; |
bool OK=true; |
862 |
|
TrkParams::Load(1); if( !TrkParams::IsLoaded(1) )cout << "void TrkTrack::Fit(double,int&,int,int) ---ERROR--- m.field not loaded "<<endl; |
863 |
|
if(!OK)return; |
864 |
|
|
865 |
TrkParams::Load( ); |
float al_ini[] = {0.,0.,0.,0.,0.}; |
|
if( !TrkParams::IsLoaded() )return; |
|
866 |
|
|
867 |
extern cMini2track track_; |
extern cMini2track track_; |
868 |
fail = 0; |
fail = 0; |
898 |
|
|
899 |
// ------------------------------------------ |
// ------------------------------------------ |
900 |
// call mini routine |
// call mini routine |
901 |
// TrkParams::Load(1); |
// ------------------------------------------ |
|
// if( !TrkParams::IsLoaded(1) ){ |
|
|
// cout << "void TrkTrack::Fit(double pfixed, int& fail, int iprint) --- ERROR --- m.field not loaded"<<endl; |
|
|
// return; |
|
|
// } |
|
902 |
int istep=0; |
int istep=0; |
903 |
int ifail=0; |
int ifail=0; |
904 |
mini2_(&istep,&ifail, &iprint); |
mini2_(&istep,&ifail, &iprint); |
1198 |
vto = iv+1; |
vto = iv+1; |
1199 |
} |
} |
1200 |
for(int i=pfrom; i<pto; i++) |
for(int i=pfrom; i<pto; i++) |
1201 |
for(int j=0; j<vto; j++) |
for(int j=vfrom; j<vto; j++){ |
1202 |
if(GetDEDX(i,j)>max)max=GetDEDX(i,j); |
if(j==0 && XGood(i) && GetDEDX(i,j)>max)max=GetDEDX(i,j); |
1203 |
|
if(j==1 && YGood(i) && GetDEDX(i,j)>max)max=GetDEDX(i,j); |
1204 |
|
} |
1205 |
return max; |
return max; |
1206 |
|
|
1207 |
}; |
}; |
1224 |
vto = iv+1; |
vto = iv+1; |
1225 |
} |
} |
1226 |
for(int i=pfrom; i<pto; i++) |
for(int i=pfrom; i<pto; i++) |
1227 |
for(int j=0; j<vto; j++) |
for(int j=vfrom; j<vto; j++){ |
1228 |
if(GetDEDX(i,j)<min)min=GetDEDX(i,j); |
if(j==0 && XGood(i) && GetDEDX(i,j)<min)min=GetDEDX(i,j); |
1229 |
|
if(j==1 && YGood(i) && GetDEDX(i,j)<min)min=GetDEDX(i,j); |
1230 |
|
} |
1231 |
return min; |
return min; |
1232 |
|
|
1233 |
}; |
}; |
1234 |
|
|
1235 |
/** |
/** |
1236 |
* \brief Give the maximum spatial residual release |
* \brief Give the maximum spatial residual |
1237 |
*/ |
*/ |
1238 |
Float_t TrkTrack::GetResidual_max(int ip, int iv){ |
Float_t TrkTrack::GetResidual_max(int ip, int iv){ |
1239 |
Float_t max=0; |
Float_t max=0; |
1250 |
vto = iv+1; |
vto = iv+1; |
1251 |
} |
} |
1252 |
for(int i=pfrom; i<pto; i++){ |
for(int i=pfrom; i<pto; i++){ |
1253 |
for(int j=0; j<vto; j++){ |
for(int j=vfrom; j<vto; j++){ |
1254 |
if(j==0 && XGood(i) && fabs(xm[i]-xv[i])>fabs(max))max=xv[i]-xm[i]; |
if(j==0 && XGood(i) && fabs(xm[i]-xv[i])>fabs(max))max=xm[i]-xv[i]; |
1255 |
if(j==1 && YGood(i) && fabs(ym[i]-yv[i])>fabs(max))max=yv[i]-ym[i]; |
if(j==1 && YGood(i) && fabs(ym[i]-yv[i])>fabs(max))max=ym[i]-yv[i]; |
1256 |
} |
} |
1257 |
} |
} |
1258 |
return max; |
return max; |
1259 |
|
|
1260 |
}; |
}; |
1261 |
|
/** |
1262 |
|
* \brief Give the average spatial residual |
1263 |
|
*/ |
1264 |
|
Float_t TrkTrack::GetResidual_av(int ip, int iv){ |
1265 |
|
// |
1266 |
|
//Sum$((xm>-50)*(xm-xv)/resx)/sqrt(TrkTrack.GetNX()*TrkTrack.GetChi2X())<0.3 |
1267 |
|
|
1268 |
|
Float_t av = 0.; |
1269 |
|
int nav = 0; |
1270 |
|
// |
1271 |
|
int pfrom = 0; |
1272 |
|
int pto = 6; |
1273 |
|
int vfrom = 0; |
1274 |
|
int vto = 2; |
1275 |
|
if(ip>=0&&ip<6){ |
1276 |
|
pfrom = ip; |
1277 |
|
pto = ip+1; |
1278 |
|
} |
1279 |
|
if(iv>=0&&iv<2){ |
1280 |
|
vfrom = iv; |
1281 |
|
vto = iv+1; |
1282 |
|
} |
1283 |
|
for(int i=pfrom; i<pto; i++){ |
1284 |
|
for(int j=vfrom; j<vto; j++){ |
1285 |
|
nav++; |
1286 |
|
if(j==0 && XGood(i)) av += (xm[i]-xv[i])/resx[i]; |
1287 |
|
if(j==1 && YGood(i)) av += (ym[i]-yv[i])/resy[i]; |
1288 |
|
} |
1289 |
|
} |
1290 |
|
if(nav==0)return -100.; |
1291 |
|
return av/nav; |
1292 |
|
|
1293 |
|
}; |
1294 |
|
|
1295 |
|
|
1296 |
/** |
/** |
2039 |
|
|
2040 |
TrkParams::Set(path,1); |
TrkParams::Set(path,1); |
2041 |
TrkParams::Load(1); |
TrkParams::Load(1); |
2042 |
|
if( !TrkParams::IsLoaded(1) ){ |
2043 |
|
cout << "void TrkLevel2::LoadField(TString path) --- ERROR --- m.field not loaded"<<endl; |
2044 |
|
} |
2045 |
|
|
2046 |
// |
// |
2047 |
}; |
}; |