From 339fbe234cc18fb2789f70c6db88cc110e0848ce Mon Sep 17 00:00:00 2001 From: shahoian Date: Sun, 29 Jan 2012 17:56:54 +0000 Subject: [PATCH] Coding conventions fixed --- STEER/ESD/AliESDv0.cxx | 24 ++++++++--------- STEER/STEER/AliGRPManager.cxx | 2 +- STEER/STEER/AliGRPManager.h | 2 +- STEER/STEER/AliGRPRecoParam.h | 35 +++++++++++++++---------- STEER/STEER/AliLHCData.cxx | 36 ++++++++++++------------- STEER/STEER/AliLHCData.h | 8 +++--- STEER/STEER/AliMatrixSparse.cxx | 10 ++++++- STEER/STEER/AliMatrixSparse.h | 3 +++ STEER/STEER/AliMatrixSq.cxx | 7 ++++- STEER/STEER/AliMatrixSq.h | 5 +++- STEER/STEER/AliMillePede2.cxx | 42 ++++++++++++++++++------------ STEER/STEER/AliMillePede2.h | 6 ++--- STEER/STEER/AliMillePedeRecord.cxx | 6 ++++- STEER/STEER/AliParamSolver.cxx | 22 +++++++++++++++- STEER/STEER/AliParamSolver.h | 2 +- STEER/STEER/AliQAChecker.h | 4 +-- STEER/STEER/AliRectMatrix.cxx | 20 +++++++++++--- STEER/STEER/AliRectMatrix.h | 10 ++++++- STEER/STEER/AliSymMatrix.cxx | 2 +- STEER/STEER/AliSymMatrix.h | 2 +- STEER/STEER/AliTrackFitter.cxx | 15 +++++++---- STEER/STEER/AliTrackFitter.h | 4 +++ STEER/STEER/AliVectorSparse.cxx | 5 ++++ STEER/STEER/AliVectorSparse.h | 2 +- STEER/STEERBase/AliMagF.cxx | 1 + STEER/STEERBase/AliMagWrapCheb.cxx | 5 ++++ STEER/STEERBase/AliMagWrapCheb.h | 3 ++- STEER/STEERBase/AliRefArray.cxx | 1 + 28 files changed, 194 insertions(+), 90 deletions(-) diff --git a/STEER/ESD/AliESDv0.cxx b/STEER/ESD/AliESDv0.cxx index 8390b06cbe4..97aa14a9bed 100644 --- a/STEER/ESD/AliESDv0.cxx +++ b/STEER/ESD/AliESDv0.cxx @@ -786,12 +786,12 @@ Double_t AliESDv0::GetKFInfo(UInt_t p1, UInt_t p2, Int_t type) const{ } AliKFParticle kfp1( *(paramP), spdg[p1] *TMath::Sign(1,p1) ); AliKFParticle kfp2( *(paramN), spdg[p2] *TMath::Sign(1,p2) ); - AliKFParticle *V0KF = new AliKFParticle; - *(V0KF)+=kfp1; - *(V0KF)+=kfp2; - if (type==0) return V0KF->GetMass(); - if (type==1) return V0KF->GetErrMass(); - if (type==2) return V0KF->GetChi2(); + AliKFParticle *v0KF = new AliKFParticle; + *(v0KF)+=kfp1; + *(v0KF)+=kfp2; + if (type==0) return v0KF->GetMass(); + if (type==1) return v0KF->GetErrMass(); + if (type==2) return v0KF->GetChi2(); return 0; } @@ -822,11 +822,11 @@ Double_t AliESDv0::GetKFInfoScale(UInt_t p1, UInt_t p2, Int_t type, Double_t d1p // AliKFParticle kfp1( *paramP, spdg[p1] *TMath::Sign(1,p1) ); AliKFParticle kfp2( *paramN, spdg[p2] *TMath::Sign(1,p2) ); - AliKFParticle *V0KF = new AliKFParticle; - *(V0KF)+=kfp1; - *(V0KF)+=kfp2; - if (type==0) return V0KF->GetMass(); - if (type==1) return V0KF->GetErrMass(); - if (type==2) return V0KF->GetChi2(); + AliKFParticle *v0KF = new AliKFParticle; + *(v0KF)+=kfp1; + *(v0KF)+=kfp2; + if (type==0) return v0KF->GetMass(); + if (type==1) return v0KF->GetErrMass(); + if (type==2) return v0KF->GetChi2(); return 0; } diff --git a/STEER/STEER/AliGRPManager.cxx b/STEER/STEER/AliGRPManager.cxx index 7f6d6cdaa2e..84458743dac 100644 --- a/STEER/STEER/AliGRPManager.cxx +++ b/STEER/STEER/AliGRPManager.cxx @@ -232,7 +232,7 @@ AliRunInfo* AliGRPManager::GetRunInfo() } //_____________________________________________________________________________ -void AliGRPManager::SetGRPEntry(AliGRPObject* source) +void AliGRPManager::SetGRPEntry(const AliGRPObject* source) { // Create a GRP entry from the extrnaly provide GRP object // To be used by HLT to create an online GRP instance diff --git a/STEER/STEER/AliGRPManager.h b/STEER/STEER/AliGRPManager.h index 0f1e7584a6d..634ad6ad1a0 100644 --- a/STEER/STEER/AliGRPManager.h +++ b/STEER/STEER/AliGRPManager.h @@ -26,7 +26,7 @@ public: const AliGRPObject* GetGRPData() const { return fGRPData; } - void SetGRPEntry(AliGRPObject* source); + void SetGRPEntry(const AliGRPObject* source); Bool_t ReadGRPEntry(); Bool_t SetMagField(); diff --git a/STEER/STEER/AliGRPRecoParam.h b/STEER/STEER/AliGRPRecoParam.h index b2a3e937321..30c82f5d0db 100644 --- a/STEER/STEER/AliGRPRecoParam.h +++ b/STEER/STEER/AliGRPRecoParam.h @@ -37,20 +37,8 @@ class AliGRPRecoParam : public AliDetectorRecoParam { SetVertexerTracksCuts(1,ncuts,cuts); return; } void SetVertexerV0Cuts(Int_t ncuts,Double_t cuts[7]); void SetVertexerCascadeCuts(Int_t ncuts,Double_t cuts[8]); - void SetVertexerTracksTPCClusterization(Bool_t use, Double_t dzcut, Double_t nsigmazcut){ - if(use) fVertexerTracksTPCclusterize=1.; - else fVertexerTracksTPCclusterize=0.; - fVertexerTracksTPCclusterdz=dzcut; - fVertexerTracksTPCclusternsigmaz=nsigmazcut; - } - void SetVertexerTracksITSClusterization(Bool_t use, Double_t dzcut, Double_t nsigmazcut){ - if(use) fVertexerTracksITSclusterize=1.; - else fVertexerTracksITSclusterize=0.; - fVertexerTracksITSclusterdz=dzcut; - fVertexerTracksITSclusternsigmaz=nsigmazcut; - } - - + void SetVertexerTracksTPCClusterization(Bool_t use, Double_t dzcut, Double_t nsigmazcut); + void SetVertexerTracksITSClusterization(Bool_t use, Double_t dzcut, Double_t nsigmazcut); Bool_t GetVertexerTracksConstraintITS() const { return fVertexerTracksConstraintITS; } Bool_t GetVertexerTracksConstraintTPC() const { return fVertexerTracksConstraintTPC; } Int_t GetVertexerTracksNCuts() const { return fVertexerTracksNCuts; } @@ -157,4 +145,23 @@ class AliGRPRecoParam : public AliDetectorRecoParam ClassDef(AliGRPRecoParam,7) // global reco parameters }; +inline void AliGRPRecoParam::SetVertexerTracksTPCClusterization(Bool_t use, Double_t dzcut, Double_t nsigmazcut) +{ + // set TPC tracks clustering settings + if(use) fVertexerTracksTPCclusterize=1.; + else fVertexerTracksTPCclusterize=0.; + fVertexerTracksTPCclusterdz=dzcut; + fVertexerTracksTPCclusternsigmaz=nsigmazcut; +} + +inline void AliGRPRecoParam::SetVertexerTracksITSClusterization(Bool_t use, Double_t dzcut, Double_t nsigmazcut) +{ + // set ITS tracks clustering settings + if(use) fVertexerTracksITSclusterize=1.; + else fVertexerTracksITSclusterize=0.; + fVertexerTracksITSclusterdz=dzcut; + fVertexerTracksITSclusternsigmaz=nsigmazcut; +} + + #endif diff --git a/STEER/STEER/AliLHCData.cxx b/STEER/STEER/AliLHCData.cxx index db304c9c1cc..8c5e79f1ed5 100755 --- a/STEER/STEER/AliLHCData.cxx +++ b/STEER/STEER/AliLHCData.cxx @@ -96,14 +96,14 @@ const Char_t* AliLHCData::fgkDCSColJaws[] = { //___________________________________________________________________ AliLHCData::AliLHCData(const TMap* dcsMap, double tmin, double tmax) - : fTMin(0),fTMax(0),fFillNumber(0),fData(0),fFile2Process(0),fMap2Process(0) + : fTMin(0),fTMax(0),fFillNumber(0),fData(0),fkFile2Process(0),fkMap2Process(0) { FillData(dcsMap,tmin,tmax); } //___________________________________________________________________ AliLHCData::AliLHCData(const Char_t* dcsFile, double tmin, double tmax) - : fTMin(0),fTMax(0),fFillNumber(0),fData(0),fFile2Process(dcsFile),fMap2Process(0) + : fTMin(0),fTMax(0),fFillNumber(0),fData(0),fkFile2Process(dcsFile),fkMap2Process(0) { FillData(dcsFile,tmin,tmax); } @@ -113,7 +113,7 @@ Bool_t AliLHCData::FillData(const TMap* dcsMap,double tmin, double tmax) { // process DCS map and fill all fields. Clear(); - fMap2Process = dcsMap; + fkMap2Process = dcsMap; FillData(tmin,tmax); return kTRUE; } @@ -123,7 +123,7 @@ Bool_t AliLHCData::FillData(const Char_t* dcsFile,double tmin, double tmax) { // process DCS file and fill all fields. Clear(); - fFile2Process = dcsFile; + fkFile2Process = dcsFile; FillData(tmin,tmax); return kTRUE; } @@ -143,7 +143,7 @@ Bool_t AliLHCData::FillData(double tmin, double tmax) int iFirst=0,iLast=0; TObjArray* arr = GetDCSEntry(fgkDCSNames[kFillNum],iFirst,iLast,fTMin,fTMax); if (arr) SetFillNumber( ExtractInt( (AliDCSArray*)arr->At(iFirst), 0) ); - if (fFile2Process) delete arr; // array was created on demand + if (fkFile2Process) delete arr; // array was created on demand // for (int ibm=0;ibm<2;ibm++) { // @@ -228,10 +228,10 @@ TObjArray* AliLHCData::GetDCSEntry(const char* key,int &entry,int &last,double t entry = -1; last = -2; TObjArray* arr; - if (fMap2Process) arr = (TObjArray*)fMap2Process->GetValue(key); - else if (fFile2Process) { + if (fkMap2Process) arr = (TObjArray*)fkMap2Process->GetValue(key); + else if (fkFile2Process) { AliLHCReader rd; - arr = rd.ReadSingleLHCDP(fFile2Process,key); + arr = rd.ReadSingleLHCDP(fkFile2Process,key); } else { AliError("Neither DCS map nor DCS filename are set"); @@ -240,7 +240,7 @@ TObjArray* AliLHCData::GetDCSEntry(const char* key,int &entry,int &last,double t // if (!arr || !arr->GetEntriesFast()) { AliWarning(Form("No data for %s",key)); - if (fMap2Process) delete arr; // created on demand + if (fkMap2Process) delete arr; // created on demand return 0; } int ntot = arr->GetEntriesFast(); @@ -262,7 +262,7 @@ TObjArray* AliLHCData::GetDCSEntry(const char* key,int &entry,int &last,double t str += " : "; str += AliLHCDipValD::TimeAsString(tmax); AliWarning(Form("All entries for %s are outside the requested range:\n%s",key,str.Data())); - if (fMap2Process) delete arr; // created on demand + if (fkMap2Process) delete arr; // created on demand return 0; } if (entry>0) entry--; @@ -381,7 +381,7 @@ Int_t AliLHCData::FillScalarRecord(int refs[2], const char* rec, const char* rec // if (last) break; } // - if (fFile2Process) { + if (fkFile2Process) { delete arr; delete arrE; } @@ -424,7 +424,7 @@ Int_t AliLHCData::FillBunchConfig(int refs[2],const char* rec) prevRecI = curValI; } // - if (fFile2Process) delete arr; + if (fkFile2Process) delete arr; return refs[kNStor]; } @@ -458,7 +458,7 @@ Int_t AliLHCData::FillAcqMode(int refs[2],const char* rec) prevRecI = curValI; } // - if (fFile2Process) delete arr; + if (fkFile2Process) delete arr; return refs[kNStor]; } @@ -491,7 +491,7 @@ Int_t AliLHCData::FillStringRecord(int refs[2],const char* rec) fData.Add(curValS); refs[kNStor]++; } - if (fFile2Process) delete arr; + if (fkFile2Process) delete arr; return refs[kNStor]; } @@ -543,7 +543,7 @@ Int_t AliLHCData::FillBunchInfo(int refs[2],const char* rec, int ibm, Bool_t inR fData.Add(curValF); refs[kNStor]++; } - if (fFile2Process) delete arr; + if (fkFile2Process) delete arr; return refs[kNStor]; // } @@ -633,7 +633,7 @@ Int_t AliLHCData::FillBCLuminosities(int refs[2],const char* rec, const char* re fData.Add(curValF); refs[kNStor]++; } - if (fFile2Process) { + if (fkFile2Process) { delete arr; delete arrE; } @@ -841,8 +841,8 @@ void AliLHCData::Clear(const Option_t *) fFillNumber = 0; fTMin = 0; fTMax = 1e10; - fFile2Process = 0; - fMap2Process = 0; + fkFile2Process = 0; + fkMap2Process = 0; // for (int i=2;i--;) { fRCInjScheme[i] = 0; diff --git a/STEER/STEER/AliLHCData.h b/STEER/STEER/AliLHCData.h index 6059bb5c942..e10fdf3d560 100755 --- a/STEER/STEER/AliLHCData.h +++ b/STEER/STEER/AliLHCData.h @@ -63,7 +63,7 @@ class AliLHCData : public TObject //le public: // - AliLHCData() : fTMin(0),fTMax(1e10),fFillNumber(0),fData(0),fFile2Process(0),fMap2Process(0) {Clear();} + AliLHCData() : fTMin(0),fTMax(1e10),fFillNumber(0),fData(0),fkFile2Process(0),fkMap2Process(0) {Clear();} AliLHCData(const TMap* dcsMap, double tmin=0, double tmax=1.e10); AliLHCData(const Char_t* dcsFile, double tmin=0, double tmax=1.e10); virtual ~AliLHCData() {} @@ -176,7 +176,7 @@ class AliLHCData : public TObject Int_t ExtractInt(AliDCSArray* dcsArray,Int_t el) const; Double_t ExtractDouble(AliDCSArray* dcsArray,Int_t el) const; TString& ExtractString(AliDCSArray* dcsArray) const; - AliLHCData(const AliLHCData& src) : TObject(src),fTMin(0),fTMax(0),fFillNumber(0),fData(0),fFile2Process(0),fMap2Process(0) { /*dummy*/ } + AliLHCData(const AliLHCData& src) : TObject(src),fTMin(0),fTMax(0),fFillNumber(0),fData(0),fkFile2Process(0),fkMap2Process(0) { /*dummy*/ } AliLHCData& operator=(const AliLHCData& ) { /*dummy*/ return *this;} Int_t TimeDifference(double v1,double v2,double tol=0.9) const; Bool_t IzZero(double val, double tol=1e-16) const {return TMath::Abs(val)=fNrows) { AliVectorSparse** arrv = new AliVectorSparse*[ir+1]; for (int i=GetSize();i--;) arrv[i] = fVecs[i]; @@ -47,6 +52,7 @@ AliVectorSparse* AliMatrixSparse::GetRowAdd(Int_t ir) //___________________________________________________________ AliMatrixSparse& AliMatrixSparse::operator=(const AliMatrixSparse& src) { + // assignment op-r if (this == &src) return *this; AliMatrixSq::operator=(src); @@ -62,6 +68,7 @@ AliMatrixSparse& AliMatrixSparse::operator=(const AliMatrixSparse& src) //___________________________________________________________ void AliMatrixSparse::Clear(Option_t*) { + // clear for (int i=fNrows;i--;) delete GetRow(i); delete [] fVecs; fNcols = fNrows = 0; @@ -70,6 +77,7 @@ void AliMatrixSparse::Clear(Option_t*) //___________________________________________________________ void AliMatrixSparse::Print(Option_t* opt) const { + // print itself printf("Sparse Matrix of size %d x %d %s\n",fNrows,fNcols,IsSymmetric() ? " (Symmetric)":""); for (int i=0;i>\n"); - // sort columns in increasing order. Used to fix the matrix after ILUk decompostion for (int i=GetSize();i--;) GetRow(i)->SortIndices(valuesToo); sw.Stop(); sw.Print(); diff --git a/STEER/STEER/AliMatrixSparse.h b/STEER/STEER/AliMatrixSparse.h index 12898b4a4e4..d82161fac61 100644 --- a/STEER/STEER/AliMatrixSparse.h +++ b/STEER/STEER/AliMatrixSparse.h @@ -57,6 +57,7 @@ class AliMatrixSparse : public AliMatrixSq //___________________________________________________ inline void AliMatrixSparse::MultiplyByVec(const TVectorD &vecIn, TVectorD &vecOut) const { + // multiplication MultiplyByVec((Double_t*)vecIn.GetMatrixArray(),(Double_t*)vecOut.GetMatrixArray()); } @@ -92,6 +93,7 @@ inline Double_t& AliMatrixSparse::operator()(Int_t row,Int_t col) //___________________________________________________ inline Double_t AliMatrixSparse::DiagElem(Int_t row) const { + // get diag elem AliVectorSparse* rowv = GetRow(row); if (!rowv) return 0; if (IsSymmetric()) return (rowv->GetNElems()>0 && rowv->GetLastIndex()==row) ? rowv->GetLastElem() : 0.; @@ -102,6 +104,7 @@ inline Double_t AliMatrixSparse::DiagElem(Int_t row) const //___________________________________________________ inline Double_t &AliMatrixSparse::DiagElem(Int_t row) { + // get diag elem AliVectorSparse* rowv = GetRowAdd(row); if (row>=fNcols) fNcols = row+1; if (IsSymmetric()) { diff --git a/STEER/STEER/AliMatrixSq.cxx b/STEER/STEER/AliMatrixSq.cxx index f0be2acb051..4d2d83eeaaf 100644 --- a/STEER/STEER/AliMatrixSq.cxx +++ b/STEER/STEER/AliMatrixSq.cxx @@ -1,7 +1,12 @@ /**********************************************************************************************/ -/* Abstract class for matrix used for millepede2 operation. */ +/* */ +/* Abstract class for matrix used for */ +/* millepede2 operation. */ +/* Works for expandable square matrices */ +/* of arbitrary dimension */ /* Author: ruben.shahoyan@cern.ch */ /* */ +/* */ /**********************************************************************************************/ #include diff --git a/STEER/STEER/AliMatrixSq.h b/STEER/STEER/AliMatrixSq.h index b4b5ae86d30..b183a355573 100644 --- a/STEER/STEER/AliMatrixSq.h +++ b/STEER/STEER/AliMatrixSq.h @@ -1,7 +1,10 @@ #ifndef ALIMATRIXSQ_H #define ALIMATRIXSQ_H + /**********************************************************************************************/ -/* Abstract class for matrix used for millepede2 operation. */ +/* */ +/* Abstract class for matrix used for */ +/* millepede2 operation. */ /* Author: ruben.shahoyan@cern.ch */ /* */ /**********************************************************************************************/ diff --git a/STEER/STEER/AliMillePede2.cxx b/STEER/STEER/AliMillePede2.cxx index 553c3968db7..f8bedf219a1 100644 --- a/STEER/STEER/AliMillePede2.cxx +++ b/STEER/STEER/AliMillePede2.cxx @@ -1,6 +1,8 @@ /**********************************************************************************************/ /* General class for alignment with large number of degrees of freedom */ /* Based on the original milliped2 by Volker Blobel */ +/* and AliMillepede class by Javier */ +/* Allows operations with large sparse matrices */ /* http://www.desy.de/~blobel/mptalks.html */ /* */ /* Author: ruben.shahoyan@cern.ch */ @@ -57,7 +59,7 @@ AliMillePede2::AliMillePede2() fNLocFits(0), fNLocFitsRejected(0), fNGloFix(0), - fGloSolveStatus(gkFailed), + fGloSolveStatus(kFailed), // fChi2CutFactor(1.), fChi2CutRef(1.), @@ -126,6 +128,7 @@ AliMillePede2::AliMillePede2(const AliMillePede2& src) : //_____________________________________________________________________________________________ AliMillePede2::~AliMillePede2() { + // destructor CloseDataRecStorage(); CloseConsRecStorage(); // @@ -155,7 +158,7 @@ AliMillePede2::~AliMillePede2() //_____________________________________________________________________________________________ Int_t AliMillePede2::InitMille(int nGlo, int nLoc, int lNStdDev,double lResCut, double lResCutInit) { - // + // init all if (nLoc>0) fNLocPar = nLoc; if (nGlo>0) fNGloPar = nGlo; if (lResCutInit>0) fResCutInit = lResCutInit; @@ -212,6 +215,7 @@ Int_t AliMillePede2::InitMille(int nGlo, int nLoc, int lNStdDev,double lResCut, //_____________________________________________________________________________________________ Bool_t AliMillePede2::ImposeDataRecFile(const char* fname) { + // set filename for records CloseDataRecStorage(); SetDataRecFName(fname); return InitDataRecStorage(kTRUE); // open in read mode @@ -220,6 +224,7 @@ Bool_t AliMillePede2::ImposeDataRecFile(const char* fname) //_____________________________________________________________________________________________ Bool_t AliMillePede2::ImposeConsRecFile(const char* fname) { + // set filename for constraints CloseConsRecStorage(); SetConsRecFName(fname); return InitConsRecStorage(kTRUE); // open in read mode @@ -311,6 +316,7 @@ Bool_t AliMillePede2::InitConsRecStorage(Bool_t read) //_____________________________________________________________________________________________ void AliMillePede2::CloseDataRecStorage() { + // close records file if (fTreeData) { if (fDataRecFile && fDataRecFile->IsWritable()) { fDataRecFile->cd(); @@ -331,6 +337,7 @@ void AliMillePede2::CloseDataRecStorage() //_____________________________________________________________________________________________ void AliMillePede2::CloseConsRecStorage() { + // close constraints file if (fTreeConstr) { if (fConsRecFile->IsWritable()) { fConsRecFile->cd(); @@ -366,6 +373,7 @@ Bool_t AliMillePede2::ReadNextRecordConstraint() //_____________________________________________________________________________________________ void AliMillePede2::SetRecordWeight(double wgh) { + // assign weight if (fRecFileStatus<2) InitDataRecStorage(); // create a buffer to store the data fRecord->SetWeight(wgh); } @@ -373,6 +381,7 @@ void AliMillePede2::SetRecordWeight(double wgh) //_____________________________________________________________________________________________ void AliMillePede2::SetRecordRun(Int_t run) { + // assign run if (fRecFileStatus<2) InitDataRecStorage(); // create a buffer to store the data fRecord->SetRunID(run); } @@ -380,6 +389,7 @@ void AliMillePede2::SetRecordRun(Int_t run) //_____________________________________________________________________________________________ void AliMillePede2::SetLocalEquation(double *dergb, double *derlc, double lMeas, double lSigma) { + // assing derivs of loc.eq. if (fRecFileStatus<2) InitDataRecStorage(); // create a buffer to store the data // // write data of single measurement @@ -431,7 +441,7 @@ void AliMillePede2::SetLocalEquation(int *indgb, double *dergb, int ngb, int *in //_____________________________________________________________________________________________ -void AliMillePede2::SetGlobalConstraint(double *dergb, double val, double sigma) +void AliMillePede2::SetGlobalConstraint(const double *dergb, double val, double sigma) { // Define a constraint equation. if (!fConsRecFile || !fConsRecFile->IsWritable()) InitConsRecStorage(); // create a buffer to store the data @@ -448,7 +458,7 @@ void AliMillePede2::SetGlobalConstraint(double *dergb, double val, double sigma) } //_____________________________________________________________________________________________ -void AliMillePede2::SetGlobalConstraint(const int *indgb, double *dergb, int ngb, double val,double sigma) +void AliMillePede2::SetGlobalConstraint(const int *indgb, const double *dergb, int ngb, double val,double sigma) { // Define a constraint equation. if (!fConsRecFile || !fConsRecFile->IsWritable()) InitConsRecStorage(); // create a buffer to store the data @@ -762,7 +772,7 @@ Int_t AliMillePede2::GlobalFit(Double_t *par, Double_t *error, Double_t *pull) // if (par) for (int i=fNGloPar;i--;) par[i] = fInitPar[i]+fDeltaPar[i]; // - if (fGloSolveStatus==gkInvert) { // errors on params are available + if (fGloSolveStatus==kInvert) { // errors on params are available if (error) for (int i=fNGloPar;i--;) error[i] = fProcPnt[i]>0 ? TMath::Sqrt(TMath::Abs(fMatCGlo->QueryDiag(i))) : 0.; if (pull) for (int i=fNGloPar;i--;) pull[i] = fProcPnt[i]>0 && (fSigmaPar[i]*fSigmaPar[i]-fMatCGlo->QueryDiag(i))>0. && fSigmaPar[i]>0 ? fDeltaPar[i]/TMath::Sqrt(fSigmaPar[i]*fSigmaPar[i]-fMatCGlo->QueryDiag(i)) : 0; @@ -779,7 +789,7 @@ Int_t AliMillePede2::GlobalFitIteration() AliInfo(Form("Global Fit Iteration#%2d (Local Fit Chi^2 cut factor: %.2f)",fIter,fChi2CutFactor)); // if (!fNGloPar || !fTreeData) { - AliInfo("No data was stored, aborting iteration"); + AliInfo("No data was stored, stopping iteration"); return 0; } TStopwatch sw,sws; @@ -1012,8 +1022,8 @@ Int_t AliMillePede2::GlobalFitIteration() printf("Solve %d |",fIter); sws.Print(); // sw.Stop(); - AliInfo(Form("Iteration#%2d %s. CPU time: %.1f",fIter,fGloSolveStatus==gkFailed ? "Failed":"Converged",sw.CpuTime())); - if (fGloSolveStatus==gkFailed) return 0; + AliInfo(Form("Iteration#%2d %s. CPU time: %.1f",fIter,fGloSolveStatus==kFailed ? "Failed":"Converged",sw.CpuTime())); + if (fGloSolveStatus==kFailed) return 0; // for (int i=fNGloPar;i--;) fDeltaPar[i] += fVecBGlo[i]; // Update global parameters values (for iterations) // @@ -1037,18 +1047,18 @@ Int_t AliMillePede2::SolveGlobalMatEq() if (!fgIsMatGloSparse) { // if (fNLagrangeConstraints==0) { // pos-def systems are faster to solve by Cholesky - if ( ((AliSymMatrix*)fMatCGlo)->SolveChol(fVecBGlo, fgInvChol) ) return fgInvChol ? gkInvert:gkNoInversion; + if ( ((AliSymMatrix*)fMatCGlo)->SolveChol(fVecBGlo, fgInvChol) ) return fgInvChol ? kInvert:kNoInversion; else AliInfo("Solution of Global Dense System by Cholesky failed, trying Gaussian Elimiation"); } // - if (((AliSymMatrix*)fMatCGlo)->SolveSpmInv(fVecBGlo, kTRUE)) return gkInvert; + if (((AliSymMatrix*)fMatCGlo)->SolveSpmInv(fVecBGlo, kTRUE)) return kInvert; else AliInfo("Solution of Global Dense System by Gaussian Elimination failed, trying iterative methods"); } // try to solve by minres TVectorD sol(fNGloSize); // AliMinResSolve *slv = new AliMinResSolve(fMatCGlo,fVecBGlo); - if (!slv) return gkFailed; + if (!slv) return kFailed; // Bool_t res = kFALSE; if (fgIterSol == AliMinResSolve::kSolMinRes) @@ -1063,7 +1073,7 @@ Int_t AliMillePede2::SolveGlobalMatEq() int defout = dup(1); if (defout<0) { AliInfo("Failed on dup"); - return gkFailed; + return kFailed; } int slvDump = open(faildump, O_RDWR|O_CREAT, 0666); if (slvDump>=0) { @@ -1082,10 +1092,10 @@ Int_t AliMillePede2::SolveGlobalMatEq() } else AliInfo("Failed on file open for matrix dumping"); close(defout); - return gkFailed; + return kFailed; } for (int i=fNGloSize;i--;) fVecBGlo[i] = sol[i]; - return gkNoInversion; + return kNoInversion; // } @@ -1140,7 +1150,7 @@ Int_t AliMillePede2::SetIterations(double lChi2CutFac) Double_t AliMillePede2::GetParError(int iPar) const { // return error for parameter iPar - if (fGloSolveStatus==gkInvert) { + if (fGloSolveStatus==kInvert) { double res = fMatCGlo->QueryDiag(iPar); if (res>=0) return TMath::Sqrt(res); } @@ -1166,7 +1176,7 @@ Int_t AliMillePede2::PrintGlobalParameters() const lGlobalCor = 0.0; // double dg; - if (fGloSolveStatus==gkInvert && TMath::Abs( (dg=fMatCGlo->QueryDiag(i)) *fDiagCGlo[i]) > 0) { + if (fGloSolveStatus==kInvert && TMath::Abs( (dg=fMatCGlo->QueryDiag(i)) *fDiagCGlo[i]) > 0) { lGlobalCor = TMath::Sqrt(TMath::Abs(1.0-1.0/(dg*fDiagCGlo[i]))); AliInfo(Form("%d\t %.6f\t %.6f\t %.6f\t %.6f\t %.6f\t %.6f\t %6d", i,fInitPar[i],fInitPar[i]+fDeltaPar[i],fDeltaPar[i],fVecBGlo[i],lError,lGlobalCor,fProcPnt[i])); diff --git a/STEER/STEER/AliMillePede2.h b/STEER/STEER/AliMillePede2.h index 7540957b078..7c3d650bbc7 100644 --- a/STEER/STEER/AliMillePede2.h +++ b/STEER/STEER/AliMillePede2.h @@ -29,7 +29,7 @@ class AliMillePede2: public TObject { public: // - enum {gkFailed,gkInvert,gkNoInversion}; // used global matrix solution methods + enum {kFailed,kInvert,kNoInversion}; // used global matrix solution methods // AliMillePede2(); AliMillePede2(const AliMillePede2& src); @@ -122,8 +122,8 @@ class AliMillePede2: public TObject // // constraints - void SetGlobalConstraint(double *dergb, double val, double sigma=0); - void SetGlobalConstraint(const int *indgb,double *dergb, int ngb, double val, double sigma=0); + void SetGlobalConstraint(const double *dergb, double val, double sigma=0); + void SetGlobalConstraint(const int *indgb, const double *dergb, int ngb, double val, double sigma=0); // // processing of the local measurement void SetRecordRun(Int_t run); diff --git a/STEER/STEER/AliMillePedeRecord.cxx b/STEER/STEER/AliMillePedeRecord.cxx index 7a8d586c6e7..c79e02271c6 100644 --- a/STEER/STEER/AliMillePedeRecord.cxx +++ b/STEER/STEER/AliMillePedeRecord.cxx @@ -30,6 +30,7 @@ fSize(0),fNGroups(0),fRunID(0),fGroupID(0),fIndex(0),fValue(0),fWeight(1) {SetUn AliMillePedeRecord::AliMillePedeRecord(const AliMillePedeRecord& src) : TObject(src),fSize(src.fSize),fNGroups(src.fNGroups),fRunID(src.fRunID),fGroupID(0),fIndex(0),fValue(0),fWeight(src.fWeight) { + // copy ct-r fIndex = new Int_t[GetDtBufferSize()]; memcpy(fIndex,src.fIndex,fSize*sizeof(Int_t)); fValue = new Double_t[GetDtBufferSize()]; @@ -40,7 +41,8 @@ AliMillePedeRecord::AliMillePedeRecord(const AliMillePedeRecord& src) : //_____________________________________________________________________________________________ AliMillePedeRecord& AliMillePedeRecord::operator=(const AliMillePedeRecord& rhs) -{ +{ + // assignment op-r if (this!=&rhs) { Reset(); for (int i=0;iReset(); for (int i=fNGlobal;i--;) fRHSGlo[i] = 0; @@ -286,12 +303,14 @@ void AliParamSolver::Clear(Option_t*) //______________________________________________________________________________________ void AliParamSolver::Print(Option_t*) const { + // print itself AliInfo(Form("Solver with %d globals for %d points",fNGlobal,fNPoints)); } //______________________________________________________________________________________ void AliParamSolver::SetNGlobal(Int_t n) { + // set N global params if (n>fMaxGlobal) { AliError(Form("Maximum number of globals was set to %d",fMaxGlobal)); return; @@ -303,6 +322,7 @@ void AliParamSolver::SetNGlobal(Int_t n) //______________________________________________________________________________________ void AliParamSolver::SetMaxGlobal(Int_t n) { + // set limit on N glob. if (n>0 && n==fMaxGlobal) return; fMaxGlobal = n; fNGlobal = n; diff --git a/STEER/STEER/AliParamSolver.h b/STEER/STEER/AliParamSolver.h index 6462e5fe68d..2dabe6dd761 100644 --- a/STEER/STEER/AliParamSolver.h +++ b/STEER/STEER/AliParamSolver.h @@ -26,7 +26,7 @@ class AliParamSolver: public TObject AliParamSolver(); AliParamSolver(Int_t maxglo,Int_t locsize=16); - AliParamSolver(AliParamSolver& src); + AliParamSolver(const AliParamSolver& src); AliParamSolver& operator=(const AliParamSolver& src); ~AliParamSolver(); // diff --git a/STEER/STEER/AliQAChecker.h b/STEER/STEER/AliQAChecker.h index 6bb61d4dfb5..a63835b60f6 100644 --- a/STEER/STEER/AliQAChecker.h +++ b/STEER/STEER/AliQAChecker.h @@ -1,5 +1,5 @@ -#ifndef ALIQAChecker_H -#define ALIQAChecker_H +#ifndef ALIQACHECKER_H +#define ALIQACHECKER_H /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * See cxx source for full Copyright notice */ diff --git a/STEER/STEER/AliRectMatrix.cxx b/STEER/STEER/AliRectMatrix.cxx index b00aa77dfb8..d69c694d2a0 100644 --- a/STEER/STEER/AliRectMatrix.cxx +++ b/STEER/STEER/AliRectMatrix.cxx @@ -1,3 +1,13 @@ +/*********************************************************************************/ +/* */ +/* Class for rectangular matrix used for */ +/* millepede2 operation. */ +/* May be sparse or dense. */ +/* ----------------------- */ +/* Author: ruben.shahoyan@cern.ch */ +/* */ +/*********************************************************************************/ + #include "AliRectMatrix.h" #include // @@ -14,7 +24,7 @@ AliRectMatrix::AliRectMatrix() AliRectMatrix::AliRectMatrix(Int_t nrow,Int_t ncol) : fNRows(nrow),fNCols(ncol),fRows(0) { - // + // c-tor fRows = new Double_t*[fNRows]; for (int i=fNRows;i--;) { fRows[i] = new Double_t[fNCols]; @@ -27,6 +37,7 @@ AliRectMatrix::AliRectMatrix(Int_t nrow,Int_t ncol) AliRectMatrix::AliRectMatrix(const AliRectMatrix &src) : TObject(src),fNRows(src.fNRows), fNCols(src.fNCols), fRows(0) { + // copy c-tor fRows = new Double_t*[fNRows]; for (int i=fNRows;i--;) { fRows[i] = new Double_t[fNCols]; @@ -37,6 +48,7 @@ AliRectMatrix::AliRectMatrix(const AliRectMatrix &src) //___________________________________________________________ AliRectMatrix::~AliRectMatrix() { + // dest-tor if (fNRows) for (int i=fNRows;i--;) delete[] fRows[i]; delete[] fRows; } @@ -44,7 +56,7 @@ AliRectMatrix::~AliRectMatrix() //___________________________________________________________ AliRectMatrix& AliRectMatrix::operator=(const AliRectMatrix& src) { - // + // assignment op-r if (&src == this) return *this; if (fNRows) for (int i=fNRows;i--;) delete[] fRows[i]; delete[] fRows; @@ -62,6 +74,7 @@ AliRectMatrix& AliRectMatrix::operator=(const AliRectMatrix& src) //___________________________________________________________ void AliRectMatrix::Print(Option_t* option) const { + // print itself printf("Rectangular Matrix: %d rows %d columns\n",fNRows,fNCols); TString opt = option; opt.ToLower(); if (opt.IsNull()) return; @@ -73,8 +86,9 @@ void AliRectMatrix::Print(Option_t* option) const //___________________________________________________________ -void AliRectMatrix::Reset() +void AliRectMatrix::Reset() const { + // reset all for (int i=fNRows;i--;) { double *row = GetRow(i); for (int j=fNCols;j--;) row[j] = 0.; diff --git a/STEER/STEER/AliRectMatrix.h b/STEER/STEER/AliRectMatrix.h index 0885b014552..ecdaeeff62e 100644 --- a/STEER/STEER/AliRectMatrix.h +++ b/STEER/STEER/AliRectMatrix.h @@ -1,6 +1,14 @@ #ifndef ALIRECTMATRIX_H #define ALIRECTMATRIX_H +/*********************************************************************************/ +/* */ +/* Class for rectangular matrix used for */ +/* millepede2 operation. */ +/* Author: ruben.shahoyan@cern.ch */ +/* */ +/*********************************************************************************/ + #include "TObject.h" class TString; @@ -23,7 +31,7 @@ class AliRectMatrix : public TObject { Double_t* operator()(Int_t row) const {return GetRow(row);} Double_t* GetRow(Int_t row) const {return fRows[row];} // - void Reset(); + void Reset() const; // virtual void Print(Option_t* option="") const; // diff --git a/STEER/STEER/AliSymMatrix.cxx b/STEER/STEER/AliSymMatrix.cxx index 2c000cce083..326aade1c4a 100644 --- a/STEER/STEER/AliSymMatrix.cxx +++ b/STEER/STEER/AliSymMatrix.cxx @@ -349,7 +349,7 @@ Bool_t AliSymMatrix::SolveChol(Double_t *brhs, Double_t *bsol,Bool_t invert) } //___________________________________________________________ -Bool_t AliSymMatrix::SolveChol(TVectorD &brhs, TVectorD &bsol,Bool_t invert) +Bool_t AliSymMatrix::SolveChol(const TVectorD &brhs, TVectorD &bsol,Bool_t invert) { bsol = brhs; return SolveChol(bsol,invert); diff --git a/STEER/STEER/AliSymMatrix.h b/STEER/STEER/AliSymMatrix.h index 7247898e67f..ccf7619abf8 100644 --- a/STEER/STEER/AliSymMatrix.h +++ b/STEER/STEER/AliSymMatrix.h @@ -74,7 +74,7 @@ class AliSymMatrix : public AliMatrixSq { Bool_t SolveChol(Double_t *brhs, Bool_t invert=kFALSE); Bool_t SolveChol(Double_t *brhs, Double_t *bsol,Bool_t invert=kFALSE); Bool_t SolveChol(TVectorD &brhs, Bool_t invert=kFALSE); - Bool_t SolveChol(TVectorD &brhs, TVectorD& bsol,Bool_t invert=kFALSE); + Bool_t SolveChol(const TVectorD &brhs, TVectorD& bsol,Bool_t invert=kFALSE); // int SolveSpmInv(double *vecB, Bool_t stabilize=kTRUE); diff --git a/STEER/STEER/AliTrackFitter.cxx b/STEER/STEER/AliTrackFitter.cxx index a02d87747b9..befa578351a 100644 --- a/STEER/STEER/AliTrackFitter.cxx +++ b/STEER/STEER/AliTrackFitter.cxx @@ -13,11 +13,16 @@ * provided "as is" without express or implied warranty. * **************************************************************************/ -//----------------------------------------------------------------- -// Implementation of the base class for fast track fitters -// -// -//----------------------------------------------------------------- +/************************************************************************* + * AliTrackFitter: base class for the fast track fitters * + * * + * Supposed to be used for alignment framework * + * More information is available in + * http://agenda.cern.ch/askArchive.php?base=agenda&categ=a057717&id=a057717s1t6/transparencies + * Author: C.Cheskov * + * * + * * + *************************************************************************/ #include #include diff --git a/STEER/STEER/AliTrackFitter.h b/STEER/STEER/AliTrackFitter.h index 0f75ef6021c..4558305efb8 100644 --- a/STEER/STEER/AliTrackFitter.h +++ b/STEER/STEER/AliTrackFitter.h @@ -4,6 +4,10 @@ /************************************************************************* * AliTrackFitter: base class for the fast track fitters * * * + * Supposed to be used for alignment framework * + * More information is available in + * http://agenda.cern.ch/askArchive.php?base=agenda&categ=a057717&id=a057717s1t6/transparencies + * Author: C.Cheskov * * * * * *************************************************************************/ diff --git a/STEER/STEER/AliVectorSparse.cxx b/STEER/STEER/AliVectorSparse.cxx index a0e209a3dcb..f96f60291fb 100644 --- a/STEER/STEER/AliVectorSparse.cxx +++ b/STEER/STEER/AliVectorSparse.cxx @@ -36,6 +36,7 @@ AliVectorSparse::AliVectorSparse() AliVectorSparse::AliVectorSparse(const AliVectorSparse& src) : TObject(src),fNElems(src.fNElems),fIndex(0),fElems(0) { + // copy c-tor fIndex = new UShort_t[fNElems]; fElems = new Double_t[fNElems]; memcpy(fIndex,src.fIndex,fNElems*sizeof(UShort_t)); @@ -45,6 +46,7 @@ AliVectorSparse::AliVectorSparse(const AliVectorSparse& src) //___________________________________________________________ void AliVectorSparse::Clear(Option_t*) { + // clear all delete[] fIndex; fIndex = 0; delete[] fElems; fElems = 0; fNElems = 0; @@ -53,6 +55,7 @@ void AliVectorSparse::Clear(Option_t*) //___________________________________________________________ AliVectorSparse& AliVectorSparse::operator=(const AliVectorSparse& src) { + // assignment op-tor if (&src==this) return *this; Clear(); TObject::operator=(src); @@ -131,6 +134,7 @@ Double_t& AliVectorSparse::FindIndexAdd(Int_t ind) //__________________________________________________________ void AliVectorSparse::ReSize(Int_t sz,Bool_t copy) { + // change the size if (sz<1) {Clear(); return;} // need to insert a new element UShort_t *arrI = new UShort_t[sz]; @@ -164,6 +168,7 @@ void AliVectorSparse::SortIndices(Bool_t valuesToo) //__________________________________________________________ void AliVectorSparse::Print(Option_t* opt) const { + // print itself TString sopt = opt; sopt.ToLower(); int ndig = sopt.Atoi(); if (ndig<=1) ndig = 2; diff --git a/STEER/STEER/AliVectorSparse.h b/STEER/STEER/AliVectorSparse.h index edc6a745f18..f7e2305f60b 100644 --- a/STEER/STEER/AliVectorSparse.h +++ b/STEER/STEER/AliVectorSparse.h @@ -43,7 +43,7 @@ class AliVectorSparse : public TObject { Double_t &GetLastElem() {return fElems[fNElems-1];} // protected: - Int_t fNElems; // + Int_t fNElems; // Number of elements UShort_t* fIndex; // Index of stored elems Double_t* fElems; // pointer on elements // diff --git a/STEER/STEERBase/AliMagF.cxx b/STEER/STEERBase/AliMagF.cxx index 65dee8a203d..363841a47ca 100644 --- a/STEER/STEERBase/AliMagF.cxx +++ b/STEER/STEERBase/AliMagF.cxx @@ -544,6 +544,7 @@ AliMagF* AliMagF::CreateFieldMap(Float_t l3Cur, Float_t diCur, Int_t convention, //_____________________________________________________________________________ const char* AliMagF::GetBeamTypeText() const { + // beam type in text form const char *beamNA = "No Beam"; const char *beamPP = "p-p"; const char *beamPbPb= "A-A"; diff --git a/STEER/STEERBase/AliMagWrapCheb.cxx b/STEER/STEERBase/AliMagWrapCheb.cxx index 9a668425a99..4fa8589ec8a 100644 --- a/STEER/STEERBase/AliMagWrapCheb.cxx +++ b/STEER/STEERBase/AliMagWrapCheb.cxx @@ -18,6 +18,7 @@ #include #include #include +#include ClassImp(AliMagWrapCheb) @@ -715,6 +716,7 @@ void AliMagWrapCheb::LoadData(const char* inpfile) //__________________________________________________________________________________________ void AliMagWrapCheb::BuildTableSol() { + // build lookup table BuildTable(fNParamsSol,fParamsSol, fNZSegSol,fNPSegSol,fNRSegSol, fMinZSol,fMaxZSol, @@ -727,6 +729,7 @@ void AliMagWrapCheb::BuildTableSol() //__________________________________________________________________________________________ void AliMagWrapCheb::BuildTableDip() { + // build lookup table BuildTable(fNParamsDip,fParamsDip, fNZSegDip,fNYSegDip,fNXSegDip, fMinZDip,fMaxZDip, @@ -739,6 +742,7 @@ void AliMagWrapCheb::BuildTableDip() //__________________________________________________________________________________________ void AliMagWrapCheb::BuildTableTPCInt() { + // build lookup table BuildTable(fNParamsTPC,fParamsTPC, fNZSegTPC,fNPSegTPC,fNRSegTPC, fMinZTPC,fMaxZTPC, @@ -751,6 +755,7 @@ void AliMagWrapCheb::BuildTableTPCInt() //__________________________________________________________________________________________ void AliMagWrapCheb::BuildTableTPCRatInt() { + // build lookup table BuildTable(fNParamsTPCRat,fParamsTPCRat, fNZSegTPCRat,fNPSegTPCRat,fNRSegTPCRat, fMinZTPCRat,fMaxZTPCRat, diff --git a/STEER/STEERBase/AliMagWrapCheb.h b/STEER/STEERBase/AliMagWrapCheb.h index c1de663752d..0285dcd136c 100644 --- a/STEER/STEERBase/AliMagWrapCheb.h +++ b/STEER/STEERBase/AliMagWrapCheb.h @@ -39,7 +39,8 @@ #include #include -#include "AliCheb3D.h" +#include +class AliCheb3D; class TSystem; class TArrayF; diff --git a/STEER/STEERBase/AliRefArray.cxx b/STEER/STEERBase/AliRefArray.cxx index 88c46f76953..2e6ac9dcc01 100644 --- a/STEER/STEERBase/AliRefArray.cxx +++ b/STEER/STEERBase/AliRefArray.cxx @@ -28,6 +28,7 @@ AliRefArray::AliRefArray() : fNElems(0),fRefSize(0),fElems(0),fRefInd(0),fRefBuf AliRefArray::AliRefArray(UInt_t nelem,UInt_t depth) : TObject(),fNElems(nelem),fRefSize(depth),fElems(0),fRefInd(0),fRefBuff(0) { + // constructor fNElems = nelem; // create array with nelem initial referres if (fNElems<1) fNElems = 1; -- 2.43.5