]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSgeomSDD.cxx
A new bunch of Global QA histogramms
[u/mrichter/AliRoot.git] / ITS / AliITSgeomSDD.cxx
index 973f061dbff8f7d10c3ad89e8ec036b2d5dd845e..eac5ba516ac0e089c74e6fcf25c928f7ad213774 100644 (file)
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
-/*
-$Log$
-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
-
-Revision 1.2.4.8  2000/10/02 15:52:05  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:35  nilsen
-Fixed up comments/documentation.
+/* $Id$ */
 
-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 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 <iostream.h>
-#include <iomanip.h>
+#include <Riostream.h>
 #include <stdlib.h>
 #include <TShape.h>
-#include <TBRIK.h>
 
 #include "AliITSgeomSDD.h"
 
 ClassImp(AliITSgeomSDD)
-AliITSgeomSDD::AliITSgeomSDD(){
+AliITSgeomSDD::AliITSgeomSDD():
+TObject(),
+fPeriod(0.0),
+fDvelocity(0.0),
+fNAnodesL(0),
+fNAnodesR(0),
+fAnodeXL(0.0),
+fAnodeXR(0.0),
+fAnodeLowEdgeL(0),
+fAnodeLowEdgeR(0),
+fName(),
+fTitle(),
+fMat(),
+fDx(0.0),
+fDy(0.0),
+fDz(0.0){
 ////////////////////////////////////////////////////////////////////////
 //    default constructor
 ////////////////////////////////////////////////////////////////////////
@@ -62,7 +52,6 @@ AliITSgeomSDD::AliITSgeomSDD(){
 //    const Float_t kDy = 0.014;//cm. (Geant 3.12 units) Radialy from the Beam
 //    const Float_t kDz = 3.763;//cm. (Geant 3.12 units) Allong the Beam Pipe
 
-//    cout << "AliITSgeomSDD default creator called: start" << endl;
     fPeriod        = 0.0;
     fDvelocity     = 0.0;
     fNAnodesL      = 0;
@@ -71,14 +60,27 @@ AliITSgeomSDD::AliITSgeomSDD(){
     fAnodeXR       = 0.0;
     fAnodeLowEdgeL = 0;
     fAnodeLowEdgeR = 0;
-    fShapeSDD      = 0;
-//    cout << "AliITSgeomSDD default creator called: end" << endl;
 }
 //________________________________________________________________________
 AliITSgeomSDD::AliITSgeomSDD(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){
+                            Int_t nAR,Float_t *leR):
+TObject(),
+fPeriod(0.0),
+fDvelocity(0.0),
+fNAnodesL(0),
+fNAnodesR(0),
+fAnodeXL(0.0),
+fAnodeXR(0.0),
+fAnodeLowEdgeL(0),
+fAnodeLowEdgeR(0),
+fName(),
+fTitle(),
+fMat(),
+fDx(0.0),
+fDy(0.0),
+fDz(0.0){
 ////////////////////////////////////////////////////////////////////////
 //    Standard constructor
 ////////////////////////////////////////////////////////////////////////
@@ -90,7 +92,6 @@ AliITSgeomSDD::AliITSgeomSDD(const Float_t *box,Float_t per,Float_t vel,
     fAnodeXR       = 0.0;
     fAnodeLowEdgeL = 0;
     fAnodeLowEdgeR = 0;
-    fShapeSDD      = 0;
     ResetSDD(box,per,vel,axL,axR,nAL,leL,nAR,leR);
 }
 //________________________________________________________________________
@@ -109,23 +110,25 @@ void AliITSgeomSDD::ResetSDD(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];
-    fShapeSDD = new TBRIK("ActiveSDD","Active volume of SDD","SDD SI DET",
-                              box[0],box[1],box[2]);
+    fName="ActiveSDD";
+    fTitle="Active volume of SDD";
+    fMat="SDD Si Det";
+    fDx=box[0];
+    fDy=box[1];
+    fDz=box[2];
 }
 //________________________________________________________________________
 AliITSgeomSDD::~AliITSgeomSDD(){
 // Destructor
 
-    if(fShapeSDD!=0) delete fShapeSDD;
-    if(fAnodeLowEdgeL!=0) delete fAnodeLowEdgeL;
-    if(fAnodeLowEdgeR!=0) delete fAnodeLowEdgeR;
-    fShapeSDD  = 0;
+    if(fAnodeLowEdgeL!=0) delete [] fAnodeLowEdgeL;
+    if(fAnodeLowEdgeR!=0) delete [] fAnodeLowEdgeR;
     fPeriod    = 0.0;
     fDvelocity = 0.0;
     fAnodeXL   = 0.0;
@@ -136,47 +139,36 @@ AliITSgeomSDD::~AliITSgeomSDD(){
     fAnodeLowEdgeR = 0;
 }
 //________________________________________________________________________
-AliITSgeomSDD::AliITSgeomSDD(AliITSgeomSDD &source){
-    // Copy constructor
-    Int_t i;
-
-    if(this==&source) return;
-    this->fShapeSDD  = new TBRIK(*(source.fShapeSDD));
-    this->fPeriod    = source.fPeriod;
-    this->fDvelocity = source.fDvelocity;
-    this->fNAnodesL  = source.fNAnodesL;
-    this->fNAnodesR  = source.fNAnodesR;
-    this->fAnodeXL  = source.fAnodeXL;
-    this->fAnodeXR  = source.fAnodeXR;
-    if(fAnodeLowEdgeL!=0) delete fAnodeLowEdgeL;
-    this->fAnodeLowEdgeL = new Float_t[fNAnodesL];
-    if(fAnodeLowEdgeR!=0) delete fAnodeLowEdgeR;
-    this->fAnodeLowEdgeR = new Float_t[fNAnodesR];
-    for(i=0;i<fNAnodesL;i++)this->fAnodeLowEdgeL[i] = source.fAnodeLowEdgeL[i];
-    for(i=0;i<fNAnodesR;i++)this->fAnodeLowEdgeR[i] = source.fAnodeLowEdgeR[i];
-    return;
+AliITSgeomSDD::AliITSgeomSDD(AliITSgeomSDD &source) : TObject(source),
+fPeriod(source.fPeriod),
+fDvelocity(source.fDvelocity),
+fNAnodesL(source.fNAnodesL),
+fNAnodesR(source.fNAnodesR),
+fAnodeXL(source.fAnodeXL),
+fAnodeXR(source.fAnodeXR),
+fAnodeLowEdgeL(0),
+fAnodeLowEdgeR(0),
+fName(source.fName),
+fTitle(source.fTitle),
+fMat(source.fMat),
+fDx(source.fDx),
+fDy(source.fDy),
+fDz(source.fDz){
+    // Copy constructor  
+  fAnodeLowEdgeL = new Float_t[fNAnodesL];
+  fAnodeLowEdgeR = new Float_t[fNAnodesR];
+  for(Int_t i=0;i<fNAnodesL;i++) fAnodeLowEdgeL[i] = source.fAnodeLowEdgeL[i];
+  for(Int_t i=0;i<fNAnodesR;i++) fAnodeLowEdgeR[i] = source.fAnodeLowEdgeR[i];
 }
 //________________________________________________________________________
 AliITSgeomSDD& AliITSgeomSDD::operator=(AliITSgeomSDD &source){
     // = operator
-    Int_t i;
 
-    if(this==&source) return *this;
-    this->fShapeSDD  = new TBRIK(*(source.fShapeSDD));
-    this->fPeriod    = source.fPeriod;
-    this->fDvelocity = source.fDvelocity;
-    this->fNAnodesL  = source.fNAnodesL;
-    this->fNAnodesR  = source.fNAnodesR;
-    this->fNAnodesR  = source.fNAnodesR;
-    this->fAnodeXL  = source.fAnodeXL;
-    this->fAnodeXR  = source.fAnodeXR;
-    if(fAnodeLowEdgeL!=0) delete fAnodeLowEdgeL;
-    this->fAnodeLowEdgeL = new Float_t[fNAnodesL];
-    if(fAnodeLowEdgeR!=0) delete fAnodeLowEdgeR;
-    this->fAnodeLowEdgeR = new Float_t[fNAnodesR];
-    for(i=0;i<fNAnodesL;i++)this->fAnodeLowEdgeL[i] = source.fAnodeLowEdgeL[i];
-    for(i=0;i<fNAnodesR;i++)this->fAnodeLowEdgeR[i] = source.fAnodeLowEdgeR[i];
-    return *this;
+  this->~AliITSgeomSDD();
+  new(this) AliITSgeomSDD(source);
+  return *this;
+
 }
 //______________________________________________________________________
 void AliITSgeomSDD::Local2Det(Float_t xl,Float_t zl,Int_t &a,Int_t &t,Int_t &s){
@@ -224,7 +216,19 @@ 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 || defined __xlC__
+    ios::fmtflags fmt;
+#else
     Int_t fmt;
+#endif
+#endif
 
     fmt = os->setf(ios::scientific);  // set scientific floating point output
     *os << "TBRIK" << " ";
@@ -249,14 +253,13 @@ void AliITSgeomSDD::Read(istream *is){
 // Standard input format for this class.
 ////////////////////////////////////////////////////////////////////////
     Int_t i;
-    Float_t dx,dy,dz;
     char shp[20];
 
     *is >> shp;
-    *is >> dx >> dy >> dz;
-    if(fShapeSDD!=0) delete fShapeSDD;
-    fShapeSDD = new TBRIK("ActiveSDD","Active volume of SDD","SDD SI DET",
-                           dx,dy,dz);
+    *is >> fDx >> fDy >> fDz;
+    fName="AcrtiveSDD";
+    fTitle="Active volulme of SDD";
+    fMat="SDD Si Det";
     *is >> fPeriod >> fDvelocity >> fNAnodesL >> fNAnodesR;
     *is >> fAnodeXL >> fAnodeXR;
     if(fAnodeLowEdgeL!=0) delete fAnodeLowEdgeL;
@@ -285,24 +288,8 @@ istream &operator>>(istream &is,AliITSgeomSDD &r){
     r.Read(&is);
     return is;
 }
-//======================================================================
-/*
-$Log$
-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 <TBRIK.h>
-
-//#include "AliITSgeomSDD256.h"
+//======================================================================
 
 ClassImp(AliITSgeomSDD256)
 
@@ -310,7 +297,8 @@ AliITSgeomSDD256::AliITSgeomSDD256() : AliITSgeomSDD(){
     // Default Constructor
 }
 //----------------------------------------------------------------------
-AliITSgeomSDD256::AliITSgeomSDD256(Int_t npar,Float_t *par) : AliITSgeomSDD(){
+AliITSgeomSDD256::AliITSgeomSDD256(Int_t npar,const Float_t *par) : 
+    AliITSgeomSDD(){
 ////////////////////////////////////////////////////////////////////////
 //    constructor
 /*
@@ -704,7 +692,7 @@ _____________________________________________
 #R              (37779, 35085), pad size (184, 140)
 */
 ////////////////////////////////////////////////////////////////////////
-    const Float_t kDxyz[]   = {3.6250,0.01499,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
@@ -713,16 +701,19 @@ _____________________________________________
     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];
+    if(npar<3){
+       Error("AliITSgeomSDD256","npar=%d<3. array par must be [3] or greater",
+             npar);
+       return;
+    } // end if
+   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;
+                           kNAnodes+1,anodeLowEdges,
+                           kNAnodes+1,anodeLowEdges);
 }
 //________________________________________________________________________
 ostream &operator<<(ostream &os,AliITSgeomSDD256 &p){
@@ -742,24 +733,8 @@ istream &operator>>(istream &is,AliITSgeomSDD256 &r){
     r.Read(&is);
     return is;
 }
-//======================================================================
-/*
-$Log$
-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 <TBRIK.h>
-
-//#include "AliITSgeomSDD300.h"
+//======================================================================
 
 ClassImp(AliITSgeomSDD300)
 
@@ -774,17 +749,15 @@ 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];
+    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;
+                           kNAnodes+1,anodeLowEdges,
+                           kNAnodes+1,anodeLowEdges);
 }
 //________________________________________________________________________
 ostream &operator<<(ostream &os,AliITSgeomSDD300 &p){