From a8d73343c5162672722e65c07a1783a6ffaf14c2 Mon Sep 17 00:00:00 2001 From: masera Date: Fri, 27 Oct 2006 08:18:41 +0000 Subject: [PATCH] changes to be compliant with Eff C++ rules --- ITS/AliITSBeamTestDig.cxx | 41 ++++++------- ITS/AliITSBeamTestDigSDD.cxx | 44 +++++++------- ITS/AliITSBeamTestDigSPD.cxx | 12 ++-- ITS/AliITSBeamTestDigSSD.cxx | 7 ++- ITS/AliITSRawClusterSDD.cxx | 108 +++++++++++++++++++---------------- ITS/AliITSRawClusterSPD.cxx | 45 +++++++++------ ITS/AliITSRawClusterSSD.cxx | 24 +++++--- 7 files changed, 153 insertions(+), 128 deletions(-) diff --git a/ITS/AliITSBeamTestDig.cxx b/ITS/AliITSBeamTestDig.cxx index 4cd85f02e06..bba8d75486d 100644 --- a/ITS/AliITSBeamTestDig.cxx +++ b/ITS/AliITSBeamTestDig.cxx @@ -12,48 +12,45 @@ ClassImp(AliITSBeamTestDig) //_____________________________________________________________ - AliITSBeamTestDig::AliITSBeamTestDig(): TTask() + AliITSBeamTestDig::AliITSBeamTestDig(): TTask(), +fITSHeader(0), +fReader(0), +fTreeD(0), +fITSgeom(0) { // // Default constructor // - fReader=0; - fTreeD=0; - fITSHeader=0; - fITSgeom=0; } //_____________________________________________________________ - AliITSBeamTestDig::AliITSBeamTestDig(const Text_t* name, const Text_t* title): TTask(name,title) +AliITSBeamTestDig::AliITSBeamTestDig(const Text_t* name, const Text_t* title): TTask(name,title), +fITSHeader(0), +fReader(0), +fTreeD(0), +fITSgeom(0) { // // Standard constructor // - fReader=0; - fTreeD=0; - fITSHeader=0; - fITSgeom = 0; } //______________________________________________________________________ -AliITSBeamTestDig::AliITSBeamTestDig(const AliITSBeamTestDig &bt):TTask(bt){ +AliITSBeamTestDig::AliITSBeamTestDig(const AliITSBeamTestDig &bt):TTask(bt), +fITSHeader(bt.fITSHeader), +fReader(bt.fReader), +fTreeD(bt.fTreeD), +fITSgeom(bt.fITSgeom){ // Copy constructor. - fReader=bt.fReader; - fTreeD=bt.fTreeD; - fITSHeader=bt.fITSHeader; - fITSgeom = bt.fITSgeom; } //______________________________________________________________________ AliITSBeamTestDig& AliITSBeamTestDig::operator=(const AliITSBeamTestDig &source){ - // Assignment operator. This is a function which is not allowed to be - // done to the ITS beam test dig. It exits with an error. - // Inputs: - if(this==&source) return *this; - Error("operator=","You are not allowed to make a copy of the AliITSBeamTestDig"); - exit(1); - return *this; //fake return + // Assignment operator + this->~AliITSBeamTestDig(); + new(this) AliITSBeamTestDig(source); + return *this; } diff --git a/ITS/AliITSBeamTestDigSDD.cxx b/ITS/AliITSBeamTestDigSDD.cxx index 4bd8c180b7a..2e41b18ac52 100644 --- a/ITS/AliITSBeamTestDigSDD.cxx +++ b/ITS/AliITSBeamTestDigSDD.cxx @@ -20,27 +20,30 @@ ClassImp(AliITSBeamTestDigSDD) //_____________________________________________________________ - AliITSBeamTestDigSDD::AliITSBeamTestDigSDD(): AliITSBeamTestDig() -{ + AliITSBeamTestDigSDD::AliITSBeamTestDigSDD(): AliITSBeamTestDig(), +fSDDEvType(0), +fSubEventAttributes(0), +fBtPer(), +fThreshold(0), +fStreamer(0){ // // Constructor // SetBtPeriod(); - fSubEventAttributes=0; - fThreshold=0; - fStreamer=0; } //_____________________________________________________________ -AliITSBeamTestDigSDD::AliITSBeamTestDigSDD(const Text_t* name, const Text_t* title): AliITSBeamTestDig(name,title) +AliITSBeamTestDigSDD::AliITSBeamTestDigSDD(const Text_t* name, const Text_t* title): AliITSBeamTestDig(name,title), +fSDDEvType(0), +fSubEventAttributes(0), +fBtPer(), +fThreshold(0), +fStreamer(0) { // // Constructor // SetBtPeriod(); - fSubEventAttributes=0; - fThreshold=0; - fStreamer=0; } //__________________________________________________________________ @@ -184,24 +187,21 @@ Int_t AliITSBeamTestDigSDD::GetEventType(){ } //______________________________________________________________________ -AliITSBeamTestDigSDD::AliITSBeamTestDigSDD(const AliITSBeamTestDigSDD &bt):AliITSBeamTestDig(bt){ +AliITSBeamTestDigSDD::AliITSBeamTestDigSDD(const AliITSBeamTestDigSDD &bt):AliITSBeamTestDig(bt), +fSDDEvType(bt.fSDDEvType), +fSubEventAttributes(bt.fSubEventAttributes), +fBtPer(bt.fBtPer), +fThreshold(bt.fThreshold), +fStreamer(bt.fStreamer){ // Copy constructor. - fSDDEvType = bt.fSDDEvType; - fSubEventAttributes = bt.fSubEventAttributes; - fBtPer = bt.fBtPer; - fThreshold = bt.fThreshold; - fStreamer = bt.fStreamer; } //______________________________________________________________________ AliITSBeamTestDigSDD& AliITSBeamTestDigSDD::operator=(const AliITSBeamTestDigSDD &source){ - // Assignment operator. This is a function which is not allowed to be - // done to the ITS beam test dig. It exits with an error. - // Inputs: - if(this==&source) return *this; - Error("operator=","You are not allowed to make a copy of the AliITSBeamTestDig"); - exit(1); - return *this; //fake return + // Assignment operator. + this->~AliITSBeamTestDigSDD(); + new(this) AliITSBeamTestDigSDD(source); + return *this; } diff --git a/ITS/AliITSBeamTestDigSPD.cxx b/ITS/AliITSBeamTestDigSPD.cxx index d0da3f9a472..e3030739386 100644 --- a/ITS/AliITSBeamTestDigSPD.cxx +++ b/ITS/AliITSBeamTestDigSPD.cxx @@ -21,23 +21,19 @@ ClassImp(AliITSBeamTestDigSPD) //_____________________________________________________________ - AliITSBeamTestDigSPD::AliITSBeamTestDigSPD(): AliITSBeamTestDig() -{ + AliITSBeamTestDigSPD::AliITSBeamTestDigSPD(): AliITSBeamTestDig(), +fFlagHeader(0){ // // Constructor // - - } //_____________________________________________________________ - AliITSBeamTestDigSPD::AliITSBeamTestDigSPD(const Text_t* name, const Text_t* title): AliITSBeamTestDig(name,title) -{ +AliITSBeamTestDigSPD::AliITSBeamTestDigSPD(const Text_t* name, const Text_t* title): AliITSBeamTestDig(name,title), +fFlagHeader(0){ // // Constructor // - - } //__________________________________________________________________ diff --git a/ITS/AliITSBeamTestDigSSD.cxx b/ITS/AliITSBeamTestDigSSD.cxx index b2fcd87a6ae..9c347534fcc 100644 --- a/ITS/AliITSBeamTestDigSSD.cxx +++ b/ITS/AliITSBeamTestDigSSD.cxx @@ -16,14 +16,17 @@ ClassImp(AliITSBeamTestDigSSD) //_____________________________________________________________ -AliITSBeamTestDigSSD::AliITSBeamTestDigSSD(): AliITSBeamTestDig() { +AliITSBeamTestDigSSD::AliITSBeamTestDigSSD(): AliITSBeamTestDig(), +fFlagHeader(0) +{ // // Constructor // } //_____________________________________________________________ -AliITSBeamTestDigSSD::AliITSBeamTestDigSSD(const Text_t* name, const Text_t* title): AliITSBeamTestDig(name,title) { +AliITSBeamTestDigSSD::AliITSBeamTestDigSSD(const Text_t* name, const Text_t* title): AliITSBeamTestDig(name,title), +fFlagHeader(0){ // // Constructor // diff --git a/ITS/AliITSRawClusterSDD.cxx b/ITS/AliITSRawClusterSDD.cxx index 61b518e5886..294f1c83a93 100644 --- a/ITS/AliITSRawClusterSDD.cxx +++ b/ITS/AliITSRawClusterSDD.cxx @@ -25,16 +25,28 @@ ClassImp(AliITSRawClusterSDD) //______________________________________________________________________ -AliITSRawClusterSDD::AliITSRawClusterSDD(){ +AliITSRawClusterSDD::AliITSRawClusterSDD(): +fX(0), +fZ(0), +fQ(0), +fWing(0), +fAnode(0), +fTime(0), +fAsigma(0), +fTsigma(0), +fPeakAmplitude(0), +fSumAmplitude(0), +fPeakPosition(-1), +fNanodes(1), +fTstart(0), +fTstop(0), +fTstartf(0), +fTstopf(0), +fAstart(0), +fAstop(0) +{ // default constructor - fX=fZ=fQ=0; - fWing=0; - fNanodes=1; - fAnode=fTime=fPeakAmplitude=0; - fPeakPosition=-1; - fMultiplicity=0; - fTstart=fTstop=fTstartf=fTstopf=0; - fAstart=fAstop=0; + fMultiplicity = 0; } //______________________________________________________________________ @@ -48,57 +60,57 @@ AliITSRawClusterSDD::AliITSRawClusterSDD(Int_t wing, Int_t Samples,Int_t Tstart, Int_t Tstop,Int_t Tstartf, Int_t Tstopf,Int_t Anodes, - Int_t Astart, Int_t Astop){ + Int_t Astart, Int_t Astop): +fX(0), +fZ(0), +fQ(Charge), +fWing(wing), +fAnode(Anode), +fTime(Time), +fAsigma(Asigma), +fTsigma(Tsigma), +fPeakAmplitude(PeakAmplitude), +fSumAmplitude(0), +fPeakPosition(PeakPosition), +fNanodes(Anodes), +fTstart(Tstart), +fTstop(Tstop), +fTstartf(Tstartf), +fTstopf(Tstopf), +fAstart(Astart), +fAstop(Astop){ // constructor - fWing = wing; - fAnode = Anode; - fTime = Time; - fQ = Charge; - fPeakAmplitude = PeakAmplitude; - fPeakPosition = PeakPosition; - fAsigma = Asigma; - fTsigma = Tsigma; - fNanodes = Anodes; - fTstart = Tstart; - fTstop = Tstop; - fTstartf = Tstartf; - fTstopf = Tstopf; - fAstart = Astart; - fAstop = Astop; - fMultiplicity = Samples; - fSumAmplitude = 0; - Int_t sign = 1; for(Int_t i=0;i