]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGDQ/dielectron/macros/analyzeJpsiME.C
including switch to set on/off iso-track core removal, cleaning and bug fix
[u/mrichter/AliRoot.git] / PWGDQ / dielectron / macros / analyzeJpsiME.C
CommitLineData
ffbede40 1void analyzeJpsiME(TString tag="./"){
2
3 TStopwatch timer;
4 timer.Start();
5
6 //_____________Setting up libraries_______________
7 gSystem->Load("libTree.so");
8 gSystem->Load("libSTEERBase.so");
9 gSystem->Load("libVMC.so");
10 gSystem->Load("libESD.so");
11 gSystem->Load("libANALYSIS.so");
12 gSystem->Load("libANALYSISalice");
13 gSystem->Load("libCORRFW");
a14d0b3e 14 gSystem->Load("libPWGDQdielectron.so");
15 gSystem->AddIncludePath("-I$ALICE_ROOT/PWGDQ/dielectron/ -I$ALICE_ROOT/ANALYSIS -I$ALICE_ROOT/CORRFW");
ffbede40 16
17 //_____________Load Macro_____________________________
18 gROOT->LoadMacro("ConfigJpsi2eeData.C"); // user Config file
19
20 // Make the analysis manager__________________________
21 AliAnalysisManager *mgr = new AliAnalysisManager("AnalysisManager");
22
23 // Event handler setting
24 Int_t nEventsToLoad = 5; // pool depth
25 AliMultiEventInputHandler *inputHandler = new AliMultiEventInputHandler(nEventsToLoad,0); // 0 for ESD, 1 for AOD
26 mgr->SetInputEventHandler(inputHandler);
27
28 // event pool setting
29 AliEventPoolOTF *myPool = new AliEventPoolOTF("event pool","ESD");
30 myPool->SetTagDirectory(tag.Data());
31 myPool->SetMultiplicityBin(0,100,100); // (min, max, bin width)
32 myPool->Init();
33
34 mgr->SetEventPool(myPool); // link event pool with manager
35 inputHandler->SetEventPool(myPool); // link event pool with input handler
36
37 // Analysis Task Jpsi->e+e-___________________________
38 AliAnalysisTaskDielectronME *task = new AliAnalysisTaskDielectronME("DielectronTaskME");
39 task->RequireFreshBuffer(); // refresh mode in the pool
40 task->SetPoolDepth(nEventsToLoad); // set pool depth in the task
41 mgr->AddTask(task);
42
43 // add dielectron analysis with different cuts to the task
44 for (Int_t i=0; i<nDie; ++i){ //nDie defined in config file
45 AliDielectron *jpsi=ConfigJpsi2ee(i);
46 task->AddDielectron(jpsi);
47 }
48
49 // Create containers for input/output_________________
50 AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("jpsi_treeEff",TTree::Class(),AliAnalysisManager::kExchangeContainer,"jpsi_Effdefault");
51 AliAnalysisDataContainer *cOutputHist1 = mgr->CreateContainer("QA", TList::Class(), AliAnalysisManager::kOutputContainer, "jpsi_QA.root");
52 AliAnalysisDataContainer *cOutputHist2 = mgr->CreateContainer("CF", TList::Class(), AliAnalysisManager::kOutputContainer, "jpsi_CF.root");
53 AliAnalysisDataContainer *cOutputHist3 = mgr->CreateContainer("jpsi_Eff_EventStat",TH1D::Class(),AliAnalysisManager::kOutputContainer,"jpsi_Eff.root");
54
55 mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer());
56 mgr->ConnectOutput(task, 0, coutput1 );
57 mgr->ConnectOutput(task, 1, cOutputHist1);
58 mgr->ConnectOutput(task, 2, cOutputHist2);
59 mgr->ConnectOutput(task, 3, cOutputHist3);
60
61 if (!mgr->InitAnalysis()) return;
62 mgr->PrintStatus();
63 TChain *chain = NULL; // null pointer to avoid entering grid mode. temporary solution
64 mgr->StartAnalysis("mix",chain);
65 //mgr->Terminate();
66
67 timer.Stop();
68 timer.Print();
69}