]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSgeomSDD.cxx
Removing obsolete macros
[u/mrichter/AliRoot.git] / ITS / AliITSgeomSDD.cxx
index bc32ac912d5a67dbc3184a82b88fc2a08f4b5868..53d47feca2cedd40974a6dbba59360be56de8755 100644 (file)
 
 /*
 $Log$
+Revision 1.18  2002/10/22 14:45:41  alibrary
+Introducing Riostream.h
+
+Revision 1.17  2002/10/14 14:57:00  hristov
+Merging the VirtualMC branch to the main development branch (HEAD)
+
+Revision 1.15.6.1  2002/06/10 17:51:15  hristov
+Merged with v3-08-02
+
+Revision 1.16  2002/05/19 18:17:03  hristov
+Changes needed by ICC/IFC compiler (Intel)
+
+Revision 1.15  2001/11/19 16:17:03  nilsen
+Applyed fixes to bugs found by Rene Brun. With many thanks. Some additonal
+bugs found by Rene require more work to fix. Will be fixed soon.
+
+Revision 1.14  2001/10/19 21:32:35  nilsen
+Minor changes to remove compliation warning on gcc 2.92.2 compiler, and
+cleanded up a little bit of code.
+
+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/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.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
 
@@ -35,11 +81,17 @@ Revision 1.2  1999/09/29 09:24:20  fca
 Introduction of the Copyright and cvs Log
 
 */
-#include <iostream.h>
-#include <iomanip.h>
+
+////////////////////////////////////////////////////////////////////////
+// This class is for the Silicon Drift Detector, SDD, specific geometry.
+// It is being replaced by AliITSsegmentationSDD class. This file also
+// constains classes derived from AliITSgeomSDD which do nothing but
+// initilize this one with predefined values.
+////////////////////////////////////////////////////////////////////////
+
+#include <Riostream.h>
 #include <stdlib.h>
 #include <TShape.h>
-#include <TBRIK.h>
 
 #include "AliITSgeomSDD.h"
 
@@ -71,6 +123,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 +151,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];
@@ -94,8 +165,8 @@ AliITSgeomSDD::~AliITSgeomSDD(){
 // Destructor
 
     if(fShapeSDD!=0) delete fShapeSDD;
-    if(fAnodeLowEdgeL!=0) delete fAnodeLowEdgeL;
-    if(fAnodeLowEdgeR!=0) delete fAnodeLowEdgeR;
+    if(fAnodeLowEdgeL!=0) delete [] fAnodeLowEdgeL;
+    if(fAnodeLowEdgeR!=0) delete [] fAnodeLowEdgeR;
     fShapeSDD  = 0;
     fPeriod    = 0.0;
     fDvelocity = 0.0;
@@ -190,12 +261,24 @@ 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;
+#if defined __GNUC__
+#if __GNUC__ > 2
     ios::fmtflags fmt;
+#else
+    Int_t fmt;
+#endif
+#else
+#if defined __ICC || defined __ECC
+    ios::fmtflags fmt;
+#else
+    Int_t fmt;
+#endif
+#endif
 
     fmt = os->setf(ios::scientific);  // set scientific floating point output
     *os << "TBRIK" << " ";
@@ -259,17 +342,64 @@ istream &operator>>(istream &is,AliITSgeomSDD &r){
 //======================================================================
 /*
 $Log$
+Revision 1.18  2002/10/22 14:45:41  alibrary
+Introducing Riostream.h
+
+Revision 1.17  2002/10/14 14:57:00  hristov
+Merging the VirtualMC branch to the main development branch (HEAD)
+
+Revision 1.15.6.1  2002/06/10 17:51:15  hristov
+Merged with v3-08-02
+
+Revision 1.16  2002/05/19 18:17:03  hristov
+Changes needed by ICC/IFC compiler (Intel)
+
+Revision 1.15  2001/11/19 16:17:03  nilsen
+Applyed fixes to bugs found by Rene Brun. With many thanks. Some additonal
+bugs found by Rene require more work to fix. Will be fixed soon.
+
+Revision 1.14  2001/10/19 21:32:35  nilsen
+Minor changes to remove compliation warning on gcc 2.92.2 compiler, and
+cleanded up a little bit of code.
+
+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/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.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 <Riostream.h>
 //#include <TBRIK.h>
 
 //#include "AliITSgeomSDD256.h"
 
 ClassImp(AliITSgeomSDD256)
 
-AliITSgeomSDD256::AliITSgeomSDD256(){
+AliITSgeomSDD256::AliITSgeomSDD256() : AliITSgeomSDD(){
+    // Default Constructor
+}
+//----------------------------------------------------------------------
+AliITSgeomSDD256::AliITSgeomSDD256(Int_t npar,const Float_t *par) : 
+    AliITSgeomSDD(){
 ////////////////////////////////////////////////////////////////////////
-//    default constructor
+//    constructor
 /*
 Pads for probe cards in ALICE-D2       /05.03.2000/
 (X,Y) coordinates are quoted in microns and referred to the centers of 
@@ -661,7 +791,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
@@ -670,15 +800,15 @@ _____________________________________________
     const Int_t   kNAnodes  = 256;  // nuber of anodes connected
     const Float_t kAnodePitch = 0.0294; // cm
     const Float_t kAnodesZ  = -3.7485; // cm Starting location of anodes in z
-    Float_t AnodeLowEdges[kNAnodes+1];
+    Float_t anodeLowEdges[kNAnodes+1];
     Int_t i;
 
 //    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);
+   anodeLowEdges[0] = kAnodesZ;
+    for(i=0;i<kNAnodes;i++)anodeLowEdges[i+1] = kAnodePitch+anodeLowEdges[i];
+    AliITSgeomSDD::ResetSDD(par,kPeriod,kVelocity,kAnodeXL,kAnodeXR,
+                           kNAnodes+1,anodeLowEdges,
+                           kNAnodes+1,anodeLowEdges);
 //    cout << "AliITSgeomSDD256 default creator called: end" << endl;
 }
 //________________________________________________________________________
@@ -702,8 +832,50 @@ istream &operator>>(istream &is,AliITSgeomSDD256 &r){
 //======================================================================
 /*
 $Log$
+Revision 1.18  2002/10/22 14:45:41  alibrary
+Introducing Riostream.h
+
+Revision 1.17  2002/10/14 14:57:00  hristov
+Merging the VirtualMC branch to the main development branch (HEAD)
+
+Revision 1.15.6.1  2002/06/10 17:51:15  hristov
+Merged with v3-08-02
+
+Revision 1.16  2002/05/19 18:17:03  hristov
+Changes needed by ICC/IFC compiler (Intel)
+
+Revision 1.15  2001/11/19 16:17:03  nilsen
+Applyed fixes to bugs found by Rene Brun. With many thanks. Some additonal
+bugs found by Rene require more work to fix. Will be fixed soon.
+
+Revision 1.14  2001/10/19 21:32:35  nilsen
+Minor changes to remove compliation warning on gcc 2.92.2 compiler, and
+cleanded up a little bit of code.
+
+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/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.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 <Riostream.h>
 //#include <TBRIK.h>
 
 //#include "AliITSgeomSDD300.h"
@@ -721,16 +893,16 @@ AliITSgeomSDD300::AliITSgeomSDD300() : AliITSgeomSDD(){
     const Float_t kAnodeXL = -3.500; // cm
     const Float_t kAnodeXR = +3.500; // cm
     const Float_t kAnodesZ = -3.75; // cm
-    Float_t AnodeLowEdges[kNAnodes+1];
+    Float_t anodeLowEdges[kNAnodes+1];
     const Float_t kanode = 0.0250;// cm anode separation.
     Int_t i;
 
 //    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);
+   anodeLowEdges[0] = kAnodesZ;
+    for(i=0;i<kNAnodes;i++)anodeLowEdges[i+1] = kanode+anodeLowEdges[i];
+    AliITSgeomSDD::ResetSDD(kDxyz,kPeriod,kVelocity,kAnodeXL,kAnodeXR,
+                           kNAnodes+1,anodeLowEdges,
+                           kNAnodes+1,anodeLowEdges);
 //    cout << "AliITSgeomSDD300 default creator called: end" << endl;
 }
 //________________________________________________________________________