]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSgeom.cxx
Leading particles selected within fiducial eta range.
[u/mrichter/AliRoot.git] / ITS / AliITSgeom.cxx
index 63d68cc7c64d3902c2b48fe0b373fa818801c898..128a76d63886f375268c3d9ea0f972ca61d52f96 100644 (file)
@@ -117,18 +117,15 @@ 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 <TSystem.h>
 #include <TRandom.h>
+#include <TSystem.h>
 
 #include "AliITSgeom.h"
-#include "AliITSgeomSPD.h"
 #include "AliITSgeomSDD.h"
+#include "AliITSgeomSPD.h"
 #include "AliITSgeomSSD.h"
+#include "AliLog.h"
 
 ClassImp(AliITSgeom)
 
@@ -265,18 +262,18 @@ void AliITSgeom::ReadNewFile(const char *filename){
     char *filtmp=0;
 
     filtmp = gSystem->ExpandPathName(filename);
-    cout << "AliITSgeom, Reading New .det file " << filtmp << endl;
+    AliInfo(Form("Reading New .det file %s",filtmp));
     fp = new ifstream(filtmp,ios::in);  // open file to write
     while(fp->get(c)!=NULL){ // for ever loop
        if(c==' ') continue; // remove blanks
        if(c=='\n') continue;
-       if(c=='#' || c=='!'){for(;fp->get(c)!=NULL,c!='\n';); continue;}
+       if(c=='#' || c=='!') {while(fp->get(c)) if(c=='\n') break; continue;}
        if(c=='/'){
            fp->get(c);{
-               if(c=='/'){for(;fp->get(c)!=NULL,c!='\n';);continue;}
+             if(c=='/') {while(fp->get(c)) if(c=='\n') break; continue;}
                if(c=='*'){
                NotYet:
-                   for(;fp->get(c)!=NULL,c!='*';);
+                   while(fp->get(c)) if(c=='*') break;
                    fp->get(c);{
                        if(c=='/') continue;
                        goto NotYet;
@@ -346,8 +343,8 @@ void AliITSgeom::ReadNewFile(const char *filename){
                ssd = 0;
                break;
            default:
-               Error("ReadNewFile","Unknown fShape type number=%d c=%c",ldet,c);
-               for(;fp->get(c)==NULL,c!='\n';); // skip to end of line.
+               AliError(Form("Unknown fShape type number=%d c=%c",ldet,c));
+               while(fp->get(c)) if(c=='\n') break; // skip to end of line.
                break;
            } // end switch
            break;
@@ -361,8 +358,8 @@ void AliITSgeom::ReadNewFile(const char *filename){
            m = 0;
            break;
        default:
-           Error("ReadNewFile","Data line i=%d c=%c",i,c);
-           for(;fp->get(c)==NULL,c!='\n';); // skip this line
+           AliError(Form("ReadNewFile","Data line i=%d c=%c",i,c));
+           while(fp->get(c)) if(c=='\n') break; // skip this line
            break;
        } // end switch i
     } // end while
@@ -539,7 +536,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 +549,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.
@@ -591,34 +588,6 @@ AliITSgeom& AliITSgeom::operator=(AliITSgeom &source){
    return *this;
 }
 //______________________________________________________________________
-inline Int_t AliITSgeom::GetNdetectors(Int_t lay) const {
-    // Return the number of detectors/ladder for the given layer
-    // Inputs:
-    //   Int_t lay   the layer number
-    // Outputs:
-    //   none.
-    // Return:
-    //   Int_t the number of detectors/ladders for the give layer
-        Int_t ndet;
-
-        ndet = fNdet[lay-1];
-        return ndet;
-}
-//______________________________________________________________________
-inline Int_t AliITSgeom::GetNladders(Int_t lay) const {
-    // Return the number of ladders for the given layer
-    // Inputs:
-    //   Int_t lay   the layer number
-    // Outputs:
-    //   none.
-    // Return:
-    //   Int_t the number of ladders for the give layer
-    Int_t nlad;
-
-    nlad = fNlad[lay-1];
-    return nlad;
-}
-//______________________________________________________________________
 Int_t AliITSgeom::GetModuleIndex(Int_t lay,Int_t lad,Int_t det){
     //      This routine computes the module index number from the layer,
     // ladder, and detector numbers. The number of ladders and detectors
@@ -636,6 +605,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
@@ -749,29 +719,6 @@ Int_t AliITSgeom::GetLastDet(Int_t dtype){
     return 0;
 }
 //______________________________________________________________________
-inline void AliITSgeom::GetCenterThetaPhi(Int_t lay,Int_t lad,Int_t det,
-                                   TVector &x){
-    //      This function returns the Cartesian translation [cm] and the
-    // 6 GEANT rotation angles [degrees]for a given layer ladder and
-    // detector number, in the TVector x (at least 9 elements large).
-    // Inputs:
-    //    Int_t lay    ITS Layer number
-    //    Int_t lad    ITS Ladder number
-    //    Int_t det    ITS Detector number
-    // Outputs:
-    //    TVector &x   The translation vector and the 6 rotaion angles
-    // Return:
-    //   none.
-    Double_t t[3],ang[6];
-    Int_t index=GetModuleIndex(lay,lad,det);
-
-    GetTrans(index,t);
-    GetGeantAngles(index,ang);
-    x(0) =   t[0];x(1) =   t[1];x(2) =   t[2];
-    x(3) = ang[0];x(4) = ang[1];x(5) = ang[2];
-    x(6) = ang[3];x(7) = ang[4];x(8) = ang[5];
-}
-//______________________________________________________________________
 void AliITSgeom::PrintComparison(FILE *fp,AliITSgeom *other){
     //     This function was primarily created for diagnostic reasons. It
     // print to a file pointed to by the file pointer fp the difference