+void AliTOFGeometryV4::GetVolumePath(Int_t *ind, Char_t *path ) {
+ //--------------------------------------------------------------------
+ // This function returns the colume path of a given pad
+ //--------------------------------------------------------------------
+ Int_t sector = ind[0];
+ Char_t string1[100];
+ Char_t string2[100];
+ Char_t string3[100];
+ Char_t string4[100];
+ Int_t nstrB = NStripB();
+ Int_t nstrC = NStripC();
+
+ Int_t icopy=-1;
+
+ if(sector<3){
+ icopy=sector+1;
+ sprintf(string1,"/ALIC_1/B077_1/B075_%i/BTO3_1",icopy);
+ }
+ else if(sector<11){
+ // icopy=sector-2;
+ icopy=sector+3;
+ sprintf(string1,"/ALIC_1/B077_1/B071_%i/BTO1_1",icopy);
+ }
+ else if(sector==11 || sector==12){
+ icopy=sector-10;
+ sprintf(string1,"/ALIC_1/B077_1/B074_%i/BTO2_1",icopy);
+ }
+ else {
+ // icopy=sector-4;
+ icopy=sector-12;
+ sprintf(string1,"/ALIC_1/B077_1/B071_%i/BTO1_1",icopy);
+ }
+
+ Int_t modnum=ind[1];
+ Int_t istrip=ind[2];
+
+ if( modnum ==0){
+ sprintf(string2,"FTOC_1/FLTC_0");
+ icopy= nstrC - istrip;
+ sprintf(string3,"FSTR_%i",icopy);
+ }
+ else if( modnum ==1){
+ sprintf(string2,"FTOB_1/FLTB_0");
+ icopy= nstrB - istrip;
+ sprintf(string3,"FSTR_%i",icopy);
+ }
+ else if( modnum ==2){
+ sprintf(string2,"FTOA_0/FLTA_0");
+ icopy= istrip+1;
+ sprintf(string3,"FSTR_%i",icopy);
+ }
+ else if( modnum ==3){
+ sprintf(string2,"FTOB_2/FLTB_0");
+ icopy= istrip+1;
+ sprintf(string3,"FSTR_%i",icopy);
+ }
+ else if( modnum ==4){
+ sprintf(string2,"FTOC_2/FLTC_0");
+ icopy= istrip+1;
+ sprintf(string3,"FSTR_%i",icopy);
+ }
+
+
+ Int_t padz = ind[3]+1;
+ Int_t padx = ind[4]+1;
+ if(modnum==3 || modnum==4){
+ padz = NpadZ() -ind[3];
+ padx = NpadX() -ind[4];
+ }
+ sprintf(string4,"FSEN_0/FSEZ_%i/FSEX_%i",padz,padx);
+ sprintf(path,"%s/%s/%s/%s",string1,string2,string3,string4);
+
+}
+
+//_____________________________________________________________________________
+void AliTOFGeometryV4::GetPos(Int_t *det, Float_t *pos)
+{
+//
+// Returns space point coor (x,y,z) (cm) for Detector
+// Indices (iSect,iPlate,iStrip,iPadX,iPadZ)
+//
+ Char_t path[100];
+ GetVolumePath(det,path );
+ if (!gGeoManager) {
+ printf("ERROR: no TGeo\n");
+ }
+ gGeoManager->cd(path);
+ TGeoHMatrix global;
+ global = *gGeoManager->GetCurrentMatrix();
+ const Double_t *tr = global.GetTranslation();
+
+ pos[0]=tr[0];
+ pos[1]=tr[1];
+ pos[2]=tr[2];
+}
+//_____________________________________________________________________________