]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSgeomSPD.h
Improved usage of the environment variable TOCDB
[u/mrichter/AliRoot.git] / ITS / AliITSgeomSPD.h
index 99d432bcd646cc477c58c4af90699fb634ccb592..858565cfb29832f59d1886222feb1144d22b53e9 100644 (file)
@@ -4,12 +4,16 @@
  * See cxx source for full Copyright notice                               */
 
 /* $Id$ */
-
+#include <Riostream.h>
 #include <TObject.h>
 #include <TBRIK.h>
 
-class ostream;
-class istream;
+////////////////////////////////////////////////////////////////////////
+// This class is for the Silicon Pixel Detector, SPD, specific geometry.
+// It is being replaced by AliITSsegmentationSPD class. This file also
+// constains classes derived from AliITSgeomSPD which do nothing but
+// initilize this one with predefined values.
+////////////////////////////////////////////////////////////////////////
 
 class TShape;
 
@@ -23,28 +27,23 @@ class AliITSgeomSPD : public TObject {
     virtual ~AliITSgeomSPD();
     virtual void ReSetBins(Float_t dy,Int_t nx,Float_t *bx,
                           Int_t nz,Float_t *bz);
-    virtual TShape *GetShape() const {return fShapeSPD;}
-    virtual Float_t GetDx() { // Get TBRIK Dx
-        if(fShapeSPD!=0) return fShapeSPD->GetDx();
-        else return 0.0;}
-    virtual Float_t GetDy() {// Get TBRIK Dy
-        if(fShapeSPD!=0) return fShapeSPD->GetDy();
-        else return 0.0;}
-    virtual Float_t GetDz() {// Get TBRIK Dz
-        if(fShapeSPD!=0) return fShapeSPD->GetDz();
-        else return 0.0;}
-    virtual Int_t GetNbinxX(){return fNbinx-1;} // returns the number of bins x
-    virtual Int_t GetNbinxZ(){return fNbinz-1;} // returns the number of bins z
-    virtual Float_t GetBinSizeX(Int_t i)
+    virtual TShape *GetShape() const {return new TBRIK(fName.Data(),
+                         fTitle.Data(),fMat.Data(),GetDx(),GetDy(),GetDz());}
+    virtual Float_t GetDx() const {return fDx;} // Get TBRIK Dx
+    virtual Float_t GetDy() const {return fDy;}// Get TBRIK Dy
+    virtual Float_t GetDz() const {return fDz;}// Get TBRIK Dz
+    virtual Int_t GetNbinsX() const {return fNbinx-1;} // returns the number of bins x
+    virtual Int_t GetNbinsZ() const {return fNbinz-1;} // returns the number of bins z
+    virtual Float_t GetBinSizeX(Int_t i) const
        {if(i<fNbinx-1&&i>=0) return fLowBinEdgeX[i+1]-fLowBinEdgeX[i];
        else return 0.0;}; // give size of bin i in x.
-    virtual Float_t GetBinSizeZ(Int_t i)
+    virtual Float_t GetBinSizeZ(Int_t i) const
        {if(i<fNbinx-1&&i>=0) return fLowBinEdgeZ[i+1]-fLowBinEdgeZ[i];
        else return 0.0;}; // give size of bin i in z.
-    virtual Float_t GetBinLowEdgeX(Int_t i)
+    virtual Float_t GetBinLowEdgeX(Int_t i) const
        {if(i<fNbinx-1&&i>=0) return fLowBinEdgeX[i];
        else return 0.0;}; // give size of bin i in x.
-    virtual Float_t GetBinLowEdgeZ(Int_t i)
+    virtual Float_t GetBinLowEdgeZ(Int_t i) const
        {if(i<fNbinz-1&&i>=0) return fLowBinEdgeZ[i];
        else return 0.0;}; // give size of bin i in z.
     virtual void InitLowBinEdgeX(){// allocate memory for fLowBinEdgeX.
@@ -54,8 +53,7 @@ class AliITSgeomSPD : public TObject {
        if(fLowBinEdgeZ!=0) delete[] fLowBinEdgeZ;
        if(fNbinz>0) fLowBinEdgeZ = new Float_t[fNbinz];else fLowBinEdgeZ = 0;}
     virtual void SetShape(const char *name,const char *title,const char *mat,
-                         Float_t dx,Float_t dy,Float_t dz)
-       {fShapeSPD = new TBRIK(name,title,mat,dx,dy,dz);};
+                         Float_t dx,Float_t dy,Float_t dz);
     virtual void SetNbinX(Int_t i){fNbinx = i+1;} // Set nubmer of pixels in x
     virtual void SetNbinZ(Int_t i){fNbinz = i+1;} // Set nubmer of pixels in z
     virtual void SetLowBinEdgeX(Int_t i,Float_t s){//puts value in fLowbinEdgeX
@@ -64,17 +62,24 @@ class AliITSgeomSPD : public TObject {
        if(i>=0&&i<fNbinz) fLowBinEdgeZ[i] = s;};
     virtual void LToDet(Float_t xl,Float_t zl,Int_t &row,Int_t &col);
     virtual void DetToL(Int_t row,Int_t col,Float_t &xl,Float_t &zl);
-    virtual void Print(ostream *os); // output streamer to standard out.
+    virtual void Print(ostream *os) const; // output streamer to standard out.
     virtual void Read(istream *is); // input streamer from standard in.
+    virtual void Print(Option_t *option="") const {TObject::Print(option);}
+    virtual Int_t Read(const char *name) {return TObject::Read(name);}
 
  protected:
-    TBRIK  *fShapeSPD; // SPD active area shape
+    TString fName;  // Object name  Replacement for TBRIK
+    TString fTitle; // Ojbect title  Replacement for TBRIK
+    TString fMat;   // Object material name  Replacement for TBRIK
+    Float_t fDx;   // half length in z  Replacement for TBRIK
+    Float_t fDy;   // half length in y  Replacement for TBRIK
+    Float_t fDz;   // half length in z  Replacement for TBRIK
     Int_t fNbinx;  // the number of elements in fLowBinEdgeX (#bins-1)
     Int_t fNbinz;  // the number of elements in fLowBinEdgeZ (#bins-1)
     Float_t *fLowBinEdgeX; //[fNbinx] Array of X lower bin edges for the pixels
     Float_t *fLowBinEdgeZ; //[fNbinz] Array of Z lower bin edges for the pixels
 
-    ClassDef(AliITSgeomSPD,1) // ITS SPD detector geometry class..
+    ClassDef(AliITSgeomSPD,2) // ITS SPD detector geometry class..
 
 };
 // Input and output function for standard C++ input/output.
@@ -92,8 +97,6 @@ istream &operator>>(istream &os,AliITSgeomSPD &source);
 
 //#include "AliITSgeomSPD.h"
 
-class ostream;
-class istream;
 
 class AliITSgeomSPD300 : public AliITSgeomSPD {
 
@@ -125,13 +128,12 @@ istream &operator>>(istream &os,AliITSgeomSPD300 &source);
 
 // temporary - this will migrate into the segmentation class
 
-class ostream;
-class istream;
 
 class AliITSgeomSPD425Short : public AliITSgeomSPD {
 
  public:
     AliITSgeomSPD425Short();
+    AliITSgeomSPD425Short(Int_t npar,Float_t *par);
 
     // This clas now has version 0 so that it will not be written to a root
     // file. This is good since there are no longer any data members to this
@@ -158,8 +160,6 @@ istream &operator>>(istream &os,AliITSgeomSPD425Short &source);
 
 // temporary - this will migrate into the segmentation class
 
-class ostream;
-class istream;
 
 class AliITSgeomSPD425Long : public AliITSgeomSPD {