fDiamondPointID(-1),
fDiamondModID(-1),
fCheckDiamondPoint(kDiamondCheckIfPrompt),
+ fFixCurvIfConstraned(kTRUE),
+ fCurvFitWasConstrained(kFALSE),
fConvAlgMatOld(100)
{
/// main constructor that takes input from configuration file
//________________________________________________________________________________________________________
Int_t AliITSAlignMille2::CheckConfigRecords(FILE* stream)
{
+ // check the correctness of the record
TString record,recTitle;
int lineCnt = 0;
rewind(stream);
// finally send local equations to millepede
SetLocalEquations(md,nloceq);
fMillepede->SaveRecordData(); // RRR
+ fCurvFitWasConstrained = kFALSE; // restore default
//
return 0;
}
}
//________________________________________________________________________________________________________
-Int_t AliITSAlignMille2::CalcIntersectionPoint(Double_t *lpar, Double_t *gpar)
+Int_t AliITSAlignMille2::CalcIntersectionPoint(const Double_t *lpar, const Double_t *gpar)
{
/// calculate track intersection point in local coordinates
/// according with a given set of parameters (local(4) and global(6))
TGeoHMatrix *tempHMat = GetSensorCurrMatrixSID(fCurrentSensID);// fCurrentModule->GetSensitiveVolumeMatrix(fCluster.GetVolumeID());
//
fTPAFitter->GetDResDParams(&fDerivativeLoc[0][0], curpoint); // resid. derivatives over the track parameters
+ if (fCurvFitWasConstrained && fFixCurvIfConstraned && !IsZero(fBField))
+ for (int i=3;i--;) fDerivativeLoc[AliITSTPArrayFit::kR0][i] = 0; //Fix curvarute
+ //
for (Int_t i=fNLocal; i--;) tempHMat->MasterToLocalVect(fDerivativeLoc[i],m.fDerLoc[i]);
//
int status = 0;
/// Set local equations with data stored in m
/// return 0 if success
//
+ Bool_t locPatt[kNLocal] = {0}; // pattern of lacal eq's to account
+ for (int i=fNLocal; i--;) {
+ if (locPatt[i]) continue; // already set
+ for (Int_t j=0; j<neq; j++) for (int ic=3;ic--;) if (!IsZero(marr[j].fDerLoc[i][ic])) locPatt[i]=kTRUE;
+ }
+ //
for (Int_t j=0; j<neq; j++) {
//
const Mille2Data &m = marr[j];
// for the diamond point (if any) the Y residual is accounted
if (ic==kY && !fUseLocalYErr && !(m.fModuleID[0]==fDiamondModID)) continue;
AliDebug(2,Form("setting local equation %c with fMeas=%.6f and fSigma=%.6f",fgkXYZ[ic],m.fMeas[ic], m.fSigma[ic]));
- Int_t nzero = 0;
- for (int i=fNLocal; i--;) nzero += SetLocalDerivative(i,m.fDerLoc[i][ic] );
+ Int_t nzero = 0, naddl = 0;
+ for (int i=0;i<=fNLocal;i++) if (locPatt[i]) nzero += SetLocalDerivative(naddl++,m.fDerLoc[i][ic] );
if (nzero==fNLocal) {
AliInfo(Form("Skipping %c residual due to the zero derivatives!",fgkXYZ[ic]));
continue;
strncpy(st,a->GetSymName(),TMath::Min(sizeof(st),strlen(a->GetSymName())+1));
a->GetMatrix(m);
//
- symname[0] = '\0';
+ memset(symname,0,250*sizeof(char));
sscanf(st,"%249s",symname);
//
// decode module list
}
//________________________________________________________________________________________________________
-void AliITSAlignMille2::ConvertParamsToGlobal()
+void AliITSAlignMille2::ConvertParamsToGlobal() const
{
// convert params in local frame to global one
double pars[AliITSAlignMille2Module::kMaxParGeom];
}
//________________________________________________________________________________________________________
-void AliITSAlignMille2::ConvertParamsToLocal()
+void AliITSAlignMille2::ConvertParamsToLocal() const
{
// convert params in global frame to local one
double pars[AliITSAlignMille2Module::kMaxParGeom];
}
//________________________________________________________________________________________________________
-Int_t AliITSAlignMille2::GetPathFromUserInfo(TList* cdbList,const char* calib,TString& path, Int_t useBit)
+Int_t AliITSAlignMille2::GetPathFromUserInfo(const TList* cdbList,const char* calib,TString& path, Int_t useBit)
{
// extract the path for specific CDB path from user info. If it is the same as already loaded, set corresponing bit
TIter itList(cdbList);
fConstrCharge = q==0 ? q:TMath::Sign(1,q);
fConstrPT = pt;
fConstrPTErr = pterr;
+ fCurvFitWasConstrained = kTRUE;
}
//________________________________________________________________________________________________________
if (crv<0 || IsZero(crv)) {
fConstrPT = -1;
fConstrPTErr = -1;
+ fCurvFitWasConstrained = kFALSE;
}
else {
fConstrPT = TMath::Abs(1./crv*fBField*kCQConv);
fConstrPTErr = crverr>1e-10 ? TMath::Abs(fConstrPT/crv*crverr) : 0.;
+ fCurvFitWasConstrained = kTRUE;
}
}
else vdrift += corr*1e-4;
//
// if IniRespSDD was used, it should be subtracted back, since it is accounted in the PreResp
- if (fIniVDriftSDD&&fIniRespSDD) {
+ if (fIniVDriftSDD&&fIniRespSDD && (fPreVDriftSDD==0)) {
double corr1 = fIniRespSDD->GetDeltaVDrift(sID, sddSide);
if (fIniRespSDD->IsVDCorrMult()) vdrift *= (1-corr1);
else vdrift -= corr1*1e-4;