1 | #ifndef MARS_MSequence
|
---|
2 | #define MARS_MSequence
|
---|
3 |
|
---|
4 | #ifndef ROOT_TArrayI
|
---|
5 | #include <TArrayI.h>
|
---|
6 | #endif
|
---|
7 |
|
---|
8 | #ifndef ROOT_TExMap
|
---|
9 | #include <TExMap.h>
|
---|
10 | #endif
|
---|
11 |
|
---|
12 | #ifndef MARS_MTime
|
---|
13 | #include "MTime.h"
|
---|
14 | #endif
|
---|
15 |
|
---|
16 | class MDirIter;
|
---|
17 |
|
---|
18 | class MSequence : public MParContainer
|
---|
19 | {
|
---|
20 | private:
|
---|
21 | UInt_t fSequence;
|
---|
22 |
|
---|
23 | MTime fStart;
|
---|
24 |
|
---|
25 | UInt_t fLastRun;
|
---|
26 | UInt_t fNumEvents;
|
---|
27 |
|
---|
28 | UInt_t fPeriod;
|
---|
29 | MTime fNight;
|
---|
30 |
|
---|
31 | TString fProject;
|
---|
32 | TString fSource;
|
---|
33 | TString fTriggerTable;
|
---|
34 | TString fHvSettings;
|
---|
35 |
|
---|
36 | TArrayI fRuns;
|
---|
37 | TArrayI fCalRuns;
|
---|
38 | TArrayI fPedRuns;
|
---|
39 | TArrayI fDatRuns;
|
---|
40 |
|
---|
41 | //TExMap fFileNames;
|
---|
42 |
|
---|
43 | void Split(TString &runs, TArrayI &data) const;
|
---|
44 | void GetFileNames(TEnv &env, const TArrayI &arr);
|
---|
45 |
|
---|
46 | const char *GetFileName(UInt_t num);
|
---|
47 |
|
---|
48 | UInt_t SetupRuns(MDirIter &iter, const TArrayI &arr, const char *path, char *id, Bool_t raw=kFALSE) const;
|
---|
49 | UInt_t AddRuns(UInt_t first, UInt_t last, TArrayI *runs);
|
---|
50 |
|
---|
51 | public:
|
---|
52 | MSequence() : fSequence((UInt_t)-1), fLastRun((UInt_t)-1),
|
---|
53 | fNumEvents((UInt_t)-1), fPeriod((UInt_t)-1) { }
|
---|
54 | MSequence(const char *fname);
|
---|
55 | MSequence(const MSequence &s) : fSequence(s.fSequence), fStart(s.fStart),
|
---|
56 | fLastRun(s.fLastRun), fNumEvents(s.fNumEvents), fPeriod(s.fPeriod),
|
---|
57 | fNight(s.fNight), fProject(s.fProject), fSource(s.fSource),
|
---|
58 | fTriggerTable(s.fTriggerTable), fHvSettings(s.fHvSettings),
|
---|
59 | fRuns(s.fRuns), fCalRuns(s.fCalRuns), fPedRuns(s.fPedRuns),
|
---|
60 | fDatRuns(s.fDatRuns) { }
|
---|
61 | ~MSequence();
|
---|
62 |
|
---|
63 | // TObject
|
---|
64 | void Print(Option_t *o="") const;
|
---|
65 |
|
---|
66 | // Genaral interface
|
---|
67 | Bool_t IsValid() const { return fSequence!=(UInt_t)-1; }
|
---|
68 |
|
---|
69 | UInt_t SetupPedRuns(MDirIter &iter, const char *path=0, char *id="P", Bool_t raw=kFALSE) const;
|
---|
70 | UInt_t SetupDatRuns(MDirIter &iter, const char *path=0, char *id="D", Bool_t raw=kFALSE) const;
|
---|
71 | UInt_t SetupAllRuns(MDirIter &iter, const char *path=0, char *id="?", Bool_t raw=kFALSE) const;
|
---|
72 | UInt_t SetupCalRuns(MDirIter &iter, const char *path=0, char *id="C", Bool_t raw=kFALSE) const;
|
---|
73 |
|
---|
74 | // Getter
|
---|
75 | UInt_t GetNumAllRuns() const { return fRuns.GetSize(); }
|
---|
76 | UInt_t GetNumDatRuns() const { return fDatRuns.GetSize(); }
|
---|
77 | UInt_t GetNumPedRuns() const { return fPedRuns.GetSize(); }
|
---|
78 | UInt_t GetNumCalRuns() const { return fCalRuns.GetSize(); }
|
---|
79 |
|
---|
80 | UInt_t GetSequence() const { return fSequence; }
|
---|
81 | UInt_t GetLastRun() const { return fLastRun; }
|
---|
82 | UInt_t GetPeriod() const { return fPeriod; }
|
---|
83 |
|
---|
84 | const UInt_t GetFirstRun() const { return fRuns[0]; }
|
---|
85 | const UInt_t GetFirstCalRun() const { return fCalRuns[0]; }
|
---|
86 | const UInt_t GetLastCalRun() const { return fCalRuns[fCalRuns.GetSize()-1]; }
|
---|
87 | const TArrayI &GetPedRuns() const { return fPedRuns; }
|
---|
88 | const TArrayI &GetCalRuns() const { return fCalRuns; }
|
---|
89 | const TArrayI &GetDatRuns() const { return fDatRuns; }
|
---|
90 |
|
---|
91 | const MTime &GetStart() const { return fStart; }
|
---|
92 | const MTime &GetNight() const { return fNight; }
|
---|
93 | const TString &GetSource() const { return fSource; }
|
---|
94 |
|
---|
95 | const TString GetStandardPath(Bool_t raw) const;
|
---|
96 |
|
---|
97 | // Setter
|
---|
98 | void SetNight(const char*night);
|
---|
99 |
|
---|
100 | UInt_t AddRuns(UInt_t first, UInt_t last) { return MSequence::AddRuns(first, last, 0); }
|
---|
101 | UInt_t AddCalRuns(UInt_t first, UInt_t last) { return MSequence::AddRuns(first, last, &fCalRuns); }
|
---|
102 | UInt_t AddPedRuns(UInt_t first, UInt_t last) { return MSequence::AddRuns(first, last, &fPedRuns); }
|
---|
103 | UInt_t AddDatRuns(UInt_t first, UInt_t last) { return MSequence::AddRuns(first, last, &fDatRuns); }
|
---|
104 |
|
---|
105 | UInt_t AddRuns(UInt_t num) { return AddRuns(num, num); }
|
---|
106 | UInt_t AddCalRuns(UInt_t num) { return AddCalRuns(num, num); }
|
---|
107 | UInt_t AddPedRuns(UInt_t num) { return AddPedRuns(num, num); }
|
---|
108 | UInt_t AddDatRuns(UInt_t num) { return AddDatRuns(num, num); }
|
---|
109 |
|
---|
110 | ClassDef(MSequence, 0)
|
---|
111 | };
|
---|
112 |
|
---|
113 | #endif
|
---|