]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSgeomSSD.cxx
Formatting changes.
[u/mrichter/AliRoot.git] / ITS / AliITSgeomSSD.cxx
index 923429c5eb899578cacdfff4d312d326074b3254..8ef056cb79efa5b9e3e30d401f2652fc3b28368a 100644 (file)
 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;
@@ -44,13 +56,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;
@@ -69,10 +93,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;
@@ -88,27 +116,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) : TObject(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];
@@ -120,21 +140,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){
@@ -214,15 +224,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;
@@ -279,12 +285,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){
@@ -304,6 +308,18 @@ istream &operator>>(istream &is,AliITSgeomSSD175 &r){
     r.Read(&is);
     return is;
 }
+AliITSgeomSSD& AliITSgeomSSD175::operator=(const AliITSgeomSSD &source) {
+////////////////////////////////////////////////////////////////////////
+//    assignment operator
+////////////////////////////////////////////////////////////////////////
+  
+
+    if(this == &source) return *this;
+    Error("AliITSgeomSSD175","Not allowed to make a = with "
+          "AliITSgeomSSD175 Using default creater instead");
+
+    return *this;
+}
 //======================================================================
 
 ClassImp(AliITSgeomSSD275and75)
@@ -346,12 +362,10 @@ 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;
 }
 //________________________________________________________________________
 ostream &operator<<(ostream &os,AliITSgeomSSD275and75 &p){
@@ -371,6 +385,19 @@ istream &operator>>(istream &is,AliITSgeomSSD275and75 &r){
     r.Read(&is);
     return is;
 }
+AliITSgeomSSD& AliITSgeomSSD275and75::operator=(const AliITSgeomSSD &source) {
+////////////////////////////////////////////////////////////////////////
+//    assignment operator
+////////////////////////////////////////////////////////////////////////
+  
+
+    if(this == &source) return *this;
+    Error("AliITSgeomSSD275and75","Not allowed to make a = with "
+          "AliITSgeomSSD275and75 Using default creater instead");
+
+    return *this;
+}
+
 //======================================================================
 
 ClassImp(AliITSgeomSSD75and275)
@@ -412,12 +439,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){
@@ -437,4 +462,17 @@ istream &operator>>(istream &is,AliITSgeomSSD75and275 &r){
     r.Read(&is);
     return is;
 }
+AliITSgeomSSD& AliITSgeomSSD75and275::operator=(const AliITSgeomSSD &source) {
+////////////////////////////////////////////////////////////////////////
+//    assignment operator
+////////////////////////////////////////////////////////////////////////
+  
+
+    if(this == &source) return *this;
+    Error("AliITSgeomSSD75and275","Not allowed to make a = with "
+          "AliITSgeomSSD75and275 Using default creater instead");
+
+    return *this;
+}
+
 //======================================================================