LCOV - code coverage report
Current view: top level - EMCAL/EMCALbase - AliEMCALCalibReference.h (source / functions) Hit Total Coverage
Test: coverage.info Lines: 3 53 5.7 %
Date: 2016-06-14 17:26:59 Functions: 3 55 5.5 %

          Line data    Source code
       1             : #ifndef ALIEMCALCALIBREFERENCE_H
       2             : #define ALIEMCALCALIBREFERENCE_H
       3             : 
       4             : /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
       5             :  * See cxx source for full Copyright notice                               */
       6             : 
       7             : /* $Id: $ */
       8             : 
       9             : #include <TObject.h>
      10             : #include <TObjArray.h>
      11             : #include "AliEMCALGeoParams.h"
      12             : class TString;
      13             : class TTree;
      14             : 
      15             : /*
      16             :   Objects of this class contain basis for reference calibrations
      17             : */
      18             : 
      19             : // total calibration factor is a product of
      20             : // a) overall calibration factor [fAbsoluteGain]
      21             : // b) individual gain factor per tower [fRelativeGain]
      22             : // c) time-dependent correction
      23             : // In this class we store the needed static ingredients for c)
      24             : 
      25             : // ******* internal class definition *************
      26             : // values per single tower
      27           0 : class AliEMCALCalibReferenceVal : public TObject {
      28             : 
      29             :  public:
      30           0 :   AliEMCALCalibReferenceVal() : TObject(), // just init values
      31           0 :     fHighLow(0),
      32           0 :     fLEDAmp(0),
      33           0 :     fLEDAmpRMS(0)
      34           0 :     {
      35           0 :     }
      36             :   
      37             :   void Init() {
      38           0 :     fHighLow = 0;
      39           0 :     fLEDAmp = 0;
      40           0 :     fLEDAmpRMS = 0;
      41           0 :     return;
      42             :   }
      43             : 
      44             :  public:
      45           0 :   void SetHighLow(Int_t i) { fHighLow = i; }; //
      46           0 :   Int_t GetHighLow() const { return fHighLow; }; //
      47           0 :   void SetLEDAmp(Float_t f) { fLEDAmp = f; }; //
      48           0 :   Float_t GetLEDAmp() const { return fLEDAmp; }; //
      49           0 :   void SetLEDAmpRMS(Float_t f) { fLEDAmpRMS = f; }; //
      50           0 :   Float_t GetLEDAmpRMS() const { return fLEDAmpRMS; }; //
      51             : 
      52             :  private:
      53             :   Int_t fHighLow; // 0 (low) or 1 (high) gain, used for LEDAmp info
      54             :   Float_t fLEDAmp; // LED amplitude
      55             :   Float_t fLEDAmpRMS; // RMS
      56             : 
      57          42 :   ClassDef(AliEMCALCalibReferenceVal, 1) // help class
      58             : };
      59             : 
      60             : // 1 SuperModule's worth of info: info on where the different APDs are
      61           0 : class AliEMCALSuperModuleCalibReference : public TObject {
      62             : 
      63             :  public:
      64           0 :   AliEMCALSuperModuleCalibReference(const int smNum=0) : TObject(), // just init values
      65           0 :     fSuperModuleNum(smNum),
      66           0 :     fReferenceTime(0)
      67           0 :     {
      68           0 :       for (int iref=0; iref<AliEMCALGeoParams::fgkEMCALLEDRefs; iref++) {
      69           0 :         fLEDRefAmp[iref] = 0;
      70           0 :         fLEDRefAmpRMS[iref] = 0;
      71           0 :         fLEDRefHighLow[iref] = 0;
      72             :       }
      73             : 
      74           0 :       for (int itemp=0; itemp<AliEMCALGeoParams::fgkEMCALTempSensors; itemp++) {
      75           0 :         fTemperature[itemp] = 0;
      76           0 :         fTemperatureRMS[itemp] = 0;
      77             :       }
      78             : 
      79           0 :       for (int icol=0; icol<AliEMCALGeoParams::fgkEMCALCols; icol++) {
      80           0 :         for (int irow=0; irow<AliEMCALGeoParams::fgkEMCALRows; irow++) {
      81           0 :           fAPDVal[icol][irow].Init();
      82             :         }
      83             :       }
      84           0 :     }
      85             : 
      86             :  public:
      87             :   // first
      88           0 :   void SetSuperModuleNum(Int_t i) { fSuperModuleNum = i;}; // 
      89           0 :   Int_t GetSuperModuleNum() const { return fSuperModuleNum;}; // 
      90           0 :   void SetReferenceTime(Int_t i) { fReferenceTime = i;}; // 
      91           0 :   Int_t GetReferenceTime() const { return fReferenceTime;}; // 
      92             : 
      93             :   // second
      94           0 :   void SetLEDRefAmp(int iLEDRef, Float_t f) { fLEDRefAmp[iLEDRef] = f;}; // 
      95           0 :   Float_t GetLEDRefAmp(int iLEDRef) const { return fLEDRefAmp[iLEDRef];}; // 
      96           0 :   void SetLEDRefAmpRMS(int iLEDRef, Float_t f) { fLEDRefAmpRMS[iLEDRef] = f;}; // 
      97           0 :   Float_t GetLEDRefAmpRMS(int iLEDRef) const { return fLEDRefAmpRMS[iLEDRef];}; // 
      98           0 :   void SetLEDRefHighLow(int iLEDRef, Int_t i) { fLEDRefHighLow[iLEDRef] = i;}; // 
      99           0 :   Int_t GetLEDRefHighLow(int iLEDRef) const { return fLEDRefHighLow[iLEDRef];}; // 
     100             : 
     101           0 :   void SetTemperature(int itemp, Float_t f) { fTemperature[itemp] = f;}; // 
     102           0 :   Float_t GetTemperature(int itemp) const { return fTemperature[itemp];}; // 
     103           0 :   void SetTemperatureRMS(int itemp, Float_t f) { fTemperatureRMS[itemp] = f;}; // 
     104           0 :   Float_t GetTemperatureRMS(int itemp) const { return fTemperatureRMS[itemp];}; // 
     105             : 
     106             :   // third
     107             :   AliEMCALCalibReferenceVal * GetAPDVal(int icol, int irow) 
     108           0 :     { return &fAPDVal[icol][irow]; };
     109             : 
     110             :  private:
     111             :   // first: overall values for the whole SuperModule
     112             :   Int_t fSuperModuleNum; // which SuperModule is this?
     113             :   Int_t fReferenceTime; // t0, unix timestamp
     114             :   
     115             :   // second: additional info for LED Reference and SM temperature
     116             :   Float_t fLEDRefAmp[AliEMCALGeoParams::fgkEMCALLEDRefs]; // LED amplitude at  t0, low gain equivalent
     117             :   Float_t fLEDRefAmpRMS[AliEMCALGeoParams::fgkEMCALLEDRefs]; // RMS
     118             :   Int_t fLEDRefHighLow[AliEMCALGeoParams::fgkEMCALLEDRefs]; // 0 (low) or 1 (high) gain
     119             :   
     120             :   Float_t fTemperature[AliEMCALGeoParams::fgkEMCALTempSensors]; // temperature at t0
     121             :   Float_t fTemperatureRMS[AliEMCALGeoParams::fgkEMCALTempSensors]; // RMS
     122             :   
     123             :   // third: individual info for each tower
     124             :   AliEMCALCalibReferenceVal fAPDVal[AliEMCALGeoParams::fgkEMCALCols][AliEMCALGeoParams::fgkEMCALRows]; // at t0
     125             : 
     126          42 :   ClassDef(AliEMCALSuperModuleCalibReference, 1) // help class
     127             : };
     128             : // ******* end of internal class definition *************
     129             : 
     130             : class AliEMCALCalibReference : public TObject {
     131             : 
     132             : public:
     133             : 
     134             :   enum kProblemType {kNoLED=-999};// code in possible problems
     135             : 
     136             :   AliEMCALCalibReference(const int nSM = AliEMCALGeoParams::fgkEMCALModules);
     137             : 
     138             :   // Read and Write txt I/O methods are normally not used, but are useful for 
     139             :   // filling the object before it is saved in OCDB 
     140             :   void ReadTextCalibReferenceInfo(Int_t nSM, const TString &txtFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to fgkEMCALModules
     141             :   void WriteTextCalibReferenceInfo(const TString &txtFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to fgkEMCALModules
     142             :   void ReadRootCalibReferenceInfo(const TString &rootFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to fgkEMCALModules
     143             :   void ReadTreeCalibReferenceInfo(TTree *tree, Bool_t swapSides=kFALSE); // info file is for nSm=1 to fgkEMCALModules
     144             :   void WriteRootCalibReferenceInfo(const TString &rootFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to fgkEMCALModules
     145             : 
     146             :   virtual ~AliEMCALCalibReference();
     147             : 
     148             :   // pointer to stored info.
     149           0 :   Int_t GetNSuperModule() const { return fNSuperModule; }; 
     150             : 
     151             :   // - via the index in the stored array:
     152             :   virtual AliEMCALSuperModuleCalibReference * GetSuperModuleCalibReferenceId(Int_t smIndex) const
     153           0 :    { return (AliEMCALSuperModuleCalibReference*) fSuperModuleData[smIndex]; };
     154             : 
     155             :   // - or via the actual SM number
     156             :   virtual AliEMCALSuperModuleCalibReference * GetSuperModuleCalibReferenceNum(Int_t smNum) const;
     157             : 
     158             : protected:
     159             : 
     160             :   Int_t           fNSuperModule; // Number of supermodules.
     161             :   TObjArray fSuperModuleData; // SuperModule data
     162             : 
     163             : private:
     164             : 
     165             :   AliEMCALCalibReference(const AliEMCALCalibReference &);
     166             :   AliEMCALCalibReference &operator = (const AliEMCALCalibReference &);
     167             : 
     168          42 :   ClassDef(AliEMCALCalibReference, 1) //CalibReference data info
     169             : };
     170             : 
     171             : #endif

Generated by: LCOV version 1.11