]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSgeom.cxx
Removing copy/paste code
[u/mrichter/AliRoot.git] / ITS / AliITSgeom.cxx
index b795cc12f0f0feff5c5ad435546201c22af064b5..89e1bf64689095d469745a7e6c56dbe569d845f3 100644 (file)
@@ -117,10 +117,10 @@ pixel coordinate system.
 // and AliITSgeomSSD for a more detailed example.
 ////////////////////////////////////////////////////////////////////////
 #include <Riostream.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
+//#include <stdlib.h>
+//#include <stdio.h>
+//#include <string.h>
+//#include <ctype.h>
 
 #include <TSystem.h>
 #include <TRandom.h>
@@ -539,7 +539,7 @@ AliITSgeom::AliITSgeom(const char *filename){
     fclose(pf);
 }
 //______________________________________________________________________
-AliITSgeom::AliITSgeom(AliITSgeom &source) : TObject(source){
+AliITSgeom::AliITSgeom(const AliITSgeom &source) : TObject(source){
     //     The copy constructor for the AliITSgeom class. It calls the
     // = operator function. See the = operator function for more details.
     // Inputs are:
@@ -552,7 +552,7 @@ AliITSgeom::AliITSgeom(AliITSgeom &source) : TObject(source){
     return;
 }
 //______________________________________________________________________
-AliITSgeom& AliITSgeom::operator=(AliITSgeom &source){
+AliITSgeom& AliITSgeom::operator=(const AliITSgeom &source){
     //     The = operator function for the AliITSgeom class. It makes an
     // independent copy of the class in such a way that any changes made
     // to the copied class will not affect the source class in any way.
@@ -608,6 +608,7 @@ Int_t AliITSgeom::GetModuleIndex(Int_t lay,Int_t lad,Int_t det){
     j = 0;
     for(k=0;k<lay-1;k++) j += fNdet[k]*fNlad[k];
     i = i+j;
+    if(i>=fNmodules) return -1;
     GetGeomMatrix(i)->GetIndex(id);
     if(id[0]==lay&&id[1]==lad&&id[2]==det) return i;
     // Array of modules fGm is not in expected order. Search for this index