]>
Commit | Line | Data |
---|---|---|
1 | AliAnalysisTask *AddTask_ConversionAODProduction(Int_t dataset=0, Bool_t isMC = kFALSE){ | |
2 | ||
3 | // Before doing anything, we load the needed library | |
4 | gSystem->Load("libPWGGAGammaConv.so"); | |
5 | // dataset 0: pp | |
6 | // dataset 1: PbPb | |
7 | // dataset 2: pPb | |
8 | ||
9 | //get the current analysis manager | |
10 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
11 | if (!mgr) { | |
12 | Error("AddTask_V0ReaderV1", "No analysis manager found."); | |
13 | return 0; | |
14 | } | |
15 | ||
16 | //========= Add PID Reponse to ANALYSIS manager ==== | |
17 | if(!(AliPIDResponse*)mgr->GetTask("PIDResponseTask")){ | |
18 | gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPIDResponse.C"); | |
19 | AddTaskPIDResponse(isMC); | |
20 | } | |
21 | ||
22 | TString analysiscut; | |
23 | TString analysiscutB; | |
24 | ||
25 | if(dataset == 1){ | |
26 | // Old cut string, no longer compatible with AliConversionCuts | |
27 | // analysiscut="900177009350113211200001000000000"; | |
28 | // New cut string as of April 2013 | |
29 | analysiscut= "1000000060084000001500000"; | |
30 | analysiscutB="1000000160084000001500000"; | |
31 | } else if (dataset == 2){ | |
32 | analysiscut= "8000000060084000001500000"; | |
33 | analysiscutB="8000000160084000001500000"; | |
34 | } else{ | |
35 | // analysiscut=" | |
36 | analysiscut ="0000000060084001001500000"; | |
37 | analysiscutB="0000000160084001001500000"; | |
38 | } | |
39 | ||
40 | //========= Add V0 Reader to ANALYSIS manager ===== | |
41 | ||
42 | AliV0ReaderV1 *fV0Reader=new AliV0ReaderV1("ConvGammaAODProduction"); | |
43 | fV0Reader->SetCreateAODs(kTRUE); | |
44 | fV0Reader->SetUseOwnXYZCalculation(kTRUE); | |
45 | fV0Reader->SetUseAODConversionPhoton(kTRUE); | |
46 | // fV0Reader->CheckAODConsistency(); | |
47 | ||
48 | AliV0ReaderV1 *fV0ReaderB=new AliV0ReaderV1("ConvGammaAODProductionB"); | |
49 | fV0ReaderB->SetCreateAODs(kTRUE); | |
50 | fV0ReaderB->SetUseOwnXYZCalculation(kTRUE); | |
51 | fV0ReaderB->SetUseAODConversionPhoton(kTRUE); | |
52 | fV0ReaderB->CheckAODConsistency(); | |
53 | ||
54 | // Set AnalysisCut Number | |
55 | AliConversionCuts *fCuts= new AliConversionCuts(analysiscut.Data(),analysiscut.Data()); | |
56 | AliConversionCuts *fCutsB= new AliConversionCuts(analysiscutB.Data(),analysiscutB.Data()); | |
57 | if(fCuts->InitializeCutsFromCutString(analysiscut.Data())){ | |
58 | fV0Reader->SetConversionCuts(fCuts); | |
59 | } | |
60 | fV0Reader->Init(); | |
61 | ||
62 | if(fCutsB->InitializeCutsFromCutString(analysiscutB.Data())){ | |
63 | fV0ReaderB->SetConversionCuts(fCutsB); | |
64 | } | |
65 | fV0ReaderB->Init(); | |
66 | ||
67 | ||
68 | AliLog::SetGlobalLogLevel(AliLog::kInfo); | |
69 | ||
70 | //================================================ | |
71 | // data containers | |
72 | //================================================ | |
73 | // find input container | |
74 | //below the trunk version | |
75 | AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer(); | |
76 | ||
77 | // connect input V0Reader | |
78 | fV0Reader->SelectCollisionCandidates(AliVEvent::kAny); | |
79 | mgr->AddTask(fV0Reader); | |
80 | mgr->ConnectInput (fV0Reader,0,cinput); | |
81 | ||
82 | fV0ReaderB->SelectCollisionCandidates(AliVEvent::kAny); | |
83 | mgr->AddTask(fV0ReaderB); | |
84 | mgr->ConnectInput (fV0ReaderB,0,cinput); | |
85 | ||
86 | return fV0Reader; | |
87 | } |