]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Fixed compatibility problem with HP unix {ios::fmtflags -> Int_t}. Fixed
authornilsen <nilsen@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 9 Feb 2001 00:00:57 +0000 (00:00 +0000)
committernilsen <nilsen@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 9 Feb 2001 00:00:57 +0000 (00:00 +0000)
bugs in iostream based streamers used to read and write .det files. Fixed
some detector sizes. Fixed bugs in some default-special constructors.

ITS/AliITSgeomMatrix.cxx
ITS/AliITSgeomSDD.cxx
ITS/AliITSgeomSDD.h
ITS/AliITSgeomSPD.cxx
ITS/AliITSgeomSPD.h
ITS/AliITSgeomSSD.cxx
ITS/AliITSgeomSSD.h

index 617eb48221115fa7023c930dd301144fa1683a10..a40e4f0ac2951f2522b88a9fcacc317970494368 100644 (file)
 
 /*
 $Log$
+Revision 1.7  2001/02/03 00:00:30  nilsen
+New version of AliITSgeom and related files. Now uses automatic streamers,
+set up for new formatted .det file which includes detector information.
+Additional smaller modifications are still to come.
+
 Revision 1.5  2000/10/02 16:32:35  barbera
 Forward declaration added
 
@@ -624,7 +629,7 @@ void AliITSgeomMatrix::Print(ostream *os){
 // Standard output format for this class.
 ////////////////////////////////////////////////////////////////////////
     Int_t i,j;
-    ios::fmtflags fmt;
+    Int_t fmt;
 
     fmt = os->setf(ios::scientific);  // set scientific floating point output
     *os << fDetectorIndex << " ";
index bc32ac912d5a67dbc3184a82b88fc2a08f4b5868..9cb3b3b1dfb6ca4c87030496fb01e95b7580f613 100644 (file)
 
 /*
 $Log$
+Revision 1.9  2001/02/03 00:00:30  nilsen
+New version of AliITSgeom and related files. Now uses automatic streamers,
+set up for new formatted .det file which includes detector information.
+Additional smaller modifications are still to come.
+
 Revision 1.8  2000/10/02 16:32:35  barbera
 Forward declaration added
 
@@ -71,6 +76,25 @@ AliITSgeomSDD::AliITSgeomSDD(const Float_t *box,Float_t per,Float_t vel,
                             Int_t nAR,Float_t *leR){
 ////////////////////////////////////////////////////////////////////////
 //    Standard constructor
+////////////////////////////////////////////////////////////////////////
+    fPeriod        = 0.0;
+    fDvelocity     = 0.0;
+    fNAnodesL      = 0;
+    fNAnodesR      = 0;
+    fAnodeXL       = 0.0;
+    fAnodeXR       = 0.0;
+    fAnodeLowEdgeL = 0;
+    fAnodeLowEdgeR = 0;
+    fShapeSDD      = 0;
+    ResetSDD(box,per,vel,axL,axR,nAL,leL,nAR,leR);
+}
+//________________________________________________________________________
+void AliITSgeomSDD::ResetSDD(const Float_t *box,Float_t per,Float_t vel,
+                            Float_t axL,Float_t axR,
+                            Int_t nAL,Float_t *leL,
+                            Int_t nAR,Float_t *leR){
+////////////////////////////////////////////////////////////////////////
+//    Standard Filler
 ////////////////////////////////////////////////////////////////////////
     Int_t i;
 
@@ -80,9 +104,9 @@ AliITSgeomSDD::AliITSgeomSDD(const Float_t *box,Float_t per,Float_t vel,
     fNAnodesR      = nAR;
     fAnodeXL       = axL;
     fAnodeXR       = axR;
-    if(fAnodeLowEdgeL!=0) delete fAnodeLowEdgeL;
+//    if(fAnodeLowEdgeL!=0) delete fAnodeLowEdgeL;
     fAnodeLowEdgeL = new Float_t[fNAnodesL];
-    if(fAnodeLowEdgeR!=0) delete fAnodeLowEdgeR;
+//    if(fAnodeLowEdgeR!=0) delete fAnodeLowEdgeR;
     fAnodeLowEdgeR = new Float_t[fNAnodesR];
     for(i=0;i<fNAnodesL;i++) fAnodeLowEdgeL[i] = leL[i];
     for(i=0;i<fNAnodesR;i++) fAnodeLowEdgeR[i] = leR[i];
@@ -190,12 +214,12 @@ void AliITSgeomSDD::Det2Local(Int_t a,Int_t t,Int_t s,Float_t &xl,Float_t &zl){
     return;
 }
 //______________________________________________________________________
-void AliITSgeomSDD::Print(ostream *os){
+void AliITSgeomSDD::Print(ostream *os) const {
 ////////////////////////////////////////////////////////////////////////
 // Standard output format for this class.
 ////////////////////////////////////////////////////////////////////////
     Int_t i;
-    ios::fmtflags fmt;
+    Int_t fmt;
 
     fmt = os->setf(ios::scientific);  // set scientific floating point output
     *os << "TBRIK" << " ";
@@ -259,6 +283,11 @@ istream &operator>>(istream &is,AliITSgeomSDD &r){
 //======================================================================
 /*
 $Log$
+Revision 1.9  2001/02/03 00:00:30  nilsen
+New version of AliITSgeom and related files. Now uses automatic streamers,
+set up for new formatted .det file which includes detector information.
+Additional smaller modifications are still to come.
+
 */
 //#include <iostream.h>
 //#include <TBRIK.h>
@@ -267,7 +296,7 @@ $Log$
 
 ClassImp(AliITSgeomSDD256)
 
-AliITSgeomSDD256::AliITSgeomSDD256(){
+AliITSgeomSDD256::AliITSgeomSDD256() : AliITSgeomSDD(){
 ////////////////////////////////////////////////////////////////////////
 //    default constructor
 /*
@@ -661,7 +690,7 @@ _____________________________________________
 #R              (37779, 35085), pad size (184, 140)
 */
 ////////////////////////////////////////////////////////////////////////
-    const Float_t kDxyz[]   = {3.6250,0.0150,4.3794};//cm. (Geant 3.12 units)
+    const Float_t kDxyz[]   = {3.6250,0.01499,4.3794};//cm. (Geant 3.12 units)
                                       // Size of sensitive region of detector
     const Float_t kPeriod   = 25.0E-09; // 40 MHz sampling frequence
     const Float_t kVelocity = 5.46875E+03; // cm/s drift velocity
@@ -676,9 +705,9 @@ _____________________________________________
 //    cout << "AliITSgeomSDD256 default creator called: start" << end;
     AnodeLowEdges[0] = kAnodesZ;
     for(i=0;i<kNAnodes;i++) AnodeLowEdges[i+1] = kAnodePitch+AnodeLowEdges[i];
-    AliITSgeomSDD::AliITSgeomSDD(kDxyz,kPeriod,kVelocity,kAnodeXL,kAnodeXR,
-                                kNAnodes+1,AnodeLowEdges,
-                                kNAnodes+1,AnodeLowEdges);
+    AliITSgeomSDD::ResetSDD(kDxyz,kPeriod,kVelocity,kAnodeXL,kAnodeXR,
+                           kNAnodes+1,AnodeLowEdges,
+                           kNAnodes+1,AnodeLowEdges);
 //    cout << "AliITSgeomSDD256 default creator called: end" << endl;
 }
 //________________________________________________________________________
@@ -702,6 +731,11 @@ istream &operator>>(istream &is,AliITSgeomSDD256 &r){
 //======================================================================
 /*
 $Log$
+Revision 1.9  2001/02/03 00:00:30  nilsen
+New version of AliITSgeom and related files. Now uses automatic streamers,
+set up for new formatted .det file which includes detector information.
+Additional smaller modifications are still to come.
+
 */
 //#include <iostream.h>
 //#include <TBRIK.h>
@@ -728,9 +762,9 @@ AliITSgeomSDD300::AliITSgeomSDD300() : AliITSgeomSDD(){
 //    cout << "AliITSgeomSDD300 default creator called: start" << endl;
     AnodeLowEdges[0] = kAnodesZ;
     for(i=0;i<kNAnodes;i++) AnodeLowEdges[i+1] = kanode+AnodeLowEdges[i];
-    AliITSgeomSDD::AliITSgeomSDD(kDxyz,kPeriod,kVelocity,kAnodeXL,kAnodeXR,
-                                kNAnodes+1,AnodeLowEdges,
-                                kNAnodes+1,AnodeLowEdges);
+    AliITSgeomSDD::ResetSDD(kDxyz,kPeriod,kVelocity,kAnodeXL,kAnodeXR,
+                           kNAnodes+1,AnodeLowEdges,
+                           kNAnodes+1,AnodeLowEdges);
 //    cout << "AliITSgeomSDD300 default creator called: end" << endl;
 }
 //________________________________________________________________________
index 5665644337d1ce4c5d114ed77f91106a4d0d4f5e..1c70045e8f5ece4c31b517c9c7c94b96e2abc04a 100644 (file)
@@ -20,19 +20,22 @@ class AliITSgeomSDD: public TObject {
     AliITSgeomSDD(AliITSgeomSDD &source);
     AliITSgeomSDD& operator=(AliITSgeomSDD &source);
     virtual ~AliITSgeomSDD();
+    void ResetSDD(const Float_t *box,Float_t per,Float_t vel,
+                 Float_t axL,Float_t axR,
+                 Int_t nA0,Float_t *le0,Int_t nA1,Float_t *le1);
     virtual TShape *GetShape() const {return fShapeSDD;}
-    virtual Float_t GetDx() { // Get TBRIK Dx
+    virtual Float_t GetDx() const { // Get TBRIK Dx
        if(fShapeSDD!=0) return fShapeSDD->GetDx();
        else return 0.0;}
-    virtual Float_t GetDy() {// Get TBRIK Dy
+    virtual Float_t GetDy() const {// Get TBRIK Dy
        if(fShapeSDD!=0) return fShapeSDD->GetDy();
        else return 0.0;}
-    virtual Float_t GetDz() {// Get TBRIK Dz
+    virtual Float_t GetDz() const {// Get TBRIK Dz
        if(fShapeSDD!=0) return fShapeSDD->GetDz();
        else return 0.0;}
-    virtual Float_t GetAnodeX(Int_t a,Int_t s){ // returns X position of anode
+    virtual Float_t GetAnodeX(Int_t a,Int_t s) const { // returns X position of anode
        if(s==0) return fAnodeXL; else return fAnodeXR;}
-    virtual Float_t GetAnodeZ(Int_t a,Int_t s){ // returns X position of anode
+    virtual Float_t GetAnodeZ(Int_t a,Int_t s)const { // returns X position of anode
        if(s==0) return 0.5*(fAnodeLowEdgeL[a]+fAnodeLowEdgeL[a+1]);
        else return 0.5*(fAnodeLowEdgeR[a]+fAnodeLowEdgeR[a+1]);}
     virtual void SetNAnodesL(Int_t s)
@@ -48,7 +51,7 @@ class AliITSgeomSDD: public TObject {
                         {fShapeSDD = new TBRIK(name,title,mat,dx,dy,dz);}
     virtual void Local2Det(Float_t xl,Float_t zl,Int_t &a,Int_t &t,Int_t &s);
     virtual void Det2Local(Int_t a,Int_t t,Int_t s,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 to standard in.
     // or what other or different information that is needed.
 
index c2db4c536904ade3410227fd721ee69bd05132f3..607dcd6a385e0c85c94202e532734f5c6381413f 100644 (file)
 
 /*
 $Log$
+Revision 1.8  2001/02/03 00:00:30  nilsen
+New version of AliITSgeom and related files. Now uses automatic streamers,
+set up for new formatted .det file which includes detector information.
+Additional smaller modifications are still to come.
+
 */
 
 #include <iostream.h>
 #include <iomanip.h>
 #include <TShape.h>
+#include <TMath.h>
 
 #include "AliITSgeomSPD.h"
 
@@ -143,10 +149,10 @@ void AliITSgeomSPD::DetToL(Int_t row,Int_t col,Float_t &xl,Float_t &zl){
     return;
 }
 //______________________________________________________________________
-void AliITSgeomSPD::Print(ostream *os){
+void AliITSgeomSPD::Print(ostream *os) const {
 // Standard output format for this class
     Int_t i;
-    ios::fmtflags fmt;
+    Int_t fmt;
 
     fmt = os->setf(ios::scientific); // set scientific floating point output
     *os << "TBRIK" << " ";
@@ -155,7 +161,7 @@ void AliITSgeomSPD::Print(ostream *os){
     *os << setprecision(16) << GetDz() << " ";
     *os << fNbinx-1 << " " << fNbinz-1 << " ";
     for(i=0;i<fNbinx;i++) *os << setprecision(16) << fLowBinEdgeX[i] << " ";
-    for(i=0;i<fNbinx;i++) *os << setprecision(16) << fLowBinEdgeZ[i] << " ";
+    for(i=0;i<fNbinz;i++) *os << setprecision(16) << fLowBinEdgeZ[i] << " ";
     *os << endl;
     os->flags(fmt);
     return;
@@ -204,6 +210,11 @@ istream &operator>>(istream &is,AliITSgeomSPD &r){
 
 /*
 $Log$
+Revision 1.8  2001/02/03 00:00:30  nilsen
+New version of AliITSgeom and related files. Now uses automatic streamers,
+set up for new formatted .det file which includes detector information.
+Additional smaller modifications are still to come.
+
 Revision 1.7  2000/10/02 16:32:35  barbera
 Forward declaration added
 
@@ -262,8 +273,8 @@ const Int_t   knbinz = 279;    // number of pixels along z direction.
     for(i=1;i<knbinz;i++) SetLowBinEdgeZ(i+1,GetBinLowEdgeZ(i)+kbinz0);
     SetLowBinEdgeZ(knbinz,GetBinLowEdgeZ(knbinz-1)+kbinz1);
 
-    if(dx!=kdx || dz!=kdz) Warning("::Default Creator",
-                                  "Detector size may not be write.");
+    if(TMath::Abs(dx-kdx)>1.0E-4 || TMath::Abs(dz-kdz)>1.0E-4) 
+       Warning("Default Creator","Detector size may not be write.");
     SetShape("ActiveSPD","Active volume of SPD","SPD SI DET",dx,kdy,dz);
 //    cout << "AliITSgeomSPD300 default creator called: end" << endl;
 }
@@ -288,6 +299,11 @@ istream &operator>>(istream &is,AliITSgeomSPD300 &r){
 //=====================================================================
 /*
 $Log$
+Revision 1.8  2001/02/03 00:00:30  nilsen
+New version of AliITSgeom and related files. Now uses automatic streamers,
+set up for new formatted .det file which includes detector information.
+Additional smaller modifications are still to come.
+
 Revision 1.7  2000/10/02 16:32:35  barbera
 Forward declaration added
 
@@ -318,7 +334,7 @@ AliITSgeomSPD425Short::AliITSgeomSPD425Short(){
 // micron pixels (large detector).
 ////////////////////////////////////////////////////////////////////////
 
-    const Float_t kdx=0.6400,kdy=0.0075,kdz=4.2650; // cm; Standard pixel
+    const Float_t kdx=0.6400,kdy=0.015,kdz=3.480;   // cm; Standard pixel
                                                     // detector size is 2dx
                                                     //  wide, 2dz long, and
                                                     //  2dy thick. Geant 3.12
@@ -327,7 +343,7 @@ AliITSgeomSPD425Short::AliITSgeomSPD425Short(){
     const Int_t   knbinx = 256;    // number of pixels along x direction.
     const Float_t kbinz0 = 0.0425; // cm; Standard pixel size in z direction.
     const Float_t kbinz1 = 0.0625; // cm; Special pixel size in z direction.
-    const Int_t   knbinz = 163;    // number of pixels along z direction.
+    const Int_t   knbinz = 160;    // number of pixels along z direction.
     Int_t i;
     Float_t dx,dz,*binSizeX,*binSizeZ;
 
@@ -341,14 +357,14 @@ AliITSgeomSPD425Short::AliITSgeomSPD425Short(){
     binSizeZ[ 31] = kbinz1;
     binSizeZ[ 32] = kbinz1;
 
+    binSizeZ[ 63] = kbinz1;
     binSizeZ[ 64] = kbinz1;
-    binSizeZ[ 65] = kbinz1;
 
-    binSizeZ[ 97] = kbinz1;
-    binSizeZ[ 98] = kbinz1;
+    binSizeZ[ 95] = kbinz1;
+    binSizeZ[ 96] = kbinz1;
 
-    binSizeZ[130] = kbinz1;
-    binSizeZ[131] = kbinz1;
+    binSizeZ[127] = kbinz1;
+    binSizeZ[128] = kbinz1;
 
     // correct detector size for bin size.
     dx = 0.0;
@@ -359,8 +375,8 @@ AliITSgeomSPD425Short::AliITSgeomSPD425Short(){
     dz *= 0.5;
 
     SetShape("ActiveSPD","Active volume of SPD","SPD SI DET",dx,kdy,dz);
-    if(dx!=kdx || dz!=kdz) Warning("AliITSgeomSPD425Short::Default Creator",
-                                  "Detector size may not be write.");
+    if(TMath::Abs(dx-kdx)>1.0E-4 || TMath::Abs(dz-kdz)>1.0E-4) 
+       Warning("Default Creator","Detector size may not be write.");
 
     InitLowBinEdgeX(); // array of bin sizes along x.
     InitLowBinEdgeZ(); // array of bin sizes along x.
@@ -391,6 +407,11 @@ istream &operator>>(istream &is,AliITSgeomSPD425Short &r){
 
 /*
 $Log$
+Revision 1.8  2001/02/03 00:00:30  nilsen
+New version of AliITSgeom and related files. Now uses automatic streamers,
+set up for new formatted .det file which includes detector information.
+Additional smaller modifications are still to come.
+
 Revision 1.7  2000/10/02 16:32:35  barbera
 Forward declaration added
 
@@ -465,8 +486,8 @@ AliITSgeomSPD425Long::AliITSgeomSPD425Long(){
     dz *= 0.5;
 
     SetShape("ActiveSPD","Active volume of SPD","SPD SI DET",dx,kdy,dz);
-    if(dx!=kdx || dz!=kdz) Warning("AliITSgeomSPD425Long::Default Creator",
-                                  "Detector size may not be write.");
+    if(TMath::Abs(dx-kdx)>1.0E-4 || TMath::Abs(dz-kdz)>1.0E-4) 
+       Warning("Default Creator","Detector size may not be write.");
 
     InitLowBinEdgeX(); // array of bin sizes along x.
     InitLowBinEdgeZ(); // array of bin sizes along x.
index 99d432bcd646cc477c58c4af90699fb634ccb592..82947c97dff0480aedf6cf9cea2aa736d4761311 100644 (file)
@@ -24,27 +24,27 @@ class AliITSgeomSPD : public TObject {
     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
+    virtual Float_t GetDx() const { // Get TBRIK Dx
         if(fShapeSPD!=0) return fShapeSPD->GetDx();
         else return 0.0;}
-    virtual Float_t GetDy() {// Get TBRIK Dy
+    virtual Float_t GetDy() const {// Get TBRIK Dy
         if(fShapeSPD!=0) return fShapeSPD->GetDy();
         else return 0.0;}
-    virtual Float_t GetDz() {// Get TBRIK Dz
+    virtual Float_t GetDz() const {// 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 Int_t GetNbinxX() const {return fNbinx-1;} // returns the number of bins x
+    virtual Int_t GetNbinxZ() 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.
@@ -64,7 +64,7 @@ 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.
 
  protected:
index 191244160942c0726e18a513516ad158f833384b..3758509d63f354a5a6977adcdb425590d2642e75 100644 (file)
 
 /*
 $Log$
+Revision 1.9  2001/02/03 00:00:30  nilsen
+New version of AliITSgeom and related files. Now uses automatic streamers,
+set up for new formatted .det file which includes detector information.
+Additional smaller modifications are still to come.
+
 Revision 1.8  2000/10/02 16:32:43  barbera
 Forward declaration added
 
@@ -44,19 +49,49 @@ Introduction of the Copyright and cvs Log
 #include "AliITSgeomSSD.h"
 
 ClassImp(AliITSgeomSSD)
+
+
+AliITSgeomSSD::AliITSgeomSSD(){
+// Default constructor
+    fShapeSSD = 0;
+    fNp       = 0;
+    fNn       = 0;
+    fLowEdgeP = 0;
+    fLowEdgeN = 0;
+    fAngleP   = 0.0;
+    fAngleN   = 0.0;
+}
+//----------------------------------------------------------------------
 AliITSgeomSSD::AliITSgeomSSD(const Float_t *box,Float_t ap,Float_t an,
                             Int_t np,Float_t *p,Int_t nn,Float_t *n){
 ////////////////////////////////////////////////////////////////////////
 //    Standard Constructor. *box={dx,dy,dz}, ap=anode angle, an=cathode angle,
 // nn= number of cathodes+1,*n= array of cathode low edges+highest edge,
 // np= number of anodes+1, *p= array of anode low edges+lighest edge.
+///////////////////////////////////////////////////////////////////////
+    fShapeSSD = 0;
+    fNp       = 0;
+    fNn       = 0;
+    fLowEdgeP = 0;
+    fLowEdgeN = 0;
+    fAngleP   = 0.0;
+    fAngleN   = 0.0;
+    ResetSSD(box,ap,an,np,p,nn,n);
+}
+//----------------------------------------------------------------------
+void AliITSgeomSSD::ResetSSD(const Float_t *box,Float_t ap,Float_t an,
+                            Int_t np,Float_t *p,Int_t nn,Float_t *n){
+////////////////////////////////////////////////////////////////////////
+//    Standard Filler. *box={dx,dy,dz}, ap=anode angle, an=cathode angle,
+// nn= number of cathodes+1,*n= array of cathode low edges+highest edge,
+// np= number of anodes+1, *p= array of anode low edges+lighest edge.
 ///////////////////////////////////////////////////////////////////////
     Int_t i;
 
     fShapeSSD = new TBRIK("ActiveSSD","Active volume of SSD","SSD SI DET",
                          box[0],box[1],box[2]);
-    if(fLowEdgeP!=0) delete fLowEdgeP;
-    if(fLowEdgeN!=0) delete fLowEdgeN;
+//    if(fLowEdgeP!=0) delete fLowEdgeP;
+//    if(fLowEdgeN!=0) delete fLowEdgeN;
     fNp = np;
     fNn = nn;
     fAngleP = ap;
@@ -147,11 +182,11 @@ void AliITSgeomSSD::Det2Local(Int_t a,Int_t c,Float_t &x,Float_t &z){
     return;
 }
 //______________________________________________________________________
-void AliITSgeomSSD::Print(ostream *os){
+void AliITSgeomSSD::Print(ostream *os) const {
 ////////////////////////////////////////////////////////////////////////
 // Standard output format for this class.
 ////////////////////////////////////////////////////////////////////////
-    ios::fmtflags fmt;
+    Int_t fmt;
     Int_t i;
 
     fmt = os->setf(ios::scientific);  // set scientific floating point output
@@ -188,7 +223,7 @@ void AliITSgeomSSD::Read(istream *is){
     if(fLowEdgeN !=0) delete fLowEdgeN;
     fLowEdgeP = new Float_t[fNp];
     fLowEdgeN = new Float_t[fNn];
-    for(i=0;0<fNp;i++) *is >> fLowEdgeP[i];
+    for(i=0;i<fNp;i++) *is >> fLowEdgeP[i];
     for(i=0;i<fNn;i++) *is >> fLowEdgeN[i];
     return;
 }
@@ -213,6 +248,11 @@ istream &operator>>(istream &is,AliITSgeomSSD &r){
 //======================================================================
 /*
 $Log$
+Revision 1.9  2001/02/03 00:00:30  nilsen
+New version of AliITSgeom and related files. Now uses automatic streamers,
+set up for new formatted .det file which includes detector information.
+Additional smaller modifications are still to come.
+
 */
 
 //#include "AliITSgeomSSD175.h"
@@ -244,7 +284,7 @@ AliITSgeomSSD175::AliITSgeomSSD175() : AliITSgeomSSD(){
     leA[kNstrips] =  kDxyz[0];
     leC[kNstrips] = -kDxyz[0];
 //    cout << "AliITSgeomSSD175 default creator called: start" << endl;
-    AliITSgeomSSD::AliITSgeomSSD(kDxyz,kangle,-kangle,
+    AliITSgeomSSD::ResetSSD(kDxyz,kangle,-kangle,
                                 kNstrips+1,leA,kNstrips+1,leC);
     delete leA;
     delete leC;
@@ -271,6 +311,11 @@ istream &operator>>(istream &is,AliITSgeomSSD175 &r){
 //======================================================================
 /*
 $Log$
+Revision 1.9  2001/02/03 00:00:30  nilsen
+New version of AliITSgeom and related files. Now uses automatic streamers,
+set up for new formatted .det file which includes detector information.
+Additional smaller modifications are still to come.
+
 */
 
 //#include "AliITSgeomSSD275and75.h"
@@ -303,7 +348,7 @@ AliITSgeomSSD275and75::AliITSgeomSSD275and75() : AliITSgeomSSD(){
     leA[kNstrips] =  kDxyz[0];
     leC[kNstrips] = -kDxyz[0];
 //    cout << "AliITSgeomSSD275and75 default creator called: start" << endl;
-    AliITSgeomSSD::AliITSgeomSSD(kDxyz,kangleA,kangleC,
+    AliITSgeomSSD::ResetSSD(kDxyz,kangleA,kangleC,
                                 kNstrips+1,leA,kNstrips+1,leC);
     delete leA;
     delete leC;
@@ -330,6 +375,11 @@ istream &operator>>(istream &is,AliITSgeomSSD275and75 &r){
 //======================================================================
 /*
 $Log$
+Revision 1.9  2001/02/03 00:00:30  nilsen
+New version of AliITSgeom and related files. Now uses automatic streamers,
+set up for new formatted .det file which includes detector information.
+Additional smaller modifications are still to come.
+
 */
 //#include "AliITSgeomSSD75and275.h"
 
@@ -361,7 +411,7 @@ AliITSgeomSSD75and275::AliITSgeomSSD75and275() : AliITSgeomSSD(){
     leA[kNstrips] =  kDxyz[0];
     leC[kNstrips] = -kDxyz[0];
 //    cout << "AliITSgeomSSD275and75 default creator called: start" << endl;
-    AliITSgeomSSD::AliITSgeomSSD(kDxyz,kangleA,kangleC,
+    AliITSgeomSSD::ResetSSD(kDxyz,kangleA,kangleC,
                                 kNstrips+1,leA,kNstrips+1,leC);
     delete leA;
     delete leC;
index 66f98bfd80c64cff243cd5187a61a9033d9341ee..292926a877ef250064135a448073bf05140da947 100644 (file)
@@ -15,27 +15,29 @@ class istream;
 class AliITSgeomSSD : public TObject {
 
  public:
-    AliITSgeomSSD(){;}; // default constructor
+    AliITSgeomSSD(); // default constructor
     AliITSgeomSSD(const Float_t *box,Float_t ap,Float_t an,
                  Int_t np,Float_t *p,Int_t nn,Float_t *n); // Constructor
     virtual ~AliITSgeomSSD(); // Destructor
     AliITSgeomSSD(const AliITSgeomSSD &source);// copy constructor
     virtual AliITSgeomSSD& operator=(const AliITSgeomSSD &source); // = opt.
+    void ResetSSD(const Float_t *box,Float_t ap,Float_t an,
+                 Int_t np,Float_t *p,Int_t nn,Float_t *n); // Filler
     virtual TShape *GetShape() const {return fShapeSSD;}// get shape
-    virtual Float_t GetDx(){if(fShapeSSD!=0) return fShapeSSD->GetDx();
+    virtual Float_t GetDx() const {if(fShapeSSD!=0) return fShapeSSD->GetDx();
                     else return 0.0;}// get Dx
-    virtual Float_t GetDy(){if(fShapeSSD!=0) return fShapeSSD->GetDy();
+    virtual Float_t GetDy() const {if(fShapeSSD!=0) return fShapeSSD->GetDy();
                     else return 0.0;}// get Dy
-    virtual Float_t GetDz(){if(fShapeSSD!=0) return fShapeSSD->GetDz();
+    virtual Float_t GetDz() const {if(fShapeSSD!=0) return fShapeSSD->GetDz();
                     else return 0.0;}// get Dz
-    virtual Int_t GetNAnodes() {return fNp-1;}//the number of Anodes "P"
-    virtual Int_t GetNCathodess() {return fNn-1;}//the number of Cathodes "N"
-    virtual Float_t GetAnodePitch(Int_t i=0){ //anode pitch for anode i
+    virtual Int_t GetNAnodes() const {return fNp-1;}//the number of Anodes "P"
+    virtual Int_t GetNCathodess() const {return fNn-1;}//the number of Cathodes "N"
+    virtual Float_t GetAnodePitch(Int_t i=0) const { //anode pitch for anode i
        if(i>=0&&i<fNp) return fLowEdgeP[i+1]-fLowEdgeP[i];else return 0.0;}
-    virtual Float_t GetCathodePitch(Int_t i=0){ // cathode pitch for cathode i
+    virtual Float_t GetCathodePitch(Int_t i=0) const { // cathode pitch for cathode i
        if(i>0&&i<fNn) return fLowEdgeN[1]-fLowEdgeN[0];else return 0.0;}
-    virtual Float_t GetAnodeAngle(){return fAngleP;}//anode strip angle.
-    virtual Float_t GetCathodeAngle(){return fAngleN;}//cathode strip angle.
+    virtual Float_t GetAnodeAngle() const {return fAngleP;}//anode strip angle.
+    virtual Float_t GetCathodeAngle() const {return fAngleN;}//cathode strip angle.
     virtual void SetShape(char *name,char *title,char *mat,
                           Float_t dx,Float_t dy,Float_t dz){
        // defines TBRIK with given paramters
@@ -56,7 +58,7 @@ class AliITSgeomSSD : public TObject {
     virtual void Local2Det(Float_t x,Float_t z,Int_t &a,Int_t &c);
     virtual void Det2Local(Int_t a,Int_t c,Float_t &x,Float_t &z);
 
-    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 to standard in.
 
  protected: