]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWG3/vertexingHF/AliAnalysisTaskSESelectHFTest.C
Helper method to create input chain AOD with friend AODVertexingHF (A.Rossi)
[u/mrichter/AliRoot.git] / PWG3 / vertexingHF / AliAnalysisTaskSESelectHFTest.C
index 783048aa8662c0510fc72994c4356bfe203ade79..2ef4bdfb32f196095d234b8ae3804c19f05c7d28 100644 (file)
@@ -13,39 +13,24 @@ void AliAnalysisTaskSESelectHFTest()
   Bool_t useParFiles=kFALSE;\r
 \r
   gROOT->LoadMacro("$ALICE_ROOT/PWG3/vertexingHF/LoadLibraries.C");\r
+  gROOT->LoadMacro("$ALICE_ROOT/PWG3/vertexingHF/MakeAODInputChain.C");\r
   LoadLibraries(useParFiles);\r
 \r
   if(analysisMode=="grid") TGrid::Connect("alien:",0,0,"t");\r
 \r
 \r
 \r
-\r
   TChain *chainAOD = 0;\r
-  TChain *chainAODfriend = 0;\r
   \r
   if(inputMode=="list") {\r
     // Local files\r
-    chainAOD = new TChain("aodTree");\r
-    chainAODfriend = new TChain("aodTree");\r
-    // set the path to the files (can be local or on alien)\r
-    chainAOD->Add(      "alien:///alice/cern.ch/user/r/rbala/analysis/out_lhcw/290001/2/AliAOD.root");\r
-    chainAODfriend->Add("alien:///alice/cern.ch/user/r/rbala/analysis/out_lhcw/290001/2/AliAOD.VertexingHF.root");\r
-    // ... add more if needed\r
+    //chainAOD = MakeAODInputChain();// with this it reads ./AliAOD.root and ./AliAOD.VertexingHF.root\r
+    chainAOD = MakeAODInputChain("alien:///alice/cern.ch/user/r/rbala/analysis/out_lhcw/290001/",2,2);\r
   } else if(inputMode=="xml") {\r
-    // xml: need to check the 1-to-1 correspondence\r
-    TString collectionfileAOD       = "collection_aod.xml";\r
-    TString collectionfileAODfriend = "collection_aodHF.xml";\r
-    TAlienCollection *collectionAOD       = TAlienCollection::Open(collectionfileAOD.Data());\r
-    TAlienCollection *collectionAODfriend = TAlienCollection::Open(collectionfileAODfriend.Data());\r
-    chainAOD = new TChain("aodTree");\r
-    chainAODfriend = new TChain("aodTree");\r
-    while(collectionAOD->Next())       chainAOD->Add(collectionAOD->GetTURL(""));\r
-    while(collectionAODfriend->Next()) chainAODfriend->Add(collectionAODfriend->GetTURL(""));\r
+    // xml\r
+    chainAOD = MakeAODInputChain("collection_aod.xml","collection_aodHF.xml");\r
   }\r
 \r
-  // attach the friend chain\r
-  chainAOD->AddFriend(chainAODfriend);\r
-\r
   // Create the analysis manager\r
   AliAnalysisManager *mgr  = new AliAnalysisManager("My Manager","My Manager");\r
   mgr->SetDebugLevel(10);\r