]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSgeomSPD.cxx
Typo in the calculation of procetile-target distance is corrected
[u/mrichter/AliRoot.git] / ITS / AliITSgeomSPD.cxx
index c2db4c536904ade3410227fd721ee69bd05132f3..ed334699a65585d3b9ff7d6b522797924e197245 100644 (file)
 
 /*
 $Log$
+Revision 1.13  2001/10/12 22:07:20  nilsen
+A patch for C++ io manipulation functions so that they will work both
+with GNU gcc 2.96 and GNU gcc 3.01 compilers. Needs to be tested with
+other platforms.
+
+Revision 1.12  2001/08/24 21:06:37  nilsen
+Added more documentation, fixed up some coding violations, and some
+forward declorations.
+
+Revision 1.11  2001/05/16 08:17:49  hristov
+Bug fixed in the StepManager to account for the difference in the geometry 
+tree for the ITS pixels. This fixes both the funny distribution of pixel 
+coordinates and the missing hits/digits/points in many sectors of the ITS 
+pixel barrel. Also included is a patch to properly get and use the detector 
+dimensions through out the ITS code. (B.Nilsen)
+
+Revision 1.10  2001/04/26 22:44:34  nilsen
+Bug fix.
+
+Revision 1.9  2001/02/09 00:00:57  nilsen
+Fixed compatibility problem with HP unix {ios::fmtflags -> Int_t}. Fixed
+bugs in iostream based streamers used to read and write .det files. Fixed
+some detector sizes. Fixed bugs in some default-special constructors.
+
+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.
+
 */
 
+////////////////////////////////////////////////////////////////////////
+// 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.
+////////////////////////////////////////////////////////////////////////
+
 #include <iostream.h>
 #include <iomanip.h>
 #include <TShape.h>
+#include <TMath.h>
 
 #include "AliITSgeomSPD.h"
 
@@ -143,10 +180,18 @@ 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;
+#if defined __GNUC__
+#if __GNUC__ > 2
     ios::fmtflags fmt;
+#else
+    Int_t fmt;
+#endif
+#else
+    Int_t fmt;
+#endif
 
     fmt = os->setf(ios::scientific); // set scientific floating point output
     *os << "TBRIK" << " ";
@@ -155,7 +200,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 +249,31 @@ istream &operator>>(istream &is,AliITSgeomSPD &r){
 
 /*
 $Log$
+Revision 1.13  2001/10/12 22:07:20  nilsen
+A patch for C++ io manipulation functions so that they will work both
+with GNU gcc 2.96 and GNU gcc 3.01 compilers. Needs to be tested with
+other platforms.
+
+Revision 1.12  2001/08/24 21:06:37  nilsen
+Added more documentation, fixed up some coding violations, and some
+forward declorations.
+
+Revision 1.11  2001/05/16 08:17:49  hristov
+Bug fixed in the StepManager to account for the difference in the geometry tree for the ITS pixels. This fixes both the funny distribution of pixel coordinates and the missing hits/digits/points in many sectors of the ITS pixel barrel. Also included is a patch to properly get and use the detector dimensions through out the ITS code. (B.Nilsen)
+
+Revision 1.10  2001/04/26 22:44:34  nilsen
+Bug fix.
+
+Revision 1.9  2001/02/09 00:00:57  nilsen
+Fixed compatibility problem with HP unix {ios::fmtflags -> Int_t}. Fixed
+bugs in iostream based streamers used to read and write .det files. Fixed
+some detector sizes. Fixed bugs in some default-special constructors.
+
+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 +332,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 +358,31 @@ istream &operator>>(istream &is,AliITSgeomSPD300 &r){
 //=====================================================================
 /*
 $Log$
+Revision 1.13  2001/10/12 22:07:20  nilsen
+A patch for C++ io manipulation functions so that they will work both
+with GNU gcc 2.96 and GNU gcc 3.01 compilers. Needs to be tested with
+other platforms.
+
+Revision 1.12  2001/08/24 21:06:37  nilsen
+Added more documentation, fixed up some coding violations, and some
+forward declorations.
+
+Revision 1.11  2001/05/16 08:17:49  hristov
+Bug fixed in the StepManager to account for the difference in the geometry tree for the ITS pixels. This fixes both the funny distribution of pixel coordinates and the missing hits/digits/points in many sectors of the ITS pixel barrel. Also included is a patch to properly get and use the detector dimensions through out the ITS code. (B.Nilsen)
+
+Revision 1.10  2001/04/26 22:44:34  nilsen
+Bug fix.
+
+Revision 1.9  2001/02/09 00:00:57  nilsen
+Fixed compatibility problem with HP unix {ios::fmtflags -> Int_t}. Fixed
+bugs in iostream based streamers used to read and write .det files. Fixed
+some detector sizes. Fixed bugs in some default-special constructors.
+
+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
 
@@ -310,24 +405,34 @@ Fixed bug in copy and operator =.
 
 ClassImp(AliITSgeomSPD425Short)
 
-AliITSgeomSPD425Short::AliITSgeomSPD425Short(){
+AliITSgeomSPD425Short::AliITSgeomSPD425Short() : AliITSgeomSPD(){
 ////////////////////////////////////////////////////////////////////////
 //    default constructor, for ITS post TDR geometry. This only consists of
 // a default constructor to construct the defalut post TDR SPD detector 
 // geometry 256 X 197 425 by 50 micron pixels with interleaved 625 by 50
 // micron pixels (large detector).
+////////////////////////////////////////////////////////////////////////
+}
+//----------------------------------------------------------------------
+AliITSgeomSPD425Short::AliITSgeomSPD425Short(Int_t npar,Float_t *par) :
+                                                              AliITSgeomSPD(){
+////////////////////////////////////////////////////////////////////////
+//    Standard constructor, for ITS post TDR geometry. This only consists of
+// a default constructor to construct the defalut post TDR SPD detector 
+// geometry 256 X 197 425 by 50 micron pixels with interleaved 625 by 50
+// micron pixels (large detector).
 ////////////////////////////////////////////////////////////////////////
 
-    const Float_t kdx=0.6400,kdy=0.0075,kdz=4.2650; // cm; Standard pixel
-                                                    // detector size is 2dx
-                                                    //  wide, 2dz long, and
-                                                    //  2dy thick. Geant 3.12
-                                                    // units.
+    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
+                                                      // units.
     const Float_t kbinx0 = 0.0050; // cm; Standard pixel size in x direction.
     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 +446,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;
@@ -358,9 +463,10 @@ AliITSgeomSPD425Short::AliITSgeomSPD425Short(){
     for(i=0;i<knbinz;i++) dz += binSizeZ[i];
     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.");
+    SetShape("ActiveSPD","Active volume of SPD","SPD SI DET",
+            par[0],par[1],par[2]);
+    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 +497,31 @@ istream &operator>>(istream &is,AliITSgeomSPD425Short &r){
 
 /*
 $Log$
+Revision 1.13  2001/10/12 22:07:20  nilsen
+A patch for C++ io manipulation functions so that they will work both
+with GNU gcc 2.96 and GNU gcc 3.01 compilers. Needs to be tested with
+other platforms.
+
+Revision 1.12  2001/08/24 21:06:37  nilsen
+Added more documentation, fixed up some coding violations, and some
+forward declorations.
+
+Revision 1.11  2001/05/16 08:17:49  hristov
+Bug fixed in the StepManager to account for the difference in the geometry tree for the ITS pixels. This fixes both the funny distribution of pixel coordinates and the missing hits/digits/points in many sectors of the ITS pixel barrel. Also included is a patch to properly get and use the detector dimensions through out the ITS code. (B.Nilsen)
+
+Revision 1.10  2001/04/26 22:44:34  nilsen
+Bug fix.
+
+Revision 1.9  2001/02/09 00:00:57  nilsen
+Fixed compatibility problem with HP unix {ios::fmtflags -> Int_t}. Fixed
+bugs in iostream based streamers used to read and write .det files. Fixed
+some detector sizes. Fixed bugs in some default-special constructors.
+
+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
 
@@ -430,7 +561,7 @@ AliITSgeomSPD425Long::AliITSgeomSPD425Long(){
     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 = 196;    // number of pixels along z direction.
+    const Int_t   knbinz = 192;    // number of pixels along z direction.
     Int_t i;
     Float_t dx,dz,*binSizeX,*binSizeZ;
 
@@ -444,17 +575,17 @@ AliITSgeomSPD425Long::AliITSgeomSPD425Long(){
     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;
 
-    binSizeZ[163] = kbinz1;
-    binSizeZ[164] = kbinz1;
+    binSizeZ[159] = kbinz1;
+    binSizeZ[160] = kbinz1;
 
     // correct detector size for bin size.
     dx = 0.0;
@@ -465,8 +596,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.