]>
Commit | Line | Data |
---|---|---|
0d57c290 | 1 | AliAnalysisTask *AddTask_mkoehler_CCbar(Bool_t hasMC_aod = kFALSE){ |
2 | //get the current analysis manager | |
3 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
4 | if (!mgr) { | |
5 | ::Error("AddTask_mkoehler_CCbar", "No analysis manager found."); | |
6 | return NULL; | |
7 | } | |
8 | if (!mgr->GetInputEventHandler()) { | |
9 | ::Error("AddTask_mkoehler_CCbar", "This task requires an input event handler"); | |
10 | return NULL; | |
11 | } | |
12 | ||
13 | //Do we have an MC handler? | |
14 | Bool_t hasMC=(mgr->GetMCtruthEventHandler()!=0x0); | |
15 | ||
0a58cbb5 | 16 | TString configFile("$ALICE_ROOT/PWGDQ/dielectron/macrosLMEE/ConfigCCbar_mk_pp.C"); |
0d57c290 | 17 | if (hasMC) configFile="$ALICE_ROOT/PWGDQ/dielectron/macros/ConfigJpsi2eeEff.C";//check later |
18 | Bool_t isAOD=mgr->GetInputEventHandler()->IsA()==AliAODInputHandler::Class(); | |
19 | ||
20 | //create task and add it to the manager | |
21 | AliAnalysisTaskMultiDielectron *task=new AliAnalysisTaskMultiDielectron("MultiDie"); | |
22 | mgr->AddTask(task); | |
23 | ||
24 | //load dielectron configuration file | |
25 | TString checkconfig="ConfigCCbar_mk_pp"; | |
26 | if (!gROOT->GetListOfGlobalFunctions()->FindObject(checkconfig.Data())) | |
27 | gROOT->LoadMacro(configFile.Data()); | |
28 | ||
29 | //add dielectron analysis with different cuts to the task | |
30 | for (Int_t i=0; i<nDie; ++i){ //nDie defined in config file | |
31 | AliDielectron *jpsi=ConfigCCbar_mk_pp(i,isAOD); | |
32 | if (isAOD) jpsi->SetHasMC(hasMC_aod); | |
33 | if (jpsi) task->AddDielectron(jpsi); | |
34 | } | |
35 | ||
36 | //Add event filter | |
37 | AliDielectronEventCuts *eventCuts=new AliDielectronEventCuts("eventCuts","Vertex Track && |vtxZ|<10 && ncontrib>0"); | |
38 | if(isAOD) eventCuts->SetVertexType(AliDielectronEventCuts::kVtxAny); | |
39 | eventCuts->SetRequireVertex(); | |
40 | eventCuts->SetMinVtxContributors(1); | |
41 | eventCuts->SetVertexZ(-10.,10.); | |
42 | task->SetEventFilter(eventCuts); | |
43 | ||
44 | // pileup rejection | |
45 | // task->SetRejectPileup(); | |
46 | task->SetTriggerMask(AliVEvent::kEMC7); | |
47 | task->UsePhysicsSelection(); | |
48 | //---------------------- | |
49 | //create data containers | |
50 | //---------------------- | |
51 | ||
52 | ||
53 | //create output container | |
54 | ||
55 | AliAnalysisDataContainer *cOutputHist1 = | |
56 | mgr->CreateContainer("mkoehler_pp_QA", TList::Class(), AliAnalysisManager::kOutputContainer, | |
57 | "LMEEoutput.root"); | |
58 | ||
59 | AliAnalysisDataContainer *cOutputHist2 = | |
60 | mgr->CreateContainer("mkoehler_pp_CF", TList::Class(), AliAnalysisManager::kOutputContainer, | |
61 | "LMEEoutput.root"); | |
62 | ||
63 | AliAnalysisDataContainer *cOutputHist3 = | |
64 | mgr->CreateContainer("mkoehler_pp_EventStat", TH1D::Class(), AliAnalysisManager::kOutputContainer, | |
65 | "LMEEoutput.root"); | |
66 | ||
67 | mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer()); | |
68 | mgr->ConnectOutput(task, 1, cOutputHist1); | |
69 | mgr->ConnectOutput(task, 2, cOutputHist2); | |
70 | mgr->ConnectOutput(task, 3, cOutputHist3); | |
71 | ||
72 | return task; | |
73 | } |