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