+Bool_t AliTPCParam::ReadGeoMatrices(){
+ //
+ // read geo matrixes
+ //
+ if (!gGeoManager){
+ AliFatal("Geo manager not initialized\n");
+ }
+ AliAlignObjAngles o;
+ //
+ if (fTrackingMatrix) delete [] fTrackingMatrix;
+ fTrackingMatrix = new TGeoHMatrix*[fNSector];
+ if (fClusterMatrix) delete [] fClusterMatrix;
+ fClusterMatrix = new TGeoHMatrix*[fNSector];
+ if (fGlobalMatrix) delete [] fGlobalMatrix;
+ fGlobalMatrix = new TGeoHMatrix*[fNSector];
+ //
+ for (Int_t isec=0; isec<fNSector; isec++) {
+ fGlobalMatrix[isec] = 0;
+ fClusterMatrix[isec]= 0;
+ fTrackingMatrix[isec]=0;
+ AliGeomManager::ELayerID iLayer;
+ Int_t iModule;
+
+ if(isec<fNInnerSector) {
+ iLayer = AliGeomManager::kTPC1;
+ iModule = isec;
+ }
+ else {
+ iLayer = AliGeomManager::kTPC2;
+ iModule = isec - fNInnerSector;
+ }
+
+ UShort_t volid = AliGeomManager::LayerToVolUID(iLayer,iModule);
+ const char *symname = AliGeomManager::SymName(volid);
+ TGeoPNEntry* pne = gGeoManager->GetAlignableEntry(symname);
+ const char *path = symname;
+ if(pne) path=pne->GetTitle();
+ if (!gGeoManager->cd(path)) return kFALSE;
+ TGeoHMatrix *m = gGeoManager->GetCurrentMatrix();
+
+ //
+ TGeoRotation mchange;
+ mchange.RotateY(90); mchange.RotateX(90);
+ Float_t ROCcenter[3];
+ GetChamberCenter(isec,ROCcenter);
+ //
+ // Convert to global coordinate system
+ //
+ fGlobalMatrix[isec] = new TGeoHMatrix(*m);
+ fGlobalMatrix[isec]->Multiply(&(mchange.Inverse()));
+ TGeoTranslation center("center",-ROCcenter[0],-ROCcenter[1],-ROCcenter[2]);
+ fGlobalMatrix[isec]->Multiply(¢er);
+ //
+ // cluster correction matrix
+ //
+ fClusterMatrix[isec] = new TGeoHMatrix;
+ Double_t sectorAngle = 20.*(isec%18)+10;
+ TGeoHMatrix rotMatrix;
+ rotMatrix.RotateZ(sectorAngle);
+ if (GetGlobalMatrix(isec)->GetTranslation()[2]>0){
+ //
+ // mirrored system
+ //
+ TGeoRotation mirrorZ;
+ mirrorZ.SetAngles(90,0,90,90,180,0);
+ fClusterMatrix[isec]->Multiply(&mirrorZ);
+ }
+ TGeoTranslation trans(0,0,GetZLength(isec));
+ fClusterMatrix[isec]->MultiplyLeft(&trans);
+ fClusterMatrix[isec]->MultiplyLeft((GetGlobalMatrix(isec)));
+ fClusterMatrix[isec]->MultiplyLeft(&(rotMatrix.Inverse()));
+ }
+ return kTRUE;
+}
+
+