end-of-line normalization
[u/mrichter/AliRoot.git] / PWGCF / EBYE / PIDFluctuation / macros / AddAliEbyEParticleRatioFluctuationTask.C
CommitLineData
a65a7e70 1//=========================================================================//
2// //
3// Analysis AddTask for Particle Ratio Fluctuation Study //
4// Author: Deepika Rathee || Satyajit Jenara //
5// drathee@cern.ch || sjena@cern.ch //
6// Fri Apr 11 13:31:07 CEST 2013
7// //
8//=========================================================================//
9
10void AddAliEbyEParticleRatioFluctuationTask(Double_t vz=10,Double_t ptl=0.5, Double_t pth=5, Int_t AODfilterBit = 768, Int_t pidtype = 2, Int_t requestTofPid = 1, Double_t nSigmaCut = 3., Int_t ikey = 0, TString analdata = "AOD", TString analtype = "PbPb", TString centralityEstimator = "V0M", TString ctaskname = "2011") {
11
12 Double_t vx = 3.; Double_t vy = 3.;
13
14 TString taskname = "EbyECF_";
15 taskname += ctaskname;
16 taskname += "_";
17 taskname += analdata;
18 taskname += "_";
19 taskname += analtype;
20 taskname += "_";
21 taskname += centralityEstimator;
22 taskname += "_";
23 taskname += Form("%d",AODfilterBit);
24 taskname += "_";
25 taskname += Form("PT_%.1f_%.1f", ptl, pth);
26 taskname += "_";
27
28 Bool_t isMC = 0;
29 if(analdata == "AODMC" || analdata == "MC")
30 isMC = 1;
31
32 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
33 if (!mgr) {
34 ::Error("AddTaskFluctuations", "No analysis manager to connect to.");
35 return NULL;
36 }
37
38 if (!mgr->GetInputEventHandler()) {
39 ::Error("AddTaskFluctuations", "This task requires an input event handler");
40 return NULL;
41 }
42 TString type = mgr->GetInputEventHandler()->GetDataType();
43
44
45 TString basefilename = AliAnalysisManager::GetCommonFileName();
46
47
48 AliHelperPID* help = new AliHelperPID();
49 help->SetNSigmaCut(nSigmaCut);
50 help->SetPIDType(pidtype);
51 help->SetfRequestTOFPID(requestTofPid);
52 help->SetfPtTOFPID(ptl);
53 help->SetisMC(isMC);
54
55 if(ikey == 0 ) {
56 AliEbyEParticleRatioFluctuationTask *task[8];
57 AliAnalysisDataContainer *cout[8];
58 for(Int_t i = 0; i < 8 ; i ++) {
59 Double_t eta = 0.1 + 0.1*i;
60 TString taskname1 = taskname;
61 taskname1 += Form("ETA_%.2f",eta);
62 task[i] = new AliEbyEParticleRatioFluctuationTask(taskname1.Data());
63 task[i]->SetVertexDiamond(vx,vy,vz);
64 task[i]->SetAODtrackCutBit(AODfilterBit);
65 task[i]->SetKinematicsCuts(ptl,pth,eta);
66 task[i]->SetHelperPID(help);
67 mgr->AddTask(task[i]);
68
69 cout[i] = mgr->CreateContainer(Form("%s",taskname1.Data()),TList::Class(),
70 AliAnalysisManager::kOutputContainer,
71 Form("%s:CFEbyE_PR",basefilename.Data()));
72 mgr->ConnectInput(task[i], 0, mgr->GetCommonInputContainer());
73 mgr->ConnectOutput(task[i], 1, cout[i]);
74
75 }
76
77 AliEbyEParticleRatioFluctuationTask *taskqa;
78 taskqa = new AliEbyEParticleRatioFluctuationTask("QACFEbyEPR");
79 // taskqa->SetPIDMethod(1);
80 taskqa->RunQA();
81 // taskqa->Debug();
82 taskqa->SetVertexDiamond(vx,vy,vz);
83 taskqa->SetAODtrackCutBit(AODfilterBit);
84 taskqa->SetKinematicsCuts(ptl,pth,0.8);
85 taskqa->SetHelperPID(help);
86 mgr->AddTask(taskqa);
87
88 AliAnalysisDataContainer *coutqa
89 = mgr->CreateContainer(Form("QA_%s",taskname1.Data()),TList::Class(),
90 AliAnalysisManager::kOutputContainer,
91 Form("%s:CFEbyE_PR",basefilename.Data()));
92 mgr->ConnectInput(taskqa, 0, mgr->GetCommonInputContainer());
93 mgr->ConnectOutput(taskqa, 1, coutqa);
94 }
95 else if(ikey > 0 && ikey < 9) {
96 Double_t eta = 0.1*ikey;
97 TString taskname1 = taskname;
98 taskname1 += Form("ETA_%.2f",eta);
99 AliEbyEParticleRatioFluctuationTask *task1
100 = new AliEbyEParticleRatioFluctuationTask(taskname1.Data());
101 task1->SetVertexDiamond(vx,vy,vz);
102 task1->SetAODtrackCutBit(AODfilterBit);
103 task1->SetKinematicsCuts(ptl,pth,eta);
104 task1->SetHelperPID(help);
105 mgr->AddTask(task1);
106
107 AliAnalysisDataContainer *cout1
108 = mgr->CreateContainer(Form("%s",taskname1.Data()),TList::Class(),
109 AliAnalysisManager::kOutputContainer,
110 Form("%s:CFEbyE_PR",basefilename.Data()));
111 mgr->ConnectInput(task1, 0, mgr->GetCommonInputContainer());
112 mgr->ConnectOutput(task1, 1, cout1);
113
114
115 AliEbyEParticleRatioFluctuationTask *taskqa1;
116 taskqa1 = new AliEbyEParticleRatioFluctuationTask("QACFEbyEPR");
117 taskqa1->RunQA();
118 taskqa1->SetVertexDiamond(vx,vy,vz);
119 taskqa1->SetAODtrackCutBit(AODfilterBit);
120 taskqa1->SetKinematicsCuts(ptl,pth,eta);
121 taskqa1->SetHelperPID(help);
122 mgr->AddTask(taskqa1);
123
124 AliAnalysisDataContainer *coutqa1
125 = mgr->CreateContainer(Form("QA_%s",taskname1.Data()),TList::Class(),
126 AliAnalysisManager::kOutputContainer,
127 Form("%s:CFEbyE_PR",basefilename.Data()));
128 mgr->ConnectInput(taskqa1, 0, mgr->GetCommonInputContainer());
129 mgr->ConnectOutput(taskqa1, 1, coutqa1);
130
131 } else return;
132
133 return;
134}