]> git.uio.no Git - u/mrichter/AliRoot.git/blob - macros/SurveyAliSurveyObjExample.C
Upsilon 8 TeV
[u/mrichter/AliRoot.git] / macros / SurveyAliSurveyObjExample.C
1 void SurveyAliSurveyObjExample(const char* user, const char* det, Int_t repNum, Int_t ver)
2 {
3     // Example of use of AliSurveyObj functionality
4     // user is the alien user allowing to connect to alien and open there the survey parsed file
5     // repNum is the report number and ver it's version
6     // As an example you could run this macro with the following line:
7     // aliroot -b -q $ALICE_ROOT/macros/SurveyAliSurveyObjExample.C("myalienusername","TPC",818098,1)
8     //
9
10     AliSurveyObj *so = new AliSurveyObj();
11
12     Int_t size = so->GetEntries();
13     printf("-> %d\n", size);
14
15     //  The survey object can be filled from local file or from the survey depot in alien.
16     //  The following commented lines show an example, then we will use the second option.
17     //  For this reason the alien user is required as argument.
18     //  so->FillFromLocalFile("~/survey/real_data/Survey_781282_HMPID.txt");
19     //  size = so->GetEntries();
20     //  printf("--> %d\n", size);
21
22     //  so->Fill("TRD", 2007, 816582, 1); 
23     //  size = so->GetEntries();
24     //  printf("----> %d\n", size);
25
26     so->Fill(det, repNum, ver, user);
27     size = so->GetEntries();
28     printf("---> %d\n", size);
29
30     Printf("Title: \"%s\"", so->GetReportTitle().Data());
31     Printf("Date: \"%s\"", so->GetReportDate().Data());
32     Printf("Detector: \"%s\"", so->GetDetector().Data());
33     Printf("URL: \"%s\"", so->GetURL().Data());
34     Printf("Number: \"%d\"", so->GetReportNumber());
35     Printf("Version: \"%d\"", so->GetReportVersion());
36     Printf("Observations: \"%s\"", so->GetObservations().Data());
37     Printf("Coordinate System: \"%s\"", so->GetCoordSys().Data());
38     Printf("Measurement Units: \"%s\"", so->GetUnits().Data());
39     Printf("Nr Columns: \"%d\"", so->GetNrColumns());
40
41     TObjArray *colNames = so->GetColumnNames();
42     for (Int_t i = 0; i < colNames->GetEntries(); ++i)
43         Printf("  Column %d --> \"%s\"", i, ((TObjString *) colNames->At(i))->GetString().Data());
44
45     Printf("Points:");
46     TObjArray *points = so->GetData();
47     for (Int_t i = 0; i < points->GetEntries(); ++i)
48         Printf("  Point %d --> \"%s\"", i, ((AliSurveyPoint *) points->At(i))->GetPointName().Data());
49
50     // See "STEER/AliSurveyPoint.h" for more getters
51
52     return;
53 }