]>
Commit | Line | Data |
---|---|---|
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> | |
15 | #include <TString.h> | |
16 | #include <TMap.h> | |
17 | ||
18 | #include "AliShuttleInterface.h" | |
19 | ||
20 | class AliShuttleLogbookEntry : public TObject { | |
21 | ||
22 | public: | |
23 | enum Status { | |
24 | kUnprocessed = 0, | |
25 | kInactive, | |
26 | kFailed, // final | |
27 | kDone // final | |
28 | }; | |
29 | ||
30 | AliShuttleLogbookEntry(); | |
31 | AliShuttleLogbookEntry(Int_t run, Status* status=0); | |
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;} | |
39 | UInt_t GetStartTime() const {TString tmp(GetRunParameter("time_created")); return tmp.Atoi();} | |
40 | UInt_t GetEndTime() const {TString tmp(GetRunParameter("time_completed")); return tmp.Atoi();} | |
41 | Bool_t GetECSSuccess() const {TString tmp(GetRunParameter("ecs_success")); return (Bool_t) tmp.Atoi();} | |
42 | Bool_t GetDATestMode() const {return fDATestMode;} | |
43 | ||
44 | // void SetRun(Int_t run) {fRun=run;} | |
45 | ||
46 | void SetRunParameter(const char* key, const char* value); | |
47 | const char* GetRunParameter(const char* key) const; | |
48 | ||
49 | Status GetDetectorStatus(const char* detCode) const | |
50 | {return GetDetectorStatus(AliShuttleInterface::GetDetPos(detCode));} | |
51 | Status GetDetectorStatus(Int_t detPos) const; | |
52 | Status* GetDetectorStatus() const {return (Status*) fDetectorStatus;} | |
53 | ||
54 | void SetDetectorStatus(const char* detCode, Status status); | |
55 | void SetDetectorStatus(Status* status); | |
56 | void SetDetectorStatus(UInt_t detPos, Status status); | |
57 | void SetDetectorStatus(const char* detCode, const char* statusName); | |
58 | void SetDetectorStatus(UInt_t detPos, const char* statusName); | |
59 | void SetDATestMode(Bool_t daTestMode) {fDATestMode = daTestMode;} | |
60 | ||
61 | const char* GetRunType() const { return GetRunParameter("run_type"); } | |
62 | ||
63 | Bool_t IsDone() const; | |
64 | ||
65 | static const char* GetDetectorStatusName(Status status); | |
66 | void Print(Option_t *option) const; | |
67 | ||
68 | private: | |
69 | ||
70 | Int_t fRun; // Run number | |
71 | TMap fRunParameters; // run parameters written in DAQ logbook | |
72 | Status fDetectorStatus[AliShuttleInterface::kNDetectors]; // Detector status array | |
73 | Bool_t fDATestMode; // flag to set whether we are in the DA Test Mode for the current run | |
74 | ||
75 | ClassDef(AliShuttleLogbookEntry, 0) | |
76 | }; | |
77 | ||
78 | #endif | |
79 |