+Bool_t AliTPCParam::ReadGeoMatrices(){
+ //
+ // read geo matrixes
+ //
+ if (!gGeoManager){
+ AliFatal("Geo manager not initialized\n");
+ }
+ AliAlignObjParams 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;
+ }
+ //
+ 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);
+ TGeoPNEntry* pne = gGeoManager->GetAlignableEntryByUID(volid);
+ if(!pne)
+ {
+ AliError(Form("Alignable entry for volume ID %d not in geometry. Exiting!",volid));
+ return kFALSE;
+ }
+ const char *path = pne->GetTitle();
+ if (!gGeoManager->cd(path)) return kFALSE;
+ TGeoHMatrix *m = gGeoManager->GetCurrentMatrix();
+ // Since GEANT4 does not allow reflections, in this case the reflection
+ // component if the matrix is embedded by TGeo inside TGeoScaledShape
+ if (gGeoManager->GetCurrentVolume()->GetShape()->IsReflected())
+ m->ReflectZ(kFALSE, kTRUE);
+ //
+ 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;
+}
+
+TGeoHMatrix * AliTPCParam::Tracking2LocalMatrix(const TGeoHMatrix * geoMatrix, Int_t sector) const{
+ //
+ // make local to tracking matrix
+ //
+ Double_t sectorAngle = 20.*(sector%18)+10;
+ TGeoHMatrix *newMatrix = new TGeoHMatrix();
+ newMatrix->RotateZ(sectorAngle);
+ newMatrix->MultiplyLeft(&(geoMatrix->Inverse()));
+ return newMatrix;
+}
+
+
+
+
+Bool_t AliTPCParam::GetStatus() const