+//_____________________________________________________________________________
+void AliTOFv5T0::AddAlignableVolumes() const
+{
+ //
+ // Create entries for alignable volumes associating the symbolic volume
+ // name with the corresponding volume path. Needs to be syncronized with
+ // eventual changes in the geometry.
+ //
+
+ TString volPath;
+ TString symName;
+
+ TString vpL0 = "ALIC_1/B077_1/BSEGMO";
+ TString vpL1 = "_1/BTOF";
+ TString vpL2 = "_1";
+ TString vpL3 = "/FTOA_0";
+ TString vpL4 = "/FLTA_0/FSTR_";
+
+ TString snSM = "TOF/sm";
+ TString snSTRIP = "/strip";
+
+ Int_t nSectors=fTOFGeometry->NSectors();
+ Int_t nStrips =fTOFGeometry->NStripA()+
+ 2*fTOFGeometry->NStripB()+
+ 2*fTOFGeometry->NStripC();
+
+ //
+ // The TOF MRPC Strips
+ // The symbolic names are: TOF/sm00/strip01
+ // ...
+ // TOF/sm17/strip91
+
+ Int_t imod=0;
+
+ for (Int_t isect = 0; isect < nSectors; isect++) {
+ for (Int_t istr = 1; istr <= nStrips; istr++) {
+
+ //if (fTOFSectors[isect]==-1) continue;
+
+ if (fTOFHoles && (isect==13 || isect==14 || isect==15)) {
+ if (istr<39) {
+ vpL3 = "/FTOB_0";
+ vpL4 = "/FLTB_0/FSTR_";
+ }
+ else if (istr>53) {
+ vpL3 = "/FTOC_0";
+ vpL4 = "/FLTC_0/FSTR_";
+ }
+ else continue;
+ }
+ else {
+ vpL3 = "/FTOA_0";
+ vpL4 = "/FLTA_0/FSTR_";
+ }
+
+ volPath = vpL0;
+ volPath += isect;
+ volPath += vpL1;
+ volPath += isect;
+ volPath += vpL2;
+ volPath += vpL3;
+ volPath += vpL4;
+ volPath += istr;
+
+
+ symName = snSM;
+ symName += Form("%02d",isect);
+ symName += snSTRIP;
+ symName += Form("%02d",istr);
+
+ AliDebug(2,"--------------------------------------------");
+ AliDebug(2,Form("Alignable object %d", imod));
+ AliDebug(2,Form("volPath=%s\n",volPath.Data()));
+ AliDebug(2,Form("symName=%s\n",symName.Data()));
+ AliDebug(2,"--------------------------------------------");
+
+ gGeoManager->SetAlignableEntry(symName.Data(),volPath.Data());
+
+ //T2L matrices for alignment
+ TGeoPNEntry *e = gGeoManager->GetAlignableEntry(symName.Data());
+ if (e) {
+ const char *path = e->GetTitle();
+ if (!gGeoManager->cd(path)) {
+ AliFatal(Form("Volume path %s not valid!",path));
+ }
+ TGeoHMatrix *globMatrix = gGeoManager->GetCurrentMatrix();
+ Double_t phi = 20.0 * (isect % 18) + 10.0;
+ TGeoHMatrix *t2l = new TGeoHMatrix();
+ t2l->RotateZ(phi);
+ t2l->MultiplyLeft(&(globMatrix->Inverse()));
+ e->SetMatrix(t2l);
+ }
+ else {
+ AliError(Form("Alignable entry %s is not valid!",symName.Data()));
+ }
+ imod++;
+ }
+ }
+
+
+ //
+ // The TOF supermodules
+ // The symbolic names are: TOF/sm00
+ // ...
+ // TOF/sm17
+ //
+ for (Int_t isect = 0; isect < nSectors; isect++) {
+
+ volPath = vpL0;
+ volPath += isect;
+ volPath += vpL1;
+ volPath += isect;
+ volPath += vpL2;
+
+ symName = snSM;
+ symName += Form("%02d",isect);
+
+ AliDebug(2,"--------------------------------------------");
+ AliDebug(2,Form("Alignable object %d", isect+imod));
+ AliDebug(2,Form("volPath=%s\n",volPath.Data()));
+ AliDebug(2,Form("symName=%s\n",symName.Data()));
+ AliDebug(2,"--------------------------------------------");
+
+ gGeoManager->SetAlignableEntry(symName.Data(),volPath.Data());
+
+ }
+
+}