1 //___________________________________________________________________
3 void merge(TString component, const Char_t *inputstring)
7 gROOT->Macro("LoadLibraries.C");
11 if (component == "COPY") {
12 CopyCPass(inputstring, "AliESDfriends_v1.root");
17 MergeCPass(inputstring, component);
21 //___________________________________________________________________
23 void MergeCPass(const Char_t *list, TString component)
26 /* select what to merge */
27 if (component == "ALL")
28 merger.AddReject("esdFriend");
30 merger.AddAccept(component.Data());
32 merger.IterTXT(list, "CalibObjects.root", kFALSE);
34 gSystem->Exec(Form("touch %s_merge_done", component.Data()));
38 //___________________________________________________________________
40 void CopyCPass(const char *searchdir, const char *pattern, Int_t timeOut=10)
43 gSystem->Setenv("XRDCLIENTMAXWAIT",Form("%d",timeOut));
44 gEnv->SetValue("XNet.RequestTimeout", timeOut);
45 gEnv->SetValue("XNet.ConnectTimeout", timeOut);
46 gEnv->SetValue("XNet.TransactionTimeout", timeOut);
47 TFile::SetOpenTimeout(timeOut);
49 TGrid::Connect("alien");
53 command = Form("find %s/ %s", searchdir, pattern);
54 cerr<<"command: "<<command<<endl;
55 TGridResult *res = gGrid->Command(command);
61 outputFile.open(Form("calib.list"));
64 while((map=(TMap*)nextmap()))
66 TObjString *objs = dynamic_cast<TObjString*>(map->GetValue("turl"));
67 if (!objs || !objs->GetString().Length())
73 TString src=Form("%s",objs->GetString().Data());
75 dst.ReplaceAll("alien:///","");
76 dst.ReplaceAll("/","_");
78 Bool_t result = TFile::Cp(src.Data(),dst.Data(),kTRUE);
80 AliSysInfo::AddStamp(dst.Data(),counter, result);
84 outputFile << dst.Data()<< endl;
87 cout<<counter<<" files copied!"<<endl;
90 gSystem->Exec("touch copy_done");