Introducing a new AOD class: AliAODcascade (A.Maire)
[u/mrichter/AliRoot.git] / PWG2 / RESONANCES / macros / AliRsnReadTaskAlien.C
CommitLineData
2e1ebf1a 1void AliRsnReadTaskAlien
2(
3 const char *kCollectionFile="wn.xml", // XML file containing tags
4 Long64_t nentries=TChain::kBigNumber
5)
6{
7 // connect to grid
8 TGrid::Connect("alien://");
9
10 // create chain of files to read
11 TAlienCollection *myCollection = TAlienCollection::Open(kCollectionFile);
12 if (!myCollection) {
13 Error("AliRsnReadTaskRL", Form("Cannot create an AliEn collection from %s", kCollectionFile));
14 return;
15 }
16 TChain* analysisChain = new TChain("esdTree");
17 myCollection->Reset();
18
19 // loop on the entries of the XML input file
20 Int_t i = 0;
21 while ( myCollection->Next() ) {
22 char esdFile[255];
23 sprintf(esdFile, "%s", myCollection->GetTURL(""));
24 Info("AliRsnReadTaskRL", Form("Adding %s", esdFile));
25 analysisChain->Add(esdFile);
26 if (++i >= 1) break;
27 }
28 Info("AliRsnReadTaskRL", Form("CHAIN HAS %d ENTRIES", (Int_t)analysisChain->GetEntries()));
29
30 // load read macro
31 gROOT->LoadMacro("$(ALICE_ROOT)/PWG2/RESONANCES/macros/AliRsnReadTask.C");
32 AliRsnReadTask(analysisChain);
33}