]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/AliSurveyObj.h
Clean-up in includes.
[u/mrichter/AliRoot.git] / STEER / AliSurveyObj.h
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
23 class TGridResult;
24
25 class AliSurveyObj: public TObject {
26
27  public:
28   AliSurveyObj();
29   ~AliSurveyObj();
30   Bool_t FillFromLocalFile(const Char_t* filename);
31   Bool_t Fill(TString detector, Int_t reportNumber,
32               Int_t reportVersion, TString username = "");
33   Bool_t Fill(TString detector, Int_t reportNumber,
34               TString username = "");
35
36   static void ListValidDetectors();
37   Int_t ListReports(TString detector = "", Int_t year = -1,
38                     Int_t reportNumber = -1,
39                     Int_t reportVersion = -1);
40
41   void SetGridUser(TString username);
42  
43   // Number of points (AliSurveyPoint) in the TObjArray
44   Int_t GetEntries() const {return fDataPoints->GetEntries();};
45
46   TString GetReportTitle() const {return fTitle;};
47   TString GetReportDate() const {return fDate;};
48   TString GetDetector() const {return fDetector;};
49   TString GetURL() const {return fURL;};
50   Int_t GetReportNumber() const {return fReportNr;};
51   Int_t GetReportVersion() const {return fVersion;};
52
53   // General comments and observations
54   TString GetObservations() const {return fObs;};
55
56   // Coordinate system used for the measurements
57   TString GetCoordSys() const {return fCoordSys;};
58
59   // Units used in the measurement
60   TString GetUnits() const {return fUnits;};
61
62   // Number of columns read from file (in the "Data" section)
63   Int_t GetNrColumns() const {return fNrColumns;};
64
65   // TObjArray with the names of the columns read
66   TObjArray *GetColumnNames() const {return fColNames.Tokenize(',');};
67
68   // TObjArray with the points read (AliSurveyPoint)
69   TObjArray *GetData() const {return fDataPoints;};
70
71   Bool_t IsValid() const {return fIsValid;};
72
73   
74  private:
75   TString fTitle;     // Report Title
76   TString fDate;      // Report Date
77   TString fDetector;  // Subdetector (or structure) surveyed
78   TString fURL;       // Report URL in EDMS
79   Int_t fReportNr;    // Report Number
80   Int_t fVersion;     // Report Version
81   TString fObs;       // General observations / comments
82   TString fCoordSys;  // Measurements coordinate system
83   TString fUnits;     // Measurements units
84   Int_t fNrColumns;   // Number of columns in data values
85   TString fColNames;  // Column names sepparated by commas
86   Bool_t fIsValid;    // Is the data valid? (sucessfully parsed)
87   TString fGridUser;  // Username to be used for the connection to GRID
88   
89   TObjArray *fDataPoints;       // Actual Data
90   
91   static const TString fgkStorage;
92   static const TString fgkBaseFolder;
93   static const TString fgkValidDetectors;
94   static const TString fgkGRPDetectors;
95   static const TString fgkMUONDetectors;
96     
97   Bool_t Connect(const char *gridUrl, const char *user);
98   Bool_t OpenFile(TString openString);
99   TString &Sanitize(TString str);
100   Bool_t ParseBuffer(const Char_t* buf);
101   void Reset();
102   Bool_t IsValidDetector(TString detector) const;
103   TString RealFolderName(TString detector) const;
104   TString FileNamePathToDetector(TString filename) const;
105   Int_t FileNamePathToReportYear(TString filename) const;
106   Int_t FileNamePathToReportNumber(TString filename) const;
107   Int_t FileNamePathToReportVersion(TString filename) const;
108   TGridResult *QueryReports(TString detector, Int_t year,
109                             Int_t reportNumber, Int_t reportVersion);
110
111   AliSurveyObj (const AliSurveyObj& surveyObj);
112   AliSurveyObj& operator=(const AliSurveyObj& surveyObj); 
113   void AddPoint(AliSurveyPoint* point);
114
115   ClassDef(AliSurveyObj, 1);
116 };
117
118 #endif