]>
Commit | Line | Data |
---|---|---|
1 | #ifndef ALI_SURVEY_OBJ_H | |
2 | #define ALI_SURVEY_OBJ_H | |
3 | ||
4 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
5 | * See cxx source for full Copyright notice */ | |
6 | ||
7 | ///////////////////////////////////////////////////////////////////// | |
8 | // // | |
9 | // class AliSurveyObj // | |
10 | // Retrieve and Convert survey data into ROOT Objects // | |
11 | // // | |
12 | ///////////////////////////////////////////////////////////////////// | |
13 | ||
14 | #include <TObject.h> | |
15 | //#include <sstream> | |
16 | ||
17 | #include <TString.h> | |
18 | #include <TObjArray.h> | |
19 | ||
20 | //#include "AliLog.h" | |
21 | //#include "AliSurveyPoint.h" | |
22 | class AliSurveyPoint; | |
23 | ||
24 | class TGridResult; | |
25 | ||
26 | class AliSurveyObj: public TObject { | |
27 | ||
28 | public: | |
29 | AliSurveyObj(); | |
30 | ~AliSurveyObj(); | |
31 | Bool_t FillFromLocalFile(const Char_t* filename); | |
32 | Bool_t Fill(TString detector, Int_t reportNumber, | |
33 | Int_t reportVersion, TString username = ""); | |
34 | Bool_t Fill(TString detector, Int_t reportNumber, | |
35 | TString username = ""); | |
36 | ||
37 | static void ListValidDetectors(); | |
38 | Int_t ListReports(TString detector = "", Int_t year = -1, | |
39 | Int_t reportNumber = -1, | |
40 | Int_t reportVersion = -1); | |
41 | ||
42 | void SetGridUser(TString username); | |
43 | ||
44 | // Number of points (AliSurveyPoint) in the TObjArray | |
45 | Int_t GetEntries() const {return fDataPoints->GetEntries();}; | |
46 | ||
47 | TString GetReportTitle() const {return fTitle;}; | |
48 | TString GetReportDate() const {return fDate;}; | |
49 | TString GetDetector() const {return fDetector;}; | |
50 | TString GetURL() const {return fURL;}; | |
51 | Int_t GetReportNumber() const {return fReportNr;}; | |
52 | Int_t GetReportVersion() const {return fVersion;}; | |
53 | ||
54 | // General comments and observations | |
55 | TString GetObservations() const {return fObs;}; | |
56 | ||
57 | // Coordinate system used for the measurements | |
58 | TString GetCoordSys() const {return fCoordSys;}; | |
59 | ||
60 | // Units used in the measurement | |
61 | TString GetUnits() const {return fUnits;}; | |
62 | ||
63 | // Number of columns read from file (in the "Data" section) | |
64 | Int_t GetNrColumns() const {return fNrColumns;}; | |
65 | ||
66 | // TObjArray with the names of the columns read | |
67 | TObjArray *GetColumnNames() const {return fColNames.Tokenize(',');}; | |
68 | ||
69 | // TObjArray with the points read (AliSurveyPoint) | |
70 | TObjArray *GetData() const {return fDataPoints;}; | |
71 | ||
72 | Bool_t IsValid() const {return fIsValid;}; | |
73 | ||
74 | ||
75 | private: | |
76 | TString fTitle; // Report Title | |
77 | TString fDate; // Report Date | |
78 | TString fDetector; // Subdetector (or structure) surveyed | |
79 | TString fURL; // Report URL in EDMS | |
80 | Int_t fReportNr; // Report Number | |
81 | Int_t fVersion; // Report Version | |
82 | TString fObs; // General observations / comments | |
83 | TString fCoordSys; // Measurements coordinate system | |
84 | TString fUnits; // Measurements units | |
85 | Int_t fNrColumns; // Number of columns in data values | |
86 | TString fColNames; // Column names sepparated by commas | |
87 | Bool_t fIsValid; // Is the data valid? (sucessfully parsed) | |
88 | TString fGridUser; // Username to be used for the connection to GRID | |
89 | ||
90 | TObjArray *fDataPoints; // Actual Data | |
91 | ||
92 | static const TString fgkStorage; // Storage | |
93 | static const TString fgkBaseFolder; // Base folder | |
94 | static const TString fgkValidDetectors;// Valid detectors | |
95 | static const TString fgkGRPDetectors;// GRP detectors | |
96 | static const TString fgkMUONDetectors;// MUON detectors | |
97 | ||
98 | Bool_t Connect(const char *gridUrl, const char *user); | |
99 | Bool_t OpenFile(TString openString); | |
100 | TString &Sanitize(TString str); | |
101 | Bool_t ParseBuffer(const Char_t* buf); | |
102 | void Reset(); | |
103 | Bool_t IsValidDetector(TString detector) const; | |
104 | TString RealFolderName(TString detector) const; | |
105 | TString FileNamePathToDetector(TString filename) const; | |
106 | Int_t FileNamePathToReportYear(TString filename) const; | |
107 | Int_t FileNamePathToReportNumber(TString filename) const; | |
108 | Int_t FileNamePathToReportVersion(TString filename) const; | |
109 | TGridResult *QueryReports(TString detector, Int_t year, | |
110 | Int_t reportNumber, Int_t reportVersion); | |
111 | ||
112 | AliSurveyObj (const AliSurveyObj& surveyObj); | |
113 | AliSurveyObj& operator=(const AliSurveyObj& surveyObj); | |
114 | void AddPoint(AliSurveyPoint* point); | |
115 | ||
116 | ClassDef(AliSurveyObj, 1); | |
117 | }; | |
118 | ||
119 | #endif |