finalizing DataGenerator component producing fake data for benchmark purpose
[u/mrichter/AliRoot.git] / PWG3 / muon / RunSingleMuonAnalysisFromAOD.C
CommitLineData
aad6618e 1//--------------------------------------------------------------------------
2// Base macro for submitting single muon analysis.
3//
4// In case it is not run with full aliroot, it needs to have in the working directory:
5// - STEERBase.par
6// - AOD.par
7// - ANALYSIS.par
8//
9// The macro reads AODs and outputs file:
10// - outputDir/singleMuAnalysis.root
11//--------------------------------------------------------------------------
12
13void runSingleMuAnalysis(Char_t *inputDir=".", Char_t *outputDir=".") {
14 TStopwatch timer;
15 timer.Start();
16 gSystem->Load("libTree");
17 gSystem->Load("libGeom");
18 gSystem->Load("libVMC");
19 gSystem->Load("libANALYSIS");
20 gSystem->Load("libSTEERBase");
21 gSystem->Load("libAOD");
22 gSystem->Load("libESD");
23 gSystem->Load("libPWG3base.so");
24
25 TString outFileName("singleMuAnalysis.root");
26 outFileName.Prepend(Form("%s/",outputDir));
27
28 //____________________________________________//
29 AliTagAnalysis *TagAna = new AliTagAnalysis("AOD");
30
31 AliRunTagCuts *runCuts = new AliRunTagCuts();
32 AliLHCTagCuts *lhcCuts = new AliLHCTagCuts();
33 AliDetectorTagCuts *detCuts = new AliDetectorTagCuts();
34 AliEventTagCuts *evCuts = new AliEventTagCuts();
35
36 TagAna->ChainLocalTags(inputDir);
37
38
39 // Temporary workaround to avoid problems with AOD tags.
40 TChain* chain = new TChain("aodTree");
41 TString inFileName("AliAOD.root");
42 inFileName.Prepend(Form("%s/",inputDir));
43 chain->Add(inFileName);
44 // When problems will be solved and/or you manage in getting a
45 // Run*.Merged.AOD.tag.root, substitute with the following lines:
46
47 //TChain* chain = 0x0;
48 //chain = TagAna->QueryTags(runCuts,lhcCuts,detCuts,evCuts);
49
50
51 //____________________________________________//
52 // Make the analysis manager
53 AliAnalysisManager *mgr = new AliAnalysisManager("TestManager");
54 AliVEventHandler* aodH = new AliAODInputHandler;
55 mgr->SetInputEventHandler(aodH);
56 //____________________________________________//
57 // 1st Pt task
58 AliAnalysisTaskSingleMu *task1 = new AliAnalysisTaskSingleMu("SingleMu");
59 mgr->AddTask(task1);
60 // Create containers for input/output
61 AliAnalysisDataContainer *cinput1 = mgr->CreateContainer("cchain1",TChain::Class(),AliAnalysisManager::kInputContainer);
62 AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("cobjArray1", TObjArray::Class(),AliAnalysisManager::kOutputContainer,outFileName.Data());
63
64 //____________________________________________//
65 mgr->ConnectInput(task1,0,cinput1);
66 mgr->ConnectOutput(task1,0,coutput1);
67 if (!mgr->InitAnalysis()) return;
68 mgr->PrintStatus();
69 mgr->StartAnalysis("local",chain);
70
71 timer.Stop();
72 timer.Print();
73}