]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSgeomSSD.cxx
Moving lib*.pkg
[u/mrichter/AliRoot.git] / ITS / AliITSgeomSSD.cxx
index 3758509d63f354a5a6977adcdb425590d2642e75..923429c5eb899578cacdfff4d312d326074b3254 100644 (file)
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
-/*
-$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.
+/* $Id$ */
 
-Revision 1.8  2000/10/02 16:32:43  barbera
-Forward declaration added
-
-Revision 1.2.4.8  2000/10/02 15:53:49  barbera
-Forward declaration added
-
-Revision 1.7  2000/07/10 16:07:18  fca
-Release version of ITS code
-
-Revision 1.2.4.2  2000/03/04 23:55:59  nilsen
-Fixed up the comments/documentation
-
-Revision 1.2.4.1  2000/01/12 19:03:32  nilsen
-This is the version of the files after the merging done in December 1999.
-See the ReadMe110100.txt file for details
-
-Revision 1.2  1999/09/29 09:24:20  fca
-Introduction of the Copyright and cvs Log
+////////////////////////////////////////////////////////////////////////
+// This class is for the Silicon Strip Detector, SSD, specific geometry.
+// It is being replaced by AliITSsegmentationSSD class. This file also
+// constains classes derived from AliITSgeomSSD which do nothing but
+// initilize this one with predefined values.
+////////////////////////////////////////////////////////////////////////
 
-*/
-#include <iostream.h>
-#include <iomanip.h>
+#include <Riostream.h>
 #include <stdlib.h>
 #include <TShape.h>
 #include <TBRIK.h>
@@ -105,15 +86,16 @@ void AliITSgeomSSD::ResetSSD(const Float_t *box,Float_t ap,Float_t an,
 AliITSgeomSSD::~AliITSgeomSSD(){
     // Destructor.
 
-    delete fLowEdgeP; fLowEdgeP = 0;
-    delete fLowEdgeN; fLowEdgeN = 0;
-    delete fShapeSSD; fShapeSSD = 0;
+    if(fLowEdgeP) delete [] fLowEdgeP; fLowEdgeP = 0;
+    if(fLowEdgeN) delete [] fLowEdgeN; fLowEdgeN = 0;
+    if(fShapeSSD) delete  fShapeSSD; fShapeSSD = 0;
     fNp = 0;
     fNn = 0;
     fAngleP = 0.0;
     fAngleN = 0.0;
 }
-AliITSgeomSSD::AliITSgeomSSD(const AliITSgeomSSD &source){
+//______________________________________________________________________
+AliITSgeomSSD::AliITSgeomSSD(const AliITSgeomSSD &source) : TObject(source){
 ////////////////////////////////////////////////////////////////////////
 //    copy  constructor
 ////////////////////////////////////////////////////////////////////////
@@ -156,6 +138,14 @@ AliITSgeomSSD& AliITSgeomSSD::operator=(const AliITSgeomSSD &source) {
 }
 //______________________________________________________________________
 void AliITSgeomSSD::Local2Det(Float_t x,Float_t z,Int_t &a,Int_t &c){
+    // Given a GEANT detector local coordinate, cm, this function returns
+    // the detector specific P and N side strip numbers.
+    // Inputs are:
+    // Float_t x   Geant detector local x coordinate in cm
+    // Float_t z   Geant detector local z coordinate in cm
+    // outputs are:
+    // Int_t &a    Detector anode strip number (P side)
+    // Int_t &c    Detector cathode strip number (N side)
     Float_t d,b;
     Int_t i;
 
@@ -178,7 +168,11 @@ void AliITSgeomSSD::Local2Det(Float_t x,Float_t z,Int_t &a,Int_t &c){
 void AliITSgeomSSD::Det2Local(Int_t a,Int_t c,Float_t &x,Float_t &z){
 //    Float_t d,b;
 //    Int_t i;
+    // use AliITSsegmentationSSD.
 
+    x=a;
+    z=c;
+    Error("Det2Locat","Use AliITSsegmentationSSD");
     return;
 }
 //______________________________________________________________________
@@ -186,8 +180,20 @@ void AliITSgeomSSD::Print(ostream *os) const {
 ////////////////////////////////////////////////////////////////////////
 // Standard output format for this class.
 ////////////////////////////////////////////////////////////////////////
-    Int_t fmt;
     Int_t i;
+#if defined __GNUC__
+#if __GNUC__ > 2
+    ios::fmtflags fmt;
+#else
+    Int_t fmt;
+#endif
+#else
+#if defined __ICC || defined __ECC || defined __xlC__
+    ios::fmtflags fmt;
+#else
+    Int_t fmt;
+#endif
+#endif
 
     fmt = os->setf(ios::scientific);  // set scientific floating point output
     *os << "TBRIK" << " ";
@@ -246,16 +252,6 @@ istream &operator>>(istream &is,AliITSgeomSSD &r){
     return is;
 }
 //======================================================================
-/*
-$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"
 
 ClassImp(AliITSgeomSSD175)
 
@@ -309,16 +305,6 @@ istream &operator>>(istream &is,AliITSgeomSSD175 &r){
     return is;
 }
 //======================================================================
-/*
-$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"
 
 ClassImp(AliITSgeomSSD275and75)
 
@@ -326,6 +312,14 @@ AliITSgeomSSD275and75::AliITSgeomSSD275and75() : AliITSgeomSSD(){
 ////////////////////////////////////////////////////////////////////////
 //    default constructor
 ////////////////////////////////////////////////////////////////////////
+}
+//----------------------------------------------------------------------
+AliITSgeomSSD275and75::AliITSgeomSSD275and75(Int_t npar,Float_t *par) : 
+                                                            AliITSgeomSSD(){
+    // Default constructor for AliITSgeomSSD with strip angles of
+    // 275 miliradians and 75 miliradians. This constructor initlizes
+    // AliITSgeomSSD with the correct values. This is the miror image
+    // of the AliITSgeomSSD75and275 class.
     const Float_t kDxyz[] ={3.6500,0.0150,2.000};//cm. (Geant 3.12 units)
     // Size of sensitive detector area x,y(thickness),z
     const Float_t kangleA  = 0.0275; // angle in rad. of anode and cathodes
@@ -335,6 +329,11 @@ AliITSgeomSSD275and75::AliITSgeomSSD275and75() : AliITSgeomSSD(){
     Float_t *leA,*leC; // array of low edges anode and cathorde.
     Int_t i;
 
+    if(npar<3){
+       Error("AliITSgeomSSD275and75",
+             "npar=%d<3. array par must be [3] or larger.",npar);
+       return;
+    } // end if
     leA = new Float_t[kNstrips+1];
     leC = new Float_t[kNstrips+1];
     leA[0] = -kDxyz[0];
@@ -348,10 +347,10 @@ AliITSgeomSSD275and75::AliITSgeomSSD275and75() : AliITSgeomSSD(){
     leA[kNstrips] =  kDxyz[0];
     leC[kNstrips] = -kDxyz[0];
 //    cout << "AliITSgeomSSD275and75 default creator called: start" << endl;
-    AliITSgeomSSD::ResetSSD(kDxyz,kangleA,kangleC,
+    AliITSgeomSSD::ResetSSD(par,kangleA,kangleC,
                                 kNstrips+1,leA,kNstrips+1,leC);
-    delete leA;
-    delete leC;
+    delete [] leA;
+    delete [] leC;
 //    cout << "AliITSgeomSSD275and75 default creator called: end" << endl;
 }
 //________________________________________________________________________
@@ -373,15 +372,6 @@ istream &operator>>(istream &is,AliITSgeomSSD275and75 &r){
     return is;
 }
 //======================================================================
-/*
-$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"
 
 ClassImp(AliITSgeomSSD75and275)
 
@@ -389,6 +379,13 @@ AliITSgeomSSD75and275::AliITSgeomSSD75and275() : AliITSgeomSSD(){
 ////////////////////////////////////////////////////////////////////////
 //    default constructor
 ////////////////////////////////////////////////////////////////////////
+}
+AliITSgeomSSD75and275::AliITSgeomSSD75and275(Int_t npar,Float_t *par) : 
+                                                            AliITSgeomSSD(){
+    // Default constructor for AliITSgeomSSD with strip angles of
+    // 75 miliradians and 275 miliradians. This constructor initlizes
+    // AliITSgeomSSD with the correct values. This is the miror image
+    // of the AliITSgeomSSD275and75 class.
     const Float_t kDxyz[] ={3.6500,0.0150,2.000};//cm. (Geant 3.12 units)
     // Size of sensitive detector area x,y(thickness),z
     const Float_t kangleA  = 0.0075; // angle in rad. of anode and cathodes
@@ -398,6 +395,11 @@ AliITSgeomSSD75and275::AliITSgeomSSD75and275() : AliITSgeomSSD(){
     Float_t *leA,*leC; // array of low edges anode and cathorde.
     Int_t i;
 
+    if(npar<3){
+       Error("AliITSgeomSSD75and275",
+             "npar=%d<3. array par must be [3] or larger.",npar);
+       return;
+    } // end if
     leA = new Float_t[kNstrips+1];
     leC = new Float_t[kNstrips+1];
     leA[0] = -kDxyz[0];
@@ -411,7 +413,7 @@ AliITSgeomSSD75and275::AliITSgeomSSD75and275() : AliITSgeomSSD(){
     leA[kNstrips] =  kDxyz[0];
     leC[kNstrips] = -kDxyz[0];
 //    cout << "AliITSgeomSSD275and75 default creator called: start" << endl;
-    AliITSgeomSSD::ResetSSD(kDxyz,kangleA,kangleC,
+    AliITSgeomSSD::ResetSSD(par,kangleA,kangleC,
                                 kNstrips+1,leA,kNstrips+1,leC);
     delete leA;
     delete leC;