]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STEER/STEER/AliSurveyObj.h
Fix bug in mu calculation (Plamen)
[u/mrichter/AliRoot.git] / STEER / STEER / AliSurveyObj.h
CommitLineData
324b1730 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>
324b1730 15
16#include <TString.h>
17#include <TObjArray.h>
18
68e43693 19class AliSurveyPoint;
75cab1ea 20class TGridResult;
21
324b1730 22class AliSurveyObj: public TObject {
23
24 public:
25 AliSurveyObj();
26 ~AliSurveyObj();
573b6a5a 27 Bool_t FillFromLocalFile(const Char_t* filename);
75cab1ea 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);
737100a1 39
40 // Number of points (AliSurveyPoint) in the TObjArray
324b1730 41 Int_t GetEntries() const {return fDataPoints->GetEntries();};
573b6a5a 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;};
737100a1 49
50 // General comments and observations
573b6a5a 51 TString GetObservations() const {return fObs;};
737100a1 52
53 // Coordinate system used for the measurements
573b6a5a 54 TString GetCoordSys() const {return fCoordSys;};
737100a1 55
56 // Units used in the measurement
573b6a5a 57 TString GetUnits() const {return fUnits;};
737100a1 58
59 // Number of columns read from file (in the "Data" section)
573b6a5a 60 Int_t GetNrColumns() const {return fNrColumns;};
737100a1 61
62 // TObjArray with the names of the columns read
573b6a5a 63 TObjArray *GetColumnNames() const {return fColNames.Tokenize(',');};
737100a1 64
65 // TObjArray with the points read (AliSurveyPoint)
573b6a5a 66 TObjArray *GetData() const {return fDataPoints;};
67
324b1730 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)
737100a1 84 TString fGridUser; // Username to be used for the connection to GRID
324b1730 85
86 TObjArray *fDataPoints; // Actual Data
87
68e43693 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
75cab1ea 93
324b1730 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);
adfef030 98 void Reset();
75cab1ea 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);
adfef030 107
737100a1 108 AliSurveyObj (const AliSurveyObj& surveyObj);
109 AliSurveyObj& operator=(const AliSurveyObj& surveyObj);
324b1730 110 void AddPoint(AliSurveyPoint* point);
adfef030 111
324b1730 112 ClassDef(AliSurveyObj, 1);
113};
114
115#endif