// Test macro for the AliAnalysisTaskSE for heavy-flavour candidates\r
// association with MC truth (using MC info in AOD)\r
// A.Dainese, andrea.dainese@lnl.infn.it\r
+ // "grid" mode added by R.Bala, bala@to.infn.it\r
//\r
- TString mode="local"; // otherwise, "grid"\r
+ TString analysisMode = "grid"; // "local" or "grid"\r
+ TString inputMode = "list"; // "list" or "xml"\r
+\r
\r
Bool_t useParFiles=kFALSE;\r
\r
gROOT->LoadMacro("$ALICE_ROOT/PWG3/vertexingHF/LoadLibraries.C");\r
LoadLibraries(useParFiles);\r
\r
- TChain *chainAOD = 0;\r
- TChain *chainAODfriend = 0;\r
+ if(analysisMode=="grid") TGrid::Connect("alien:",0,0,"t");\r
+\r
\r
- chainAOD = new TChain("aodTree");\r
- chainAODfriend = new TChain("aodTree");\r
\r
- if(mode=="local") {\r
- // Local files \r
- chainAOD->Add("./AliAOD.root");\r
- chainAODfriend->Add("./AliAOD.VertexingHF.root");\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
- } else { // grid (NOT TESTED YET)\r
- //Fetch files with AliEn\r
+ } else if(inputMode=="xml") {\r
// xml: need to check the 1-to-1 correspondence\r
- const char *collectionfileAOD = "CollectionAOD.xml";\r
- const char *collectionfileAODfriend = "CollectionAODfriend.xml";\r
- TGrid::Connect("alien://");\r
- //Create an AliTagAnalysis Object and chain the tags\r
- AliTagAnalysis *tagAna = new AliTagAnalysis();\r
- chainAOD = tagAna->GetChainFromCollection(collectionfileAOD,"aodTree");\r
- chainAODfriend = tagAna->GetChainFromCollection(collectionfileAODfriend,"aodTree");\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
}\r
\r
// attach the friend chain\r
\r
// Input\r
AliAODInputHandler *inputHandler = new AliAODInputHandler();\r
- //inputHandler->AddFriend("AliAOD.VertexingHF.root");//should not be needed\r
mgr->SetInputEventHandler(inputHandler);\r
\r
\r
\r
//\r
// Create containers for input/output\r
- mgr->ConnectInput(hfTask,0,mgr->GetCommonInputContainer());\r
- /* \r
- // before v4-17-Release\r
AliAnalysisDataContainer *cinput = mgr->CreateContainer("cinput",TChain::Class(), \r
- AliAnalysisManager::kInputContainer);\r
- mgr->ConnectInput(hfTask,0,cinput);\r
- */\r
+ AliAnalysisManager::kInputContainer);\r
AliAnalysisDataContainer *coutput = mgr->CreateContainer("coutput",TList::Class(),\r
AliAnalysisManager::kOutputContainer, \r
"CmpHF.root");\r
+ mgr->ConnectInput(hfTask,0,mgr->GetCommonInputContainer());\r
+\r
mgr->ConnectOutput(hfTask,1,coutput);\r
- \r
+\r
//\r
// Run the analysis\r
// \r
printf("CHAIN HAS %d ENTRIES\n",(Int_t)chainAOD->GetEntries());\r
if(mgr->InitAnalysis()) {\r
mgr->PrintStatus();\r
- mgr->StartAnalysis(mode.Data(),chainAOD);\r
+ mgr->StartAnalysis("local",chainAOD);\r
}\r
\r
return;\r
// A.Dainese, andrea.dainese@lnl.infn.it\r
//\r
\r
+ TString analysisMode = "grid"; // "local" or "grid"\r
+ TString inputMode = "list"; // "list" or "xml"\r
+\r
+\r
Bool_t useParFiles=kFALSE;\r
\r
gROOT->LoadMacro("$ALICE_ROOT/PWG3/vertexingHF/LoadLibraries.C");\r
LoadLibraries(useParFiles);\r
\r
+ if(analysisMode=="grid") TGrid::Connect("alien:",0,0,"t");\r
\r
- // Local files \r
- TChain *chain = new TChain("aodTree");\r
- chain->Add("./AliAOD.root");\r
\r
- // or:\r
- /*\r
- //Fetch files with AliEn :\r
- const char *collectionfile = "CollectionTags.xml";\r
- TGrid::Connect("alien://") ;\r
- //Create an AliRunTagCuts and an AliEventTagCuts Object and impose some selection criteria\r
- AliRunTagCuts *runCuts = new AliRunTagCuts();\r
- AliEventTagCuts *eventCuts = new AliEventTagCuts();\r
- AliLHCTagCuts *lhcCuts = new AliLHCTagCuts();\r
- AliDetectorTagCuts *detCuts = new AliDetectorTagCuts();\r
- eventCuts->SetMultiplicityRange(0,20000);\r
- //Create an AliTagAnalysis Object and chain the tags\r
- AliTagAnalysis *tagAna = new AliTagAnalysis();\r
- tagAna->SetType("AOD");\r
- TAlienCollection *coll = TAlienCollection::Open(collectionfile);\r
- TGridResult *tagResult = coll->GetGridResult("",0,0);\r
- tagResult->Print();\r
- tagAna->ChainGridTags(tagResult);\r
- //Create a new aod chain and assign the chain that is returned by querying the tags\r
- TChain* chain = tagAna->QueryTags(runCuts,lhcCuts,detCuts,eventCuts);\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
+ } 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
+ }\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
\r
// Input\r
AliAODInputHandler *inputHandler = new AliAODInputHandler();\r
- inputHandler->AddFriend("AliAOD.VertexingHF.root");\r
+ //inputHandler->AddFriend("AliAOD.VertexingHF.root");\r
mgr->SetInputEventHandler(inputHandler);\r
\r
// Output \r
//\r
// Run the analysis\r
// \r
- printf("CHAIN HAS %d ENTRIES\n",(Int_t)chain->GetEntries());\r
+ printf("CHAIN HAS %d ENTRIES\n",(Int_t)chainAOD->GetEntries());\r
if(mgr->InitAnalysis()) {\r
mgr->PrintStatus();\r
- mgr->StartAnalysis("local",chain);\r
- //mgr->StartAnalysis("grid",chain);\r
+ mgr->StartAnalysis("local",chainAOD);\r
}\r
\r
return;\r