LCOV - code coverage report
Current view: top level - TRD/TRDbase - AliTRDDataDCS.h (source / functions) Hit Total Coverage
Test: coverage.info Lines: 1 81 1.2 %
Date: 2016-06-14 17:26:59 Functions: 1 82 1.2 %

          Line data    Source code
       1             : #ifndef ALITRDDATADCS_H
       2             : #define ALITRDDATADCS_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             : ////////////////////////////////////////////////////////////////////////////
      10             : //                                                                        //
      11             : // Extracts the DCS information                                           //
      12             : //                                                                        //
      13             : ////////////////////////////////////////////////////////////////////////////
      14             : 
      15             : #include <TNamed.h>
      16             : 
      17             : class TObjArray;
      18             : class TString;
      19             : 
      20             : class TGraph;
      21             : class AliSplineFit;
      22             : class TMap;
      23             : 
      24             : class AliTRDDataDCS : public TNamed
      25             : {
      26             :   
      27             :  public :
      28             :     
      29             :   AliTRDDataDCS ();
      30             :   ~AliTRDDataDCS ();
      31             :   
      32             :   Bool_t ExtractDCS (TMap * aliDCS);
      33             :   Bool_t PerformFit ();
      34             :   void   ClearFits ();
      35             :   void   ClearGraphs ();
      36             :   
      37           0 :   UInt_t        GetNAlias () const {return fNAlias;}
      38             :   TString       GetAmandaStr (UInt_t iAlias) const;
      39             :   UInt_t        GetNChannel (UInt_t iAlias) const; 
      40             :   
      41             :   TGraph *              GetGraph (UInt_t iAlias, UInt_t iChannel = 0) const;
      42             :   AliSplineFit *        GetFit (UInt_t iAlias, UInt_t iChannel = 0) const;
      43             :   
      44             :   // Get TGraph
      45           0 :   TGraph * GetGraphChamberByteStatus (UInt_t iSensor) const             {return GetGraph (kChamberByteStatus, iSensor);}
      46           0 :   TGraph * GetGraphPreTrigger () const                                  {return GetGraph (kPreTrigger);}
      47           0 :   TGraph * GetGraphGoofyHv () const                                     {return GetGraph (kGoofyHv);}
      48           0 :   TGraph * GetGraphGoofyPeakPos (UInt_t iSensor) const                  {return GetGraph (kGoofyPeakPos, iSensor);}
      49           0 :   TGraph * GetGraphGoofyPeakArea (UInt_t iSensor) const                 {return GetGraph (kGoofyPeakArea, iSensor);}
      50           0 :   TGraph * GetGraphGoofyTemp (UInt_t iSensor) const                     {return GetGraph (kGoofyTemp, iSensor);}
      51           0 :   TGraph * GetGraphGoofyPressure () const                               {return GetGraph (kGoofyPressure);}
      52           0 :   TGraph * GetGraphGoofyVelocity () const                               {return GetGraph (kGoofyVelocity);}
      53           0 :   TGraph * GetGraphGoofyGain (UInt_t iSensor) const                     {return GetGraph (kGoofyGain, iSensor);}
      54           0 :   TGraph * GetGraphGoofyCO2 ()  const                                   {return GetGraph (kGoofyCO2);}
      55           0 :   TGraph * GetGraphGoofyN2 () const                                     {return GetGraph (kGoofyN2);}
      56           0 :   TGraph * GetGraphGasO2 () const                                       {return GetGraph (kGasO2);}
      57           0 :   TGraph * GetGraphGasOverpressure () const                             {return GetGraph (kGasOverpressure);}
      58           0 :   TGraph * GetGraphEnvTemp (UInt_t iSensor) const                       {return GetGraph (kEnvTemp, iSensor);}
      59           0 :   TGraph * GetGraphHvAnodeImon (UInt_t iSensor) const                   {return GetGraph (kHvAnodeImon, iSensor);}
      60           0 :   TGraph * GetGraphHvDriftImon (UInt_t iSensor) const                   {return GetGraph (kHvDriftImon, iSensor);}
      61           0 :   TGraph * GetGraphHvAnodeUmon (UInt_t iSensor) const                   {return GetGraph (kHvAnodeUmon, iSensor);}
      62           0 :   TGraph * GetGraphHvDriftUmon (UInt_t iSensor) const                   {return GetGraph (kHvDriftUmon, iSensor);}
      63           0 :   TGraph * GetGraphAdcClkPhase () const                                 {return GetGraph (kAdcClkPhase);}
      64           0 :   TGraph * GetGraphAtmPressure () const                                 {return GetGraph (kAtmPressure);}
      65           0 :   TGraph * GetGraphLuminosity () const                                  {return GetGraph (kLuminosity);}
      66           0 :   TGraph * GetGraphMagneticField () const                               {return GetGraph (kMagneticField);}
      67             :   
      68           0 :   AliSplineFit * GetFitChamberByteStatus (UInt_t iSensor) const         {return GetFit (kChamberByteStatus, iSensor);}
      69           0 :   AliSplineFit * GetFitPreTrigger () const                              {return GetFit (kPreTrigger);}
      70           0 :   AliSplineFit * GetFitGoofyHv () const                                 {return GetFit (kGoofyHv);}
      71           0 :   AliSplineFit * GetFitGoofyPeakPos (UInt_t iSensor) const              {return GetFit (kGoofyPeakPos, iSensor);}
      72           0 :   AliSplineFit * GetFitGoofyPeakArea (UInt_t iSensor) const             {return GetFit (kGoofyPeakArea, iSensor);}
      73           0 :   AliSplineFit * GetFitGoofyTemp (UInt_t iSensor) const                 {return GetFit (kGoofyTemp, iSensor);}
      74           0 :   AliSplineFit * GetFitGoofyPressure () const                           {return GetFit (kGoofyPressure);}
      75           0 :   AliSplineFit * GetFitGoofyVelocity () const                           {return GetFit (kGoofyVelocity);}
      76           0 :   AliSplineFit * GetFitGoofyGain (UInt_t iSensor) const                 {return GetFit (kGoofyGain, iSensor);}
      77           0 :   AliSplineFit * GetFitGoofyCO2 ()  const                               {return GetFit (kGoofyCO2);}
      78           0 :   AliSplineFit * GetFitGoofyN2 () const                                 {return GetFit (kGoofyN2);}
      79           0 :   AliSplineFit * GetFitGasO2 () const                                   {return GetFit (kGasO2);}
      80           0 :   AliSplineFit * GetFitGasOverpressure () const                         {return GetFit (kGasOverpressure);}
      81           0 :   AliSplineFit * GetFitEnvTemp (UInt_t iSensor) const                   {return GetFit (kEnvTemp, iSensor);}
      82           0 :   AliSplineFit * GetFitHvAnodeImon (UInt_t iSensor) const               {return GetFit (kHvAnodeImon, iSensor);}
      83           0 :   AliSplineFit * GetFitHvDriftImon (UInt_t iSensor) const               {return GetFit (kHvDriftImon, iSensor);}
      84           0 :   AliSplineFit * GetFitHvAnodeUmon (UInt_t iSensor) const               {return GetFit (kHvAnodeUmon, iSensor);}
      85           0 :   AliSplineFit * GetFitHvDriftUmon (UInt_t iSensor) const               {return GetFit (kHvDriftUmon, iSensor);}
      86           0 :   AliSplineFit * GetFitAdcClkPhase () const                             {return GetFit (kAdcClkPhase);}
      87           0 :   AliSplineFit * GetFitAtmPressure () const                             {return GetFit (kAtmPressure);}
      88           0 :   AliSplineFit * GetFitLuminosity () const                              {return GetFit (kLuminosity);}
      89           0 :   AliSplineFit * GetFitMagneticField () const                           {return GetFit (kMagneticField);}
      90             :   
      91             :   void Print (const Option_t * const option = "") const;
      92             :     
      93             :  protected :
      94             :           
      95             :     TGraph       * FindAndMakeGraph (TMap * const dcsMap
      96             :                                    , const char * amandaStr
      97             :                                    , char dataType);
      98             :     AliSplineFit * Fit (const TGraph * const graph,
      99             :                         Int_t  kMinPoints, Int_t  kIter, 
     100             :                         Double_t  kMaxDelta, Int_t  kFitReq);
     101             :     
     102             :     void Init ();
     103             :     void InitFits ();
     104             :     void InitGraphs ();
     105             :     
     106             :     void SetConf (UInt_t iAlias, const char * amanda, char dataType, UInt_t nChannel, 
     107             :                   Bool_t enableGraph, Bool_t enableFit, Int_t kMinPoints, 
     108             :                   Int_t kIter, Double_t kMaxDelta, Int_t kFitReq);
     109             :     
     110             :  private :
     111             :     
     112             :     enum { kChamberByteStatus = 0
     113             :          , kPreTrigger        = 1
     114             :          , kGoofyHv           = 2
     115             :          , kGoofyPeakPos      = 3
     116             :          , kGoofyPeakArea     = 4
     117             :          , kGoofyTemp         = 5
     118             :          , kGoofyPressure     = 6
     119             :          , kGoofyVelocity     = 7
     120             :          , kGoofyGain         = 8
     121             :          , kGoofyCO2          = 9
     122             :          , kGoofyN2           = 10
     123             :          , kGasO2             = 11
     124             :          , kGasOverpressure   = 12
     125             :          , kEnvTemp           = 13
     126             :          , kHvAnodeImon       = 14
     127             :          , kHvDriftImon       = 15
     128             :          , kHvAnodeUmon       = 16
     129             :          , kHvDriftUmon       = 17
     130             :          , kAdcClkPhase       = 18
     131             :          , kAtmPressure       = 19
     132             :          , kLuminosity        = 20
     133             :          , kMagneticField     = 21
     134             :     };
     135             :               
     136             :   Bool_t fGraphsAreIni;              // Check whether graphs are initialized
     137             :   Bool_t fFitsAreIni;                // Check whether firs are initialized
     138             :   UInt_t fNAlias;                    // Number of aliases
     139             :       
     140             :     class AliTRDDataDCSdata {
     141             :      public:
     142             :       AliTRDDataDCSdata()
     143           0 :         :fFit(0x0)
     144           0 :         ,fGraph(0x0) { };
     145           0 :       virtual ~AliTRDDataDCSdata() { };
     146           0 :       TObjArray GetFit() const          { return fFit;      }
     147           0 :       TObjArray GetGraph() const        { return fGraph;    }
     148           0 :       TObject*  GetFit(Int_t i) const   { return fFit[i];   }
     149           0 :       TObject*  GetGraph(Int_t i) const { return fGraph[i]; }
     150             :      protected:
     151             :       TObjArray fFit;                   // array of AliSplineFit
     152             :       TObjArray fGraph;                 // array of TGraph
     153             :     };      
     154             : 
     155             :     class AliTRDDataDCSconf {
     156             :      public:
     157             :       AliTRDDataDCSconf()
     158           0 :         :fAmanda(0)
     159           0 :         ,fDataType(0)
     160           0 :         ,fNChannel(0)
     161           0 :         ,fEnableGraph(0)
     162           0 :         ,fEnableFit(0)
     163           0 :         ,fMinPoints(0)
     164           0 :         ,fIter(0)
     165           0 :         ,fMaxDelta(0)
     166           0 :         ,fFitReq(0) { };
     167           0 :       virtual ~AliTRDDataDCSconf() { };
     168           0 :       TString  GetAmanda() const        { return fAmanda;      }
     169           0 :       Char_t   GetDataType() const      { return fDataType;    }
     170           0 :       UInt_t   GetNChannel() const      { return fNChannel;    }
     171           0 :       Bool_t   GetEnableGraph() const   { return fEnableGraph; }
     172           0 :       Bool_t   GetEnableFit() const     { return fEnableFit;   }
     173           0 :       Int_t    GetMinPoints() const     { return fMinPoints;   }
     174           0 :       Int_t    GetIter() const          { return fIter;        }
     175           0 :       Double_t GetMaxDelta() const      { return fMaxDelta;    }
     176           0 :       Int_t    GetFitReq() const        { return fFitReq;      }
     177           0 :       void     SetAmanda(TString s)     { fAmanda      = s;    }
     178           0 :       void     SetDataType(Char_t d)    { fDataType    = d;    }
     179           0 :       void     SetNChannel(UInt_t n)    { fNChannel    = n;    }
     180           0 :       void     SetEnableGraph(Bool_t e) { fEnableGraph = e;    }
     181           0 :       void     SetEnableFit(Bool_t e)   { fEnableFit   = e;    }
     182           0 :       void     SetMinPoints(Int_t m)    { fMinPoints   = m;    }
     183           0 :       void     SetIter(Int_t i)         { fIter        = i;    }
     184           0 :       void     SetMaxDelta(Double_t m)  { fMaxDelta    = m;    }
     185           0 :       void     SetFitReq(Int_t f)       { fFitReq      = f;    }
     186             :      protected:
     187             :         TString   fAmanda;              // amanda string
     188             :         Char_t    fDataType;            // 'c' for char, 'f' for float
     189             :         UInt_t    fNChannel;            // number of channel
     190             :         Bool_t    fEnableGraph;         // will be converted in TGraph
     191             :         Bool_t    fEnableFit;           // will be converted in AliSplineFit
     192             :         Int_t     fMinPoints;           // minimum number of points per knot in fit
     193             :         Int_t     fIter;                // number of iterations for spline fit
     194             :         Double_t  fMaxDelta;            // precision parameter for spline fit
     195             :         Int_t     fFitReq;              // fit requirement, 2 = continuous 2nd derivative
     196             :       };      
     197             : 
     198             :       AliTRDDataDCSdata fDatas [22];    // configurations       
     199             :       AliTRDDataDCSconf fConfs [22];    // data arrays          
     200             :       
     201          48 :       ClassDef(AliTRDDataDCS,1)         // TRD calibration class
     202             :         
     203             : };
     204             : 
     205             : #endif

Generated by: LCOV version 1.11