From bf6adc126caa67f54b786d1339f33f44712e4e7c Mon Sep 17 00:00:00 2001 From: alibrary Date: Fri, 29 Apr 2005 06:07:24 +0000 Subject: [PATCH] Coding Conventions & Cleanup --- CONTAINERS/AliArrayBranch.cxx | 20 +++++++++++++----- CONTAINERS/AliArrayBranch.h | 33 +++++++++++++++-------------- ITS/AliITSspdTestBeam.cxx | 7 ++----- ITS/AliITSspdTestBeam.h | 32 ++++++++++++++-------------- ITS/AliITStrackSA.cxx | 3 +++ ITS/AliITStrackerMI.cxx | 39 ++++++++++++++++++----------------- ITS/AliITStrackerMI.h | 33 ++++++++++++++--------------- ITS/AliITStrackerSA.cxx | 37 +++++++++++---------------------- PHOS/AliPHOSGetter.h | 2 +- TPC/AliTPCParam.cxx | 9 +------- TPC/AliTPCParam.h | 29 +++++++++++--------------- TPC/AliTPCtrackerParam.h | 7 ++----- 12 files changed, 119 insertions(+), 132 deletions(-) diff --git a/CONTAINERS/AliArrayBranch.cxx b/CONTAINERS/AliArrayBranch.cxx index 1e238c3852d..e37dcf58e7a 100644 --- a/CONTAINERS/AliArrayBranch.cxx +++ b/CONTAINERS/AliArrayBranch.cxx @@ -15,6 +15,12 @@ /* $Id$ */ +//----------------------------------------------------- +// A Branch for the case of an array of clone objects. +//----------------------------------------------------- +// Author M.Ivanov +//*KEND. + #include "TROOT.h" #include "AliArrayBranch.h" #include "TFile.h" @@ -39,11 +45,6 @@ #include "AliObjectArray.h" #include "AliDataType.h" -//----------------------------------------------------- -// A Branch for the case of an array of clone objects. -//----------------------------------------------------- - -//*KEND. R__EXTERN TTree *gTree; @@ -657,6 +658,9 @@ void AliArrayBranch::Streamer(TBuffer &b) void AliArrayBranch::Import(TLeaf * leaf, Int_t n) { + // + // Import leaf n from the branch + // const Int_t kIntUndefined = -9999; Int_t j = 0; @@ -996,6 +1000,9 @@ AliTree::AliTree(const char *name,const char *title, Int_t maxvirtualsize): TBranch * AliTree::AliBranch(const char *name, void *clonesaddress, Int_t bufsize, Int_t splitlevel, Int_t compres) { + // + // Create an AliBranch and returns a reference to the TBranch + // if (clonesaddress == 0) return 0; char *cpointer =(char*)clonesaddress; char **ppointer =(char**)cpointer; @@ -1016,6 +1023,9 @@ TBranch * AliTree::AliBranch(const char *name, void *clonesaddress, Int_t bufsiz TBranch* AliTree::AliBranch(const char *name, const char *classname, void *addobj, Int_t bufsize, Int_t splitlevel) { + // + // Create an AliBranch and returns a reference to the TBranch + // gTree = this; TClass *cl = gROOT->GetClass(classname); if (!cl) { diff --git a/CONTAINERS/AliArrayBranch.h b/CONTAINERS/AliArrayBranch.h index eb5214dfcf3..58f1a353fad 100644 --- a/CONTAINERS/AliArrayBranch.h +++ b/CONTAINERS/AliArrayBranch.h @@ -21,9 +21,10 @@ class AliObjectArray; class AliArraySubBranch : public TBranch { public: - AliArraySubBranch(){;} + AliArraySubBranch(){} AliArraySubBranch(const char* name, void* address, const char* leaflist, Int_t basketsize = 32000, - Int_t compress = -1):TBranch(name, address, leaflist, basketsize, compress){;} + Int_t compress = -1):TBranch(name, address, leaflist, basketsize, compress){} + virtual ~AliArraySubBranch() {} virtual Int_t GetEntryExport(Long64_t entry, Int_t getall, TClonesArray* list, Int_t n) { return TBranch::GetEntryExport(entry, getall, list, n); } virtual Int_t GetEntryExport(Int_t entry, Int_t getall, AliObjectArray* list, Int_t n); virtual void ReadBasketExport(TBuffer &b, TLeaf *leaf, AliObjectArray *list, Int_t n); @@ -32,16 +33,6 @@ public: class AliArrayBranch : public TBranch { -private: - void Import(TLeaf * leaf, Int_t n); //integer fill leef buffer -protected: - AliObjectArray *fList; //Pointer to the clonesarray - Int_t fRead; //flag = 1 if clonesarray has been read - Int_t fN; //Number of elements in ClonesArray - Int_t fNdataMax; //Maximum value of fN - TString fClassName; //name of the class of the objets in the ClonesArray - TBranch *fBranchCount; //Branch with clones count - public: AliArrayBranch(); AliArrayBranch(const Text_t *name, void *clonesaddress, TTree * tree, Int_t basketsize=32000,Int_t compress=-1); @@ -50,14 +41,26 @@ public: virtual void Browse(TBrowser *b); virtual Int_t Fill(); virtual Int_t GetEntry(Long64_t entry=0, Int_t getall = 0); - virtual Int_t GetN() {return fN;} - AliObjectArray *GetList() {return fList;} - Bool_t IsFolder() {return kTRUE;} + virtual Int_t GetN() const {return fN;} + AliObjectArray *GetList() const {return fList;} virtual void Print(Option_t *option="") const; virtual void Reset(Option_t *option=""); virtual void SetAddress(void *add); virtual void SetBasketSize(Int_t buffsize); virtual Bool_t IsFolder() const {return kTRUE;} + +protected: + AliObjectArray *fList; //Pointer to the clonesarray + Int_t fRead; //flag = 1 if clonesarray has been read + Int_t fN; //Number of elements in ClonesArray + Int_t fNdataMax; //Maximum value of fN + TString fClassName; //name of the class of the objets in the ClonesArray + TBranch *fBranchCount; //Branch with clones count + +private: + AliArrayBranch(const AliArrayBranch &); + AliArrayBranch & operator=(const AliArrayBranch &); + void Import(TLeaf * leaf, Int_t n); //integer fill leef buffer ClassDef(AliArrayBranch,1) //Branch in case of an array of clone objects }; diff --git a/ITS/AliITSspdTestBeam.cxx b/ITS/AliITSspdTestBeam.cxx index 7d994ea6a17..2e2b76e8a29 100644 --- a/ITS/AliITSspdTestBeam.cxx +++ b/ITS/AliITSspdTestBeam.cxx @@ -25,11 +25,8 @@ // the class AliITSvSPD002 must be read in, one way or the other, so that // the Geometry transoformation class AliITSgeom will prpoerly be inilized. -#include -#include -#include -#include -#include + +//#include #include #include "AliITSspdTestBeam.h" diff --git a/ITS/AliITSspdTestBeam.h b/ITS/AliITSspdTestBeam.h index 8ee39298690..9790550e645 100644 --- a/ITS/AliITSspdTestBeam.h +++ b/ITS/AliITSspdTestBeam.h @@ -1,26 +1,32 @@ -#include #ifndef ALIITSSPDTESTBEAM_H #define ALIITSSPDTESTBEAM_H /* Copyright (c) 1998-2001, ALICE Experiment at CERN, All rights reserved * * See cxx source for full Copyright notice */ +/* $Id$ */ + +// +// Class for the reading of the SPD +// Test beam data +// More information on this class will follow +// + +#include #include -//class ifstream; class AliITS; class AliITSspdTestBeamHeader; class AliITSspdTestBeamTail; class AliITSspdTestBeamBurst; class AliITSspdTestBeamData; -class AliITSspdTestBeam : public TTask{ - public: +class AliITSspdTestBeam : public TTask +{ +public: AliITSspdTestBeam(); AliITSspdTestBeam(const Char_t *filename,const Char_t *opt="2002", AliITS *its=0); - AliITSspdTestBeam(const AliITSspdTestBeam &s):TTask(s){if(this==&s) return;Error("Copy constructor","You are not allowed to make a copy of AliITSspdTestBeam");exit(1);} //Not to be used! - AliITSspdTestBeam& operator=(AliITSspdTestBeam &s){if(this==&s) return *this;Error("operator=","You are not allowed to make a copy of AliITSspdTestBeam");exit(1);return *this;} //Not to be used! virtual ~AliITSspdTestBeam(); // virtual Int_t OpenInputFile(const Char_t *filename,Int_t start=0, @@ -28,7 +34,9 @@ class AliITSspdTestBeam : public TTask{ virtual Int_t Read(Int_t i=0); virtual Int_t Decode(); virtual Int_t GetNumberOfPilots()const{return 3;} - private: +private: + AliITSspdTestBeam(const AliITSspdTestBeam &); + AliITSspdTestBeam & operator=(const AliITSspdTestBeam &); void SetTerminationWord(){fTermination=0xffffd9f0;} // AliITSspdTestBeamHeader *fRH; //! Run Header @@ -80,13 +88,11 @@ class AliITSTestBeamData{ #ifndef ALIITSSPDTESTBEAMHEADER_H #define ALIITSSPDTESTBEAMHEADER_H -#include - -//class ostream; - /* Copyright (c) 1998-2001, ALICE Experiment at CERN, All rights reserved * * See cxx source for full Copyright notice */ +#include + class AliITSspdTestBeamHeader : public AliITSTestBeamData{ public: AliITSspdTestBeamHeader(){}; @@ -128,8 +134,6 @@ ostream &operator<<(ostream &os,AliITSspdTestBeamHeader &source); #include -//class ostream; - class AliITSspdTestBeamTail : public AliITSTestBeamData{ public: AliITSspdTestBeamTail(){}; @@ -160,8 +164,6 @@ ostream &operator<<(ostream &os,AliITSspdTestBeamTail &source); #include -//class ostream; - class AliITSspdTestBeamBurst : public AliITSTestBeamData{ public: AliITSspdTestBeamBurst(){}; diff --git a/ITS/AliITStrackSA.cxx b/ITS/AliITStrackSA.cxx index 19a95f9239d..a0512e4422b 100755 --- a/ITS/AliITStrackSA.cxx +++ b/ITS/AliITStrackSA.cxx @@ -12,6 +12,9 @@ * about the suitability of this software for any purpose. It is * * provided "as is" without express or implied warranty. * **************************************************************************/ + +/* $Id$ */ + //////////////////////////////////////////////////// // Stand alone track class // // Origin: Elisabetta Crescio // diff --git a/ITS/AliITStrackerMI.cxx b/ITS/AliITStrackerMI.cxx index 647ef97b812..0ff7333e95d 100644 --- a/ITS/AliITStrackerMI.cxx +++ b/ITS/AliITStrackerMI.cxx @@ -13,6 +13,8 @@ * provided "as is" without express or implied warranty. * **************************************************************************/ +/* $Id$ */ + //------------------------------------------------------------------------- // Implementation of the ITS tracker class // It reads AliITSclusterV2 clusters and creates AliITStrackMI tracks @@ -21,19 +23,18 @@ // dEdx analysis by: Boris Batyunya, JINR, Boris.Batiounia@cern.ch // //------------------------------------------------------------------------- -#include "AliITSrecoV2.h" + +#include #include -#include "AliITSgeom.h" +#include +#include + #include "AliESD.h" +#include "AliESDV0MI.h" +#include "AliHelix.h" #include "AliITSclusterV2.h" +#include "AliITSgeom.h" #include "AliITStrackerMI.h" -#include "TMatrixD.h" -#include "TFile.h" -#include "TTree.h" -#include "AliHelix.h" -#include "AliESDV0MI.h" -#include "AliLog.h" -#include "TTreeStream.h" ClassImp(AliITStrackerMI) @@ -3177,11 +3178,11 @@ Int_t AliITStrackerMI::GetNearestLayer(const Double_t *xr) const{ //Get nearest upper layer close to the point xr. // rough approximation // - const Float_t radiuses[6]={4,6.5,15.03,24.,38.5,43.7}; + const Float_t kRadiuses[6]={4,6.5,15.03,24.,38.5,43.7}; Float_t radius = TMath::Sqrt(xr[0]*xr[0]+xr[1]*xr[1]); Int_t res =6; for (Int_t i=0;i<6;i++){ - if (radiusGetRr()); Float_t sigmap = 0.5*sigmap0*(0.6+0.4*p12); // "resolution: of point angle - as a function of radius and momenta - Float_t CausalityA = (1.0-pvertex->GetCausalityP()[0])*(1.0-pvertex->GetCausalityP()[1]); - Float_t CausalityB = TMath::Sqrt(TMath::Min(pvertex->GetCausalityP()[2],Float_t(0.7))* + Float_t causalityA = (1.0-pvertex->GetCausalityP()[0])*(1.0-pvertex->GetCausalityP()[1]); + Float_t causalityB = TMath::Sqrt(TMath::Min(pvertex->GetCausalityP()[2],Float_t(0.7))* TMath::Min(pvertex->GetCausalityP()[3],Float_t(0.7))); // - Float_t Likelihood0 = (TMath::Exp(-pvertex->GetDistNorm())+0.1) *(pvertex->GetDist2()<0.5)*(pvertex->GetDistNorm()<5); + Float_t likelihood0 = (TMath::Exp(-pvertex->GetDistNorm())+0.1) *(pvertex->GetDist2()<0.5)*(pvertex->GetDistNorm()<5); - Float_t Likelihood1 = TMath::Exp(-(1.0001-pvertex->GetPointAngle())/sigmap)+ + Float_t likelihood1 = TMath::Exp(-(1.0001-pvertex->GetPointAngle())/sigmap)+ 0.4*TMath::Exp(-(1.0001-pvertex->GetPointAngle())/(4.*sigmap))+ 0.4*TMath::Exp(-(1.0001-pvertex->GetPointAngle())/(8.*sigmap))+ 0.1*TMath::Exp(-(1.0001-pvertex->GetPointAngle())/0.01); // - if (CausalityA -#include "AliTracker.h" -#include "AliITStrackMI.h" -#include "AliITSclusterV2.h" -#include "AliV0vertex.h" - class AliESD; -class AliITSgeom; -class TTree; +class AliESDV0MI; class AliHelix; +class AliITSgeom; class AliV0vertex; -class AliESDV0MI; - -class TTreeSRedirector; - - - +#include "AliITSclusterV2.h" +#include "AliITStrackMI.h" +#include "AliTracker.h" +#include "AliV0vertex.h" //------------------------------------------------------------------------- class AliITStrackerMI : public AliTracker { @@ -101,7 +98,7 @@ public: Double_t GetR() const {return fR;} Int_t FindClusterIndex(Float_t z) const; AliITSclusterV2 *GetCluster(Int_t i) const {return i -#include "TArrayI.h" + +#include #include #include #include #include -#include "AliRun.h" + +#include "AliESD.h" +#include "AliESDVertex.h" +#include "AliESDtrack.h" +#include "AliITSRiemannFit.h" +#include "AliITSVertexer.h" #include "AliITSclusterTable.h" #include "AliITSclusterV2.h" #include "AliITSgeom.h" -#include "AliITSRiemannFit.h" -#include "AliITStrackerSA.h" #include "AliITStrackSA.h" -#include "AliITSVertexer.h" -#include "AliESDVertex.h" -#include "AliESD.h" -#include "AliESDtrack.h" +#include "AliITStrackerSA.h" +#include "AliRun.h" ClassImp(AliITStrackerSA) @@ -66,23 +70,6 @@ AliITStrackerSA::AliITStrackerSA(AliITSgeom *geom, AliESDVertex *vert):AliITStra } -//______________________________________________________________________ -AliITStrackerSA::AliITStrackerSA(const AliITStrackerSA &trkr) : - AliITStrackerMI(trkr) { - // Copy constructor - // Copies are not allowed. The method is protected to avoid misuse. - Error("AliITStrackerSA","Copy constructor not allowed\n"); -} - -//______________________________________________________________________ -AliITStrackerSA& AliITStrackerSA::operator=(const - AliITStrackerSA& /* trkr */){ - // Assignment operator - // Assignment is not allowed. The method is protected to avoid misuse. - Error("= operator","Assignment operator not allowed\n"); - return *this; -} - //____________________________________________________________________________ AliITStrackerSA::AliITStrackerSA(AliITSgeom *geom, AliITSVertexer *vertexer):AliITStrackerMI(geom) { diff --git a/PHOS/AliPHOSGetter.h b/PHOS/AliPHOSGetter.h index 654f93396c2..4ada0735c0d 100644 --- a/PHOS/AliPHOSGetter.h +++ b/PHOS/AliPHOSGetter.h @@ -197,7 +197,7 @@ public: virtual void PostSDigitizer (AliPHOSSDigitizer * sdigitizer) const {PhosLoader()->PostSDigitizer(sdigitizer);} virtual void PostDigitizer (AliPHOSDigitizer * digitizer) - const {PhosLoader()->PostDigitizer(dynamic_cast(digitizer));} + const {PhosLoader()->PostDigitizer(digitizer);} virtual TString Version() const { return PhosLoader()->GetTitle() ; } virtual AliPHOSLoader * PhosLoader() const { return fgPhosLoader ; } diff --git a/TPC/AliTPCParam.cxx b/TPC/AliTPCParam.cxx index 4418efb52ce..5646360646e 100644 --- a/TPC/AliTPCParam.cxx +++ b/TPC/AliTPCParam.cxx @@ -28,15 +28,8 @@ // -#include -#include -#include -#include #include - - - ClassImp(AliTPCParam) @@ -503,7 +496,7 @@ Bool_t AliTPCParam::Update() -Bool_t AliTPCParam::GetStatus() +Bool_t AliTPCParam::GetStatus() const { //get information about object consistency return fbStatus; diff --git a/TPC/AliTPCParam.h b/TPC/AliTPCParam.h index af0e22e7cdf..986cba6c501 100644 --- a/TPC/AliTPCParam.h +++ b/TPC/AliTPCParam.h @@ -12,8 +12,6 @@ #include "AliDetectorParam.h" #include "TMath.h" - - class AliTPCParam : public AliDetectorParam { ////////////////////////////////////////////////////// ////////////////////////////////////////////////////// @@ -97,7 +95,7 @@ public: //return number of valid response bin virtual void SetDefault(); //set defaut TPCparam virtual Bool_t Update(); //recalculate and check geometric parameters - Bool_t GetStatus(); //get information about object consistency + Bool_t GetStatus() const; //get information about object consistency Int_t GetIndex(Int_t sector, Int_t row) const; //give index of the given sector and pad row Int_t GetNSegmentsTotal() const {return fNtRows;} Double_t GetLowMaxY(Int_t irow) const {return irow*0.;} @@ -227,7 +225,7 @@ public: Float_t GetOuterWWPitch() const {return fOuterWWPitch;} Int_t GetOuterDummyWire() const {return fOuterDummyWire;} Float_t GetOuterOffWire() const {return fOuterOffWire;} - Float_t GetLastWireUp1() {return fLastWireUp1;} + Float_t GetLastWireUp1() const {return fLastWireUp1;} Float_t GetROuterFirstWire() const {return fROuterFirstWire;} Float_t GetROuterLastWire() const {return fROuterLastWire;} Float_t GetWWPitch(Int_t isector = 0) const { @@ -250,18 +248,14 @@ public: Float_t GetPadPitchWidth(Int_t isector = 0) const { return ( (isector < fNInnerSector) ? fInnerPadPitchWidth :fOuterPadPitchWidth);} Float_t GetPadPitchLength(Int_t isector = 0, Int_t padrow=0) const - { - if (isector < fNInnerSector) {return fInnerPadPitchLength;} - else { - return ((padrow //---- AliRoot headers ------- -//#include "alles.h" -#include "AliRun.h" -//#include "AliGausCorr.h" -//#include "AliMagF.h" +#include "AliConfig.h" #include "AliTPCkineGrid.h" #include "AliTPCtrack.h" -//#include "AliTrackReference.h" //---------------------------- class AliTPC; -- 2.43.0