source: trunk/MagicSoft/Mars/mtemp/mucm/classes/MDataSetIter.h@ 4691

Last change on this file since 4691 was 4683, checked in by marcos, 20 years ago
*** empty log message ***
File size: 2.0 KB
Line 
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 ROOT_TObjArray
13#include <TObjArray.h>
14#endif
15
16class MLog;
17class TString;
18
19class MDataSetIter : public MDirIter
20{
21 private:
22
23 TObjArray fFileList; // List with all the file names ordered by name
24 // The list contains TNamed(file, "")
25 TObjArray fSrcList; // List with the valid source names
26
27 Int_t fLastProcessedRun; // Runnumber of the last processed run
28
29 MRunIter* fPedRuns;
30 MRunIter* fCalRuns;
31 MRunIter* fDataRuns;
32
33 TString fSrcName;
34 TString fDate;
35
36 MLog *fLog;
37
38 Int_t fDefCalRun;
39 TString fDefCalRunPath;
40
41 Int_t CheckSourceName(TString& src);
42 void AddToFileList(MDirIter& dir);
43 void ScanFileName(const TString& file, TString& name, TString& path, TString& date, TString& src, Int_t* run, char* type);
44
45 public:
46
47 MDataSetIter();
48
49 Int_t AddDirectory(const char *dir, const char *filter="*.root", Int_t recursive=0);
50 void SelectSourceName(const char *src);
51
52 Int_t NextDataSet();
53
54 void SetInitialRun(Int_t run) { fLastProcessedRun = run; }
55
56 TString* GetSrcName() { return &fSrcName; }
57 TString* GetDate() { return &fDate; }
58 MRunIter* GetDataRuns()
59 {
60 fDataRuns->Reset();
61 return fDataRuns;
62 }
63 MRunIter* GetPedRuns()
64 {
65 fPedRuns->Reset();
66 return fPedRuns;
67 }
68 MRunIter* GetCalRuns()
69 {
70 fCalRuns->Reset();
71 return fCalRuns;
72 }
73
74 void Reset()
75 {
76 MDirIter::Reset();
77 fLastProcessedRun = 0;
78 }
79
80 void Print(const Option_t *option="") const;
81
82 Int_t Loop(TString option, TString LockSrcName="");
83
84 Int_t IsPreviousRunUsable(MRunIter& oldRun);
85
86
87 Int_t GetLastProcessedRun() const { return fLastProcessedRun; }
88
89 void SetDefCalRun(Int_t run, const char* path) {fDefCalRun = run; fDefCalRunPath = path; }
90
91
92 ClassDef(MDataSetIter, 1) // Iterator for runs
93};
94
95#endif
Note: See TracBrowser for help on using the repository browser.