ROOT logo
#ifndef ALIGRPPREPROCESSOR_H
#define ALIGRPPREPROCESSOR_H
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
 * See cxx source for full Copyright notice                               */

//-------------------------------------------------------------------------
//                          Class AliGRPPreprocessor
//                  Global Run Parameters (GRP) preprocessor
//
//    Origin: Panos Christakoglou, UOA-CERN, Panos.Christakoglou@cern.ch
//    Modified: Ernesto.Lopez.Torres@cern.ch  CEADEN-CERN
//-------------------------------------------------------------------------



//////////////////////////////////////////////////////////////////////////
//                                                                      //
//                        AliGRPPreprocessor                            //
//                                                                      //
//           Implementation of the GRP preprocessor                     //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

#include "AliPreprocessor.h"

class TList;
class TString;
class TObjArray;
class AliDCSSensorArray;
class AliGRPObject;
class AliSplineFit;
class AliLHCClockPhase;

class AliGRPPreprocessor: public AliPreprocessor {
 public:

	enum DP {kL3Polarity = 0, kDipolePolarity,  
		 kL3Current, kDipoleCurrent, 
		 kL3bsf17H1, kL3bsf17H2, kL3bsf17H3, kL3bsf17Temperature, 
		 kL3bsf4H1, kL3bsf4H2, kL3bsf4H3, kL3bsf4Temperature, 
		 kL3bkf17H1, kL3bkf17H2, kL3bkf17H3, kL3bkf17Temperature, 
		 kL3bkf4H1, kL3bkf4H2, kL3bkf4H3, kL3bkf4Temperature, 
		 kL3bsf13H1, kL3bsf13H2, kL3bsf13H3, kL3bsf13Temperature,
		 kL3bsf8H1, kL3bsf8H2, kL3bsf8H3, kL3bsf8Temperature,
		 kL3bkf13H1, kL3bkf13H2, kL3bkf13H3, kL3bkf13Temperature,
		 kL3bkf8H1, kL3bkf8H2, kL3bkf8H3, kL3bkf8Temperature,
		 kDipoleInsideH1, kDipoleInsideH2, kDipoleInsideH3, kDipoleInsideTemperature,
		 kDipoleOutsideH1, kDipoleOutsideH2, kDipoleOutsideH3, kDipoleOutsideTemperature,
                 kCavernTemperature, kCavernAtmosPressure, kSurfaceAtmosPressure, 
		 kCavernAtmosPressure2};

	enum DPHallProbes { 
		 khpL3bsf17H1=0, khpL3bsf17H2, khpL3bsf17H3, khpL3bsf17Temperature, 
		 khpL3bsf4H1, khpL3bsf4H2, khpL3bsf4H3, khpL3bsf4Temperature, 
		 khpL3bkf17H1, khpL3bkf17H2, khpL3bkf17H3, khpL3bkf17Temperature, 
		 khpL3bkf4H1, khpL3bkf4H2, khpL3bkf4H3, khpL3bkf4Temperature, 
		 khpL3bsf13H1, khpL3bsf13H2, khpL3bsf13H3, khpL3bsf13Temperature,
		 khpL3bsf8H1, khpL3bsf8H2, khpL3bsf8H3, khpL3bsf8Temperature,
		 khpL3bkf13H1, khpL3bkf13H2, khpL3bkf13H3, khpL3bkf13Temperature,
		 khpL3bkf8H1, khpL3bkf8H2, khpL3bkf8H3, khpL3bkf8Temperature,
		 khpDipoleInsideH1, khpDipoleInsideH2, khpDipoleInsideH3, khpDipoleInsideTemperature,
		 khpDipoleOutsideH1, khpDipoleOutsideH2, khpDipoleOutsideH3, khpDipoleOutsideTemperature};

                      AliGRPPreprocessor(AliShuttleInterface* shuttle);
  virtual            ~AliGRPPreprocessor();
  
  static      Int_t   ReceivePromptRecoParameters(
                                  UInt_t run,
                                  const char* dbHost,
                                  Int_t dbPort,
                                  const char* dbName,
                                  const char* user,
                                  const char* password,
                                  const char *cdbRoot,
				  TString &gdc
                                 );
  static   THashList*  ProcessAliases(const char* aliasesFile);

 protected:

  virtual      void   Initialize(Int_t run, UInt_t startTime, UInt_t endTime);
  
  virtual     UInt_t   Process(TMap* valueSet);

               Int_t   ProcessDaqLB(AliGRPObject* grpobj);
              UInt_t   ProcessDaqFxs();
              UInt_t   ProcessDqmFxs();
              UInt_t   ProcessSPDMeanVertex();
              UInt_t   ProcessLHCData(AliGRPObject* grpobj);
              UInt_t   ProcessDcsFxs(TString partition="", TString detector="");
               Int_t   ProcessDcsDPs(TMap* valueSet, AliGRPObject* grpobj);
               Int_t   ProcessL3DPs(const TMap* valueSet, AliGRPObject* grpobj);
               Int_t   ProcessDipoleDPs(const TMap* valueSet, AliGRPObject* grpobj);
               Int_t   ProcessEnvDPs(TMap* valueSet, AliGRPObject* grpobj);
               Int_t   ProcessHPDPs(const TMap* valueSet, AliGRPObject* grpobj);
	       //               Int_t   ProcessDcsDPs(TMap* valueSet, TMap* grpmap);
   AliDCSSensorArray*  GetPressureMap(TMap *dcsAliasMap);
   AliSplineFit* GetSplineFit(const TObjArray *array, const TString& stringID);
   //AliSplineFit* GetSplineFit(TMap* mapDCS, const TString& stringID);
   TString ProcessChar(const TObjArray *array);
   Char_t ProcessBool(const TObjArray *array, Bool_t &change);
   Float_t ProcessInt(const TObjArray *array);
   Float_t ProcessUInt(const TObjArray *array);
   Float_t* ProcessFloatAll(const TObjArray* array);
   Float_t* ProcessFloatAllMagnet(const TObjArray* array, Int_t indexDP, Bool_t &isZero);
   Bool_t GetDAQStartEndTimeOk() const {return fdaqStartEndTimeOk;}
   void SetDAQStartEndTimeOk(Bool_t daqStartEndTimeOk) {fdaqStartEndTimeOk = daqStartEndTimeOk;}

   Float_t ProcessEnergy(TObjArray* array, Double_t timeStart);
   AliLHCClockPhase* ProcessLHCClockPhase(TObjArray *beam1phase,TObjArray *beam2phase,
					  Double_t timeEnd);
   TString ParseBeamTypeString(TString beamType, Int_t iBeamType);
   Bool_t CheckFileRecords (const char* fileName) const;
   
 private:
 
  static const Int_t   fgknDAQLbPar;            //! number of DAQ lb parameters for PHYSICS runs
  static const Int_t   fgknDCSDP;               //! number of dcs dps
  static const char*   fgkDCSDataPoints[];      //! names of dcs dps
  static const char*   fgkDCSDataPointsHallProbes[];      //! names of dcs dps for Hall Probes
  static const Int_t   fgknDCSDPHallProbes;           //! number of Hall Probes

  AliDCSSensorArray*   fPressure; //pressure array

  AliGRPPreprocessor(const AliGRPPreprocessor&); // Not implemented
  AliGRPPreprocessor& operator=(const AliGRPPreprocessor&); // Not implemented

  Float_t fmaxFloat; // maximum float accepted
  Float_t fminFloat; // minimum float accepted
  Double_t fmaxDouble; // maximum double accepted
  Double_t fminDouble; // minimum double accepted
  Int_t fmaxInt; // maximum int accepted
  Int_t fminInt; // minimum int accepted
  UInt_t fmaxUInt; // maximum uint accepted
  UInt_t fminUInt; // minimum uint accepted
  Bool_t fdaqStartEndTimeOk; // flag to set whether the DAQ_time_start/end fields are set

  TObjArray* ffailedDPs; //TObjArray of failed DPs names

  static const Int_t   fgknLHCDP;               //! number of lhc dps
  static const char*   fgkLHCDataPoints[];      //! names of lhc dps
  static const Int_t   fgkDCSDPHallTopShift;    //! shift from the top to the Hall Probes from the list of DCS DPs names
  static const Int_t   fgkDCSDPNonWorking;    //! Number of non working DCS DPs 

  ClassDef(AliGRPPreprocessor, 0);
};

#endif
 AliGRPPreprocessor.h:1
 AliGRPPreprocessor.h:2
 AliGRPPreprocessor.h:3
 AliGRPPreprocessor.h:4
 AliGRPPreprocessor.h:5
 AliGRPPreprocessor.h:6
 AliGRPPreprocessor.h:7
 AliGRPPreprocessor.h:8
 AliGRPPreprocessor.h:9
 AliGRPPreprocessor.h:10
 AliGRPPreprocessor.h:11
 AliGRPPreprocessor.h:12
 AliGRPPreprocessor.h:13
 AliGRPPreprocessor.h:14
 AliGRPPreprocessor.h:15
 AliGRPPreprocessor.h:16
 AliGRPPreprocessor.h:17
 AliGRPPreprocessor.h:18
 AliGRPPreprocessor.h:19
 AliGRPPreprocessor.h:20
 AliGRPPreprocessor.h:21
 AliGRPPreprocessor.h:22
 AliGRPPreprocessor.h:23
 AliGRPPreprocessor.h:24
 AliGRPPreprocessor.h:25
 AliGRPPreprocessor.h:26
 AliGRPPreprocessor.h:27
 AliGRPPreprocessor.h:28
 AliGRPPreprocessor.h:29
 AliGRPPreprocessor.h:30
 AliGRPPreprocessor.h:31
 AliGRPPreprocessor.h:32
 AliGRPPreprocessor.h:33
 AliGRPPreprocessor.h:34
 AliGRPPreprocessor.h:35
 AliGRPPreprocessor.h:36
 AliGRPPreprocessor.h:37
 AliGRPPreprocessor.h:38
 AliGRPPreprocessor.h:39
 AliGRPPreprocessor.h:40
 AliGRPPreprocessor.h:41
 AliGRPPreprocessor.h:42
 AliGRPPreprocessor.h:43
 AliGRPPreprocessor.h:44
 AliGRPPreprocessor.h:45
 AliGRPPreprocessor.h:46
 AliGRPPreprocessor.h:47
 AliGRPPreprocessor.h:48
 AliGRPPreprocessor.h:49
 AliGRPPreprocessor.h:50
 AliGRPPreprocessor.h:51
 AliGRPPreprocessor.h:52
 AliGRPPreprocessor.h:53
 AliGRPPreprocessor.h:54
 AliGRPPreprocessor.h:55
 AliGRPPreprocessor.h:56
 AliGRPPreprocessor.h:57
 AliGRPPreprocessor.h:58
 AliGRPPreprocessor.h:59
 AliGRPPreprocessor.h:60
 AliGRPPreprocessor.h:61
 AliGRPPreprocessor.h:62
 AliGRPPreprocessor.h:63
 AliGRPPreprocessor.h:64
 AliGRPPreprocessor.h:65
 AliGRPPreprocessor.h:66
 AliGRPPreprocessor.h:67
 AliGRPPreprocessor.h:68
 AliGRPPreprocessor.h:69
 AliGRPPreprocessor.h:70
 AliGRPPreprocessor.h:71
 AliGRPPreprocessor.h:72
 AliGRPPreprocessor.h:73
 AliGRPPreprocessor.h:74
 AliGRPPreprocessor.h:75
 AliGRPPreprocessor.h:76
 AliGRPPreprocessor.h:77
 AliGRPPreprocessor.h:78
 AliGRPPreprocessor.h:79
 AliGRPPreprocessor.h:80
 AliGRPPreprocessor.h:81
 AliGRPPreprocessor.h:82
 AliGRPPreprocessor.h:83
 AliGRPPreprocessor.h:84
 AliGRPPreprocessor.h:85
 AliGRPPreprocessor.h:86
 AliGRPPreprocessor.h:87
 AliGRPPreprocessor.h:88
 AliGRPPreprocessor.h:89
 AliGRPPreprocessor.h:90
 AliGRPPreprocessor.h:91
 AliGRPPreprocessor.h:92
 AliGRPPreprocessor.h:93
 AliGRPPreprocessor.h:94
 AliGRPPreprocessor.h:95
 AliGRPPreprocessor.h:96
 AliGRPPreprocessor.h:97
 AliGRPPreprocessor.h:98
 AliGRPPreprocessor.h:99
 AliGRPPreprocessor.h:100
 AliGRPPreprocessor.h:101
 AliGRPPreprocessor.h:102
 AliGRPPreprocessor.h:103
 AliGRPPreprocessor.h:104
 AliGRPPreprocessor.h:105
 AliGRPPreprocessor.h:106
 AliGRPPreprocessor.h:107
 AliGRPPreprocessor.h:108
 AliGRPPreprocessor.h:109
 AliGRPPreprocessor.h:110
 AliGRPPreprocessor.h:111
 AliGRPPreprocessor.h:112
 AliGRPPreprocessor.h:113
 AliGRPPreprocessor.h:114
 AliGRPPreprocessor.h:115
 AliGRPPreprocessor.h:116
 AliGRPPreprocessor.h:117
 AliGRPPreprocessor.h:118
 AliGRPPreprocessor.h:119
 AliGRPPreprocessor.h:120
 AliGRPPreprocessor.h:121
 AliGRPPreprocessor.h:122
 AliGRPPreprocessor.h:123
 AliGRPPreprocessor.h:124
 AliGRPPreprocessor.h:125
 AliGRPPreprocessor.h:126
 AliGRPPreprocessor.h:127
 AliGRPPreprocessor.h:128
 AliGRPPreprocessor.h:129
 AliGRPPreprocessor.h:130
 AliGRPPreprocessor.h:131
 AliGRPPreprocessor.h:132
 AliGRPPreprocessor.h:133
 AliGRPPreprocessor.h:134
 AliGRPPreprocessor.h:135
 AliGRPPreprocessor.h:136
 AliGRPPreprocessor.h:137
 AliGRPPreprocessor.h:138
 AliGRPPreprocessor.h:139
 AliGRPPreprocessor.h:140
 AliGRPPreprocessor.h:141
 AliGRPPreprocessor.h:142
 AliGRPPreprocessor.h:143
 AliGRPPreprocessor.h:144
 AliGRPPreprocessor.h:145
 AliGRPPreprocessor.h:146
 AliGRPPreprocessor.h:147
 AliGRPPreprocessor.h:148