]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/AliSurveyObj.h
Adding support for CINT7, CMSH7, CMUL7, CMUU7, CEMC7 triggers
[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
16 #include <TString.h>
17 #include <TObjArray.h>
18
19 class AliSurveyPoint;
20 class TGridResult;
21
22 class AliSurveyObj: public TObject {
23
24  public:
25   AliSurveyObj();
26   ~AliSurveyObj();
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 = "");
32
33   static void ListValidDetectors();
34   Int_t ListReports(TString detector = "", Int_t year = -1,
35                     Int_t reportNumber = -1,
36                     Int_t reportVersion = -1);
37
38   void SetGridUser(TString username);
39  
40   // Number of points (AliSurveyPoint) in the TObjArray
41   Int_t GetEntries() const {return fDataPoints->GetEntries();};
42
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;};
49
50   // General comments and observations
51   TString GetObservations() const {return fObs;};
52
53   // Coordinate system used for the measurements
54   TString GetCoordSys() const {return fCoordSys;};
55
56   // Units used in the measurement
57   TString GetUnits() const {return fUnits;};
58
59   // Number of columns read from file (in the "Data" section)
60   Int_t GetNrColumns() const {return fNrColumns;};
61
62   // TObjArray with the names of the columns read
63   TObjArray *GetColumnNames() const {return fColNames.Tokenize(',');};
64
65   // TObjArray with the points read (AliSurveyPoint)
66   TObjArray *GetData() const {return fDataPoints;};
67
68   Bool_t IsValid() const {return fIsValid;};
69
70   
71  private:
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
85   
86   TObjArray *fDataPoints;       // Actual Data
87   
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
93     
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);
98   void Reset();
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);
107
108   AliSurveyObj (const AliSurveyObj& surveyObj);
109   AliSurveyObj& operator=(const AliSurveyObj& surveyObj); 
110   void AddPoint(AliSurveyPoint* point);
111
112   ClassDef(AliSurveyObj, 1);
113 };
114
115 #endif