From cd77595ef8dc1f3b33b2eb180b715a44681d6407 Mon Sep 17 00:00:00 2001 From: nilsen Date: Mon, 19 Nov 2001 16:17:03 +0000 Subject: [PATCH] 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. --- ITS/AliITS.cxx | 7 ++++-- ITS/AliITS.h | 3 +++ ITS/AliITSRad.cxx | 11 +++++++++ ITS/AliITSRad.h | 4 +-- ITS/AliITSVertex.cxx | 49 ++++++++++++++++++++----------------- ITS/AliITSVertex.h | 3 ++- ITS/AliITSclusterSSD.cxx | 2 +- ITS/AliITSgeomSDD.cxx | 16 ++++++++++-- ITS/AliITSgeomSSD.cxx | 26 +++++++++++++++++--- ITS/AliITSpackageSSD.cxx | 7 ++++-- ITS/AliITSpackageSSD.h | 7 ------ ITS/AliITSsimulationSDD.cxx | 6 ----- 12 files changed, 92 insertions(+), 49 deletions(-) diff --git a/ITS/AliITS.cxx b/ITS/AliITS.cxx index 5bb01baaf9a..13f6f325a31 100644 --- a/ITS/AliITS.cxx +++ b/ITS/AliITS.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.63 2001/10/24 21:16:34 nilsen +Removed some dead code and improved comments/documntation. + Revision 1.62 2001/10/21 19:23:21 nilsen Added function to allow to limit which detectors to digitize and reconstruct. The default is All. This change makes no changes to any root file. @@ -300,7 +303,7 @@ AliITS::AliITS() : AliDetector() { fEuclidOut = 0; fITSgeom = 0; fITSmodules = 0; - SetDetectors(); // default to "All". This variable not written out. + SetDetectors(); // default to fOpt="All". This variable not written out. fIdN = 0; fIdName = 0; @@ -352,7 +355,7 @@ AliITS::AliITS(const char *name, const char *title):AliDetector(name,title){ fEuclidOut = 0; fITSgeom = 0; fITSmodules = 0; - SetDetectors(); // default to "All". This variable not written out. + SetDetectors(); // default to fOpt="All". This variable not written out. fIdN = 0; fIdName = 0; diff --git a/ITS/AliITS.h b/ITS/AliITS.h index 5da33cc75a8..0b5b0eba600 100644 --- a/ITS/AliITS.h +++ b/ITS/AliITS.h @@ -10,6 +10,7 @@ //////////////////////////////////////////////////////////////////////// #include // used in inline function GetModule. +#include // used in inline function SetHitsAddressBranch #include "AliDetector.h" @@ -67,6 +68,8 @@ class AliITS : public AliDetector { virtual void SetDefaultClusterFinders(); virtual void MakeBranch(Option_t *opt=" ", const char *file=0); virtual void SetTreeAddress(); + // For a give branch from the treeH sets the TClonesArray address. + virtual void SetHitsAddressBranch(TBranch *b){b->SetAddress(fHits);} // Return pointer to DetType #id AliITSDetType *DetType(Int_t id); //Int_t NDetTypes() {return fNDetTypes;} diff --git a/ITS/AliITSRad.cxx b/ITS/AliITSRad.cxx index 54b0d4c892c..38187da8f83 100644 --- a/ITS/AliITSRad.cxx +++ b/ITS/AliITSRad.cxx @@ -8,7 +8,18 @@ ClassImp(AliITSRad) +//______________________________________________________________________ +AliITSRad::AliITSRad() { + // Default constructor + + fmrad1 = 0; + fmrad2 = 0; + fmrad3 = 0; + fmrad4 = 0; + fmrad5 = 0; + fmrad6 = 0; +} AliITSRad::AliITSRad(Int_t iimax, Int_t jjmax) { imax=iimax; diff --git a/ITS/AliITSRad.h b/ITS/AliITSRad.h index 0bdeb1e1952..31370dc2e41 100644 --- a/ITS/AliITSRad.h +++ b/ITS/AliITSRad.h @@ -17,9 +17,9 @@ class TMatrix; class AliITSRad : public TObject { public: - + ALIITSRAD(); // Default constructor. AliITSRad(Int_t iimax, Int_t jjmax); // class constructor - ~AliITSRad(); // class destructor + virtual ~AliITSRad(); // class destructor Int_t Getimax() {return imax;} // return the first dimension of the matrices Int_t Getjmax() {return jmax;} // return the second dimension of the matrices diff --git a/ITS/AliITSVertex.cxx b/ITS/AliITSVertex.cxx index 78c99e0d0a0..e713d307f7f 100644 --- a/ITS/AliITSVertex.cxx +++ b/ITS/AliITSVertex.cxx @@ -37,9 +37,24 @@ ClassImp(AliITSVertex) ////////////////////////////////////////////////////////////////////// -//______________________________________________________________________________ +//______________________________________________________________________ +AliITSVertex::AliITSVertex() { + // Default Constructor -AliITSVertex::AliITSVertex() { + fPosition = 0; + fResolution = 0; + fSNR = 0; +} +//______________________________________________________________________ +AliITSVertex::~AliITSVertex() { + // Default Constructor + + if(fPosition){ delete [] fPosition; fPostion = 0;} + if(fResolution){ delete []fResoultion; fResolution = 0;} + if(fSNR){ delete [] fSNR;fSNR = 0;} +} +//______________________________________________________________________ +void AliITSVertex::Exec(){ fPosition = new Double_t[3]; fResolution = new Double_t[3]; @@ -422,27 +437,15 @@ AliITSVertex::AliITSVertex() { delete hITSYv; } - - -//______________________________________________________________________________ - -AliITSVertex::~AliITSVertex() { - delete [] fPosition; - delete [] fResolution; - delete [] fSNR; -} - -//______________________________________________________________________________ - +//______________________________________________________________________ Double_t AliITSVertex::PhiFunc(Float_t p[]) { - Double_t phi=0; - if(p[1]>0 && p[0]>0) phi=(TMath::ATan((Double_t)(p[1]/p[0]))*57.29578); - if(p[1]>0 && p[0]<0) phi=(TMath::ATan((Double_t)(p[1]/p[0]))*57.29578)+180; - if(p[1]<0 && p[0]<0) phi=(TMath::ATan((Double_t)(p[1]/p[0]))*57.29578)+180; - if(p[1]<0 && p[0]>0) phi=(TMath::ATan((Double_t)(p[1]/p[0]))*57.29578)+360; - return phi; -} - -//______________________________________________________________________________ + Double_t phi=0; + if(p[1]>0 && p[0]>0) phi=(TMath::ATan((Double_t)(p[1]/p[0]))*57.29578); + if(p[1]>0 && p[0]<0) phi=(TMath::ATan((Double_t)(p[1]/p[0]))*57.29578)+180; + if(p[1]<0 && p[0]<0) phi=(TMath::ATan((Double_t)(p[1]/p[0]))*57.29578)+180; + if(p[1]<0 && p[0]>0) phi=(TMath::ATan((Double_t)(p[1]/p[0]))*57.29578)+360; + return phi; +} +//______________________________________________________________________ diff --git a/ITS/AliITSVertex.h b/ITS/AliITSVertex.h index 714f74aee80..a8376848f6f 100644 --- a/ITS/AliITSVertex.h +++ b/ITS/AliITSVertex.h @@ -16,7 +16,8 @@ class AliITSVertex : public TObject { public: AliITSVertex(); - ~AliITSVertex(); + virtual ~AliITSVertex(); + void Exec(); Double_t PhiFunc(Float_t p[]); // This class determines 3D vertex position, resolution and signal diff --git a/ITS/AliITSclusterSSD.cxx b/ITS/AliITSclusterSSD.cxx index fc054e83092..a5caddfb65b 100644 --- a/ITS/AliITSclusterSSD.cxx +++ b/ITS/AliITSclusterSSD.cxx @@ -17,7 +17,7 @@ AliITSclusterSSD::AliITSclusterSSD() fNTracks = -1; fLeftNeighbour = kFALSE; fRightNeighbour = kFALSE; - fCrossedClusterIndexes = new TArrayI(300); + fCrossedClusterIndexes = 0; fConsumed=kFALSE; } diff --git a/ITS/AliITSgeomSDD.cxx b/ITS/AliITSgeomSDD.cxx index b7ebad9012c..b8be382424b 100644 --- a/ITS/AliITSgeomSDD.cxx +++ b/ITS/AliITSgeomSDD.cxx @@ -15,6 +15,10 @@ /* $Log$ +Revision 1.14 2001/10/19 21:32:35 nilsen +Minor changes to remove compliation warning on gcc 2.92.2 compiler, and +cleanded up a little bit of code. + 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 @@ -146,8 +150,8 @@ AliITSgeomSDD::~AliITSgeomSDD(){ // Destructor if(fShapeSDD!=0) delete fShapeSDD; - if(fAnodeLowEdgeL!=0) delete fAnodeLowEdgeL; - if(fAnodeLowEdgeR!=0) delete fAnodeLowEdgeR; + if(fAnodeLowEdgeL!=0) delete [] fAnodeLowEdgeL; + if(fAnodeLowEdgeR!=0) delete [] fAnodeLowEdgeR; fShapeSDD = 0; fPeriod = 0.0; fDvelocity = 0.0; @@ -319,6 +323,10 @@ istream &operator>>(istream &is,AliITSgeomSDD &r){ //====================================================================== /* $Log$ +Revision 1.14 2001/10/19 21:32:35 nilsen +Minor changes to remove compliation warning on gcc 2.92.2 compiler, and +cleanded up a little bit of code. + 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 @@ -789,6 +797,10 @@ istream &operator>>(istream &is,AliITSgeomSDD256 &r){ //====================================================================== /* $Log$ +Revision 1.14 2001/10/19 21:32:35 nilsen +Minor changes to remove compliation warning on gcc 2.92.2 compiler, and +cleanded up a little bit of code. + 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 diff --git a/ITS/AliITSgeomSSD.cxx b/ITS/AliITSgeomSSD.cxx index 85101470c1a..e71d15e3b7d 100644 --- a/ITS/AliITSgeomSSD.cxx +++ b/ITS/AliITSgeomSSD.cxx @@ -15,6 +15,11 @@ /* $Log$ +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. @@ -125,9 +130,9 @@ void AliITSgeomSSD::ResetSSD(const Float_t *box,Float_t ap,Float_t an, AliITSgeomSSD::~AliITSgeomSSD(){ // Destructor. - delete fLowEdgeP; fLowEdgeP = 0; - delete fLowEdgeN; fLowEdgeN = 0; - delete fShapeSSD; fShapeSSD = 0; + 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; @@ -284,6 +289,11 @@ istream &operator>>(istream &is,AliITSgeomSSD &r){ //====================================================================== /* $Log$ +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. @@ -359,6 +369,11 @@ istream &operator>>(istream &is,AliITSgeomSSD175 &r){ //====================================================================== /* $Log$ +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. @@ -443,6 +458,11 @@ istream &operator>>(istream &is,AliITSgeomSSD275and75 &r){ //====================================================================== /* $Log$ +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. diff --git a/ITS/AliITSpackageSSD.cxx b/ITS/AliITSpackageSSD.cxx index a9656e2dac0..785be49bfe4 100644 --- a/ITS/AliITSpackageSSD.cxx +++ b/ITS/AliITSpackageSSD.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.4 2000/07/12 05:32:20 fca +Correcting several syntax problem with static members + */ #include @@ -37,10 +40,10 @@ ClassImp(AliITSpackageSSD) AliITSpackageSSD::AliITSpackageSSD() { fNclustersN=0; - fClusterNIndexes = new TArrayI(300); + fClusterNIndexes = 0; fNclustersP=0; - fClusterPIndexes = new TArrayI(300); + fClusterPIndexes = 0; if (debug) cout<<"Default Ctor was used\n>>>>>>>>>>>>>><<<<<<<<<<<<<"; } diff --git a/ITS/AliITSpackageSSD.h b/ITS/AliITSpackageSSD.h index 469136e7669..5dba2843cc2 100644 --- a/ITS/AliITSpackageSSD.h +++ b/ITS/AliITSpackageSSD.h @@ -103,10 +103,3 @@ private: }; #endif - - - - - - - diff --git a/ITS/AliITSsimulationSDD.cxx b/ITS/AliITSsimulationSDD.cxx index 1152e969c3d..2e8f8424f35 100644 --- a/ITS/AliITSsimulationSDD.cxx +++ b/ITS/AliITSsimulationSDD.cxx @@ -303,12 +303,6 @@ AliITSsimulationSDD::~AliITSsimulationSDD() { delete fStream; delete fElectronics; - fD.Set(0); - fT1.Set(0); - fT2.Set(0); - fTol.Set(0); - fNoise.Set(0); - fBaseline.Set(0); fITS = 0; if (fHis) { -- 2.39.3