]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSgeomSSD.cxx
SDD PreProcessor updated (F. Prino)
[u/mrichter/AliRoot.git] / ITS / AliITSgeomSSD.cxx
index 4f46d4b98a24b3f0d5c141cf11d43bad932377db..8bd452a1b74346cc897f32bbf6b68230e7a63bd8 100644 (file)
 // 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"
 
@@ -122,25 +124,13 @@ AliITSgeomSSD::~AliITSgeomSSD(){
     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;
-    fName = source.fName;
-    fTitle = source.fTitle;
-    fMat = source.fMat;
-    fDx = source.fDx;
-    fDy = source.fDy;
-    fDz = source.fDz;
-    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];
@@ -152,26 +142,11 @@ AliITSgeomSSD& AliITSgeomSSD::operator=(const AliITSgeomSSD &source) {
 ////////////////////////////////////////////////////////////////////////
 //    assignment operator
 ////////////////////////////////////////////////////////////////////////
-    Int_t i;
 
-    if(this == &source) return *this;
-    fName = source.fName;
-    fTitle = source.fTitle;
-    fMat = source.fMat;
-    fDx = source.fDx;
-    fDy = source.fDy;
-    fDz = source.fDz;
-    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){