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