]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSgeomSSD.cxx
some histos added for TPC clusters
[u/mrichter/AliRoot.git] / ITS / AliITSgeomSSD.cxx
index 5848a7d81e8cf8787666a250570f4bab3eb30993..e61cb495506ed3b3301417401bb5e3b1af89af6c 100644 (file)
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
-/*
-$Log$
-Revision 1.16  2002/10/14 14:57:00  hristov
-Merging the VirtualMC branch to the main development branch (HEAD)
-
-Revision 1.14.6.1  2002/06/10 17:51:15  hristov
-Merged with v3-08-02
-
-Revision 1.15  2002/05/19 18:17:03  hristov
-Changes needed by ICC/IFC compiler (Intel)
-
-Revision 1.14  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.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: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
-
-*/
+/* $Id$ */
 
 ////////////////////////////////////////////////////////////////////////
 // This class is for the Silicon Strip Detector, SSD, specific geometry.
@@ -78,19 +22,33 @@ Introduction of the Copyright and cvs Log
 // initilize this one with predefined values.
 ////////////////////////////////////////////////////////////////////////
 
-#include <Riostream.h>
 #include <stdlib.h>
-#include <TShape.h>
+
+#include <Riostream.h>
 #include <TBRIK.h>
+#include <TMath.h>
+#include <TShape.h>
 
 #include "AliITSgeomSSD.h"
 
 ClassImp(AliITSgeomSSD)
 
 
-AliITSgeomSSD::AliITSgeomSSD(){
+AliITSgeomSSD::AliITSgeomSSD():
+TObject(),
+fName(),
+fTitle(),
+fMat(),
+fDx(0.0),
+fDy(0.0),
+fDz(0.0),
+fNp(0),
+fNn(0),
+fLowEdgeP(0),
+fLowEdgeN(0),
+fAngleP(0.0),
+fAngleN(0.0){
 // Default constructor
-    fShapeSSD = 0;
     fNp       = 0;
     fNn       = 0;
     fLowEdgeP = 0;
@@ -100,13 +58,25 @@ AliITSgeomSSD::AliITSgeomSSD(){
 }
 //----------------------------------------------------------------------
 AliITSgeomSSD::AliITSgeomSSD(const Float_t *box,Float_t ap,Float_t an,
-                            Int_t np,Float_t *p,Int_t nn,Float_t *n){
+                            Int_t np,Float_t *p,Int_t nn,Float_t *n):
+TObject(),
+fName(),
+fTitle(),
+fMat(),
+fDx(0.0),
+fDy(0.0),
+fDz(0.0),
+fNp(0),
+fNn(0),
+fLowEdgeP(0),
+fLowEdgeN(0),
+fAngleP(0.0),
+fAngleN(0.0){
 ////////////////////////////////////////////////////////////////////////
 //    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;
@@ -125,10 +95,14 @@ void AliITSgeomSSD::ResetSSD(const Float_t *box,Float_t ap,Float_t an,
 ///////////////////////////////////////////////////////////////////////
     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;
+    fName = "ActiveSSD";
+    fTitle = "Active volume of SSD";
+    fMat = "SSD Si Det";
+    fDx  = box[0];
+    fDy  = box[1];
+    fDz  = box[2];
+    if(fLowEdgeP!=0) delete fLowEdgeP;
+    if(fLowEdgeN!=0) delete fLowEdgeN;
     fNp = np;
     fNn = nn;
     fAngleP = ap;
@@ -144,26 +118,19 @@ AliITSgeomSSD::~AliITSgeomSSD(){
 
     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),
+fName(source.fName),fTitle(source.fTitle),fMat(source.fMat),fDx(source.fDx),fDy(source.fDy),fDz(source.fDz),fNp(source.fNp),fNn(source.fNn),fLowEdgeP(0),fLowEdgeN(0),fAngleP(source.fAngleP),fAngleN(source.fAngleN){
 ////////////////////////////////////////////////////////////////////////
 //    copy  constructor
 ////////////////////////////////////////////////////////////////////////
     Int_t i;
 
-    if(this == &source) return;
-    this->fShapeSSD = new TBRIK(*(source.fShapeSSD));
-    this->fNp = source.fNp;
-    this->fNn = source.fNn;
-    delete fLowEdgeP;
-    delete fLowEdgeN;
-    this->fAngleP = source.fAngleP;
-    this->fAngleN = source.fAngleN;
     fLowEdgeP = new Float_t[fNp];
     fLowEdgeN = new Float_t[fNn];
     for(i=0;i<fNp;i++) this->fLowEdgeP[i] = source.fLowEdgeP[i];
@@ -175,21 +142,11 @@ AliITSgeomSSD& AliITSgeomSSD::operator=(const AliITSgeomSSD &source) {
 ////////////////////////////////////////////////////////////////////////
 //    assignment operator
 ////////////////////////////////////////////////////////////////////////
-    Int_t i;
 
-    if(this == &source) return *this;
-    this->fShapeSSD = new TBRIK(*(source.fShapeSSD));
-    this->fNp = source.fNp;
-    this->fNn = source.fNn;
-    delete fLowEdgeP;
-    delete fLowEdgeN;
-    this->fAngleP = source.fAngleP;
-    this->fAngleN = source.fAngleN;
-    fLowEdgeP = new Float_t[fNp];
-    fLowEdgeN = new Float_t[fNn];
-    for(i=0;i<fNp;i++) this->fLowEdgeP[i] = source.fLowEdgeP[i];
-    for(i=0;i<fNn;i++) this->fLowEdgeN[i] = source.fLowEdgeN[i];
-    return *this;
+  this->~AliITSgeomSSD();
+  new(this) AliITSgeomSSD(source);
+  return *this;
+
 }
 //______________________________________________________________________
 void AliITSgeomSSD::Local2Det(Float_t x,Float_t z,Int_t &a,Int_t &c){
@@ -223,7 +180,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;
 }
 //______________________________________________________________________
@@ -239,7 +200,7 @@ void AliITSgeomSSD::Print(ostream *os) const {
     Int_t fmt;
 #endif
 #else
-#if defined __ICC
+#if defined __ICC || defined __ECC || defined __xlC__
     ios::fmtflags fmt;
 #else
     Int_t fmt;
@@ -265,15 +226,11 @@ void AliITSgeomSSD::Read(istream *is){
 ////////////////////////////////////////////////////////////////////////
 // Standard input format for this class.
 ////////////////////////////////////////////////////////////////////////
-    Float_t dx,dy,dz;
     Int_t i;
     char shp[20];
 
     *is >> shp;
-    *is >> dx >> dy >> dz;
-    if(fShapeSSD!=0) delete fShapeSSD;
-    fShapeSSD = new TBRIK("ActiveSSD","Active volume of SSD","SSD SI DET",
-                           dx,dy,dz);
+    *is >> fDx >> fDy >> fDz;
     *is >> fNp >> fNn;
     *is >> fAngleP >> fAngleN;
     if(fLowEdgeP !=0) delete fLowEdgeP;
@@ -303,46 +260,6 @@ istream &operator>>(istream &is,AliITSgeomSSD &r){
     return is;
 }
 //======================================================================
-/*
-$Log$
-Revision 1.16  2002/10/14 14:57:00  hristov
-Merging the VirtualMC branch to the main development branch (HEAD)
-
-Revision 1.14.6.1  2002/06/10 17:51:15  hristov
-Merged with v3-08-02
-
-Revision 1.15  2002/05/19 18:17:03  hristov
-Changes needed by ICC/IFC compiler (Intel)
-
-Revision 1.14  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.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 "AliITSgeomSSD175.h"
 
 ClassImp(AliITSgeomSSD175)
 
@@ -370,12 +287,10 @@ AliITSgeomSSD175::AliITSgeomSSD175() : AliITSgeomSSD(){
     } // end for i
     leA[kNstrips] =  kDxyz[0];
     leC[kNstrips] = -kDxyz[0];
-//    cout << "AliITSgeomSSD175 default creator called: start" << endl;
     AliITSgeomSSD::ResetSSD(kDxyz,kangle,-kangle,
                                 kNstrips+1,leA,kNstrips+1,leC);
     delete leA;
     delete leC;
-//    cout << "AliITSgeomSSD175 default creator called: end" << endl;
 }
 //________________________________________________________________________
 ostream &operator<<(ostream &os,AliITSgeomSSD175 &p){
@@ -395,47 +310,19 @@ istream &operator>>(istream &is,AliITSgeomSSD175 &r){
     r.Read(&is);
     return is;
 }
-//======================================================================
-/*
-$Log$
-Revision 1.16  2002/10/14 14:57:00  hristov
-Merging the VirtualMC branch to the main development branch (HEAD)
-
-Revision 1.14.6.1  2002/06/10 17:51:15  hristov
-Merged with v3-08-02
-
-Revision 1.15  2002/05/19 18:17:03  hristov
-Changes needed by ICC/IFC compiler (Intel)
-
-Revision 1.14  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.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.
+AliITSgeomSSD175& AliITSgeomSSD175::operator=(const AliITSgeomSSD175 &source) {
+////////////////////////////////////////////////////////////////////////
+//    assignment operator
+////////////////////////////////////////////////////////////////////////
+  
 
-*/
+    if(this == &source) return *this;
+    Error("AliITSgeomSSD175","Not allowed to make a = with "
+          "AliITSgeomSSD175 Using default creater instead");
 
-//#include "AliITSgeomSSD275and75.h"
+    return *this;
+}
+//======================================================================
 
 ClassImp(AliITSgeomSSD275and75)
 
@@ -460,6 +347,11 @@ AliITSgeomSSD275and75::AliITSgeomSSD275and75(Int_t npar,Float_t *par) :
     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];
@@ -472,13 +364,12 @@ AliITSgeomSSD275and75::AliITSgeomSSD275and75(Int_t npar,Float_t *par) :
     } // end for i
     leA[kNstrips] =  kDxyz[0];
     leC[kNstrips] = -kDxyz[0];
-//    cout << "AliITSgeomSSD275and75 default creator called: start" << endl;
     AliITSgeomSSD::ResetSSD(par,kangleA,kangleC,
                                 kNstrips+1,leA,kNstrips+1,leC);
-    delete leA;
-    delete leC;
-//    cout << "AliITSgeomSSD275and75 default creator called: end" << endl;
+    delete [] leA;
+    delete [] leC;
 }
+
 //________________________________________________________________________
 ostream &operator<<(ostream &os,AliITSgeomSSD275and75 &p){
 ////////////////////////////////////////////////////////////////////////
@@ -497,46 +388,20 @@ istream &operator>>(istream &is,AliITSgeomSSD275and75 &r){
     r.Read(&is);
     return is;
 }
-//======================================================================
-/*
-$Log$
-Revision 1.16  2002/10/14 14:57:00  hristov
-Merging the VirtualMC branch to the main development branch (HEAD)
-
-Revision 1.14.6.1  2002/06/10 17:51:15  hristov
-Merged with v3-08-02
-
-Revision 1.15  2002/05/19 18:17:03  hristov
-Changes needed by ICC/IFC compiler (Intel)
-
-Revision 1.14  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.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)
+AliITSgeomSSD275and75& AliITSgeomSSD275and75::operator=(const AliITSgeomSSD275and75 &source) {
+////////////////////////////////////////////////////////////////////////
+//    assignment operator
+////////////////////////////////////////////////////////////////////////
+  
 
-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.
+    if(this == &source) return *this;
+    Error("AliITSgeomSSD275and75","Not allowed to make a = with "
+          "AliITSgeomSSD275and75 Using default creater instead");
 
-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.
+    return *this;
+}
 
-*/
-//#include "AliITSgeomSSD75and275.h"
+//======================================================================
 
 ClassImp(AliITSgeomSSD75and275)
 
@@ -560,6 +425,11 @@ AliITSgeomSSD75and275::AliITSgeomSSD75and275(Int_t npar,Float_t *par) :
     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];
@@ -572,12 +442,10 @@ AliITSgeomSSD75and275::AliITSgeomSSD75and275(Int_t npar,Float_t *par) :
     } // end for i
     leA[kNstrips] =  kDxyz[0];
     leC[kNstrips] = -kDxyz[0];
-//    cout << "AliITSgeomSSD275and75 default creator called: start" << endl;
     AliITSgeomSSD::ResetSSD(par,kangleA,kangleC,
                                 kNstrips+1,leA,kNstrips+1,leC);
     delete leA;
     delete leC;
-//    cout << "AliITSgeomSSD275and75 default creator called: end" << endl;
 }
 //________________________________________________________________________
 ostream &operator<<(ostream &os,AliITSgeomSSD75and275 &p){
@@ -597,4 +465,17 @@ istream &operator>>(istream &is,AliITSgeomSSD75and275 &r){
     r.Read(&is);
     return is;
 }
+AliITSgeomSSD75and275& AliITSgeomSSD75and275::operator=(const AliITSgeomSSD75and275 &source) {
+////////////////////////////////////////////////////////////////////////
+//    assignment operator
+////////////////////////////////////////////////////////////////////////
+  
+
+    if(this == &source) return *this;
+    Error("AliITSgeomSSD75and275","Not allowed to make a = with "
+          "AliITSgeomSSD75and275 Using default creater instead");
+
+    return *this;
+}
+
 //======================================================================