\r
#define CORHW_\r
\r
-AliAlignObjParams AliITSAlignMille2Module::fgTempAlignObj;\r
-const Float_t AliITSAlignMille2Module::fgkDummyConstraint = 1.E3;\r
+\r
+const Float_t AliITSAlignMille2Module::fgkDummyConstraint = 1e-2;//1.E3;\r
\r
//-------------------------------------------------------------\r
AliITSAlignMille2Module::AliITSAlignMille2Module() : \r
} \r
\r
//-------------------------------------------------------------\r
-AliITSAlignMille2Module::AliITSAlignMille2Module(Int_t index,UShort_t volid,char* symname,TGeoHMatrix *m,Int_t nsv,UShort_t *volidsv) : \r
+AliITSAlignMille2Module::AliITSAlignMille2Module(Int_t index, UShort_t volid, const char* symname,\r
+ const TGeoHMatrix *m, Int_t nsv, const UShort_t *volidsv) : \r
TNamed(), \r
fNSensVol(0), \r
fIndex(-1), \r
// operator =\r
//\r
if(this==&m) return *this;\r
- ((TNamed *)this)->operator=(m);\r
+ this->TNamed::operator=(m);\r
//\r
fNSensVol=m.fNSensVol;\r
fIndex=m.fIndex;\r
fDetType = m.fDetType;\r
fVolumeID=m.fVolumeID;\r
fNParTot = m.fNParTot;\r
- fNParFree = m.fNParFree;\r
+ fNParFree = m.fNParFree; \r
+ fNProcPoints = m.fNProcPoints; \r
delete[] fParVals; fParVals = 0;\r
delete[] fParErrs; fParErrs = 0;\r
delete[] fParCstr; fParCstr = 0;\r
if (fNParTot) {\r
fParVals = new Float_t[fNParTot];\r
fParErrs = new Float_t[fNParTot];\r
+ fParCstr = new Float_t[fNParTot];\r
for (int i=m.GetNParTot();i--;) {\r
fParVals[i] = m.fParVals[i];\r
fParErrs[i] = m.fParErrs[i];\r
//\r
fParOffs.Set(fNParTot);\r
for (int i=0;i<fNParTot;i++) fParOffs[i] = m.fParOffs[i];\r
- for (int i=3;i--;) fSigmaFactor[i] = m.fSigmaFactor[i];\r
+ for (int i=0;i<3;i++) fSigmaFactor[i] = m.fSigmaFactor[i];\r
if (fMatrix) delete fMatrix;\r
fMatrix=new TGeoHMatrix(*m.GetMatrix());\r
+ if(fSensVolMatrix) delete fSensVolMatrix;\r
+ fSensVolMatrix = new TGeoHMatrix(*m.fSensVolMatrix);\r
+ if(fSensVolModifMatrix) delete fSensVolModifMatrix;\r
+ fSensVolModifMatrix = new TGeoHMatrix(*m.fSensVolModifMatrix);\r
fSensVolIndex = m.fSensVolIndex;\r
fSensVolVolumeID = m.fSensVolVolumeID;\r
fParent = m.fParent;\r
} \r
\r
//-------------------------------------------------------------\r
-Int_t AliITSAlignMille2Module::Set(Int_t index, UShort_t volid, char* symname, TGeoHMatrix *m, Int_t nsv, UShort_t *volidsv) \r
+Int_t AliITSAlignMille2Module::Set(Int_t index, UShort_t volid, const char* symname, \r
+ const TGeoHMatrix *m, Int_t nsv, const UShort_t *volidsv) \r
{\r
// initialize a custom supermodule\r
// index, volid, symname and matrix must be given\r
//-------------------------------------------------------------\r
void AliITSAlignMille2Module::SetFreeDOF(Int_t dof,Double_t cstr)\r
{\r
- if (cstr>0) fParCstr[dof] = fgkDummyConstraint+1.; // the parameter is free and unconstrained\r
- else if (cstr<0) fParCstr[dof] = -cstr; // the parameter is free but constrained\r
- else fParCstr[dof] = 0; // fixed parameter\r
+ if (AliITSAlignMille2::IsZero(cstr)) fParCstr[dof] = 0; // fixed parameter\r
+ else if (cstr>0) fParCstr[dof] = fgkDummyConstraint+1.; // the parameter is free and unconstrained\r
+ else fParCstr[dof] = -cstr; // the parameter is free but constrained\r
}\r
\r
//-------------------------------------------------------------\r
if (GetIndexFromVolumeID(voluid)<0) return; // bad volid\r
//\r
// in principle, the correct size of fSensVol... arrays was set outside but check anyway\r
- if (fSensVolVolumeID.GetSize()<fNSensVol) {\r
+ if (fSensVolVolumeID.GetSize()<fNSensVol+1) {\r
fSensVolVolumeID.Set(fNSensVol+1);\r
fSensVolIndex.Set(fNSensVol+1);\r
}\r
}\r
\r
//-------------------------------------------------------------\r
-TGeoHMatrix *AliITSAlignMille2Module::GetSensitiveVolumeModifiedMatrix(UShort_t voluid, Double_t *delta,Bool_t local)\r
+TGeoHMatrix *AliITSAlignMille2Module::GetSensitiveVolumeModifiedMatrix(UShort_t voluid, const Double_t *delta,Bool_t local)\r
{\r
// modify the original TGeoHMatrix of the sensitive module 'voluid' according\r
// with a delta transform. applied to the supermodule matrix\r
ang[1]=delta[4]; // theta (Y)\r
ang[2]=delta[5]; // phi (Z)\r
//\r
- fgTempAlignObj.SetRotation(ang[0],ang[1],ang[2]);\r
- fgTempAlignObj.SetTranslation(tr[0],tr[1],tr[2]);\r
+ static AliAlignObjParams tempAlignObj;\r
+ tempAlignObj.SetRotation(ang[0],ang[1],ang[2]);\r
+ tempAlignObj.SetTranslation(tr[0],tr[1],tr[2]);\r
AliDebug(3,Form("Delta angles: psi=%f theta=%f phi=%f",ang[0],ang[1],ang[2]));\r
TGeoHMatrix hm;\r
- fgTempAlignObj.GetMatrix(hm);\r
+ tempAlignObj.GetMatrix(hm);\r
//printf("\n0: delta matrix\n");hm.Print();\r
\r
// 1) start setting fSensVolModif = fSensVol\r
}\r
\r
//-------------------------------------------------------------\r
-AliAlignObjParams *AliITSAlignMille2Module::GetSensitiveVolumeMisalignment(UShort_t voluid, Double_t *deltalocal)\r
+AliAlignObjParams *AliITSAlignMille2Module::GetSensitiveVolumeMisalignment(UShort_t voluid, const Double_t *deltalocal)\r
{\r
// calculate misalignment of sens.vol. 'voluid' according with a displacement 'deltalocal'\r
// of the mother volume. The misalignment is returned as AliAlignObjParams object\r
ang[1]=deltalocal[4]; // theta (Y)\r
ang[2]=deltalocal[5]; // phi (Z)\r
//\r
- fgTempAlignObj.SetRotation(ang[0],ang[1],ang[2]);\r
- fgTempAlignObj.SetTranslation(tr[0],tr[1],tr[2]);\r
+ static AliAlignObjParams tempAlignObj;\r
+ tempAlignObj.SetRotation(ang[0],ang[1],ang[2]);\r
+ tempAlignObj.SetTranslation(tr[0],tr[1],tr[2]);\r
AliDebug(3,Form("Delta angles: psi=%f theta=%f phi=%f",ang[0],ang[1],ang[2]));\r
//\r
- return GetSensitiveVolumeMisalignment(voluid,&fgTempAlignObj);\r
+ return GetSensitiveVolumeMisalignment(voluid,&tempAlignObj);\r
}\r
\r
//-------------------------------------------------------------\r
-AliAlignObjParams *AliITSAlignMille2Module::GetSensitiveVolumeMisalignment(UShort_t voluid, AliAlignObjParams *a)\r
+AliAlignObjParams *AliITSAlignMille2Module::GetSensitiveVolumeMisalignment(UShort_t voluid, const AliAlignObjParams *a)\r
{\r
// return the misalignment of the sens. vol. 'voluid' corresponding with \r
// a misalignment 'a' in the mother volume\r
// << RS\r
\r
// reset align object (may not be needed...)\r
- fgTempAlignObj.SetVolUID(0);\r
- fgTempAlignObj.SetSymName("");\r
- fgTempAlignObj.SetTranslation(0,0,0);\r
- fgTempAlignObj.SetRotation(0,0,0);\r
+ static AliAlignObjParams tempAlignObj;\r
+ tempAlignObj.SetVolUID(0);\r
+ tempAlignObj.SetSymName("");\r
+ tempAlignObj.SetTranslation(0,0,0);\r
+ tempAlignObj.SetRotation(0,0,0);\r
//\r
// >> RS\r
#ifdef CORHW_\r
}\r
#endif\r
// << RS\r
- if (!fgTempAlignObj.SetMatrix(*fSensVolModifMatrix)) return NULL;\r
- fgTempAlignObj.SetVolUID(voluid);\r
- fgTempAlignObj.SetSymName(AliGeomManager::SymName(voluid));\r
+ if (!tempAlignObj.SetMatrix(*fSensVolModifMatrix)) return NULL;\r
+ tempAlignObj.SetVolUID(voluid);\r
+ tempAlignObj.SetSymName(AliGeomManager::SymName(voluid));\r
//\r
- return &fgTempAlignObj;\r
+ return &tempAlignObj;\r
}\r
\r
// >> RS\r
//-------------------------------------------------------------\r
-AliAlignObjParams *AliITSAlignMille2Module::GetSensitiveVolumeTotalMisalignment(UShort_t voluid, Double_t *deltalocal)\r
+AliAlignObjParams *AliITSAlignMille2Module::GetSensitiveVolumeTotalMisalignment(UShort_t voluid, const Double_t *deltalocal)\r
{\r
// calculate misalignment of sens.vol. 'voluid' according with a displacement 'deltalocal'\r
// of the mother volume. The misalignment is returned as AliAlignObjParams object including\r
ang[2]=deltalocal[5]; // phi (Z)\r
\r
// reset align object (may not be needed...)\r
- fgTempAlignObj.SetVolUID(0);\r
- fgTempAlignObj.SetSymName("");\r
- fgTempAlignObj.SetRotation(ang[0],ang[1],ang[2]);\r
- fgTempAlignObj.SetTranslation(tr[0],tr[1],tr[2]);\r
+ static AliAlignObjParams tempAlignObj;\r
+ tempAlignObj.SetVolUID(0);\r
+ tempAlignObj.SetSymName("");\r
+ tempAlignObj.SetRotation(ang[0],ang[1],ang[2]);\r
+ tempAlignObj.SetTranslation(tr[0],tr[1],tr[2]);\r
AliDebug(3,Form("Delta angles: psi=%f theta=%f phi=%f",ang[0],ang[1],ang[2]));\r
\r
// Gsv = Gg * Gg-1 * Gsv -> Lsv,g = Gg-1 * Gsv\r
\r
// prepare the Delta matrix Dg\r
TGeoHMatrix dg;\r
- fgTempAlignObj.GetMatrix(dg);\r
+ tempAlignObj.GetMatrix(dg);\r
//dg.Print();\r
\r
// 1) start setting fSensVolModif = Gsv\r
//printf("\n5: modif=finale\n");fSensVolModifMatrix->Print();\r
\r
// reset align object (may not be needed...)\r
- fgTempAlignObj.SetVolUID(0);\r
- fgTempAlignObj.SetSymName("");\r
- fgTempAlignObj.SetTranslation(0,0,0);\r
- fgTempAlignObj.SetRotation(0,0,0);\r
+ tempAlignObj.SetVolUID(0);\r
+ tempAlignObj.SetSymName("");\r
+ tempAlignObj.SetTranslation(0,0,0);\r
+ tempAlignObj.SetRotation(0,0,0);\r
\r
#ifdef CORHW_\r
// correction for SPD y-shift\r
fSensVolModifMatrix->Multiply( &deltay.Inverse() );\r
}\r
#endif\r
- if (!fgTempAlignObj.SetMatrix(*fSensVolModifMatrix)) return NULL;\r
- fgTempAlignObj.SetVolUID(voluid);\r
- fgTempAlignObj.SetSymName(AliGeomManager::SymName(voluid));\r
+ if (!tempAlignObj.SetMatrix(*fSensVolModifMatrix)) return NULL;\r
+ tempAlignObj.SetVolUID(voluid);\r
+ tempAlignObj.SetSymName(AliGeomManager::SymName(voluid));\r
\r
\r
- //fgTempAlignObj.Print("");\r
+ //tempAlignObj.Print("");\r
\r
- return &fgTempAlignObj;\r
+ return &tempAlignObj;\r
}\r
//-------------------------------------------------------------\r
\r
//-------------------------------------------------------------\r
-AliAlignObjParams *AliITSAlignMille2Module::GetSensitiveVolumeGlobalMisalignment(UShort_t voluid, Double_t *deltalocal)\r
+AliAlignObjParams *AliITSAlignMille2Module::GetSensitiveVolumeGlobalMisalignment(UShort_t voluid, const Double_t *deltalocal)\r
{\r
// calculate misalignment of sens.vol. 'voluid' according with a displacement 'deltalocal'\r
// of the mother volume. The misalignment is returned as AliAlignObjParams object\r
ang[2]=deltalocal[5]; // phi (Z)\r
\r
// reset align object (may not be needed...)\r
- fgTempAlignObj.SetTranslation(0,0,0);\r
- fgTempAlignObj.SetRotation(0,0,0);\r
+ static AliAlignObjParams tempAlignObj;\r
+ tempAlignObj.SetTranslation(0,0,0);\r
+ tempAlignObj.SetRotation(0,0,0);\r
\r
- fgTempAlignObj.SetRotation(ang[0],ang[1],ang[2]);\r
- fgTempAlignObj.SetTranslation(tr[0],tr[1],tr[2]);\r
+ tempAlignObj.SetRotation(ang[0],ang[1],ang[2]);\r
+ tempAlignObj.SetTranslation(tr[0],tr[1],tr[2]);\r
AliDebug(3,Form("Delta angles: psi=%f theta=%f phi=%f",ang[0],ang[1],ang[2]));\r
\r
// Gsv = Gg * Gg-1 * Gsv -> Lsv,g = Gg-1 * Gsv\r
\r
// prepare the Delta matrix Dg\r
TGeoHMatrix dg;\r
- fgTempAlignObj.GetMatrix(dg);\r
+ tempAlignObj.GetMatrix(dg);\r
//dg.Print();\r
\r
dg.MultiplyLeft( fMatrix );\r
dg.Multiply( &fMatrix->Inverse() );\r
\r
// reset align object (may not be needed...)\r
- fgTempAlignObj.SetTranslation(0,0,0);\r
- fgTempAlignObj.SetRotation(0,0,0);\r
+ tempAlignObj.SetTranslation(0,0,0);\r
+ tempAlignObj.SetRotation(0,0,0);\r
\r
- fgTempAlignObj.SetVolUID(voluid);\r
- fgTempAlignObj.SetSymName(AliGeomManager::SymName(voluid));\r
+ tempAlignObj.SetVolUID(voluid);\r
+ tempAlignObj.SetSymName(AliGeomManager::SymName(voluid));\r
\r
- if (!fgTempAlignObj.SetMatrix(dg)) return NULL;\r
+ if (!tempAlignObj.SetMatrix(dg)) return NULL;\r
\r
- //fgTempAlignObj.Print("");\r
+ //tempAlignObj.Print("");\r
\r
- return &fgTempAlignObj;\r
+ return &tempAlignObj;\r
}\r
// << RS\r
\r
//-------------------------------------------------------------\r
void AliITSAlignMille2Module::Print(Option_t*) const \r
{\r
+ // print data\r
//\r
const char* typeName[] = {"SPD","SDD","SSD"};\r
printf("*** ITS SuperModule for AliITSAlignMille ***\n");\r
printf("Factors : X=%.2f Y=%.2f Z=%.2f\n"\r
"DOF: %cTx:%5d| %cTy:%5d| %cTz:%5d| %cPsi:%5d| %cTheta:%5d| %cPhi:%5d|",\r
fSigmaFactor[0],fSigmaFactor[1],fSigmaFactor[2],\r
- IsFreeDOF(kDOFTX) ? '+':'-',fParOffs[kDOFTX],IsFreeDOF(kDOFTY) ? '+':'-',fParOffs[kDOFTY],\r
- IsFreeDOF(kDOFTZ) ? '+':'-',fParOffs[kDOFTZ],IsFreeDOF(kDOFPS) ? '+':'-',fParOffs[kDOFPS],\r
- IsFreeDOF(kDOFTH) ? '+':'-',fParOffs[kDOFTH],IsFreeDOF(kDOFPH) ? '+':'-',fParOffs[kDOFPH]);\r
- if (IsSDD()) printf("%cT0:%5d| %cDV:%5d|",IsFreeDOF(kDOFT0)?'+':'-',fParOffs[kDOFT0],\r
- IsFreeDOF(kDOFDV)?'+':'-',fParOffs[kDOFDV]);\r
+ IsFreeDOF(kDOFTX) ? '+':'-',GetParOffset(kDOFTX),IsFreeDOF(kDOFTY) ? '+':'-',GetParOffset(kDOFTY),\r
+ IsFreeDOF(kDOFTZ) ? '+':'-',GetParOffset(kDOFTZ),IsFreeDOF(kDOFPS) ? '+':'-',GetParOffset(kDOFPS),\r
+ IsFreeDOF(kDOFTH) ? '+':'-',GetParOffset(kDOFTH),IsFreeDOF(kDOFPH) ? '+':'-',GetParOffset(kDOFPH));\r
+ if (IsSDD()) {\r
+ printf("%cT0:%5d| %cDVl:%5d| %cDVr:%5d|",IsFreeDOF(kDOFT0)?'+':'-',GetParOffset(kDOFT0),\r
+ IsFreeDOF(kDOFDVL)?'+':'-',GetParOffset(kDOFDVL),IsFreeDOF(kDOFDVR)?'+':'-',GetParOffset(kDOFDVR));\r
+ if (IsVDriftLRSame()) printf("(dVL=dVR)");\r
+ }\r
printf("\n");\r
fMatrix->Print();\r
printf("%4d Sensitive volumes | %6d Processed Points\n",fNSensVol,fNProcPoints);\r
//-------------------------------------------------------------\r
Bool_t AliITSAlignMille2Module::IsAlignable() const\r
{\r
+ // it it alignable?\r
TGeoManager* geoManager = AliGeomManager::GetGeometry();\r
if (!geoManager) {\r
AliInfo("Couldn't initialize geometry");\r
//-------------------------------------------------------------\r
void AliITSAlignMille2Module::AssignDetType()\r
{\r
+ // assign the detector type\r
TString tp = GetName();\r
if (tp.Contains("SPD",TString::kIgnoreCase)) fDetType = kSPD;\r
else if (tp.Contains("SDD",TString::kIgnoreCase)) fDetType = kSDD;\r
else if (tp.Contains("SSD",TString::kIgnoreCase)) fDetType = kSSD;\r
else fDetType = -1;\r
- fNParTot = IsSDD() ? 8:6;\r
+ fNParTot = IsSDD() ? kMaxParTot:kMaxParGeom;\r
fNParFree = 0;\r
fParVals = new Float_t[fNParTot];\r
fParErrs = new Float_t[fNParTot]; \r
//-------------------------------------------------------------\r
void AliITSAlignMille2Module::EvaluateDOF()\r
{\r
+ // count d.o.f.\r
fNParFree = 0;\r
for (int i=fNParTot;i--;) if (IsFreeDOF(i)) fNParFree++;\r
}\r
// return global parameters of the sensor volid\r
for (int i=3;i--;) t[i] = r[i] = 0.;\r
if (SensVolMatrix(volid,fSensVolMatrix)) return; \r
- fgTempAlignObj.SetMatrix(*fSensVolMatrix);\r
- fgTempAlignObj.GetPars(t,r);\r
+ AliAlignObjParams tempAlignObj;\r
+ tempAlignObj.SetMatrix(*fSensVolMatrix);\r
+ tempAlignObj.GetPars(t,r);\r
}\r
\r
//-------------------------------------------------------------\r
for (int i=3;i--;) t[i] = r[i] = 0.;\r
if (SensVolMatrix(volid,fSensVolMatrix)) return; \r
fSensVolMatrix->MultiplyLeft( &fMatrix->Inverse() );\r
- fgTempAlignObj.SetMatrix(*fSensVolMatrix);\r
- fgTempAlignObj.GetPars(t,r);\r
+ AliAlignObjParams tempAlignObj; \r
+ tempAlignObj.SetMatrix(*fSensVolMatrix);\r
+ tempAlignObj.GetPars(t,r);\r
}\r
\r
//-------------------------------------------------------------\r
-void AliITSAlignMille2Module::GetSensVolGlobalParams(UShort_t volid,Double_t* loct,Double_t* locr,Double_t *t, Double_t *r)\r
+void AliITSAlignMille2Module::GetSensVolGlobalParams(UShort_t volid,const Double_t* loct, const Double_t* locr,Double_t *t, Double_t *r)\r
{\r
// return global parameters of the sensor volid modified by the localDelta params\r
for (int i=3;i--;) t[i] = r[i] = 0.;\r
if (SensVolMatrix(volid,fSensVolMatrix)) return; \r
- fgTempAlignObj.SetTranslation(loct[0],loct[1],loct[2]);\r
- fgTempAlignObj.SetRotation(locr[0],locr[1],locr[2]);\r
+ AliAlignObjParams tempAlignObj;\r
+ tempAlignObj.SetTranslation(loct[0],loct[1],loct[2]);\r
+ tempAlignObj.SetRotation(locr[0],locr[1],locr[2]);\r
//\r
- fgTempAlignObj.GetMatrix(*fSensVolModifMatrix); // obtain local delta\r
+ tempAlignObj.GetMatrix(*fSensVolModifMatrix); // obtain local delta\r
fSensVolModifMatrix->MultiplyLeft( fSensVolMatrix ); // obtain global delta\r
- fgTempAlignObj.SetMatrix(*fSensVolModifMatrix);\r
- fgTempAlignObj.GetPars(t,r); // obtain global params\r
+ tempAlignObj.SetMatrix(*fSensVolModifMatrix);\r
+ tempAlignObj.GetPars(t,r); // obtain global params\r
}\r
\r
//-------------------------------------------------------------\r
-void AliITSAlignMille2Module::GetSensVolLocalParams(UShort_t volid,Double_t* loct,Double_t* locr,Double_t *t, Double_t *r)\r
+void AliITSAlignMille2Module::GetSensVolLocalParams(UShort_t volid,const Double_t* loct,const Double_t* locr,Double_t *t, Double_t *r)\r
{\r
// return parameters of the sensor volid (modified by the localDelta params) in the current volume\r
for (int i=3;i--;) t[i] = r[i] = 0.;\r
if (SensVolMatrix(volid,fSensVolMatrix)) return; \r
- fgTempAlignObj.SetTranslation(loct[0],loct[1],loct[2]);\r
- fgTempAlignObj.SetRotation(locr[0],locr[1],locr[2]);\r
+ AliAlignObjParams tempAlignObj;\r
+ tempAlignObj.SetTranslation(loct[0],loct[1],loct[2]);\r
+ tempAlignObj.SetRotation(locr[0],locr[1],locr[2]);\r
//\r
- fgTempAlignObj.GetMatrix(*fSensVolModifMatrix); // obtain local delta\r
+ tempAlignObj.GetMatrix(*fSensVolModifMatrix); // obtain local delta\r
fSensVolModifMatrix->MultiplyLeft( fSensVolMatrix ); // obtain global delta\r
fSensVolModifMatrix->MultiplyLeft( &fMatrix->Inverse() ); // obtain delta in current volume\r
- fgTempAlignObj.SetMatrix(*fSensVolModifMatrix);\r
- fgTempAlignObj.GetPars(t,r); // obtain params\r
+ tempAlignObj.SetMatrix(*fSensVolModifMatrix);\r
+ tempAlignObj.GetPars(t,r); // obtain params\r
}\r
\r
//-------------------------------------------------------------\r
void AliITSAlignMille2Module::SetParVals(Double_t *vl,Int_t npar)\r
{\r
+ // set parameters\r
for (int i=TMath::Min(npar,(Int_t)fNParTot);i--;) fParVals[i] = vl[i];\r
}\r
\r
// DeltaGlobal = (ModifParents)*DeltaLocal*(ModifParents)^-1 \r
//\r
*fSensVolMatrix = *fMatrix; // current global matrix\r
+ AliAlignObjParams tempAlignObj;\r
AliITSAlignMille2Module* parent = GetParent();\r
while (parent) {\r
if (parent->GeomParamsGlobal()) {\r
}\r
fSensVolMatrix->MultiplyLeft( &parent->GetMatrix()->Inverse() ); // Local Matrix\r
Float_t *parpar = parent->GetParVals();\r
- fgTempAlignObj.SetTranslation(parpar[0],parpar[1],parpar[2]);\r
- fgTempAlignObj.SetRotation(parpar[3],parpar[4],parpar[5]);\r
- fgTempAlignObj.GetMatrix(*fSensVolModifMatrix);\r
+ tempAlignObj.SetTranslation(parpar[0],parpar[1],parpar[2]);\r
+ tempAlignObj.SetRotation(parpar[3],parpar[4],parpar[5]);\r
+ tempAlignObj.GetMatrix(*fSensVolModifMatrix);\r
fSensVolMatrix->MultiplyLeft(fSensVolModifMatrix);\r
fSensVolMatrix->MultiplyLeft(parent->GetMatrix()); // global matrix after parents modifications\r
parent = parent->GetParent();\r
}\r
//\r
- fgTempAlignObj.SetTranslation(fParVals[0],fParVals[1],fParVals[2]);\r
- fgTempAlignObj.SetRotation(fParVals[3],fParVals[4],fParVals[5]);\r
- fgTempAlignObj.GetMatrix(*fSensVolModifMatrix); // local delta matrix\r
+ tempAlignObj.SetTranslation(fParVals[0],fParVals[1],fParVals[2]);\r
+ tempAlignObj.SetRotation(fParVals[3],fParVals[4],fParVals[5]);\r
+ tempAlignObj.GetMatrix(*fSensVolModifMatrix); // local delta matrix\r
fSensVolModifMatrix->Multiply( &fSensVolMatrix->Inverse() );\r
fSensVolModifMatrix->MultiplyLeft( fSensVolMatrix );\r
- fgTempAlignObj.SetMatrix( *fSensVolModifMatrix ); // global delta matrix\r
- fgTempAlignObj.GetPars(pars,pars+3);\r
+ tempAlignObj.SetMatrix( *fSensVolModifMatrix ); // global delta matrix\r
+ tempAlignObj.GetPars(pars,pars+3);\r
//\r
}\r
\r
// DeltaLocal = (DeltaParents*GlobalMat)^-1*DeltaGlobal*(DeltaParents*GlobalMat)\r
//\r
AliITSAlignMille2Module* parent = GetParent();\r
- fgTempAlignObj.SetTranslation(0.,0.,0.);\r
- fgTempAlignObj.SetRotation(0.,0.,0.);\r
- fgTempAlignObj.GetMatrix(*fSensVolMatrix); // get no-shift matrix\r
+ AliAlignObjParams tempAlignObj;\r
+ tempAlignObj.SetTranslation(0.,0.,0.);\r
+ tempAlignObj.SetRotation(0.,0.,0.);\r
+ tempAlignObj.GetMatrix(*fSensVolMatrix); // get no-shift matrix\r
//\r
while (parent) { // accumulate the product of parents global modifications\r
if (!parent->GeomParamsGlobal()) {\r
return;\r
}\r
Float_t *parpar = parent->GetParVals();\r
- fgTempAlignObj.SetTranslation(parpar[0],parpar[1],parpar[2]);\r
- fgTempAlignObj.SetRotation(parpar[3],parpar[4],parpar[5]);\r
- fgTempAlignObj.GetMatrix(*fSensVolModifMatrix);\r
+ tempAlignObj.SetTranslation(parpar[0],parpar[1],parpar[2]);\r
+ tempAlignObj.SetRotation(parpar[3],parpar[4],parpar[5]);\r
+ tempAlignObj.GetMatrix(*fSensVolModifMatrix);\r
fSensVolMatrix->Multiply(fSensVolModifMatrix); \r
parent = parent->GetParent();\r
}\r
// global matrix after parents modifications\r
fSensVolMatrix->Multiply(fMatrix);\r
//\r
- fgTempAlignObj.SetTranslation(fParVals[0],fParVals[1],fParVals[2]);\r
- fgTempAlignObj.SetRotation(fParVals[3],fParVals[4],fParVals[5]);\r
- fgTempAlignObj.GetMatrix(*fSensVolModifMatrix); // global delta matrix\r
+ tempAlignObj.SetTranslation(fParVals[0],fParVals[1],fParVals[2]);\r
+ tempAlignObj.SetRotation(fParVals[3],fParVals[4],fParVals[5]);\r
+ tempAlignObj.GetMatrix(*fSensVolModifMatrix); // global delta matrix\r
fSensVolModifMatrix->MultiplyLeft( &fSensVolMatrix->Inverse() );\r
fSensVolModifMatrix->Multiply( fSensVolMatrix );\r
- fgTempAlignObj.SetMatrix( *fSensVolModifMatrix ); // local delta matrix\r
- fgTempAlignObj.GetPars(pars,pars+3);\r
+ tempAlignObj.SetMatrix( *fSensVolModifMatrix ); // local delta matrix\r
+ tempAlignObj.GetPars(pars,pars+3);\r
+ //\r
+}\r
+\r
+\r
+//-------------------------------------------------------------\r
+void AliITSAlignMille2Module::CalcDerivDPosDPar(Int_t sensVol,const Double_t* pl, Double_t *deriv)\r
+{\r
+ // calculate jacobian of the global position vs Parameters (dPos/dParam) \r
+ // for the point in the sensor sensVol\r
+ const double kDel = 0.01;\r
+ double pos0[3],pos1[3],pos2[3],pos3[3];\r
+ double delta[kMaxParGeom];\r
+ //\r
+ for (int ip=kMaxParGeom;ip--;) delta[ip] = 0;\r
+ //\r
+ for (int ip=kMaxParGeom;ip--;) {\r
+ //\r
+ delta[ip] -= kDel;\r
+ GetSensitiveVolumeModifiedMatrix(sensVol,delta,!GeomParamsGlobal())->LocalToMaster(pl,pos0); \r
+ delta[ip] += kDel/2;\r
+ GetSensitiveVolumeModifiedMatrix(sensVol,delta,!GeomParamsGlobal())->LocalToMaster(pl,pos1); \r
+ delta[ip] += kDel;\r
+ GetSensitiveVolumeModifiedMatrix(sensVol,delta,!GeomParamsGlobal())->LocalToMaster(pl,pos2); \r
+ delta[ip] += kDel/2;\r
+ GetSensitiveVolumeModifiedMatrix(sensVol,delta,!GeomParamsGlobal())->LocalToMaster(pl,pos3); \r
+ //\r
+ delta[ip] = 0;\r
+ double *curd = deriv + ip*3;\r
+ for (int i=3;i--;) curd[i] = (8.*(pos2[i]-pos1[i]) - (pos3[i]-pos0[i]))/6./kDel;\r
+ }\r
//\r
}\r
\r
\r
\r
//-------------------------------------------------------------\r
-void AliITSAlignMille2Module::GetGlobalParams(Double_t *t, Double_t *r)\r
+void AliITSAlignMille2Module::GetGlobalParams(Double_t *t, Double_t *r) const\r
{\r
// global parameters of the module\r
- fgTempAlignObj.SetMatrix( *fMatrix );\r
- fgTempAlignObj.GetPars(t,r);\r
+ AliAlignObjParams tempAlignObj;\r
+ tempAlignObj.SetMatrix( *fMatrix );\r
+ tempAlignObj.GetPars(t,r);\r
}\r
\r
//-------------------------------------------------------------\r
void AliITSAlignMille2Module::GetGlobalParams(const Double_t* loct, const Double_t* locr, Double_t *t, Double_t *r)\r
{\r
// global parameters of the module after the modification by local loct,locr\r
- fgTempAlignObj.SetTranslation(loct[0],loct[1],loct[2]);\r
- fgTempAlignObj.SetRotation(locr[0],locr[1],locr[2]);\r
- fgTempAlignObj.GetMatrix(*fSensVolModifMatrix); \r
+ AliAlignObjParams tempAlignObj;\r
+ tempAlignObj.SetTranslation(loct[0],loct[1],loct[2]);\r
+ tempAlignObj.SetRotation(locr[0],locr[1],locr[2]);\r
+ tempAlignObj.GetMatrix(*fSensVolModifMatrix); \r
*fSensVolMatrix = *fMatrix;\r
fSensVolMatrix->Multiply(fSensVolModifMatrix);\r
- fgTempAlignObj.SetMatrix(*fSensVolMatrix);\r
- fgTempAlignObj.GetPars(t,r);\r
+ tempAlignObj.SetMatrix(*fSensVolMatrix);\r
+ tempAlignObj.GetPars(t,r);\r
}\r
\r
//-------------------------------------------------------------\r
void AliITSAlignMille2Module::GetLocalParams(const Double_t* glot, const Double_t* glor, Double_t *t, Double_t *r)\r
{\r
// obtain local delta parameters from global delta params\r
- fgTempAlignObj.SetTranslation(glot[0],glot[1],glot[2]);\r
- fgTempAlignObj.SetRotation(glor[0],glor[1],glor[2]);\r
- fgTempAlignObj.GetMatrix(*fSensVolMatrix); \r
+ AliAlignObjParams tempAlignObj;\r
+ tempAlignObj.SetTranslation(glot[0],glot[1],glot[2]);\r
+ tempAlignObj.SetRotation(glor[0],glor[1],glor[2]);\r
+ tempAlignObj.GetMatrix(*fSensVolMatrix); \r
fSensVolMatrix->Multiply( fMatrix );\r
fSensVolMatrix->MultiplyLeft( &fMatrix->Inverse() );\r
- fgTempAlignObj.SetMatrix(*fSensVolMatrix);\r
- fgTempAlignObj.GetPars(t,r);\r
+ tempAlignObj.SetMatrix(*fSensVolMatrix);\r
+ tempAlignObj.GetPars(t,r);\r
}\r
-\r