]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGLF/SPECTRA/IdentifiedHighPt/grid/copyStatisticFiles.C
Merge branch 'feature-movesplit'
[u/mrichter/AliRoot.git] / PWGLF / SPECTRA / IdentifiedHighPt / grid / copyStatisticFiles.C
CommitLineData
4ebdd20e 1//using namespace std;
2
3#include <iostream>
4
5#include "ListDirectories.h"
6
7
8
9const char * GetLocalFileName1(Int_t run, const char * path);
10const char * GetLocalFileName2(Int_t run, const char * path);
11//---------------------------------------------------------
12
13
14void copyStatisticFiles() {
15
16
17
18
19 //loading libraries
20 loadlibs();
21
22
23 // connect to grid
24 TGrid::Connect("alien://");
25
26 // do not use scientific notation for run number
27 TGaxis::SetMaxDigits(7) ;
28
29
30 // loop over all files
31 Int_t ifile =-1;
32 Int_t ifileGood = 0;
33 Int_t ifileNotEmpty = 0;
34 while (runs[++ifile] > 0) {
35
36
37 //loop over two root files
38 for(Int_t i=0;i<2;++i){
39
40 Long_t *id,*size,*flags,*mt;
41
42 TString file;
43 TFile *fr=0;
44 TString file2 ;
45 TFile *fr2=0;
46
47 TFile *fc=0; // centrality, only in local mode for the time being
48
49 cout<<"location.Data()="<<location.Data()<<endl;
50 cout<<"runs[ifile]="<<runs[ifile]<<endl;
51 //cout<<" output.Data()="<<output.Data()<<endl;
52
53
54 switch(i){
55 case 0:{
56 file.Form("alien://%s/000%d/HighPtDeDx_Tree.root",location.Data(),runs[ifile] );
57
58 Printf("\nBegin of reading: %s", file.Data());
59
60 gSystem->Exec(Form("alien_cp %s %s",file.Data(), GetLocalFileName1(runs[ifile], localPath)));
61 cout << Form("alien_cp %s %s",file.Data(), GetLocalFileName1(runs[ifile], localPath)) <<endl;
62 }break;
63 case 1:{
64 file.Form("alien://%s/000%d/HighPtDeDxV0_Tree.root",location.Data(),runs[ifile] );
65
66 Printf("\nBegin of reading: %s", file.Data());
67
68 gSystem->Exec(Form("alien_cp %s %s",file.Data(), GetLocalFileName2(runs[ifile], localPath)));
69 cout << Form("alien_cp %s %s",file.Data(), GetLocalFileName2(runs[ifile], localPath)) <<endl;
70 }break;
71
72
73
74 }
75
76
77 }
78 //gSystem->Exec(Form("alien_cp %s %s",file2.Data(), GetLocalFileName2(runs[ifile], localSuffix, localPath)));
79 //cout << Form("alien_cp %s %s",file2.Data(), GetLocalFileName2(runs[ifile], localSuffix, localPath)) <<endl;
80
81
82 }
83}
84
85const char * GetLocalFileName1(Int_t run, const char * path) {
86 // returns the filename of the local copy of the event_stat file
87 static TString name;
88 // name.Form("%s/event_stat_%s_%d.root", path, suffix, run);
89 name.Form("%s/HighPtDeDx_Tree_%d.root", path, run);
90 return name.Data();
91
92}
93const char * GetLocalFileName2(Int_t run, const char * path) {
94 // returns the filename of the local copy of the event_stat file
95 static TString name;
96 // name.Form("%s/event_stat_%s_%d.root", path, suffix, run);
97 name.Form("%s/HighPtDeDxV0_Tree_%d.root", path, run);
98 return name.Data();
99
100}
101
102void loadlibs()
103{
104 gSystem->Load("libVMC");
105 gSystem->Load("libTree");
106 gSystem->Load("libSTEERBase");
107 gSystem->Load("libESD");
108 gSystem->Load("libAOD");
109 gSystem->Load("libANALYSIS");
110 gSystem->Load("libANALYSISalice");
111 gSystem->Load("libCORRFW");
112 gSystem->Load("libMinuit");
113 gSystem->Load("libPWG2spectra");
114 gSystem->Load("libPWG0base");
115}