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