From c893147d00c1d0361c56039577faa1cabe83fced Mon Sep 17 00:00:00 2001 From: cblume Date: Thu, 6 Aug 2009 09:35:40 +0000 Subject: [PATCH] Coding rules --- TRD/AliTRDDataDCS.cxx | 13 ++--- TRD/AliTRDDataDCS.h | 9 ++-- TRD/AliTRDPreprocessor.cxx | 13 ++--- TRD/AliTRDPreprocessor.h | 2 +- TRD/AliTRDSaxHandler.cxx | 4 -- TRD/AliTRDSaxHandler.h | 10 ++-- TRD/AliTRDtestBeam.cxx | 2 +- TRD/AliTRDtestBeam.h | 6 +-- TRD/AliTRDtransform.cxx | 34 +++++------- TRD/AliTRDtransform.h | 14 ++--- TRD/Cal/AliTRDCalPIDRefMaker.cxx | 66 +++++++++++------------ TRD/Cal/AliTRDCalPIDRefMaker.h | 23 ++++---- TRD/Cal/AliTRDCalPad.cxx | 13 +++-- TRD/Cal/AliTRDCalPad.h | 8 +-- TRD/Cal/AliTRDCalROC.cxx | 73 ++++++++++++-------------- TRD/Cal/AliTRDCalROC.h | 27 +++++----- TRD/Cal/AliTRDCalSingleChamberStatus.h | 7 ++- 17 files changed, 153 insertions(+), 171 deletions(-) diff --git a/TRD/AliTRDDataDCS.cxx b/TRD/AliTRDDataDCS.cxx index 072cca0512e..277dfdf0e6d 100644 --- a/TRD/AliTRDDataDCS.cxx +++ b/TRD/AliTRDDataDCS.cxx @@ -36,15 +36,15 @@ #include #include -#include #include #include "AliDCSValue.h" #include "AliDCSValue.h" #include "AliLog.h" -#include "AliTRDDataDCS.h" #include "AliSplineFit.h" +#include "AliTRDDataDCS.h" + ClassImp(AliTRDDataDCS) //_____________________________________________________________________________ @@ -243,8 +243,9 @@ Bool_t AliTRDDataDCS::ExtractDCS (TMap *dcsAlias) } //_____________________________________________________________________________ -TGraph *AliTRDDataDCS::FindAndMakeGraph (TMap *dcsMap, const char *amandaStr, - char dataType) +TGraph *AliTRDDataDCS::FindAndMakeGraph (TMap * const dcsMap + , const char *amandaStr + , char dataType) { // // Create the graphs @@ -359,7 +360,7 @@ Bool_t AliTRDDataDCS::PerformFit() } //_____________________________________________________________________________ -AliSplineFit *AliTRDDataDCS::Fit(TGraph *graph, +AliSplineFit *AliTRDDataDCS::Fit(const TGraph * const graph, Int_t minPoints, Int_t iter, Double_t maxDelta, Int_t fitReq) { @@ -381,7 +382,7 @@ AliSplineFit *AliTRDDataDCS::Fit(TGraph *graph, } //_____________________________________________________________________________ -void AliTRDDataDCS::Print(Option_t* option) const +void AliTRDDataDCS::Print(const Option_t * const option) const { // // Print function diff --git a/TRD/AliTRDDataDCS.h b/TRD/AliTRDDataDCS.h index 9564effe253..44b29cae16d 100644 --- a/TRD/AliTRDDataDCS.h +++ b/TRD/AliTRDDataDCS.h @@ -88,13 +88,14 @@ class AliTRDDataDCS : public TNamed AliSplineFit * GetFitLuminosity () const {return GetFit (kLuminosity);} AliSplineFit * GetFitMagneticField () const {return GetFit (kMagneticField);} - void Print (Option_t* option = "") const; + void Print (const Option_t * const option = "") const; protected : - TGraph * FindAndMakeGraph (TMap * dcsMap, const char * amandaStr, - char dataType); - AliSplineFit * Fit (TGraph * graph, + TGraph * FindAndMakeGraph (TMap * const dcsMap + , const char * amandaStr + , char dataType); + AliSplineFit * Fit (const TGraph * const graph, Int_t kMinPoints, Int_t kIter, Double_t kMaxDelta, Int_t kFitReq); diff --git a/TRD/AliTRDPreprocessor.cxx b/TRD/AliTRDPreprocessor.cxx index 12f48a4526d..e42d9ffd186 100644 --- a/TRD/AliTRDPreprocessor.cxx +++ b/TRD/AliTRDPreprocessor.cxx @@ -32,15 +32,14 @@ // // //////////////////////////////////////////////////////////////////////////// +#include + #include #include -#include #include #include #include -#include #include -#include #include "AliCDBMetaData.h" #include "AliLog.h" @@ -51,14 +50,13 @@ #include "AliTRDCalibraMode.h" #include "AliTRDCalibPadStatus.h" #include "AliTRDSaxHandler.h" -#include "Cal/AliTRDCalDet.h" +#include "AliTRDgeometry.h" #include "Cal/AliTRDCalPad.h" #include "Cal/AliTRDCalPadStatus.h" #include "Cal/AliTRDCalDCS.h" #include "Cal/AliTRDCalSingleChamberStatus.h" #include "Cal/AliTRDCalROC.h" - ClassImp(AliTRDPreprocessor) //______________________________________________________________________________________________ @@ -481,8 +479,11 @@ Bool_t AliTRDPreprocessor::ExtractPedestals() return error; } + //__________________________________________________________________ -Bool_t AliTRDPreprocessor::AreThereDataPedestal(AliTRDCalSingleChamberStatus *calROCStatus, Bool_t second){ +Bool_t AliTRDPreprocessor::AreThereDataPedestal(AliTRDCalSingleChamberStatus * const calROCStatus + , Bool_t second) +{ // // Data for this half chamber diff --git a/TRD/AliTRDPreprocessor.h b/TRD/AliTRDPreprocessor.h index 4549684af2c..64ab617fa20 100644 --- a/TRD/AliTRDPreprocessor.h +++ b/TRD/AliTRDPreprocessor.h @@ -44,7 +44,7 @@ class AliTRDPreprocessor : public AliPreprocessor UInt_t ProcessDCSConfigData(); // process DCS configuration - Bool_t AreThereDataPedestal(AliTRDCalSingleChamberStatus *calROCStatus, Bool_t second); + Bool_t AreThereDataPedestal(AliTRDCalSingleChamberStatus * const calROCStatus, Bool_t second); void SetDefaultStatus(AliTRDCalSingleChamberStatus &calROCStatus, Bool_t second); void SetStatus(AliTRDCalSingleChamberStatus &calROCStatus, AliTRDCalSingleChamberStatus *calROCStatusPrevious,Bool_t second); void SetDefaultNoise(AliTRDCalROC &calROCNoise, Bool_t second); diff --git a/TRD/AliTRDSaxHandler.cxx b/TRD/AliTRDSaxHandler.cxx index 859663be195..0f20a376a98 100644 --- a/TRD/AliTRDSaxHandler.cxx +++ b/TRD/AliTRDSaxHandler.cxx @@ -24,11 +24,8 @@ // // //////////////////////////////////////////////////////////////////////////// -#include -#include #include #include -#include #include #include "AliLog.h" @@ -42,7 +39,6 @@ #include "Cal/AliTRDCalDCSGTU.h" ClassImp(AliTRDSaxHandler) - //_____________________________________________________________________________ AliTRDSaxHandler::AliTRDSaxHandler() diff --git a/TRD/AliTRDSaxHandler.h b/TRD/AliTRDSaxHandler.h index ff7aea8d11c..180c71d4509 100644 --- a/TRD/AliTRDSaxHandler.h +++ b/TRD/AliTRDSaxHandler.h @@ -1,5 +1,5 @@ -#ifndef AliTRDSAXHANDLER_H -#define AliTRDSAXHANDLER_H +#ifndef ALITRDSAXHANDLER_H +#define ALITRDSAXHANDLER_H /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * * See cxx source for full Copyright notice */ @@ -33,9 +33,9 @@ public: virtual ~AliTRDSaxHandler(); AliTRDSaxHandler &operator=(const AliTRDSaxHandler &sh); - TObjArray* GetDCSFEEDataArray() { return fFEEArr; } - TObjArray* GetDCSPTRDataArray() { return fPTRArr; } - TObjArray* GetDCSGTUDataArray() { return fGTUArr; } + TObjArray* GetDCSFEEDataArray() const { return fFEEArr; } + TObjArray* GetDCSPTRDataArray() const { return fPTRArr; } + TObjArray* GetDCSGTUDataArray() const { return fGTUArr; } AliTRDCalDCS* GetCalDCSObj(); // to be called by the preprocessor Int_t GetHandlerStatus() const { return fHandlerStatus; } diff --git a/TRD/AliTRDtestBeam.cxx b/TRD/AliTRDtestBeam.cxx index 39ea161f383..79426dfbe8f 100644 --- a/TRD/AliTRDtestBeam.cxx +++ b/TRD/AliTRDtestBeam.cxx @@ -522,7 +522,7 @@ AliTRDrawStream *AliTRDtestBeam::GetTRDrawStream() } //____________________________________________________________________________ -Int_t AliTRDtestBeam::Int(Int_t i, Char_t *start) const +Int_t AliTRDtestBeam::Int(Int_t i, const Char_t * const start) const { // // ????? diff --git a/TRD/AliTRDtestBeam.h b/TRD/AliTRDtestBeam.h index 22621c54ab6..e0d62e43c0e 100644 --- a/TRD/AliTRDtestBeam.h +++ b/TRD/AliTRDtestBeam.h @@ -1,5 +1,5 @@ -#ifndef AliTRDTESTBEAM_H -#define AliTRDTESTBEAM_H +#ifndef ALITRDTESTBEAM_H +#define ALITRDTESTBEAM_H /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * See cxx source for full Copyright notice */ @@ -100,7 +100,7 @@ protected: // data reading - Int_t Int(Int_t i, Char_t *start) const; + Int_t Int(Int_t i, const Char_t * const start) const; Int_t DecodeSi(); // diff --git a/TRD/AliTRDtransform.cxx b/TRD/AliTRDtransform.cxx index f5d12ba2573..77ca47c1b5c 100644 --- a/TRD/AliTRDtransform.cxx +++ b/TRD/AliTRDtransform.cxx @@ -25,8 +25,6 @@ #include #include "AliLog.h" -#include "AliTracker.h" -#include "AliCodeTimer.h" #include "AliTRDtransform.h" #include "AliTRDcluster.h" @@ -40,8 +38,6 @@ ClassImp(AliTRDtransform) //_____________________________________________________________________________ -//AliTRDtransform::AliTRDtransform() -// :AliTransform() AliTRDtransform::AliTRDtransform() :TObject() ,fGeo(0x0) @@ -51,8 +47,8 @@ AliTRDtransform::AliTRDtransform() ,fCalVdriftROC(0x0) ,fCalT0ROC(0x0) ,fCalPRFROC(0x0) - ,fCalVdriftDet(0x0) - ,fCalT0Det(0x0) + ,fkCalVdriftDet(0x0) + ,fkCalT0Det(0x0) ,fCalVdriftDetValue(0) ,fCalT0DetValue(0) ,fSamplingFrequency(0) @@ -67,8 +63,6 @@ AliTRDtransform::AliTRDtransform() } //_____________________________________________________________________________ -//AliTRDtransform::AliTRDtransform(Int_t det) -// :AliTransform() AliTRDtransform::AliTRDtransform(Int_t det) :TObject() ,fGeo(0x0) @@ -78,8 +72,8 @@ AliTRDtransform::AliTRDtransform(Int_t det) ,fCalVdriftROC(0x0) ,fCalT0ROC(0x0) ,fCalPRFROC(0x0) - ,fCalVdriftDet(0x0) - ,fCalT0Det(0x0) + ,fkCalVdriftDet(0x0) + ,fkCalT0Det(0x0) ,fCalVdriftDetValue(0) ,fCalT0DetValue(0) ,fSamplingFrequency(0) @@ -108,16 +102,14 @@ AliTRDtransform::AliTRDtransform(Int_t det) } // Get the calibration objects for the global calibration - fCalVdriftDet = fCalibration->GetVdriftDet(); - fCalT0Det = fCalibration->GetT0Det(); + fkCalVdriftDet = fCalibration->GetVdriftDet(); + fkCalT0Det = fCalibration->GetT0Det(); SetDetector(det); } //_____________________________________________________________________________ -//AliTRDtransform::AliTRDtransform(const AliTRDtransform &t) -// :AliTransform(t) AliTRDtransform::AliTRDtransform(const AliTRDtransform &t) :TObject(t) ,fGeo(0x0) @@ -127,8 +119,8 @@ AliTRDtransform::AliTRDtransform(const AliTRDtransform &t) ,fCalVdriftROC(0x0) ,fCalT0ROC(0x0) ,fCalPRFROC(0x0) - ,fCalVdriftDet(0x0) - ,fCalT0Det(0x0) + ,fkCalVdriftDet(0x0) + ,fkCalT0Det(0x0) ,fCalVdriftDetValue(0) ,fCalT0DetValue(0) ,fSamplingFrequency(0) @@ -156,8 +148,8 @@ AliTRDtransform::AliTRDtransform(const AliTRDtransform &t) if (!fCalibration) { AliError("Cannot find calibration object"); } - fCalVdriftDet = fCalibration->GetVdriftDet(); - fCalT0Det = fCalibration->GetT0Det(); + fkCalVdriftDet = fCalibration->GetVdriftDet(); + fkCalT0Det = fCalibration->GetT0Det(); } @@ -190,8 +182,8 @@ void AliTRDtransform::SetDetector(Int_t det) fCalPRFROC = fCalibration->GetPRFROC(det); // Get the detector wise defined calibration values - fCalVdriftDetValue = fCalVdriftDet->GetValue(det); - fCalT0DetValue = fCalT0Det->GetValue(det); + fCalVdriftDetValue = fkCalVdriftDet->GetValue(det); + fCalT0DetValue = fkCalT0Det->GetValue(det); // Shift needed to define Z-position relative to middle of chamber Int_t layer = fGeo->GetLayer(det); @@ -261,6 +253,7 @@ Bool_t AliTRDtransform::Transform(AliTRDcluster *c) c->SetSigmaZ2(fPadPlane->GetRowSize(row)*fPadPlane->GetRowSize(row)/12.); return kTRUE; + } //_____________________________________________________________________________ @@ -275,4 +268,5 @@ void AliTRDtransform::Recalibrate(AliTRDcluster *c, Bool_t setDet) if (setDet) SetDetector(c->GetDetector()); Transform(c); + } diff --git a/TRD/AliTRDtransform.h b/TRD/AliTRDtransform.h index 9ac22c92bb1..d42b621abd4 100644 --- a/TRD/AliTRDtransform.h +++ b/TRD/AliTRDtransform.h @@ -13,7 +13,6 @@ //////////////////////////////////////////////////////////////////////////// #include "TObject.h" -//#include "../TPC/AliTransform.h" class TGeoHMatrix; @@ -25,9 +24,10 @@ class AliTRDCalROC; class AliTRDCalDet; class AliTRDpadPlane; -//class AliTRDtransform : public AliTransform { class AliTRDtransform : public TObject { -public: + + public: + AliTRDtransform(); AliTRDtransform(Int_t det); AliTRDtransform(const AliTRDtransform &t); @@ -41,6 +41,7 @@ public: void SetDetector(Int_t det); protected: + AliTRDgeometry *fGeo; // TRD geometry Int_t fDetector; // Detector number @@ -50,8 +51,8 @@ protected: AliTRDCalROC *fCalVdriftROC; // Pad wise Vdrift calibration object AliTRDCalROC *fCalT0ROC; // Pad wise T0 calibration object AliTRDCalROC *fCalPRFROC; // Pad wise PRF calibration object - const AliTRDCalDet *fCalVdriftDet; // ROC wise Vdrift calibration object - const AliTRDCalDet *fCalT0Det; // ROC wise T0 calibration object + const AliTRDCalDet *fkCalVdriftDet; // ROC wise Vdrift calibration object + const AliTRDCalDet *fkCalT0Det; // ROC wise T0 calibration object Double_t fCalVdriftDetValue; // ROC wise Vdrift calibration value Double_t fCalT0DetValue; // ROC wise T0 calibration value @@ -62,8 +63,7 @@ protected: TGeoHMatrix *fMatrix; // Transformation matrix for a given chamber - ClassDef(AliTRDtransform, 2) // Transforms clusters + ClassDef(AliTRDtransform, 3) // Transforms clusters }; - #endif diff --git a/TRD/Cal/AliTRDCalPIDRefMaker.cxx b/TRD/Cal/AliTRDCalPIDRefMaker.cxx index bd1408cb7e3..dc076dced3c 100644 --- a/TRD/Cal/AliTRDCalPIDRefMaker.cxx +++ b/TRD/Cal/AliTRDCalPIDRefMaker.cxx @@ -33,18 +33,15 @@ #include #include #include -#include #include #include #include #include #include -#include #include #include #include -#include "AliLog.h" #include "AliPID.h" #include "AliESD.h" #include "AliRun.h" @@ -60,12 +57,10 @@ #include "AliTRDgeometry.h" #include "AliTRDtrack.h" -#include - ClassImp(AliTRDCalPIDRefMaker) -TLinearFitter *AliTRDCalPIDRefMaker::fFitter2D2 = 0x0; -TLinearFitter *AliTRDCalPIDRefMaker::fFitter2D1 = 0x0; +TLinearFitter *AliTRDCalPIDRefMaker::fgFitter2D2 = 0x0; +TLinearFitter *AliTRDCalPIDRefMaker::fgFitter2D1 = 0x0; //__________________________________________________________________ AliTRDCalPIDRefMaker::AliTRDCalPIDRefMaker() @@ -109,8 +104,8 @@ AliTRDCalPIDRefMaker::~AliTRDCalPIDRefMaker() if(fH2dEdx[ispec]) delete fH2dEdx[ispec]; if(fPrinc[ispec]) delete fPrinc[ispec]; } - if(fFitter2D1){ delete fFitter2D1; fFitter2D1 = 0x0;} - if(fFitter2D2){ delete fFitter2D2; fFitter2D2 = 0x0;} + if(fgFitter2D1){ delete fgFitter2D1; fgFitter2D1 = 0x0;} + if(fgFitter2D2){ delete fgFitter2D2; fgFitter2D2 = 0x0;} } @@ -364,13 +359,13 @@ Bool_t AliTRDCalPIDRefMaker::BuildLQReferences(const Char_t *File, const Char_t } //__________________________________________________________________ -Bool_t AliTRDCalPIDRefMaker::BuildNNReferences(const Char_t* /*File*/, const Char_t* /*dir*/) +Bool_t AliTRDCalPIDRefMaker::BuildNNReferences(const Char_t* /*File*/, const Char_t* /*dir*/) const { return kTRUE; } //__________________________________________________________________ -Double_t AliTRDCalPIDRefMaker::Estimate2D2(TH2 *h, Float_t &x, Float_t &y) +Double_t AliTRDCalPIDRefMaker::Estimate2D2(TH2 * const h, Float_t &x, Float_t &y) { // // Linear interpolation of data point with a parabolic expresion using @@ -399,9 +394,9 @@ Double_t AliTRDCalPIDRefMaker::Estimate2D2(TH2 *h, Float_t &x, Float_t &y) Double_t entries; // late construction of fitter - if(!fFitter2D2) fFitter2D2 = new TLinearFitter(6, "1++x++y++x*x++y*y++x*y"); + if(!fgFitter2D2) fgFitter2D2 = new TLinearFitter(6, "1++x++y++x*x++y*y++x*y"); - fFitter2D2->ClearPoints(); + fgFitter2D2->ClearPoints(); Int_t npoints=0; Int_t binx0, binx1, biny0, biny1; for(int bin=0; bin<5; bin++){ @@ -415,13 +410,13 @@ Double_t AliTRDCalPIDRefMaker::Estimate2D2(TH2 *h, Float_t &x, Float_t &y) if((entries = h->GetBinContent(ibin, jbin)) == 0.) continue; p[0] = ax->GetBinCenter(ibin); p[1] = ay->GetBinCenter(jbin); - fFitter2D2->AddPoint(p, log(entries), 1./sqrt(entries)); + fgFitter2D2->AddPoint(p, log(entries), 1./sqrt(entries)); npoints++; } } if(npoints>=25) break; } - if(fFitter2D2->Eval() == 1){ + if(fgFitter2D2->Eval() == 1){ printf(" x = %9.4f y = %9.4f\n", x, y); printf("\tbinx %d biny %d\n", binx, biny); printf("\tpoints %d\n", npoints); @@ -429,16 +424,17 @@ Double_t AliTRDCalPIDRefMaker::Estimate2D2(TH2 *h, Float_t &x, Float_t &y) return 0.; } TVectorD vec(6); - fFitter2D2->GetParameters(vec); + fgFitter2D2->GetParameters(vec); Double_t result = vec[0] + x*vec[1] + y*vec[2] + x*x*vec[3] + y*y*vec[4] + x*y*vec[5]; return exp(result); } //__________________________________________________________________ -Double_t AliTRDCalPIDRefMaker::Estimate2D1(TH2 *h, Float_t &x, Float_t &y - , Float_t &dCT, Float_t &rmin - , Float_t &rmax) +Double_t AliTRDCalPIDRefMaker::Estimate2D1(TH2 * const h, Float_t &x, Float_t &y + , const Float_t &dCT + , const Float_t &rmin + , const Float_t &rmax) { // // Linear interpolation of data point with a plane using @@ -462,9 +458,9 @@ Double_t AliTRDCalPIDRefMaker::Estimate2D1(TH2 *h, Float_t &x, Float_t &y Double_t rxy = sqrt(x*x + y*y), rpxy; // late construction of fitter - if(!fFitter2D1) fFitter2D1 = new TLinearFitter(3, "1++x++y"); + if(!fgFitter2D1) fgFitter2D1 = new TLinearFitter(3, "1++x++y"); - fFitter2D1->ClearPoints(); + fgFitter2D1->ClearPoints(); Int_t npoints=0; for(int ibin=1; ibin<=nbinsx; ibin++){ for(int jbin=1; jbin<=nbinsy; jbin++){ @@ -475,24 +471,24 @@ Double_t AliTRDCalPIDRefMaker::Estimate2D1(TH2 *h, Float_t &x, Float_t &y if((x*p[0] + y*p[1])/rxy/rpxy < dCT) continue; if(rpxy rmax) continue; - fFitter2D1->AddPoint(p, log(entries), 1./sqrt(entries)); + fgFitter2D1->AddPoint(p, log(entries), 1./sqrt(entries)); npoints++; } } if(npoints<15) return 0.; - if(fFitter2D1->Eval() == 1){ + if(fgFitter2D1->Eval() == 1){ printf(" x = %9.4f y = %9.4f\n", x, y); printf("\tpoints %d\n", npoints); return 0.; } TVectorD vec(3); - fFitter2D1->GetParameters(vec); + fgFitter2D1->GetParameters(vec); Double_t result = vec[0] + x*vec[1] + y*vec[2]; return exp(result); } //__________________________________________________________________ -// Double_t AliTRDCalPIDRefMaker::Estimate3D2(TH3 *h, Float_t &x, Float_t &y, Float_t &z) +// Double_t AliTRDCalPIDRefMaker::Estimate3D2(TH3 * const h, Float_t &x, Float_t &y, Float_t &z) // { // // Author Alex Bercuci (A.Bercuci@gsi.de) // return 0.; @@ -602,12 +598,12 @@ void AliTRDCalPIDRefMaker::Prepare2D() //const Float_t dPhiRange = .1; Int_t nPoints[nPhi], nFitPoints, binStart, binStop; TLinearFitter refsFitter[nPhi], refsLongFitter(6, "1++x++y++x*x++y*y++x*y"); - Float_t fFitterRange[nPhi]; + Float_t fgFitterRange[nPhi]; Bool_t kFitterStatus[nPhi]; for(int iphi=0; iphi storeX[nPhi], storeY[nPhi]; @@ -615,7 +611,7 @@ void AliTRDCalPIDRefMaker::Prepare2D() // define working variables Float_t x0, y0, rx, ry; //Float_t rc, rmin, rmax, dr, dCT; - Double_t Phi, r; + Double_t phi, r; Int_t iPhi; Double_t entries; for(int ispec=0; ispec<5; ispec++){ @@ -623,7 +619,7 @@ void AliTRDCalPIDRefMaker::Prepare2D() for(int iphi=0; iphi 0.) ? 1. : -1.) * TMath::ACos(rxy[0]/r); // [-pi, pi] - iPhi = nPhi/2 + Int_t(Phi/dPhi) - ((Phi/dPhi > 0.) ? 0 : 1); + phi = ((rxy[1] > 0.) ? 1. : -1.) * TMath::ACos(rxy[0]/r); // [-pi, pi] + iPhi = nPhi/2 + Int_t(phi/dPhi) - ((phi/dPhi > 0.) ? 0 : 1); refsFitter[iPhi].AddPoint(rxy, log(entries), 1./sqrt(entries)); nPoints[iPhi]++; @@ -704,8 +700,8 @@ void AliTRDCalPIDRefMaker::Prepare2D() fH2dEdx[ispec]->SetBinContent(ibin, jbin, estimate/xy[0]/xy[1]); } else { // interpolation outside the covariance ellipse r = sqrt(rxy[0]*rxy[0] + rxy[1]*rxy[1]); - Phi = ((rxy[1] > 0.) ? 1. : -1.) * TMath::ACos(rxy[0]/r); // [-pi, pi] - iPhi = nPhi/2 + Int_t(Phi/dPhi) - ((Phi/dPhi > 0.) ? 0 : 1); + phi = ((rxy[1] > 0.) ? 1. : -1.) * TMath::ACos(rxy[0]/r); // [-pi, pi] + iPhi = nPhi/2 + Int_t(phi/dPhi) - ((phi/dPhi > 0.) ? 0 : 1); storeX[iPhi].push_back(ibin); storeY[iPhi].push_back(jbin); @@ -718,8 +714,8 @@ void AliTRDCalPIDRefMaker::Prepare2D() TVectorD vec(3); Int_t xbin, ybin; for(int iphi=0; iphi #include +//#include "AliMathBase.h" + #include "AliTRDCalPad.h" #include "AliTRDCalROC.h" #include "AliTRDCalDet.h" #include "AliTRDpadPlane.h" -#include "AliMathBase.h" #include "AliTRDgeometry.h" ClassImp(AliTRDCalPad) @@ -201,7 +202,8 @@ Double_t AliTRDCalPad::GetMeanRMS(Double_t &rms, const AliTRDCalDet *calDet, Int } //_____________________________________________________________________________ -Double_t AliTRDCalPad::GetMean(const AliTRDCalDet *calDet, Int_t type, AliTRDCalPad* outlierPad) +Double_t AliTRDCalPad::GetMean(const AliTRDCalDet *calDet, Int_t type + , AliTRDCalPad* const outlierPad) { // // return mean of the mean of all ROCs @@ -228,7 +230,8 @@ Double_t AliTRDCalPad::GetMean(const AliTRDCalDet *calDet, Int_t type, AliTRDCal } //_____________________________________________________________________________ -Double_t AliTRDCalPad::GetRMS(const AliTRDCalDet *calDet, Int_t type, AliTRDCalPad* outlierPad) +Double_t AliTRDCalPad::GetRMS(const AliTRDCalDet *calDet, Int_t type + , AliTRDCalPad* const outlierPad) { // // return mean of the RMS of all ROCs @@ -256,7 +259,7 @@ Double_t AliTRDCalPad::GetRMS(const AliTRDCalDet *calDet, Int_t type, AliTRDCalP //_____________________________________________________________________________ Double_t AliTRDCalPad::GetMedian(const AliTRDCalDet *calDet, Int_t type - , AliTRDCalPad* outlierPad) + , AliTRDCalPad* const outlierPad) { // // return mean of the median of all ROCs @@ -285,7 +288,7 @@ Double_t AliTRDCalPad::GetMedian(const AliTRDCalDet *calDet, Int_t type //_____________________________________________________________________________ Double_t AliTRDCalPad::GetLTM(Double_t *sigma, Double_t fraction , const AliTRDCalDet *calDet, Int_t type - , AliTRDCalPad* outlierPad) + , AliTRDCalPad* const outlierPad) { // // return mean of the LTM and sigma of all ROCs diff --git a/TRD/Cal/AliTRDCalPad.h b/TRD/Cal/AliTRDCalPad.h index e65bd0611e9..05f3859cacc 100644 --- a/TRD/Cal/AliTRDCalPad.h +++ b/TRD/Cal/AliTRDCalPad.h @@ -45,11 +45,11 @@ class AliTRDCalPad : public TNamed // Statistic Double_t GetMeanRMS(Double_t &rms, const AliTRDCalDet *calDet = 0, Int_t type = 0); - Double_t GetMean(const AliTRDCalDet *calDet = 0, Int_t type = 0, AliTRDCalPad* outlierPad = 0); - Double_t GetRMS(const AliTRDCalDet *calDet = 0, Int_t type = 0, AliTRDCalPad* outlierPad = 0) ; - Double_t GetMedian(const AliTRDCalDet *calDet = 0, Int_t type = 0, AliTRDCalPad* outlierPad = 0) ; + Double_t GetMean(const AliTRDCalDet *calDet = 0, Int_t type = 0, AliTRDCalPad* const outlierPad = 0); + Double_t GetRMS(const AliTRDCalDet *calDet = 0, Int_t type = 0, AliTRDCalPad* const outlierPad = 0); + Double_t GetMedian(const AliTRDCalDet *calDet = 0, Int_t type = 0, AliTRDCalPad* const outlierPad = 0); Double_t GetLTM(Double_t *sigma=0, Double_t fraction=0.9 - , const AliTRDCalDet *calDet = 0, Int_t type = 0, AliTRDCalPad* outlierPad = 0); + , const AliTRDCalDet *calDet = 0, Int_t type = 0, AliTRDCalPad* const outlierPad = 0); // Plot functions TH1F *MakeHisto1D(const AliTRDCalDet *calDet = 0, Int_t typedet=0, Float_t min=4, Float_t max=-4,Int_t type=0); diff --git a/TRD/Cal/AliTRDCalROC.cxx b/TRD/Cal/AliTRDCalROC.cxx index 5320731038b..6e3514c07a1 100644 --- a/TRD/Cal/AliTRDCalROC.cxx +++ b/TRD/Cal/AliTRDCalROC.cxx @@ -24,26 +24,14 @@ // // /////////////////////////////////////////////////////////////////////////////// -#include -#include -#include #include +#include +#include +#include -#include "AliTRDCalROC.h" -#include "TMath.h" #include "AliMathBase.h" -#include "TLinearFitter.h" -#include "TArrayI.h" -#include "TH2F.h" -#include "TH1F.h" -#include "TArrayF.h" -#include "TGraph2D.h" -#include "TGraphDelaunay.h" -#include "TList.h" - -#include "AliTRDCommonParam.h" -#include "AliTRDpadPlane.h" -#include "AliLog.h" + +#include "AliTRDCalROC.h" ClassImp(AliTRDCalROC) @@ -231,73 +219,73 @@ void AliTRDCalROC::Copy(TObject &c) const } //___________________________________________________________________________________ -Double_t AliTRDCalROC::GetMean(AliTRDCalROC* outlierROC) +Double_t AliTRDCalROC::GetMean(AliTRDCalROC* const outlierROC) const { // // Calculate the mean // Double_t *ddata = new Double_t[fNchannels]; - Int_t NPoints = 0; + Int_t nPoints = 0; for (Int_t i=0;iGetValue(i)))) { if(fData[i] > 0.000000000000001){ - ddata[NPoints]= (Double_t) fData[i]/10000; - NPoints++; + ddata[nPoints]= (Double_t) fData[i]/10000; + nPoints++; } } } - Double_t mean = TMath::Mean(NPoints,ddata); + Double_t mean = TMath::Mean(nPoints,ddata); delete [] ddata; return mean; } //_______________________________________________________________________________________ -Double_t AliTRDCalROC::GetMedian(AliTRDCalROC* outlierROC) +Double_t AliTRDCalROC::GetMedian(AliTRDCalROC* const outlierROC) const { // // Calculate the median // Double_t *ddata = new Double_t[fNchannels]; - Int_t NPoints = 0; + Int_t nPoints = 0; for (Int_t i=0;iGetValue(i)))) { if(fData[i] > 0.000000000000001){ - ddata[NPoints]= (Double_t) fData[i]/10000; - NPoints++; + ddata[nPoints]= (Double_t) fData[i]/10000; + nPoints++; } } } - Double_t mean = TMath::Median(NPoints,ddata); + Double_t mean = TMath::Median(nPoints,ddata); delete [] ddata; return mean; } //____________________________________________________________________________________________ -Double_t AliTRDCalROC::GetRMS(AliTRDCalROC* outlierROC) +Double_t AliTRDCalROC::GetRMS(AliTRDCalROC* const outlierROC) const { // // Calculate the RMS // Double_t *ddata = new Double_t[fNchannels]; - Int_t NPoints = 0; + Int_t nPoints = 0; for (Int_t i=0;iGetValue(i)))) { if(fData[i] > 0.000000000000001){ - ddata[NPoints]= (Double_t)fData[i]/10000; - NPoints++; + ddata[nPoints]= (Double_t)fData[i]/10000; + nPoints++; } } } - Double_t mean = TMath::RMS(NPoints,ddata); + Double_t mean = TMath::RMS(nPoints,ddata); delete [] ddata; return mean; } //______________________________________________________________________________________________ -Double_t AliTRDCalROC::GetLTM(Double_t *sigma, Double_t fraction, AliTRDCalROC* outlierROC) +Double_t AliTRDCalROC::GetLTM(Double_t *sigma, Double_t fraction, AliTRDCalROC* const outlierROC) { // // Calculate LTM mean and sigma @@ -305,17 +293,17 @@ Double_t AliTRDCalROC::GetLTM(Double_t *sigma, Double_t fraction, AliTRDCalROC* Double_t *ddata = new Double_t[fNchannels]; Double_t mean=0, lsigma=0; - UInt_t NPoints = 0; + UInt_t nPoints = 0; for (Int_t i=0;iGetValue(i))) { if(fData[i] > 0.000000000000001){ - ddata[NPoints]= (Double_t) fData[i]/10000; - NPoints++; + ddata[nPoints]= (Double_t) fData[i]/10000; + nPoints++; } } } - Int_t hh = TMath::Min(TMath::Nint(fraction *NPoints), Int_t(NPoints)); - AliMathBase::EvaluateUni(NPoints,ddata, mean, lsigma, hh); + Int_t hh = TMath::Min(TMath::Nint(fraction *nPoints), Int_t(nPoints)); + AliMathBase::EvaluateUni(nPoints,ddata, mean, lsigma, hh); if (sigma) *sigma=lsigma; delete [] ddata; return mean; @@ -327,6 +315,7 @@ Bool_t AliTRDCalROC::Add(Float_t c1) // // add constant // + Bool_t result = kTRUE; for (Int_t idata = 0; idata< fNchannels; idata++) { if(((GetValue(idata)+c1) <= 6.5535) && ((GetValue(idata)+c1) >= 0.0)) SetValue(idata,GetValue(idata)+c1); @@ -344,6 +333,7 @@ Bool_t AliTRDCalROC::Multiply(Float_t c1) // // multiply constant // + Bool_t result = kTRUE; if(c1 < 0) return kFALSE; for (Int_t idata = 0; idata< fNchannels; idata++) { @@ -362,6 +352,7 @@ Bool_t AliTRDCalROC::Add(const AliTRDCalROC * roc, Double_t c1) // // add values // + Bool_t result = kTRUE; for (Int_t idata = 0; idata< fNchannels; idata++){ if(((GetValue(idata)+roc->GetValue(idata)*c1) <= 6.5535) && @@ -381,6 +372,7 @@ Bool_t AliTRDCalROC::Multiply(const AliTRDCalROC* roc) // // multiply values - per by pad // + Bool_t result = kTRUE; for (Int_t idata = 0; idata< fNchannels; idata++){ if((GetValue(idata)*roc->GetValue(idata)) <= 6.5535) @@ -399,6 +391,7 @@ Bool_t AliTRDCalROC::Divide(const AliTRDCalROC* roc) // // divide values // + Bool_t result = kTRUE; Float_t kEpsilon=0.00000000000000001; for (Int_t idata = 0; idata< fNchannels; idata++){ @@ -423,6 +416,7 @@ Bool_t AliTRDCalROC::Unfold() // This is for the noise study // Return kFALSE if one or more of the pad col was not normalised // + Bool_t result = kTRUE; Float_t kEpsilon=0.00000000000000001; @@ -470,6 +464,7 @@ TH2F * AliTRDCalROC::MakeHisto2D(Float_t min, Float_t max,Int_t type, Float_t m // type -1 = user defined range // 0 = nsigma cut nsigma=min // 1 = delta cut around median delta=min + Float_t kEpsilonr = 0.005; gStyle->SetPalette(1); @@ -524,8 +519,8 @@ TH1F * AliTRDCalROC::MakeHisto1D(Float_t min, Float_t max,Int_t type, Float_t m // type -1 = user defined range // 0 = nsigma cut nsigma=min // 1 = delta cut around median delta=min - Float_t kEpsilonr = 0.005; + Float_t kEpsilonr = 0.005; if (type>=0){ if (type==0){ diff --git a/TRD/Cal/AliTRDCalROC.h b/TRD/Cal/AliTRDCalROC.h index 3fd0d9c2b91..6339533dd97 100644 --- a/TRD/Cal/AliTRDCalROC.h +++ b/TRD/Cal/AliTRDCalROC.h @@ -12,8 +12,6 @@ ////////////////////////////////////////////////// #include -#include -#include class TArrayI; class TArrayF; @@ -35,26 +33,25 @@ class AliTRDCalROC : public TObject AliTRDCalROC &operator=(const AliTRDCalROC &c); virtual void Copy(TObject &c) const; - Int_t GetNrows() const { return fNrows; }; - Int_t GetNcols() const { return fNcols; }; + Int_t GetNrows() const { return fNrows; }; + Int_t GetNcols() const { return fNcols; }; - Int_t GetChannel(Int_t c, Int_t r) { return r+c*fNrows; }; - Int_t GetNchannels() const { return fNchannels; }; + Int_t GetChannel(Int_t c, Int_t r) const { return r+c*fNrows; }; + Int_t GetNchannels() const { return fNchannels; }; - Float_t GetValue(Int_t ich) const { return (Float_t) fData[ich] / 10000; }; - Float_t GetValue(Int_t col, Int_t row) { return GetValue(GetChannel(col,row)); }; + Float_t GetValue(Int_t ich) const { return (Float_t) fData[ich] / 10000; }; + Float_t GetValue(Int_t col, Int_t row) { return GetValue(GetChannel(col,row)); }; - void SetValue(Int_t ich, Float_t value) - { fData[ich] = (UShort_t) (value * 10000); }; + void SetValue(Int_t ich, Float_t value) { fData[ich] = (UShort_t) (value * 10000); }; void SetValue(Int_t col, Int_t row, Float_t value) - { SetValue(GetChannel(col,row), value); }; + { SetValue(GetChannel(col,row), value); }; // statistic // - Double_t GetMean(AliTRDCalROC *outlierROC=0); - Double_t GetRMS(AliTRDCalROC *outlierROC=0); - Double_t GetMedian(AliTRDCalROC *outlierROC=0); - Double_t GetLTM(Double_t *sigma=0, Double_t fraction=0.9, AliTRDCalROC *outlierROC=0); + Double_t GetMean(AliTRDCalROC * const outlierROC=0) const; + Double_t GetRMS(AliTRDCalROC * const outlierROC=0) const; + Double_t GetMedian(AliTRDCalROC * const outlierROC=0) const; + Double_t GetLTM(Double_t *sigma=0, Double_t fraction=0.9, AliTRDCalROC * const outlierROC=0); // algebra Bool_t Add(Float_t c1); diff --git a/TRD/Cal/AliTRDCalSingleChamberStatus.h b/TRD/Cal/AliTRDCalSingleChamberStatus.h index 4f3ff8c1999..618977919da 100644 --- a/TRD/Cal/AliTRDCalSingleChamberStatus.h +++ b/TRD/Cal/AliTRDCalSingleChamberStatus.h @@ -1,5 +1,5 @@ -#ifndef AliTRDCalSingleChamberStatus_H -#define AliTRDCalSingleChamberStatus_H +#ifndef ALITRDCALSINGLECHAMBERSTATUS_H +#define ALITRDCALSINGLECHAMBERSTATUS_H /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * See cxx source for full Copyright notice */ @@ -22,8 +22,7 @@ class AliTRDCalSingleChamberStatus : public TObject { , kPadBridgedLeft = 4 , kPadBridgedRight = 8 , kReadSecond = 16 - , kNotConnected = 32 -}; + , kNotConnected = 32}; AliTRDCalSingleChamberStatus(); AliTRDCalSingleChamberStatus(Int_t p, Int_t c, Int_t cols); -- 2.39.3