#ifndef TMConfig_H
#define TMConfig_H

#include <TString.h>


class TMConfig {

 public:
  virtual ~TMConfig();
  static TMConfig* Instance();

  void LoadConfig(const Char_t *fileName = "");
  void SaveConfig(const Char_t *fileName = "");
  void SetDefaultConfig();

  UInt_t  GETaa_nbInRun_() {return aa_nbInRun_;}
  UInt_t  GETaa_runNb_() {return aa_runNb_;}
  Int_t   GETmoodVersionFlag() {return moodVersionFlag;}
  Int_t   GEThandleEventMin() {return handleEventMin;}
  Int_t   GEThandleEventMax() {return handleEventMax;}
  TString GETuploadCommand2() {return uploadCommand2;}
  UInt_t  GETeventType() {return eventType;}
  UInt_t  GETmonitoringPolicy() {return monitoringPolicy;}
  Bool_t  GETmonitorOffLine() {return monitorOffLine;}
  Bool_t  GETdeclareMonitor() {return declareMonitor;}
  Bool_t  GETswap16() {return swap16;}
  Bool_t  GETswap32() {return swap32;}
  Bool_t  GETsetNowait() {return setNowait;}
  TString GETdataSourceFullPath() {return dataSourceFullPath;}
  TString GETdataSourceFullPathOnline() {return dataSourceFullPathOnline;}
  TString GETdataSourceFullPathOffline() {return dataSourceFullPathOffline;}
  Bool_t  GETdataSourceOnline() {return dataSourceOnline;}
  TString GETnameOfMp() {return nameOfMp;}
  Bool_t  GETmultipleFiles() {return multipleFiles;}
  Bool_t  GETdumpInconsistent() {return dumpInconsistent;}
  Bool_t  GETalerBeforeDumping() {return alerBeforeDumping;}    
  UInt_t  GETdumpNr() {return dumpNr;}
  UInt_t  GETdeadLimit() {return deadLimit;}
  UInt_t  GETnoisyLimit() {return noisyLimit;}
  TString GETuploadCommand() {return uploadCommand;}
  Float_t GETupdateTime() {return updateTime;}
  TString GETmovieName() {return movieName;}
  UInt_t  GETmovieTotal() {return movieTotal;}
  UInt_t  GETmovieRate() {return movieRate;}
  UInt_t  GETmovieDelay() {return movieDelay;}
  Bool_t  GETeqActive(UInt_t eq) {return eqActive[eq];}
  Int_t   GETerrorSuppr() {return errorSuppr;}
  Bool_t  GETrootMode() {return rootMode;}
  Bool_t  GETadvEvCntDumpAll() {return advEvCntDumpAll;}
  Bool_t  GETglobalOverlap() {return globalOverlap;}
  Bool_t  GETmultipleFileType() {return multipleFileType;}
  Bool_t  GETdataSourceOfflineList() {return dataSourceOfflineList;}
  TString GETdataSourceFullPathOfflineList() {return dataSourceFullPathOfflineList;}
  Float_t GETsafetyHoldTime() {return safetyHoldTime;}
  Float_t GETsafetyContTime() {return safetyContTime;}
  UInt_t  GETstopRunEventNumber() {return stopRunEventNumber;}
  ULong_t GETtriggerMask0() {return triggerMask0;}
  ULong_t GETtriggerMask1() {return triggerMask1;}

  void SETaa_nbInRun_(UInt_t val) {aa_nbInRun_=val;}
  void SETaa_runNb_(UInt_t val) {aa_runNb_=val;}
  void SETmoodVersionFlag(Int_t val) {moodVersionFlag=val;}
  void SEThandleEventMin(Int_t val) {handleEventMin=val;}
  void SEThandleEventMax(Int_t val) {handleEventMax=val;}
  void SETuploadCommand2(const Char_t* val) {uploadCommand2=val;}
  void SETeventType(UInt_t val) {eventType=val;}
  void SETmonitoringPolicy(UInt_t val) {monitoringPolicy=val;}
  void SETmonitorOffLine(Bool_t val) {monitorOffLine=val;}
  void SETdeclareMonitor(Bool_t val) {declareMonitor=val;}
  void SETswap16(Bool_t val) {swap16=val;}
  void SETswap32(Bool_t val) {swap32=val;}
  void SETsetNowait(Bool_t val) {setNowait=val;}
  void SETdataSourceFullPath(const Char_t* val) {dataSourceFullPath=val;}
  void SETdataSourceFullPathOnline(const Char_t* val) {dataSourceFullPathOnline=val;}
  void SETdataSourceFullPathOffline(const Char_t* val) {dataSourceFullPathOffline=val;}
  void SETdataSourceOnline(Bool_t val) {dataSourceOnline=val;}
  void SETnameOfMp(const Char_t* val) {nameOfMp=val;}
  void SETmultipleFiles(Bool_t val) {multipleFiles=val;}
  void SETdumpInconsistent(Bool_t val) {dumpInconsistent=val;}
  void SETalerBeforeDumping(Bool_t val) {alerBeforeDumping=val;}    
  void SETdumpNr(UInt_t val) {dumpNr=val;}
  void SETdeadLimit(UInt_t val) {deadLimit=val;}
  void SETnoisyLimit(UInt_t val) {noisyLimit=val;}
  void SETuploadCommand(const Char_t* val) {uploadCommand=val;}
  void SETupdateTime(Float_t val) {updateTime=val;}
  void SETmovieName(const Char_t* val) {movieName=val;}
  void SETmovieTotal(UInt_t val) {movieTotal=val;}
  void SETmovieRate(UInt_t val) {movieRate=val;}
  void SETmovieDelay(UInt_t val) {movieDelay=val;}
  void SETeqActive(UInt_t eq, Bool_t val) {eqActive[eq]=val;}
  void SETerrorSuppr(Int_t val) {errorSuppr=val;}
  void SETrootMode(Bool_t val) {rootMode=val;}
  void SETadvEvCntDumpAll(Bool_t val) {advEvCntDumpAll=val;}
  void SETglobalOverlap(Bool_t val) {globalOverlap=val;}
  void SETmultipleFileType(Bool_t val) {multipleFileType=val;}
  void SETdataSourceOfflineList(Bool_t val) {dataSourceOfflineList=val;}
  void SETdataSourceFullPathOfflineList(const Char_t* val) {dataSourceFullPathOfflineList=val;}
  void SETsafetyHoldTime(Float_t val) {safetyHoldTime=val;}
  void SETsafetyContTime(Float_t val) {safetyContTime=val;}
  void SETstopRunEventNumber(UInt_t val) {stopRunEventNumber=val;}
  void SETtriggerMask0(ULong_t val) {triggerMask0=val;}
  void SETtriggerMask1(ULong_t val) {triggerMask1=val;}


 private:
  TMConfig();
  static Bool_t instanceFlag;
  static TMConfig *single;


  // Config parameters:

  UInt_t aa_nbInRun_;
  UInt_t aa_runNb_;
  Int_t  moodVersionFlag;
  Int_t  handleEventMin;
  Int_t  handleEventMax;
  TString uploadCommand2;
  UInt_t eventType;          // DATE Options
  UInt_t monitoringPolicy;
  Bool_t monitorOffLine;
  Bool_t declareMonitor;
  Bool_t swap16;
  Bool_t swap32;
  Bool_t setNowait;
  TString dataSourceFullPath;
  TString dataSourceFullPathOnline;
  TString dataSourceFullPathOffline;
  Bool_t dataSourceOnline;
  TString nameOfMp;
  Bool_t multipleFiles;
  Bool_t dumpInconsistent;
  Bool_t alerBeforeDumping;    
  UInt_t dumpNr;
  UInt_t deadLimit;
  UInt_t noisyLimit;
  TString uploadCommand;
  Float_t updateTime;
  TString movieName;
  UInt_t movieTotal;
  UInt_t movieRate;
  UInt_t movieDelay;
  Bool_t eqActive[20];
  Int_t errorSuppr;
  Bool_t rootMode;
  Bool_t advEvCntDumpAll;
  Bool_t globalOverlap;
  Bool_t multipleFileType;
  Bool_t dataSourceOfflineList;
  TString dataSourceFullPathOfflineList;
  Float_t safetyHoldTime;
  Float_t safetyContTime;
  UInt_t stopRunEventNumber;
  ULong_t triggerMask0;
  ULong_t triggerMask1;

};

#endif

