New format of the GRP object (Chiara)
[u/mrichter/AliRoot.git] / STEER / AliGRPPreprocessor.h
1 #ifndef ALIGRPPREPROCESSOR_H
2 #define ALIGRPPREPROCESSOR_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 //-------------------------------------------------------------------------
7 //                          Class AliGRPPreprocessor
8 //                  Global Run Parameters (GRP) preprocessor
9 //
10 //    Origin: Panos Christakoglou, UOA-CERN, Panos.Christakoglou@cern.ch
11 //    Modified: Ernesto.Lopez.Torres@cern.ch  CEADEN-CERN
12 //-------------------------------------------------------------------------
13
14
15
16 //////////////////////////////////////////////////////////////////////////
17 //                                                                      //
18 //                        AliGRPPreprocessor                            //
19 //                                                                      //
20 //           Implementation of the GRP preprocessor                     //
21 //                                                                      //
22 //////////////////////////////////////////////////////////////////////////
23
24 #include "AliPreprocessor.h"
25
26 class TList;
27 class TString;
28 class AliDCSSensorArray;
29 class AliGRPObject;
30 class AliSplineFit;
31
32 class AliGRPPreprocessor: public AliPreprocessor {
33  public:
34
35         enum DP {kLHCState = 0, kL3Polarity, kDipolePolarity, kLHCLuminosity, kBeamIntensity, 
36                  kL3Current, kDipoleCurrent, 
37                  kL3_BSF17_H1, kL3_BSF17_H2, kL3_BSF17_H3, kL3_BSF17_Temperature, 
38                  kL3_BSF4_H1, kL3_BSF4_H2, kL3_BSF4_H3, kL3_BSF4_Temperature, 
39                  kL3_BKF17_H1, kL3_BKF17_H2, kL3_BKF17_H3, kL3_BKF17_Temperature, 
40                  kL3_BKF4_H1, kL3_BKF4_H2, kL3_BKF4_H3, kL3_BKF4_Temperature, 
41                  kL3_BSF13_H1, kL3_BSF13_H2, kL3_BSF13_H3, kL3_BSF13_Temperature,
42                  kL3_BSF8_H1, kL3_BSF8_H2, kL3_BSF8_H3, kL3_BSF8_Temperature,
43                  kL3_BKF13_H1, kL3_BKF13_H2, kL3_BKF13_H3, kL3_BKF13_Temperature,
44                  kL3_BKF8_H1, kL3_BKF8_H2, kL3_BKF8_H3, kL3_BKF8_Temperature,
45                  kDipole_Inside_H1, kDipole_Inside_H2, kDipole_Inside_H3, kDipole_Inside_Temperature,
46                  kDipole_Outside_H1, kDipole_Outside_H2, kDipole_Outside_H3, kDipole_Outside_Temperature,
47                  kCavernTemperature, kCavernAtmosPressure, kSurfaceAtmosPressure};
48
49         enum DP_HallProbes { 
50                  k_HP_L3_BSF17_H1= 0 , k_HP_L3_BSF17_H2, k_HP_L3_BSF17_H3, k_HP_L3_BSF17_Temperature, 
51                  k_HP_L3_BSF4_H1, k_HP_L3_BSF4_H2, k_HP_L3_BSF4_H3, k_HP_L3_BSF4_Temperature, 
52                  k_HP_L3_BKF17_H1, k_HP_L3_BKF17_H2, k_HP_L3_BKF17_H3, k_HP_L3_BKF17_Temperature, 
53                  k_HP_L3_BKF4_H1, k_HP_L3_BKF4_H2, k_HP_L3_BKF4_H3, k_HP_L3_BKF4_Temperature, 
54                  k_HP_L3_BSF13_H1, k_HP_L3_BSF13_H2, k_HP_L3_BSF13_H3, k_HP_L3_BSF13_Temperature,
55                  k_HP_L3_BSF8_H1, k_HP_L3_BSF8_H2, k_HP_L3_BSF8_H3, k_HP_L3_BSF8_Temperature,
56                  k_HP_L3_BKF13_H1, k_HP_L3_BKF13_H2, k_HP_L3_BKF13_H3, k_HP_L3_BKF13_Temperature,
57                  k_HP_L3_BKF8_H1, k_HP_L3_BKF8_H2, k_HP_L3_BKF8_H3, k_HP_L3_BKF8_Temperature,
58                  k_HP_Dipole_Inside_H1, k_HP_Dipole_Inside_H2, k_HP_Dipole_Inside_H3, k_HP_Dipole_Inside_Temperature,
59                  k_HP_Dipole_Outside_H1, k_HP_Dipole_Outside_H2, k_HP_Dipole_Outside_H3, k_HP_Dipole_Outside_Temperature};
60
61                       AliGRPPreprocessor(AliShuttleInterface* shuttle);
62   virtual            ~AliGRPPreprocessor();
63   
64   static      Int_t   ReceivePromptRecoParameters(
65                                   UInt_t run,
66                                   const char* dbHost,
67                                   Int_t dbPort,
68                                   const char* dbName,
69                                   const char* user,
70                                   const char* password,
71                                   const char *cdbRoot
72                                  );
73
74  protected:
75
76   virtual      void   Initialize(Int_t run, UInt_t startTime, UInt_t endTime);
77   
78   virtual     UInt_t   Process(TMap* valueSet);
79
80                 AliGRPObject*  ProcessDaqLB();
81               UInt_t   ProcessDaqFxs();
82               UInt_t   ProcessDcsFxs();
83                Int_t   ProcessDcsDPs(TMap* valueSet, AliGRPObject* grpobj);
84                Int_t   ProcessLHCDPs(TMap* valueSet, AliGRPObject* grpobj);
85                Int_t   ProcessL3DPs(TMap* valueSet, AliGRPObject* grpobj);
86                Int_t   ProcessDipoleDPs(TMap* valueSet, AliGRPObject* grpobj);
87                Int_t   ProcessEnvDPs(TMap* valueSet, AliGRPObject* grpobj);
88                Int_t   ProcessHPDPs(TMap* valueSet, AliGRPObject* grpobj);
89                //               Int_t   ProcessDcsDPs(TMap* valueSet, TMap* grpmap);
90    AliDCSSensorArray*  GetPressureMap(TMap *dcsAliasMap);
91    AliSplineFit* GetSplineFit(TObjArray *array, const TString& stringID);
92    //AliSplineFit* GetSplineFit(TMap* mapDCS, const TString& stringID);
93    TString ProcessChar(TObjArray *array);
94    Char_t ProcessBool(TObjArray *array);
95    Float_t ProcessInt(TObjArray *array);
96    Float_t ProcessUInt(TObjArray *array);
97    Float_t* ProcessFloatAll(TObjArray* array);
98
99  private:
100  
101   static const Int_t   fgknDAQLbPar;            //! number of DAQ lb parameters
102   static const Int_t   fgknDCSDP;               //! number of dcs dps
103   static const char*   fgkDCSDataPoints[];      //! names of dcs dps
104   static const char*   fgkLHCState[];           //! names of LHC States
105   static const char*   fgkDCSDataPoints_HallProbes[];      //! names of dcs dps for Hall Probes
106   static const Int_t   fgknDCSDP_HallProbes;           //! names of LHC States for Hall Probes
107
108   AliDCSSensorArray*   fPressure; //pressure array
109
110                        AliGRPPreprocessor(const AliGRPPreprocessor&); // Not implemented
111                        AliGRPPreprocessor& operator=(const AliGRPPreprocessor&); // Not implemented
112
113   ClassDef(AliGRPPreprocessor, 0);
114 };
115
116 #endif