.so cleanup: removed from gSystem->Load()
[u/mrichter/AliRoot.git] / PWGGA / GammaConv / macros / AddTask_ConversionAODProduction.C
CommitLineData
ae947965 1AliAnalysisTask *AddTask_ConversionAODProduction(Int_t dataset=0, Bool_t isMC = kFALSE){
d30a006f 2
d9e819f6 3 // Before doing anything, we load the needed library
4070f709 4 gSystem->Load("libPWGGAGammaConv");
72cfe7c8 5 // dataset 0: pp
6 // dataset 1: PbPb
7 // dataset 2: pPb
d30a006f 8
72cfe7c8 9 //get the current analysis manager
10 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
11 if (!mgr) {
d9e819f6 12 Error("AddTask_V0ReaderV1", "No analysis manager found.");
13 return 0;
72cfe7c8 14 }
d30a006f 15
72cfe7c8 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 analysiscutEvent;
24 TString analysiscutB;
d30a006f 25
72cfe7c8 26 if(dataset == 1){
72cfe7c8 27 analysiscutEvent = "1000000";
3013611f 28 analysiscut= "060000084000001500000000";
29 analysiscutB="160000084000001500000000";
72cfe7c8 30 } else if (dataset == 2){
31 analysiscutEvent = "8000000";
3013611f 32 analysiscut= "060000084000001500000000";
33 analysiscutB="160000084000001500000000";
72cfe7c8 34 } else{
72cfe7c8 35 analysiscutEvent = "0000000";
3013611f 36 analysiscut ="060000084001001500000000";
37 analysiscutB="160000084001001500000000";
72cfe7c8 38 }
d30a006f 39
72cfe7c8 40 //========= Add V0 Reader to ANALYSIS manager =====
d30a006f 41
72cfe7c8 42 AliV0ReaderV1 *fV0Reader=new AliV0ReaderV1("ConvGammaAODProduction");
43 fV0Reader->SetCreateAODs(kTRUE);
44 fV0Reader->SetUseOwnXYZCalculation(kTRUE);
45 fV0Reader->SetUseAODConversionPhoton(kTRUE);
701932b8 46// fV0Reader->CheckAODConsistency();
ae947965 47
72cfe7c8 48 AliV0ReaderV1 *fV0ReaderB=new AliV0ReaderV1("ConvGammaAODProductionB");
49 fV0ReaderB->SetCreateAODs(kTRUE);
50 fV0ReaderB->SetUseOwnXYZCalculation(kTRUE);
51 fV0ReaderB->SetUseAODConversionPhoton(kTRUE);
7b0e6b5d 52// fV0ReaderB->CheckAODConsistency();
ae947965 53
d9e819f6 54 AliConvEventCuts *fEventCutsA=NULL;
55 AliConvEventCuts *fEventCutsB=NULL;
72cfe7c8 56 if(analysiscutEvent!=""){
d9e819f6 57 fEventCutsA= new AliConvEventCuts(analysiscutEvent.Data(),analysiscutEvent.Data());
58 fEventCutsA->SetPreSelectionCutFlag(kTRUE);
59 fEventCutsA->SetV0ReaderName("ConvGammaAODProduction");
60 if(fEventCutsA->InitializeCutsFromCutString(analysiscutEvent.Data())){
61 fV0Reader->SetEventCuts(fEventCutsA);
62 }
63 fEventCutsB= new AliConvEventCuts(analysiscutEvent.Data(),analysiscutEvent.Data());
64 fEventCutsB->SetPreSelectionCutFlag(kTRUE);
65 fEventCutsB->SetV0ReaderName("ConvGammaAODProductionB");
66 if(fEventCutsB->InitializeCutsFromCutString(analysiscutEvent.Data())){
67 fV0ReaderB->SetEventCuts(fEventCutsB);
72cfe7c8 68 }
69 }
70
71 // Set AnalysisCut Number
72 AliConversionPhotonCuts *fCuts= new AliConversionPhotonCuts(analysiscut.Data(),analysiscut.Data());
73 AliConversionPhotonCuts *fCutsB= new AliConversionPhotonCuts(analysiscutB.Data(),analysiscutB.Data());
74 if(fCuts->InitializeCutsFromCutString(analysiscut.Data())){
75 fCuts->SetIsHeavyIon(dataset);
76 fV0Reader->SetConversionCuts(fCuts);
77 }
78
79 fV0Reader->Init();
d30a006f 80
72cfe7c8 81 if(fCutsB->InitializeCutsFromCutString(analysiscutB.Data())){
82 fCutsB->SetIsHeavyIon(dataset);
83 fV0ReaderB->SetConversionCuts(fCutsB);
84 }
85 fV0ReaderB->Init();
ae947965 86
72cfe7c8 87 AliLog::SetGlobalLogLevel(AliLog::kInfo);
d30a006f 88
72cfe7c8 89 //================================================
90 // data containers
91 //================================================
92 // find input container
93 //below the trunk version
94 AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer();
d30a006f 95
72cfe7c8 96 // connect input V0Reader
72cfe7c8 97 mgr->AddTask(fV0Reader);
98 mgr->ConnectInput (fV0Reader,0,cinput);
d30a006f 99
72cfe7c8 100 mgr->AddTask(fV0ReaderB);
101 mgr->ConnectInput (fV0ReaderB,0,cinput);
ae947965 102
72cfe7c8 103 return fV0Reader;
d30a006f 104}