]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSgeom.cxx
Fixing some problems in the CDB access (Alberto)
[u/mrichter/AliRoot.git] / ITS / AliITSgeom.cxx
index e6f1b8c89da6df33fbaafb07d9f17a7c438b721f..58d8100c36ca48d67090411566276e3f62a4afa1 100644 (file)
@@ -628,6 +628,7 @@ fShape(0,0)      // TObjArray of detector geom.
     } // end while ever loop
     fclose(pf);
 }
+
 //______________________________________________________________________
 AliITSgeom::AliITSgeom(const AliITSgeom &source) : TObject(source){
     //     The copy constructor for the AliITSgeom class. It calls the
@@ -643,6 +644,7 @@ AliITSgeom::AliITSgeom(const AliITSgeom &source) : TObject(source){
     *this = source;  // Just use the = operator for now.
     return;
 }
+
 //______________________________________________________________________
 AliITSgeom& AliITSgeom::operator=(const AliITSgeom &source){
     //     The = operator function for the AliITSgeom class. It makes an
@@ -686,6 +688,7 @@ AliITSgeom& AliITSgeom::operator=(const AliITSgeom &source){
         this->fGm.AddAt(new TObject(*(source.fGm.At(i))),i);
     return *this;
 }
+
 //______________________________________________________________________
 Int_t AliITSgeom::GetModuleIndex(Int_t lay,Int_t lad,Int_t det)const{
     //      This routine computes the module index number from the layer,
@@ -867,16 +870,17 @@ Int_t AliITSgeom::GetLastDet(Int_t dtype)const{
     // Return:
     //     the module index for the last occurrence of that detector type.
 
-    switch(dtype){
-    case 0:
-        return GetLastSPD();
+    switch((AliITSDetector)dtype){
+    case kSPD:
+        return GetModuleIndex(3,1,1)-1;
         break;
-    case 1:
-        return GetLastSDD();
+    case kSDD:
+        return GetModuleIndex(5,1,1)-1;
         break;
-    case 2:
-        return GetLastSSD();
+    case kSSD:
+        return GetIndexMax()-1;
         break;
+    case kSSDp: case kSDDp: case kND:
     default:
         Warning("GetLastDet","undefined detector type %d",dtype);
         return 0;
@@ -1435,6 +1439,16 @@ Double_t AliITSgeom::GetAverageRadiusOfLayer(Int_t layer,Double_t &range)const{
                dl[1] = ((AliITSgeomSSD*)GetShape(idet))->GetDy();
                dl[2] = ((AliITSgeomSSD*)GetShape(idet))->GetDz();
            } break;
+           case kND:{
+               Warning("GetAverageRadiusOfLayer",
+                       "idet=kND undefined detector type");
+               continue;
+           }break;
+           default:{
+               Warning("GetAverageRadiusOfLayer",
+                       "idet=%d not a defined value",(Int_t)idet);
+               continue;
+           }break;
            }// end switch.
         } // end of
         n++;