]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TRD/AliTRDDataDCS.h
New DCS code by Wilfried
[u/mrichter/AliRoot.git] / TRD / AliTRDDataDCS.h
1 #ifndef AliTRDDataDCS_H
2 #define AliTRDDAtaDCS_H
3
4 #include <TNamed.h>
5 #include <TObjArray.h>
6 #include <TString.h>
7
8 class TGraph;
9 class AliSplineFit;
10 class TMap;
11
12
13 class AliTRDDataDCS : public TNamed
14 {
15   
16   public :
17     
18     AliTRDDataDCS ();
19   ~AliTRDDataDCS ();
20   
21   Bool_t ExtractDCS (TMap * aliDCS);
22   Bool_t PerformFit ();
23   void   ClearFits ();
24   void   ClearGraphs ();
25   
26   UInt_t        GetNAlias () const {return fNAlias;}
27   TString       GetAmandaStr (UInt_t iAlias) const;
28   UInt_t        GetNChannel (UInt_t iAlias) const; 
29   
30   TGraph *              GetGraph (UInt_t iAlias, UInt_t iChannel = 0) const;
31   AliSplineFit *        GetFit (UInt_t iAlias, UInt_t iChannel = 0) const;
32   
33   // Get TGraph
34   TGraph * GetGraphChamberByteStatus (UInt_t iSensor) const             {return GetGraph (chamberByteStatus, iSensor);}
35   TGraph * GetGraphPreTrigger () const                                  {return GetGraph (preTrigger);}
36   TGraph * GetGraphGoofyHv () const                                     {return GetGraph (goofyHv);}
37   TGraph * GetGraphGoofyPeakPos (UInt_t iSensor) const                  {return GetGraph (goofyPeakPos, iSensor);}
38   TGraph * GetGraphGoofyPeakArea (UInt_t iSensor) const                 {return GetGraph (goofyPeakArea, iSensor);}
39   TGraph * GetGraphGoofyTemp (UInt_t iSensor) const                     {return GetGraph (goofyTemp, iSensor);}
40   TGraph * GetGraphGoofyPressure () const                               {return GetGraph (goofyPressure);}
41   TGraph * GetGraphGoofyVelocity () const                               {return GetGraph (goofyVelocity);}
42   TGraph * GetGraphGoofyGain (UInt_t iSensor) const                     {return GetGraph (goofyGain, iSensor);}
43   TGraph * GetGraphGoofyCO2 ()  const                                   {return GetGraph (goofyCO2);}
44   TGraph * GetGraphGoofyN2 () const                                     {return GetGraph (goofyN2);}
45   TGraph * GetGraphGasO2 () const                                       {return GetGraph (gasO2);}
46   TGraph * GetGraphGasOverpressure () const                             {return GetGraph (gasOverpressure);}
47   TGraph * GetGraphEnvTemp (UInt_t iSensor) const                       {return GetGraph (envTemp, iSensor);}
48   TGraph * GetGraphHvAnodeImon (UInt_t iSensor) const                   {return GetGraph (hvAnodeImon, iSensor);}
49   TGraph * GetGraphHvDriftImon (UInt_t iSensor) const                   {return GetGraph (hvDriftImon, iSensor);}
50   TGraph * GetGraphHvAnodeUmon (UInt_t iSensor) const                   {return GetGraph (hvAnodeUmon, iSensor);}
51   TGraph * GetGraphHvDriftUmon (UInt_t iSensor) const                   {return GetGraph (hvDriftUmon, iSensor);}
52   TGraph * GetGraphAdcClkPhase () const                                 {return GetGraph (adcClkPhase);}
53   TGraph * GetGraphAtmPressure () const                                 {return GetGraph (atmPressure);}
54   TGraph * GetGraphLuminosity () const                                  {return GetGraph (luminosity);}
55   TGraph * GetGraphMagneticField () const                               {return GetGraph (magneticField);}
56   
57   AliSplineFit * GetFitChamberByteStatus (UInt_t iSensor) const         {return GetFit (chamberByteStatus, iSensor);}
58   AliSplineFit * GetFitPreTrigger () const                              {return GetFit (preTrigger);}
59   AliSplineFit * GetFitGoofyHv () const                                 {return GetFit (goofyHv);}
60   AliSplineFit * GetFitGoofyPeakPos (UInt_t iSensor) const              {return GetFit (goofyPeakPos, iSensor);}
61   AliSplineFit * GetFitGoofyPeakArea (UInt_t iSensor) const             {return GetFit (goofyPeakArea, iSensor);}
62   AliSplineFit * GetFitGoofyTemp (UInt_t iSensor) const                 {return GetFit (goofyTemp, iSensor);}
63   AliSplineFit * GetFitGoofyPressure () const                           {return GetFit (goofyPressure);}
64   AliSplineFit * GetFitGoofyVelocity () const                           {return GetFit (goofyVelocity);}
65   AliSplineFit * GetFitGoofyGain (UInt_t iSensor) const                 {return GetFit (goofyGain, iSensor);}
66   AliSplineFit * GetFitGoofyCO2 ()  const                               {return GetFit (goofyCO2);}
67   AliSplineFit * GetFitGoofyN2 () const                                 {return GetFit (goofyN2);}
68   AliSplineFit * GetFitGasO2 () const                                   {return GetFit (gasO2);}
69   AliSplineFit * GetFitGasOverpressure () const                         {return GetFit (gasOverpressure);}
70   AliSplineFit * GetFitEnvTemp (UInt_t iSensor) const                   {return GetFit (envTemp, iSensor);}
71   AliSplineFit * GetFitHvAnodeImon (UInt_t iSensor) const               {return GetFit (hvAnodeImon, iSensor);}
72   AliSplineFit * GetFitHvDriftImon (UInt_t iSensor) const               {return GetFit (hvDriftImon, iSensor);}
73   AliSplineFit * GetFitHvAnodeUmon (UInt_t iSensor) const               {return GetFit (hvAnodeUmon, iSensor);}
74   AliSplineFit * GetFitHvDriftUmon (UInt_t iSensor) const               {return GetFit (hvDriftUmon, iSensor);}
75   AliSplineFit * GetFitAdcClkPhase () const                             {return GetFit (adcClkPhase);}
76   AliSplineFit * GetFitAtmPressure () const                             {return GetFit (atmPressure);}
77   AliSplineFit * GetFitLuminosity () const                              {return GetFit (luminosity);}
78   AliSplineFit * GetFitMagneticField () const                           {return GetFit (magneticField);}
79   
80   void Print (Option_t* option = "") const;
81   
82   
83   public :
84     
85     const UInt_t  chamberByteStatus;
86     const UInt_t  preTrigger;
87     const UInt_t  goofyHv;
88     const UInt_t  goofyPeakPos;
89     const UInt_t  goofyPeakArea;
90     const UInt_t  goofyTemp;
91     const UInt_t  goofyPressure;
92     const UInt_t  goofyVelocity;
93     const UInt_t  goofyGain;
94     const UInt_t  goofyCO2;
95     const UInt_t  goofyN2;
96     const UInt_t  gasO2;
97     const UInt_t  gasOverpressure;
98     const UInt_t  envTemp ;
99     const UInt_t  hvAnodeImon;
100     const UInt_t  hvDriftImon;
101     const UInt_t  hvAnodeUmon;
102     const UInt_t  hvDriftUmon;
103     const UInt_t  adcClkPhase;
104     const UInt_t  atmPressure;
105     const UInt_t  luminosity;
106     const UInt_t  magneticField;
107     const UInt_t  fNAlias;
108     
109     
110     
111     protected :
112       
113       private :
114       
115       TGraph * FindAndMakeGraph (TMap * dcsMap, const char * amandaStr,
116                                  char dataType);
117     AliSplineFit * Fit (TGraph * graph,
118                         Int_t  kMinPoints, Int_t  kIter, 
119                         Double_t  kMaxDelta, Int_t  kFitReq);
120     
121     void Init ();
122     void InitFits ();
123     void InitGraphs ();
124     
125     void SetConf (UInt_t iAlias, const char * amanda, char dataType, UInt_t nChannel, 
126                   Bool_t enableGraph, Bool_t enableFit, Int_t kMinPoints, 
127                   Int_t kIter, Double_t kMaxDelta, Int_t kFitReq);
128     
129     private :
130       
131       Bool_t graphsAreIni;
132       Bool_t fitsAreIni;
133       
134       struct data {
135         TObjArray fit;                  // array of AliSplineFit
136         TObjArray graph;                // array of TGraph
137       };
138       
139       struct conf {
140         TString amanda;                 // amanda string
141         char dataType;                  // 'c' for char, 'f' for float
142         UInt_t nChannel;                // number of channel
143         Bool_t enableGraph;             // will be converted in TGraph
144         Bool_t enableFit;               // will be converted in AliSplineFit
145         Int_t  kMinPoints;              // minimum number of points per knot in fit
146         Int_t  kIter;                   // number of iterations for spline fit
147         Double_t  kMaxDelta;            // precision parameter for spline fit
148         Int_t  kFitReq;                 // fit requirement, 2 = continuous 2nd derivative
149       };
150       
151       data fDatas [22];         
152       conf fConfs [22];                 
153       
154       ClassDef(AliTRDDataDCS,1)         //  TRD calibration class
155         
156         };
157
158 #endif