From ce469aede3c8d627da7e39e7126571a5c639d12f Mon Sep 17 00:00:00 2001 From: rpreghen Date: Thu, 25 Mar 2010 09:09:49 +0000 Subject: [PATCH] coding conventions --- TOF/AliTOFCTPLatency.cxx | 18 +++---- TOF/AliTOFCTPLatency.h | 18 +++---- TOF/AliTOFDRMStatusHeader3.h | 16 +++--- TOF/AliTOFDeltaBCOffset.cxx | 18 +++---- TOF/AliTOFDeltaBCOffset.h | 18 +++---- TOF/AliTOFHitDataBuffer.cxx | 13 ++++- TOF/AliTOFHitDataBuffer.h | 11 ++-- TOF/AliTOFT0Fill.cxx | 18 +++---- TOF/AliTOFT0Fill.h | 18 +++---- TOF/AliTOFT0FillOnlineCalib.cxx | 16 +++--- TOF/AliTOFT0FillOnlineCalib.h | 18 +++---- TOF/AliTOFcalibHisto.cxx | 22 ++++---- TOF/AliTOFcalibHisto.h | 94 ++++++++++++++++----------------- 13 files changed, 151 insertions(+), 147 deletions(-) diff --git a/TOF/AliTOFCTPLatency.cxx b/TOF/AliTOFCTPLatency.cxx index d5abc4c496a..8c4f2a8b49b 100644 --- a/TOF/AliTOFCTPLatency.cxx +++ b/TOF/AliTOFCTPLatency.cxx @@ -13,15 +13,15 @@ * provided "as is" without express or implied warranty. * **************************************************************************/ -/* - * - * - * this class defines the CTPLatency object to be stored - * in OCDB in order to apply CTPLatency correction during - * reconstruction. - * - * - */ +// * +// * +// * +// * this class defines the CTPLatency object to be stored +// * in OCDB in order to apply CTPLatency correction during +// * reconstruction. +// * +// * +// * #include "AliTOFCTPLatency.h" diff --git a/TOF/AliTOFCTPLatency.h b/TOF/AliTOFCTPLatency.h index 5f3d1225fe6..f14e2eb9b62 100644 --- a/TOF/AliTOFCTPLatency.h +++ b/TOF/AliTOFCTPLatency.h @@ -5,15 +5,15 @@ * See cxx source for full Copyright notice */ /* $Id$ */ -/* - * - * - * this class defines the CTPLatency object to be stored - * in OCDB in order to apply CTPLatency correction during - * reconstruction. - * - * - */ +// * +// * +// * +// * this class defines the CTPLatency object to be stored +// * in OCDB in order to apply CTPLatency correction during +// * reconstruction. +// * +// * +// * #include "TObject.h" diff --git a/TOF/AliTOFDRMStatusHeader3.h b/TOF/AliTOFDRMStatusHeader3.h index 3b2e2ada0b6..7e737b3c8fb 100644 --- a/TOF/AliTOFDRMStatusHeader3.h +++ b/TOF/AliTOFDRMStatusHeader3.h @@ -17,15 +17,15 @@ class AliTOFDRMStatusHeader3 { public: - UInt_t GetSlot() {return fSlotID;}; - UInt_t GetL0BCID() {return fL0BCID;}; - UInt_t GetRunTimeInfo() {return fRunTimeInfo;}; - UInt_t GetWordType() {return fWordType;}; + UInt_t GetSlot() const {return fSlotID;}; + UInt_t GetL0BCID() const {return fL0BCID;}; + UInt_t GetRunTimeInfo() const {return fRunTimeInfo;}; + UInt_t GetWordType() const {return fWordType;}; private: - UInt_t fSlotID: 4; - UInt_t fL0BCID: 12; - UInt_t fRunTimeInfo: 12; - UInt_t fWordType: 4; + UInt_t fSlotID: 4; // slodID + UInt_t fL0BCID: 12; // L0BCID + UInt_t fRunTimeInfo: 12; // runtime info + UInt_t fWordType: 4; // word type }; #endif diff --git a/TOF/AliTOFDeltaBCOffset.cxx b/TOF/AliTOFDeltaBCOffset.cxx index 25aec195859..b1a150c620d 100644 --- a/TOF/AliTOFDeltaBCOffset.cxx +++ b/TOF/AliTOFDeltaBCOffset.cxx @@ -13,15 +13,15 @@ * provided "as is" without express or implied warranty. * **************************************************************************/ -/* - * - * - * this class defines the DeltaBCOffset object to be stored - * in OCDB in order to apply DeltaBC correction during - * reconstruction. - * - * - */ +// * +// * +// * +// * this class defines the DeltaBCOffset object to be stored +// * in OCDB in order to apply DeltaBC correction during +// * reconstruction. +// * +// * +// * #include "AliTOFDeltaBCOffset.h" diff --git a/TOF/AliTOFDeltaBCOffset.h b/TOF/AliTOFDeltaBCOffset.h index e195940fbc2..16a782b6eef 100644 --- a/TOF/AliTOFDeltaBCOffset.h +++ b/TOF/AliTOFDeltaBCOffset.h @@ -5,15 +5,15 @@ * See cxx source for full Copyright notice */ /* $Id$ */ -/* - * - * - * this class defines the DeltaBCOffset object to be stored - * in OCDB in order to apply DeltaBC correction during - * reconstruction. - * - * - */ +// * +// * +// * +// * this class defines the DeltaBCOffset object to be stored +// * in OCDB in order to apply DeltaBC correction during +// * reconstruction. +// * +// * +// * #include "TObject.h" diff --git a/TOF/AliTOFHitDataBuffer.cxx b/TOF/AliTOFHitDataBuffer.cxx index 2fe97c392e3..a0cbf18bca9 100644 --- a/TOF/AliTOFHitDataBuffer.cxx +++ b/TOF/AliTOFHitDataBuffer.cxx @@ -31,8 +31,8 @@ container for TOF raw data // // //////////////////////////////////////////////////////////////////////// -#include "AliLog.h" #include "AliTOFHitDataBuffer.h" +#include "AliTOFHitData.h" ClassImp(AliTOFHitDataBuffer) @@ -58,6 +58,17 @@ AliTOFHitDataBuffer::~AliTOFHitDataBuffer() { } +//----------------------------------------------------------------------------- + +AliTOFHitDataBuffer& AliTOFHitDataBuffer::operator=(const AliTOFHitDataBuffer & source) { + // operator = + if (&source != this) { + TObject::operator=(source); + fBuffer = source.fBuffer; + } + return *this; +} + //----------------------------------------------------------------------------- Bool_t AliTOFHitDataBuffer::Add(AliTOFHitData &HitData) { // adding a new entry diff --git a/TOF/AliTOFHitDataBuffer.h b/TOF/AliTOFHitDataBuffer.h index 76a94434dcd..c43c6d03196 100644 --- a/TOF/AliTOFHitDataBuffer.h +++ b/TOF/AliTOFHitDataBuffer.h @@ -12,9 +12,10 @@ /////////////////////////////////////////////////////////////// #include "TObject.h" -#include "AliTOFHitData.h" #include "TClonesArray.h" +class AliTOFHitData; + class AliTOFHitDataBuffer : public TObject { @@ -25,13 +26,7 @@ public TObject AliTOFHitDataBuffer(Int_t size); // overloaded constructor ~AliTOFHitDataBuffer(); // default destructor AliTOFHitDataBuffer(const AliTOFHitDataBuffer &source) : TObject(source), fBuffer(source.fBuffer) {}; // copy constructor - AliTOFHitDataBuffer& operator=(const AliTOFHitDataBuffer & source) { - if (&source != this) { - TObject::operator=(source); - fBuffer = source.fBuffer; - } - return *this; - }; // operator = + AliTOFHitDataBuffer& operator=(const AliTOFHitDataBuffer & source); // operator = void Reset() {fBuffer.Clear();}; // reset Bool_t Add(AliTOFHitData &HitData); // add diff --git a/TOF/AliTOFT0Fill.cxx b/TOF/AliTOFT0Fill.cxx index 6f023507ee2..8a2536088ad 100644 --- a/TOF/AliTOFT0Fill.cxx +++ b/TOF/AliTOFT0Fill.cxx @@ -13,15 +13,15 @@ * provided "as is" without express or implied warranty. * **************************************************************************/ -/* - * - * - * this class defines the T0Fill object to be stored - * in OCDB in order to apply T0Fill correction during - * reconstruction. - * - * - */ +// * +// * +// * +// * this class defines the T0Fill object to be stored +// * in OCDB in order to apply T0Fill correction during +// * reconstruction. +// * +// * +// * #include "AliTOFT0Fill.h" diff --git a/TOF/AliTOFT0Fill.h b/TOF/AliTOFT0Fill.h index b768c6d2f86..f87e528d877 100644 --- a/TOF/AliTOFT0Fill.h +++ b/TOF/AliTOFT0Fill.h @@ -5,15 +5,15 @@ * See cxx source for full Copyright notice */ /* $Id$ */ -/* - * - * - * this class defines the T0Fill object to be stored - * in OCDB in order to apply T0Fill correction during - * reconstruction. - * - * - */ +// * +// * +// * +// * this class defines the T0Fill object to be stored +// * in OCDB in order to apply T0Fill correction during +// * reconstruction. +// * +// * +// * #include "TObject.h" diff --git a/TOF/AliTOFT0FillOnlineCalib.cxx b/TOF/AliTOFT0FillOnlineCalib.cxx index e5348c37435..2a1ae613ce5 100644 --- a/TOF/AliTOFT0FillOnlineCalib.cxx +++ b/TOF/AliTOFT0FillOnlineCalib.cxx @@ -13,14 +13,14 @@ * provided "as is" without express or implied warranty. * **************************************************************************/ -/* - * - * - * this class defines the T0Fill online calibration object to be stored - * in OCDB in order to obtain a corrected T0Fill from online algorithm - * - * - */ +// * +// * +// * +// * this class defines the T0Fill online calibration object to be stored +// * in OCDB in order to obtain a corrected T0Fill from online algorithm +// * +// * +// * #include "AliTOFT0FillOnlineCalib.h" diff --git a/TOF/AliTOFT0FillOnlineCalib.h b/TOF/AliTOFT0FillOnlineCalib.h index 1f6b00d6aba..8ec41002198 100644 --- a/TOF/AliTOFT0FillOnlineCalib.h +++ b/TOF/AliTOFT0FillOnlineCalib.h @@ -5,15 +5,15 @@ * See cxx source for full Copyright notice */ /* $Id$ */ -/* - * - * - * this class defines the T0Fill online calibration object to be stored - * in OCDB in order to obtain a corrected T0Fill from online algorithm - * - * - * - */ +// * +// * +// * +// * this class defines the T0Fill online calibration object to be stored +// * in OCDB in order to obtain a corrected T0Fill from online algorithm +// * +// * +// * +// * #include "TObject.h" diff --git a/TOF/AliTOFcalibHisto.cxx b/TOF/AliTOFcalibHisto.cxx index c597e7ec812..80c84764cad 100644 --- a/TOF/AliTOFcalibHisto.cxx +++ b/TOF/AliTOFcalibHisto.cxx @@ -13,16 +13,16 @@ * provided "as is" without express or implied warranty. * **************************************************************************/ -/************************************************************************* - * - * AliTOFcalibHisto - class to handle TOF calibration histograms, - * map histograms and more - * - * - * autors: Roberto Preghenella (R+) - * concacts: preghenella@bo.infn.it - * - *************************************************************************/ +// * +// * +// * AliTOFcalibHisto - class to handle TOF calibration histograms, +// * map histograms and more +// * +// * +// * autors: Roberto Preghenella (R+) +// * concacts: preghenella@bo.infn.it +// * +// * #include "AliTOFcalibHisto.h" #include "AliLog.h" @@ -354,7 +354,7 @@ AliTOFcalibHisto::~AliTOFcalibHisto() //__________________________________________________________________________ void -AliTOFcalibHisto::LoadHisto(TFile* file, TH1D **histo, const Char_t *name) +AliTOFcalibHisto::LoadHisto(TFile * const file, TH1D **histo, const Char_t *name) { /* load histo */ *histo = (TH1D *)file->Get(name); diff --git a/TOF/AliTOFcalibHisto.h b/TOF/AliTOFcalibHisto.h index b88ba64ede2..5df58ce462e 100644 --- a/TOF/AliTOFcalibHisto.h +++ b/TOF/AliTOFcalibHisto.h @@ -4,16 +4,16 @@ /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * See cxx source for full Copyright notice */ -/************************************************************************* - * - * AliTOFcalibHisto - class to handle TOF calibration histograms, - * map histograms and more - * - * - * autors: Roberto Preghenella (R+) - * concacts: preghenella@bo.infn.it - * - *************************************************************************/ +// * +// * +// * AliTOFcalibHisto - class to handle TOF calibration histograms, +// * map histograms and more +// * +// * +// * autors: Roberto Preghenella (R+) +// * concacts: preghenella@bo.infn.it +// * +// * #include "TObject.h" #include "TString.h" @@ -99,6 +99,41 @@ public TObject kNcalibStats }; + AliTOFcalibHisto(); /* default constructor */ + virtual ~AliTOFcalibHisto(); /* default destructor */ + + /* getters */ + static const Char_t *GetCalibHistoFileName() {return fgCalibHistoFileName.Data();}; /* get calib histo file name */ + static const Char_t *GetCalibParFileName() {return fgCalibParFileName.Data();}; /* get calib par file name */ + static const Char_t *GetCalibStatFileName() {return fgCalibStatFileName.Data();}; /* get calib stat file name */ + + /* setters */ + static void SetCalibHistoFileName(const Char_t *value) {fgCalibHistoFileName = value;}; /* set calib histo file name */ + static void SetCalibParFileName(const Char_t *value) {fgCalibParFileName = value;}; /* set calib par file name */ + static void SetCalibStatFileName(const Char_t *value) {fgCalibStatFileName = value;}; /* set calib stat file name */ + static void SetCableCorrectionFlag(Int_t i, Bool_t flag) {if (i < kNcorrections) fgCableCorrectionFlag[i] = flag;}; // set cable correction flag + static void SetFullCorrectionFlag(Int_t i, Bool_t flag) {if (i < kNcorrections) fgFullCorrectionFlag[i] = flag;}; // set full correction flag + + /* methods */ + static Int_t GetIndexEO(Int_t ddl, Int_t trm, Int_t chain, Int_t tdc, Int_t channel) {return (channel + 8 * tdc + 120 * chain + 240 * trm + 2400 * ddl);}; /* get index EO */ + void LoadCalibHisto(); /* load calib histo */ + void LoadCalibPar(); /* load calib par */ + void LoadCalibStat(); /* load calib stat */ + void WriteCalibHisto(); /* write calib histo */ + void WriteCalibStat(); /* write calib stat */ + Double_t GetCalibConst(Int_t histo) {return GetHisto(fCalibConst[histo], 0);}; /* get calib const */ + Double_t GetCalibMap(Int_t histo, Int_t index) {return GetHisto(fCalibMap[histo], index);}; /* get calib map */ + Double_t GetCalibPar(Int_t histo, Int_t index) {return GetHisto(fCalibPar[histo], index);}; /* get calib par */ + Bool_t GetCalibStat(Int_t histo, Int_t index) {return GetHisto(fCalibStat[histo], index) != 0. ? kTRUE : kFALSE;}; /* get calib stat */ + Double_t GetCorrection(Int_t corr, Int_t index, Double_t tot = 0.); /* get correction */ + Double_t GetNominalCorrection(Int_t index); /* get nominal correction */ + void ApplyNominalCorrection(AliESDtrack *track); /* apply nominal corrections */ + + Double_t GetCableCorrection(Int_t index); /* get cable correction */ + Double_t GetFullCorrection(Int_t index, Double_t tot = 0.); /* get full correction */ + + Bool_t GetStatus(Int_t index); /* get status */ + private: static TFile *fgCalibHistoFile; /* calib histo file */ @@ -135,7 +170,7 @@ public TObject TH1D *fCalibStat[kNcalibStats]; // calib stat array /* methods */ - void LoadHisto(TFile *file, TH1D **histo, const Char_t *name); /* create histo */ + void LoadHisto(TFile * const file, TH1D **histo, const Char_t *name); /* create histo */ void CreateHisto(TH1D **histo, const Char_t *name, Int_t size); /* create histo */ void WriteHisto(TFile *file, TH1D *histo); /* write histo */ void SetHisto(TH1D *histo, Int_t index, Double_t value); /* set histo */ @@ -144,43 +179,6 @@ public TObject AliTOFcalibHisto(const AliTOFcalibHisto &source) : TObject(source) {}; /* copy constructor */ AliTOFcalibHisto &operator=(const AliTOFcalibHisto &) {return *this;}; /* operator= */ - public: - - AliTOFcalibHisto(); /* default constructor */ - virtual ~AliTOFcalibHisto(); /* default destructor */ - - /* getters */ - static const Char_t *GetCalibHistoFileName() {return fgCalibHistoFileName.Data();}; /* get calib histo file name */ - static const Char_t *GetCalibParFileName() {return fgCalibParFileName.Data();}; /* get calib par file name */ - static const Char_t *GetCalibStatFileName() {return fgCalibStatFileName.Data();}; /* get calib stat file name */ - - /* setters */ - static void SetCalibHistoFileName(const Char_t *value) {fgCalibHistoFileName = value;}; /* set calib histo file name */ - static void SetCalibParFileName(const Char_t *value) {fgCalibParFileName = value;}; /* set calib par file name */ - static void SetCalibStatFileName(const Char_t *value) {fgCalibStatFileName = value;}; /* set calib stat file name */ - static void SetCableCorrectionFlag(Int_t i, Bool_t flag) {if (i < kNcorrections) fgCableCorrectionFlag[i] = flag;}; // set cable correction flag - static void SetFullCorrectionFlag(Int_t i, Bool_t flag) {if (i < kNcorrections) fgFullCorrectionFlag[i] = flag;}; // set full correction flag - - /* methods */ - static Int_t GetIndexEO(Int_t ddl, Int_t trm, Int_t chain, Int_t tdc, Int_t channel) {return (channel + 8 * tdc + 120 * chain + 240 * trm + 2400 * ddl);}; /* get index EO */ - void LoadCalibHisto(); /* load calib histo */ - void LoadCalibPar(); /* load calib par */ - void LoadCalibStat(); /* load calib stat */ - void WriteCalibHisto(); /* write calib histo */ - void WriteCalibStat(); /* write calib stat */ - Double_t GetCalibConst(Int_t histo) {return GetHisto(fCalibConst[histo], 0);}; /* get calib const */ - Double_t GetCalibMap(Int_t histo, Int_t index) {return GetHisto(fCalibMap[histo], index);}; /* get calib map */ - Double_t GetCalibPar(Int_t histo, Int_t index) {return GetHisto(fCalibPar[histo], index);}; /* get calib par */ - Bool_t GetCalibStat(Int_t histo, Int_t index) {return GetHisto(fCalibStat[histo], index) != 0. ? kTRUE : kFALSE;}; /* get calib stat */ - Double_t GetCorrection(Int_t corr, Int_t index, Double_t tot = 0.); /* get correction */ - Double_t GetNominalCorrection(Int_t index); /* get nominal correction */ - void ApplyNominalCorrection(AliESDtrack *track); /* apply nominal corrections */ - - Double_t GetCableCorrection(Int_t index); /* get cable correction */ - Double_t GetFullCorrection(Int_t index, Double_t tot = 0.); /* get full correction */ - - Bool_t GetStatus(Int_t index); /* get status */ - ClassDef(AliTOFcalibHisto, 1); }; -- 2.43.0