Run type field added in SHUTTLE framework. Run type is read from "run type" logbook...
[u/mrichter/AliRoot.git] / SHUTTLE / AliShuttleLogbookEntry.h
CommitLineData
2bb7b766 1#ifndef ALI_SHUTTLE_LOGBOOK_ENTRY_H
2#define ALI_SHUTTLE_LOGBOOK_ENTRY_H
3
4
5/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
6 * See cxx source for full Copyright notice */
7
8/* $Id$ */
9
10//
11// This class is a container for the data queried from DAQ's logbook and logbook_shuttle tables.
12//
13
14#include <TObject.h>
eba76848 15#include <TString.h>
16#include <TMap.h>
2bb7b766 17
eba76848 18#include "AliShuttleInterface.h"
2bb7b766 19
eba76848 20class AliShuttleLogbookEntry : public TObject {
2bb7b766 21
22public:
23 enum Status {
24 kUnprocessed = 0,
25 kInactive,
26 kFailed, // final
27 kDone // final
28 };
29
30 AliShuttleLogbookEntry();
eba76848 31 AliShuttleLogbookEntry(Int_t run, Status* status=0);
2bb7b766 32 ~AliShuttleLogbookEntry();
33
34 AliShuttleLogbookEntry& operator=(const AliShuttleLogbookEntry& c);
35 AliShuttleLogbookEntry(const AliShuttleLogbookEntry& c);
36 virtual void Copy(TObject& c) const;
37
38 Int_t GetRun() const {return fRun;}
eba76848 39 UInt_t GetStartTime() const {TString tmp(GetRunParameter("time_start")); return tmp.Atoi();}
40 UInt_t GetEndTime() const {TString tmp(GetRunParameter("time_end")); return tmp.Atoi();}
2bb7b766 41
eba76848 42// void SetRun(Int_t run) {fRun=run;}
43
44 void SetRunParameter(const char* key, const char* value);
45 const char* GetRunParameter(const char* key) const;
2bb7b766 46
441b0e9c 47 Status GetDetectorStatus(const char* detCode) const
48 {return GetDetectorStatus(AliShuttleInterface::GetDetPos(detCode));}
2bb7b766 49 Status GetDetectorStatus(Int_t detPos) const;
50 Status* GetDetectorStatus() const {return (Status*) fDetectorStatus;}
51
52 void SetDetectorStatus(const char* detCode, Status status);
53 void SetDetectorStatus(Status* status);
54 void SetDetectorStatus(UInt_t detPos, Status status);
eba76848 55 void SetDetectorStatus(const char* detCode, const char* statusName);
56 void SetDetectorStatus(UInt_t detPos, const char* statusName);
2bb7b766 57
441b0e9c 58 const char* GetRunType(const char* detCode) const
59 {return GetRunType(AliShuttleInterface::GetDetPos(detCode));}
60 const char* GetRunType(Int_t detPos) const;
61 TString* GetRunType() const {return (TString*) fRunType;}
62
63 void SetRunType(const char* detCode, const char* runType);
64 void SetRunType(UInt_t detPos, const char* runType);
65 void SetRunType(const TString* runType);
66
67
2bb7b766 68 Bool_t IsDone() const;
69
70 static const char* GetDetectorStatusName(Status status);
71 void Print(Option_t *option) const;
72
2bb7b766 73private:
74
75 Int_t fRun; // Run number
eba76848 76 TMap fRunParameters; // run parameters written in DAQ logbook
77 Status fDetectorStatus[AliShuttleInterface::kNDetectors]; // Detector status array
441b0e9c 78 TString fRunType[AliShuttleInterface::kNDetectors]; // Run type array
2bb7b766 79
80 ClassDef(AliShuttleLogbookEntry, 0)
81};
82
83#endif
84