]>
Commit | Line | Data |
---|---|---|
5842a526 | 1 | AliAnalysisTaskV0ForRAA *AddTaskV0ForRAA(Bool_t anaPP=kFALSE, Bool_t wSDD=kFALSE,Int_t cent=0,Int_t centDet=1,Int_t centRange=0, Bool_t mcMode=kFALSE, Bool_t mcTruthMode=kFALSE,Bool_t usePID=kFALSE,Double_t radCut=0.0,const Char_t * addname=""){ |
1c835fdc | 2 | |
3 | ||
4 | ||
5 | //--- get the current analysis manager ---// | |
6 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
7 | if (!mgr) { | |
8 | Error("AddTask_V0ForRAA", "No analysis manager found."); | |
9 | return 0; | |
10 | } | |
11 | ||
12 | ||
13 | // -- check for ESD and MC ---// | |
14 | Bool_t hasESD=kFALSE,hasMC=kFALSE; | |
15 | AliESDInputHandler *esdH = | |
16 | static_cast<AliESDInputHandler*>(mgr->GetInputEventHandler()); | |
17 | if (esdH) hasESD=kTRUE; | |
18 | cout<<"ESD: "<<hasESD<<endl; | |
19 | if(!hasESD) return NULL; | |
20 | ||
21 | if(mcMode || mcTruthMode){ | |
22 | AliMCEventHandler *mcH = dynamic_cast<AliMCEventHandler*> | |
23 | (AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler()); | |
24 | if (mcH) hasMC=kTRUE; | |
25 | cout<<"MC: "<<hasMC<<endl; | |
26 | if(!hasMC) return NULL; | |
27 | } | |
28 | ||
1c835fdc | 29 | |
30 | //========= Add task to the ANALYSIS manager ===== | |
31 | TString cutsname = "AliESDtrackCutsV0ForRAA"; | |
32 | TString taskname = "V0ForRAA"; | |
33 | TString outname = "V0ForRAA"; | |
34 | ||
35 | if(mcMode) { | |
36 | cutsname +="_MCreco"; | |
37 | taskname +="_MCreco"; | |
38 | outname +="_MCreco"; | |
39 | } | |
40 | if(mcTruthMode){ | |
41 | cutsname +="_MCTruth"; | |
42 | taskname +="_MCTruth"; | |
43 | outname +="_MCTruth"; | |
44 | } | |
45 | if(anaPP) { | |
46 | cutsname += "_pp"; | |
47 | taskname += "_pp"; | |
48 | outname += "_pp"; | |
49 | } | |
50 | else { | |
51 | cutsname +="_cent"; | |
52 | cutsname += cent; | |
53 | ||
54 | taskname +="_cent"; | |
55 | taskname += cent; | |
56 | ||
57 | outname +="_cent"; | |
58 | outname += cent; | |
59 | } | |
60 | ||
0afca428 | 61 | cutsname += addname; |
62 | taskname += addname; | |
63 | outname += addname; | |
0ee65027 | 64 | |
1c835fdc | 65 | |
66 | AliAnalysisTaskV0ForRAA *task = new AliAnalysisTaskV0ForRAA(taskname); | |
67 | ||
aa3d4e29 | 68 | Double_t minPt=0.0; |
7e69aeda | 69 | //task->SetESDTrackCuts(70,4,kTRUE); |
70 | //task->SetESDTrackCutsCharged(70,4,kTRUE); | |
71 | //task->SetESDTrackCutsLowPt(70,4,kTRUE); | |
11e769d9 | 72 | |
aa3d4e29 | 73 | |
74 | //Add cuts to task | |
11e769d9 | 75 | |
1c835fdc | 76 | |
77 | //--- analysis modes ---// | |
78 | task->SetAnapp(anaPP); | |
79 | task->SetMCMode(mcMode); | |
80 | task->SetMCTruthMode(mcTruthMode); | |
5842a526 | 81 | task->SelectWithSDD(wSDD); |
aa3d4e29 | 82 | //---------- cuts -------------// |
83 | //general cuts | |
8894eb3b | 84 | // task->SetUseOnthefly(kTRUE); |
aa3d4e29 | 85 | task->SetUsePID(usePID,3.0,100.0); |
1c835fdc | 86 | task->SetPrimVertexZCut(10.0,kTRUE); |
aa3d4e29 | 87 | |
88 | //rapidity | |
0afca428 | 89 | task->SetRapidityCutMother(kTRUE,0.5); |
7e69aeda | 90 | //task->SetDoEtaOfMCDaughtersCut(kFALSE,0.8); |
1c835fdc | 91 | |
aa3d4e29 | 92 | //TPC cuts |
9b677fa0 | 93 | // task->SetCutMoreNclsThanRows(kTRUE); |
94 | // task->SetCutMoreNclsThanFindable(kTRUE); | |
aa3d4e29 | 95 | task->SetLowPtTPCCutAliESDTrackCut(-1.0); |
9b677fa0 | 96 | // task->SetRatioFoundOverFindable(0.5); |
aa3d4e29 | 97 | |
98 | //V0 specific cuts | |
9b677fa0 | 99 | //task->SetCosOfPointingAngleK(0.99,1000.0); |
100 | //task->SetCosOfPointingAngleL(0.998,1000.0); | |
aa3d4e29 | 101 | |
aa3d4e29 | 102 | |
9b677fa0 | 103 | //task->SetArmenterosCutQt(-1.0,6.0,kTRUE,kFALSE); |
aa3d4e29 | 104 | |
9b677fa0 | 105 | //task->SetDCAV0ToVertexK0(0.4); |
106 | //task->SetDCAV0ToVertexL(1.2); | |
aa3d4e29 | 107 | |
9b677fa0 | 108 | //task->SetDCADaughtersK0(0.23); |
109 | //task->SetDCADaughtersL(0.35); | |
110 | //task->SetDCADaughtersAL(0.35); | |
aa3d4e29 | 111 | |
5842a526 | 112 | task->SetDecayRadiusXYMinMax(radCut,1000.0); |
aa3d4e29 | 113 | |
114 | ||
1c835fdc | 115 | //--- centrality ---// |
aa3d4e29 | 116 | task->SetUseCentrality(centDet); // 0=off, 1=VZERO, 2=SPD |
117 | task->SetUseCentralityBin(cent); // bin to be used 0,5,10,20,30,40,50,60,70,80,90,(100=SPDonly) | |
9b677fa0 | 118 | task->SetUseCentralityRange(centRange); // Add centrality bin for increasing original bin range. |
119 | // For cent 60-80%: cent = 60 and centRange = 10 | |
1c835fdc | 120 | |
9b677fa0 | 121 | task->SelectCollisionCandidates(AliVEvent::kMB | AliVEvent::kCentral | AliVEvent::kSemiCentral ); |
1c835fdc | 122 | |
123 | mgr->AddTask(task); | |
124 | ||
125 | ||
126 | //================================================ | |
127 | // data containers | |
128 | //================================================ | |
129 | // find input container | |
130 | ||
131 | AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer(); | |
132 | ||
133 | AliAnalysisDataContainer *coutput1 = | |
0ee65027 | 134 | mgr->CreateContainer(outname, TList::Class(), |
c475916a | 135 | AliAnalysisManager::kOutputContainer,Form("%s:simones", AliAnalysisManager::GetCommonFileName())); |
1c835fdc | 136 | |
137 | //--- connect containers ---// | |
138 | mgr->ConnectInput (task, 0, cinput ); | |
139 | mgr->ConnectOutput (task, 1, coutput1); | |
140 | ||
6cdc2a74 | 141 | AliLog::SetClassDebugLevel("AliAnalysisTaskV0ForRAA",2); |
142 | ||
1c835fdc | 143 | return task; |
144 | } |