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