]> 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 4f46d4b98a24b3f0d5c141cf11d43bad932377db..e61cb495506ed3b3301417401bb5e3b1af89af6c 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){
@@ -335,7 +310,7 @@ istream &operator>>(istream &is,AliITSgeomSSD175 &r){
     r.Read(&is);
     return is;
 }
-AliITSgeomSSD& AliITSgeomSSD175::operator=(const AliITSgeomSSD &source) {
+AliITSgeomSSD175& AliITSgeomSSD175::operator=(const AliITSgeomSSD175 &source) {
 ////////////////////////////////////////////////////////////////////////
 //    assignment operator
 ////////////////////////////////////////////////////////////////////////
@@ -394,6 +369,7 @@ AliITSgeomSSD275and75::AliITSgeomSSD275and75(Int_t npar,Float_t *par) :
     delete [] leA;
     delete [] leC;
 }
+
 //________________________________________________________________________
 ostream &operator<<(ostream &os,AliITSgeomSSD275and75 &p){
 ////////////////////////////////////////////////////////////////////////
@@ -412,7 +388,7 @@ istream &operator>>(istream &is,AliITSgeomSSD275and75 &r){
     r.Read(&is);
     return is;
 }
-AliITSgeomSSD& AliITSgeomSSD275and75::operator=(const AliITSgeomSSD &source) {
+AliITSgeomSSD275and75& AliITSgeomSSD275and75::operator=(const AliITSgeomSSD275and75 &source) {
 ////////////////////////////////////////////////////////////////////////
 //    assignment operator
 ////////////////////////////////////////////////////////////////////////
@@ -489,7 +465,7 @@ istream &operator>>(istream &is,AliITSgeomSSD75and275 &r){
     r.Read(&is);
     return is;
 }
-AliITSgeomSSD& AliITSgeomSSD75and275::operator=(const AliITSgeomSSD &source) {
+AliITSgeomSSD75and275& AliITSgeomSSD75and275::operator=(const AliITSgeomSSD75and275 &source) {
 ////////////////////////////////////////////////////////////////////////
 //    assignment operator
 ////////////////////////////////////////////////////////////////////////