hooks for PMD flow analysis
[u/mrichter/AliRoot.git] / PWG2 / FLOW / macros / AddTaskPIDflowQA.C
1 void AddTaskPIDflowQA( Float_t centrMin=0.,
2                        Float_t centrMax=100.,
3                        TString fileNameBase="outputPIDQA"  )
4 {   
5   AliFlowEventCuts* cutsEvent = new AliFlowEventCuts("event cuts");
6   cutsEvent->SetCentralityPercentileRange(centrMin,centrMax);
7   cutsEvent->SetCentralityPercentileMethod(AliFlowEventCuts::kV0);
8   //cutsEvent->SetRefMultMethod(AliFlowEventCuts::kTPConly);
9   //cutsEvent->SetCentralityPercentileMethod(AliFlowEventCuts::kSPD1tracklets);
10   cutsEvent->SetNContributorsRange(2);
11   cutsEvent->SetPrimaryVertexZrange(-10.,10.);
12   cutsEvent->SetCutSPDvertexerAnomaly(); //"Francesco's cut"
13   cutsEvent->SetCutZDCtiming();
14   
15         AliESDtrackCuts*  cutsTrack = new AliESDtrackCuts("cutsTrack","cutsTrack");
16         cutsTrack->SetPtRange(0.2,5.);
17         cutsTrack->SetEtaRange(-0.8,0.8);
18         cutsTrack->SetMinNClustersTPC(70);
19         cutsTrack->SetMaxChi2PerClusterTPC(4.0);
20         cutsTrack->SetMaxDCAToVertexXY(0.3);
21         cutsTrack->SetMaxDCAToVertexZ(0.3);
22         cutsTrack->SetDCAToVertex2D(kTRUE);
23         cutsTrack->SetAcceptKinkDaughters(kFALSE);
24         cutsTrack->SetRequireTPCRefit(kTRUE);
25         cutsTrack->SetRequireITSRefit(kTRUE);
26         cutsTrack->SetMinNClustersITS(2);
27         
28         //task1->SetNsigmaDCAcut(5.0,5.0);
29         //task1->SetMCOn();     
30
31   TString centralityName("");
32   centralityName+=Form("%.0f",centrMin);
33   centralityName+="-";
34   centralityName+=Form("%.0f",centrMax);
35
36   TString fileName(fileNameBase);
37   fileName.Append(Form("%.0f%.0f",centrMin,centrMax));
38   fileName.Append(".root");
39
40   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
41   if (!mgr) {
42     Error("AddTaskFlowEvent", "No analysis manager to connect to.");
43     return;
44   }
45   
46   if (!mgr->GetInputEventHandler()) {
47     ::Error("AddTaskFlowEvent", "This task requires an input event handler");
48     return;
49   }  
50
51   AliAnalysisTaskPIDflowQA* task = new AliAnalysisTaskPIDflowQA(Form("taskPIDQA%.0f%.0f",centrMin,centrMax));
52         task->SetAliESDtrackCuts(cutsTrack);
53   task->SetEventCuts(cutsEvent);
54   task->SelectCollisionCandidates(AliVEvent::kMB);
55   //old
56   task->GetESDpid()->GetTPCResponse().SetBetheBlochParameters(0.0283086,
57                                                     2.63394e+01,
58                                                     5.04114e-11,
59                                                     2.12543e+00,
60                                                     4.88663e+00 );
61   //new
62   //task->GetESDpid()->GetTPCResponse().SetBetheBlochParameters(1.28949/50.,
63   //                                                  2.74095e+01,
64   //                                                  TMath::Exp(-3.21763e+01),
65   //                                                  2.44026,
66   //                                                  6.58800);
67
68
69   mgr->AddTask(task);
70
71   AliAnalysisDataContainer* coutputQAtask = mgr->CreateContainer(Form("output%s",centralityName.Data()),
72                                                  TList::Class(),
73                                                  AliAnalysisManager::kOutputContainer,
74                                                  fileName.Data());
75   mgr->ConnectInput(task,0,mgr->GetCommonInputContainer());
76   mgr->ConnectOutput(task,1,coutputQAtask);
77 }