2 // Macro for the running of the AliAnalysisTaskMuonAODfromGeneral
5 void RunMuonAODfromGeneral(char* filein = "../FromESDToGenAOD/AliAOD.root", char* fileout = "AliMuonAOD.root" ){
7 gSystem->Load("libTree");
8 gSystem->Load("libGeom");
9 gSystem->Load("libSTEERBase");
10 gSystem->Load("libAOD");
11 gSystem->Load("libANALYSIS");
12 gSystem->Load("libPWGHFbase.so");
15 TChain* chain = new TChain("aodTree");
18 // Make aod output handler
19 AliAODHandler* aodHandler = new AliAODHandler();
20 aodHandler->SetOutputFileName(fileout);
22 // Make the analysis manager
23 AliAnalysisManager *mgr = new AliAnalysisManager("AOD Manager", "AOD Manager");
24 mgr->SetOutputEventHandler(aodHandler);
25 mgr-> SetDebugLevel(10);
27 // Task for AOD generation from PWG0base directory
28 AliAnalysisTaskMuonAODfromGeneral *aodfilter = new AliAnalysisTaskMuonAODfromGeneral("AOD Filter",7000.);
29 mgr->AddTask(aodfilter);
31 // Create containers for input/output
32 AliAnalysisDataContainer *cinput1 = mgr->CreateContainer("cchain",TChain::Class(),
33 AliAnalysisManager::kInputContainer);
34 AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("tree", TTree::Class(),
35 AliAnalysisManager::kOutputContainer, "default");
36 AliAnalysisDataContainer *coutput2 = mgr->CreateContainer("histo", TH1F::Class(),
37 AliAnalysisManager::kOutputContainer, "default");
39 mgr->ConnectInput (aodfilter, 0, cinput1 );
40 mgr->ConnectOutput (aodfilter, 0, coutput1 );
45 mgr->StartAnalysis("local",chain);
49 Int_t setupPar(const char* pararchivename) {
54 char processline[1024];
55 sprintf(processline,".! tar xvzf %s.par",pararchivename);
56 gROOT->ProcessLine(processline);
57 const char* ocwd = gSystem->WorkingDirectory();
58 gSystem->ChangeDirectory(pararchivename);
60 // check for BUILD.sh and execute
61 if (!gSystem->AccessPathName("PROOF-INF/BUILD.sh")) {
62 printf("*******************************\n");
63 printf("*** Building PAR archive ***\n");
64 printf("*******************************\n");
66 if (gSystem->Exec("PROOF-INF/BUILD.sh")) {
67 Error("runAnalysis","Cannot Build the PAR Archive! - Abort!");
71 // check for SETUP.C and execute
72 if (!gSystem->AccessPathName("PROOF-INF/SETUP.C")) {
73 printf("*******************************\n");
74 printf("*** Setup PAR archive ***\n");
75 printf("*******************************\n");
76 gROOT->Macro("PROOF-INF/SETUP.C");
79 gSystem->ChangeDirectory("../");