]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TOF/AliTOFcalibHisto.h
some coverity fixes
[u/mrichter/AliRoot.git] / TOF / AliTOFcalibHisto.h
index 7466d747b687bd072e3023aea90ca1455a842902..5df58ce462e59359e74b29a8de3240ebf03a5133 100644 (file)
@@ -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"
@@ -94,16 +94,59 @@ public TObject
     kNcalibPars
   };
 
+  enum ECalibStat_t {
+    kStripStat,
+    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 */
   static TFile *fgCalibParFile; /* calib par file */
+  static TFile *fgCalibStatFile; /* calib stat file */
 
   static TString fgCalibHistoFileName; /* calib histo file name */
   static TString fgCalibParFileName; /* calib par file name */
+  static TString fgCalibStatFileName; /* calib par file name */
   static const TString fgkCalibConstName[kNcalibConsts]; // calib const name array */
   static const TString fgkCalibMapName[kNcalibMaps]; // calib map name array */
   static const TString fgkCalibParName[kNcalibPars]; // calib par name array */
+  static const TString fgkCalibStatName[kNcalibStats]; // calib stat name array */
 
   static const Double_t fgkLHCperiod; /* LHC clock period */
   static const Double_t fgkAmphenolCableDelay; /* Amphenol cable delay */
@@ -119,12 +162,15 @@ public TObject
   static Bool_t fgCableCorrectionFlag[kNcorrections]; // cable correction flag
   static Bool_t fgFullCorrectionFlag[kNcorrections]; // full correction flag
 
+  static const Int_t fgkStripStat[18][91]; // strip status
+
   TH1D *fCalibConst[kNcalibConsts]; // calib const array
   TH1D *fCalibMap[kNcalibMaps]; // calib map array
   TH1D *fCalibPar[kNcalibPars]; // calib par array
+  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 */
@@ -133,36 +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 */
-
-  /* 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 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 WriteCalibHisto(); /* write calib histo */
-  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 */
-  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 */
-  
   ClassDef(AliTOFcalibHisto, 1);
   
 };