1 | #ifndef MARS_MDirIterExt
|
---|
2 | #define MARS_MDataSetIter
|
---|
3 |
|
---|
4 | #ifndef MARS_MDirIter
|
---|
5 | #include "MDirIter.h"
|
---|
6 | #endif
|
---|
7 |
|
---|
8 | #ifndef MARS_MRunIter
|
---|
9 | #include "MRunIter.h"
|
---|
10 | #endif
|
---|
11 |
|
---|
12 | #ifndef MARS_MSequence
|
---|
13 | #include "MSequence.h"
|
---|
14 | #endif
|
---|
15 |
|
---|
16 | #ifndef ROOT_TObjArray
|
---|
17 | #include <TObjArray.h>
|
---|
18 | #endif
|
---|
19 |
|
---|
20 | class MLog;
|
---|
21 | class TString;
|
---|
22 |
|
---|
23 | class MDataSetIter : public MDirIter
|
---|
24 | {
|
---|
25 | private:
|
---|
26 |
|
---|
27 | TObjArray fFileList; // List with all the file names ordered by name
|
---|
28 | // The list contains TNamed(file, "")
|
---|
29 | TObjArray fSrcList; // List with the valid source names
|
---|
30 |
|
---|
31 |
|
---|
32 | Int_t fInitialRun; // Runnumber of the first run to proccess
|
---|
33 | Int_t fEndRun; // Runnumber of the last run to proccess
|
---|
34 | Int_t fLastProcessedDataRun; // Runnumber of the last processed run
|
---|
35 | Int_t fLastDataRun; // Lst Data runnumber in fFileList
|
---|
36 |
|
---|
37 | MRunIter* fPedRuns;
|
---|
38 | MRunIter* fCalRuns;
|
---|
39 | MRunIter* fDataRuns;
|
---|
40 | MSequence* fSequence;
|
---|
41 |
|
---|
42 | TString fSrcName;
|
---|
43 | TString fDate;
|
---|
44 |
|
---|
45 | Int_t fDefCalRun;
|
---|
46 | TString fDefCalRunPath;
|
---|
47 |
|
---|
48 | MLog *fLog;
|
---|
49 |
|
---|
50 |
|
---|
51 | Int_t CheckSourceName(TString& src);
|
---|
52 | Int_t CompareSourceNames(TString& src1, TString& src2);
|
---|
53 | void AddToFileList(MDirIter& dir);
|
---|
54 | void ScanFileName(const TString& file, TString& name, TString& path, TString& date, TString& src, Int_t* run, char* type);
|
---|
55 | Int_t IsPreviousRunUsable(MRunIter& oldRun);
|
---|
56 | Int_t Loop(TString option, TString LockSrcName="");
|
---|
57 | void FindLastDataRun();
|
---|
58 |
|
---|
59 | public:
|
---|
60 |
|
---|
61 | MDataSetIter();
|
---|
62 |
|
---|
63 | Int_t AddDirectory(const char *dir, const char *filter="*.root", Int_t recursive=0);
|
---|
64 | void SelectSourceName(const char *src);
|
---|
65 |
|
---|
66 | Int_t NextDataSet();
|
---|
67 |
|
---|
68 | void SetInitialRun(Int_t run) { fInitialRun = run; }
|
---|
69 | void SetEndRun(Int_t run)
|
---|
70 | {
|
---|
71 | fEndRun = run;
|
---|
72 | FindLastDataRun();
|
---|
73 | }
|
---|
74 | void SetDefCalRun(Int_t run, const char* path) {fDefCalRun = run; fDefCalRunPath = path; }
|
---|
75 |
|
---|
76 | Int_t GetLastProcessedRun() const { return fLastProcessedDataRun; }
|
---|
77 |
|
---|
78 | TString* GetSrcName() { return &fSrcName; }
|
---|
79 | TString* GetDate() { return &fDate; }
|
---|
80 | MRunIter* GetDataRuns()
|
---|
81 | {
|
---|
82 | fDataRuns->Reset();
|
---|
83 | return fDataRuns;
|
---|
84 | }
|
---|
85 | MRunIter* GetPedRuns()
|
---|
86 | {
|
---|
87 | fPedRuns->Reset();
|
---|
88 | return fPedRuns;
|
---|
89 | }
|
---|
90 | MRunIter* GetCalRuns()
|
---|
91 | {
|
---|
92 | fCalRuns->Reset();
|
---|
93 | return fCalRuns;
|
---|
94 | }
|
---|
95 |
|
---|
96 | void Reset()
|
---|
97 | {
|
---|
98 | fLastProcessedDataRun = 0;
|
---|
99 | }
|
---|
100 |
|
---|
101 | void Print(const Option_t *option="") const;
|
---|
102 |
|
---|
103 | Bool_t HasFinishedSuccesfully();
|
---|
104 |
|
---|
105 | Int_t WriteSequence();
|
---|
106 |
|
---|
107 |
|
---|
108 | ClassDef(MDataSetIter, 1) // Iterator for data set made of Pec, Cal and Data runs
|
---|
109 | };
|
---|
110 |
|
---|
111 | #endif
|
---|