Attempt to monitor what file is read and merged by what job
[u/mrichter/AliRoot.git] / PWGCF / Correlations / macros / 3particlecorrelations / AddTask_DiHadron.C
CommitLineData
6935079d 1//#include "exception.h"\r
2//For running on PbPb data 0-50% most central\r
3AliAnalysisTask *AddTask_DiHadron(Int_t IncludeLowPtBins=0){\r
4\r
5 //get the current analysis manager\r
6 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();\r
7 if (!mgr) {\r
8 Error("AddTask_sma_PriVtx", "No analysis manager found.");\r
9 return 0;\r
10 }\r
11\r
12 \r
13 //========= SetInitial Parameters =====\r
14 //Int_t IncludeLowPtBins=0;//Set to 1 to include low pt triggers\r
15\r
16 //Track Quality Cuts\r
17 Int_t MinimumClustersTPC=70;\r
18 Float_t MinClusterRatio=0.51;//Must have at least this ratio not shared\r
19 Float_t MaxTPCchi2=4;\r
20 Int_t MinimumClustersITS=0;\r
21 Float_t EtaCut=0.9;//Tracks in +/- Eta are used\r
22 Float_t TriggerEtaCut=0.5;//Trigger particle restriction so flat area in acceptanc can be created\r
23 Float_t NearPhiCut=1.5;//Cut used to seperate near and away side for delta eta plots\r
24 Float_t XECut=NearPhiCut;//For XE distribution near and away seperation\r
25 Float_t MaxDCA=3;//Total DCA Cut\r
26 Float_t MaxDCAXY=2.4;\r
27 Float_t MaxDCAZ=3.2;\r
28 Int_t DCAMethod=1;//0 MaxDCA used, 1 MaxDCAXY and MaxDCAZ used 2 pT dependent DCA cut\r
29 Int_t TPCRefit=1;\r
30 Int_t ITSRefit=0;//1 for all particles, 2 for particles above 5 GeV/c\r
31 Int_t SPDCut=0;//check for a point in 1 of first 2 layers of the its\r
32 Float_t MinimumPt=0.25;//Minimum Pt considered by the code\r
33 Float_t MaximumPt=50;\r
34 Float_t ZVertexCut=10;//in cm\r
35\r
36 //Options\r
37 Int_t RunOnAOD=1;\r
38 Int_t EfficiencyCorrection=1;//do efficiency corrections in this code\r
39 Int_t MakeMCHistos=0;//if 0 MC histograms are not made (will be empty if 1 and ran on real data)\r
40 Int_t DEBUG=0;//for debugging\r
41 \r
42 \r
43 \r
44 //Binning\r
45 Int_t nBinPhi=60;//Number of bins for #Delta#phi histograms\r
46 Int_t nBinEta=54;//Number of bins for #Delta#eta histograms\r
47 Int_t nBinsPhiEtaPhi=20;//Number of bins for #Delta#phi-#Delta#eta in #Delta#phi\r
48 Int_t nBinsPhiEtaEta=18;//Number of bins for #Delta#phi-#Delta#eta in #Delta#phi\r
49 Int_t nBinsPhiPhi=30;//Number of bins for #Delta#phi-#Delta#phi\r
50 Int_t nBinsEtaEta=27;//Number of bins for #Delta#eta-#Delta#eta \r
51 const Float_t fPi=3.1415926535898;\r
52 Float_t PhiPlotMin=-fPi/3;//Min bin edge in #Delta#phi\r
53 Float_t PhiPlotMax=2*fPi+PhiPlotMin;//Max bin edge\r
54 \r
55 //Size of some arrays change array contents below\r
56 const Int_t NTriggerPtBins2=11;//max20\r
57 const Int_t NTriggerPtBins1=8;//max=20\r
58 Int_t NTriggerPtBins=NTriggerPtBins1;\r
59 if(IncludeLowPtBins)NTriggerPtBins=NTriggerPtBins2;\r
60 const Int_t NEventsToMix=10;//max=100\r
61 const Int_t NCentralityBins=7;//max=10 //6\r
62 const Int_t PercentageCentralityBins=1;//0 or 1\r
63 const Int_t NAssociatedPtBins=25;//max=50\r
64 const Int_t N3ParticleAssociatedPtBins=4;//max=50\r
65 const Int_t NZVertexBinsForMixing=1;//max=20\r
66 const Int_t NXEBins=1;//max=20\r
67 const Int_t NumberOfTriggerIDs=1;\r
68 Float_t EffFitPtCut=3;\r
69\r
70 TF1 *EfficiencyFitLow=new TF1("EfficiencyFitLow","[0]/[1]*exp(-0.5*pow(x/[1],2))+[2]+[3]*x+[4]*x**2+[5]*x**3",MinimumPt,EffFitPtCut);\r
71 TF1 *EfficiencyFitHigh=new TF1("EfficiencyFitHigh","[0]+[1]*(x-3)",EffFitPtCut,MaximumPt);\r
72 const Int_t NParamFitLow=6;\r
73 const Int_t NParamFitHigh=2;\r
74 \r
75 //Not high enough occupancy to worry about the centrality in pp\r
76 //For overlapping centrality bins efficiencies from first bin are used\r
77 //For 1% bins from pass2 \r
78Float_t FitLowParam[NCentralityBins*NParamFitLow]={\r
79 -0.0227546, 0.21379, 0.916013, 0.0586031, -0.0429047, 0.0064962,\r
80 -0.0224257, 0.215105, 0.916696, 0.0593096, -0.0429726, 0.00650312,\r
81 -0.0220935, 0.208194, 0.915207, 0.0613371, -0.0416018, 0.00576639,\r
82 -0.0229694, 0.208645, 0.919995, 0.0527738, -0.0344433, 0.00430404,\r
83 -0.0235676, 0.206099, 0.922875, 0.0476261, -0.0298983, 0.0032692,\r
84 -0.0238139, 0.206366, 0.925183, 0.0430703, -0.0264516, 0.00250388,\r
85 -0.024815, 0.204409, 0.928448, 0.03423, -0.019894, 0.00121746\r
86};\r
87 Float_t FitHighParam[NCentralityBins*NParamFitHigh]={\r
88 0.881078, 0.00158217,\r
89 0.883456, 0.00144851,\r
90 0.880495, 0.00369636,\r
91 0.884535, 0.00297087,\r
92 0.884937, 0.00166201,\r
93 0.883934, 0.00290625,\r
94 0.884964, -0.000784607\r
95 };\r
96 \r
97 Float_t V2FitPtCut=2.75;\r
98 Float_t V3FitPtCut=2.75;\r
99 Float_t V4FitPtCut=2.75;\r
100 TF1 *V2FitLow=new TF1("V2FitLow","[0]*(x+[1]*x**2+[2]*x**3+[3]*x**4)",MinimumPt,V2FitPtCut);\r
101 TF1 *V2FitHigh=new TF1("V2FitHigh","[0]*exp(-0.5*((x-[1])/[2])**2)+[3]",V2FitPtCut,MaximumPt);\r
102 TF1 *V3FitLow=new TF1("V3FitLow","[0]*(x+[1]*x**2+[2]*x**3+[3]*x**4)",MinimumPt,V2FitPtCut);\r
103 TF1 *V3FitHigh=new TF1("V3FitHigh","[0]*exp(-0.5*((x-[1])/[2])**2)+[3]",V2FitPtCut,MaximumPt);\r
104 TF1 *V4FitLow=new TF1("V4FitLow","[0]*(x+[1]*x**2+[2]*x**3+[3]*x**4)",MinimumPt,V2FitPtCut);\r
105 TF1 *V4FitHigh=new TF1("V4FitHigh","[0]*exp(-0.5*((x-[1])/[2])**2)+[3]",V2FitPtCut,MaximumPt);\r
106\r
107 const Int_t NParamV2FitLow=4;\r
108 const Int_t NParamV2FitHigh=4;\r
109 const Int_t NParamV3FitLow=4;\r
110 const Int_t NParamV3FitHigh=4;\r
111 const Int_t NParamV4FitLow=4;\r
112 const Int_t NParamV4FitHigh=4;\r
113\r
114 //From FlowScale2 macro\r
115Float_t FitLowParamV2[NCentralityBins*NParamV2FitLow]={\r
1160.046931, -0.504895, 0.186345, -0.030504,\r
1170.060953, -0.503882, 0.197361, -0.030849,\r
1180.088939, -0.396433, 0.127467, -0.016969,\r
1190.122602, -0.347615, 0.098626, -0.012576,\r
1200.155403, -0.296297, 0.065681, -0.007492,\r
1210.177546, -0.271958, 0.049388, -0.005644,\r
1220.187634, -0.223967, 0.011281, 0.001462};\r
123Float_t FitHighParamV2[NCentralityBins*NParamV2FitHigh]={\r
1240.000000, 4.478095, 0.500000, 0.049007,\r
1250.012659, 3.603740, 0.656049, 0.071827,\r
1260.043836, 3.623140, 1.414293, 0.089569,\r
1270.071277, 3.490653, 1.454361, 0.112755,\r
1280.082163, 3.324474, 1.429585, 0.145809,\r
1290.085348, 3.194132, 1.562318, 0.163847,\r
1300.061056, 2.994950, 1.442946, 0.194451};\r
131Float_t FitLowParamV3[NCentralityBins*NParamV3FitLow]={\r
1320.019078, 0.793599, -0.436079, 0.075946,\r
1330.025818, 0.088555, 0.070194, -0.026702,\r
1340.028562, 0.297268, -0.112696, 0.013257,\r
1350.034723, 0.137282, -0.008578, -0.009524,\r
1360.041567, -0.002427, 0.093642, -0.032998,\r
1370.045574, 0.059023, 0.029342, -0.019022,\r
1380.052432, -0.067332, 0.087218, -0.028239};\r
139Float_t FitHighParamV3[NCentralityBins*NParamV3FitHigh]={\r
1400.079111, 3.802577, 3.182298, 0.000000,\r
1410.105446, 4.216029, 2.377002, 0.000000,\r
1420.106553, 4.500000, 2.825647, 0.009652,\r
1430.099684, 3.875928, 1.968600, 0.022106,\r
1440.103187, 3.597519, 1.980556, 0.022403,\r
1450.123473, 3.773586, 2.099909, 0.011130,\r
1460.140945, 3.618698, 1.852780, 0.000000};\r
147Float_t FitLowParamV4[NCentralityBins*NParamV4FitLow]={\r
1480.005289, 1.000000, 0.398581, -0.095251,\r
1490.018611, -1.000000, 0.837275, -0.163058,\r
1500.022107, -1.000000, 0.847701, -0.168469,\r
1510.025434, -1.000000, 0.854238, -0.176690,\r
1520.030768, -1.000000, 0.811683, -0.164335,\r
1530.037000, -1.000000, 0.781250, -0.158122,\r
1540.043484, -1.000000, 0.752546, -0.153147};\r
155 Float_t FitHighParamV4[NCentralityBins*NParamV4FitHigh]={\r
1560.061365, 3.669890, 1.724126, 0.014456,\r
1570.086516, 4.194769, 1.723464, 0.000000,\r
1580.030263, 4.008413, 0.563914, 0.067831,\r
1590.073456, 4.255665, 1.551659, 0.025494,\r
1600.058771, 4.102898, 1.191926, 0.048796,\r
1610.054682, 4.221963, 1.119594, 0.064515,\r
1620.094564, 4.500000, 1.568750, 0.038027};\r
163\r
164\r
165\r
166 if(IncludeLowPtBins){ Float_t TriggerPtBins[(NTriggerPtBins2+1)]={0.75,1,2,2.5,3,4,6,8,10,15,20,25};}\r
167 else{ Float_t TriggerPtBins[(NTriggerPtBins1+1)]={2.5,3,4,6,8,10,15,20,25};}\r
168\r
169 Float_t AssociatedPtBins[(NAssociatedPtBins+1)]={0.25,0.5,0.75,1,1.5,2,2.5,3,3.5,4,4.5,5,6,7,8,9,10,12,15,20,25,30,40,50,70,100};\r
170 \r
171 Float_t AssociatedPtBins31[N3ParticleAssociatedPtBins]={0.5,0.75,1,2};\r
172 Float_t AssociatedPtBins32[N3ParticleAssociatedPtBins]={0.75,1,2,3};\r
173 \r
174 Int_t CentralityBins1[NCentralityBins]={0,0,5,10,20,30,40};\r
175 Int_t CentralityBins2[NCentralityBins]={2,5,10,20,30,40,50};\r
176\r
177 Float_t XEBins[(NXEBins+1)]={0,0.01};\r
178 //char *TriggerIDArray="CINT1B";//seperate multiple with ,\r
179 //char *TriggerIDArray="CSH1-B";//seperate multiple with ,\r
180 char *TriggerIDArray="C";//PbPb test, using SelectCollisionsCanidates instead\r
181\r
182 ////////////////////////\r
183 //Add the task\r
184 ////////////////////////\r
185 AliAnalysisTaskDiHadron *task = new AliAnalysisTaskDiHadron("julery_DiHadron");\r
186 task->SetCuts(MinimumClustersTPC,MinClusterRatio,MaxTPCchi2,MinimumClustersITS, EtaCut,TriggerEtaCut,NearPhiCut,XECut,MaxDCA,MaxDCAXY,MaxDCAZ, DCAMethod, TPCRefit,ITSRefit,SPDCut,MinimumPt,MaximumPt,ZVertexCut,NumberOfTriggerIDs,TriggerIDArray);\r
187 task->SetOptions(RunOnAOD,EfficiencyCorrection,DEBUG,MakeMCHistos);\r
188 task->SetBins(nBinPhi,nBinEta,nBinsPhiEtaPhi,nBinsPhiEtaEta,nBinsPhiPhi,nBinsEtaEta,PhiPlotMin,PhiPlotMax,NTriggerPtBins,NEventsToMix,NCentralityBins,PercentageCentralityBins,NAssociatedPtBins,N3ParticleAssociatedPtBins,NZVertexBinsForMixing,NXEBins,TriggerPtBins,AssociatedPtBins,AssociatedPtBins31,AssociatedPtBins32,CentralityBins1,CentralityBins2,XEBins);\r
189 task->SetEfficiencies(EffFitPtCut,EfficiencyFitLow,EfficiencyFitHigh,NParamFitLow,NParamFitHigh,FitLowParam,FitHighParam);\r
190 task->SetFlow(V2FitPtCut,V3FitPtCut,V4FitPtCut,V2FitLow,V2FitHigh,V3FitLow,V3FitHigh,V4FitLow,V4FitHigh,NParamV2FitLow,NParamV2FitHigh,NParamV3FitLow,NParamV3FitHigh,NParamV4FitLow,NParamV4FitHigh,FitLowParamV2,FitHighParamV2,FitLowParamV3,FitHighParamV3,FitLowParamV4,FitHighParamV4);\r
191\r
192// physics selection\r
193Int_t isMC=0;//1 for MC 0 for DATA\r
194//gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPhysicsSelection.C");\r
195//AliPhysicsSelectionTask *PhysicsTask=AddTaskPhysicsSelection(isMC, 0); //isMC is true when processing monte carlo, the second 0 disables the cluster vs tracklets\r
196 gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPhysicsSelection.C");\r
197 //AliPhysicsSelectionTask* physSelTask = AddTaskPhysicsSelection(isMC,0);\r
198 task->SelectCollisionCandidates(AliVEvent::kMB);\r
199 //AliCentralitySelectionTask *centSelTask = AliCentralitySelectionTask("CentralitySelection");\r
200 \r
201 mgr->AddTask(task);\r
202 \r
203\r
204 //================================================\r
205 // data containers\r
206 //================================================\r
207 // find input container\r
208 //below the trunk version\r
209 // AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer();\r
210 //this is the old way!!!\r
211 AliAnalysisDataContainer *cinput = (AliAnalysisDataContainer*)mgr->GetContainers()->FindObject("cAUTO_INPUT");\r
212 \r
213 // define output containers, please use 'username'_'somename'\r
214 AliAnalysisDataContainer *coutput1 = \r
215 mgr->CreateContainer("julery_DiHadron", TList::Class(),\r
216 AliAnalysisManager::kOutputContainer,"julery_DiHadron.root");\r
217\r
218 // connect containers\r
219 mgr->ConnectInput (task, 0, cinput );\r
220 mgr->ConnectOutput (task, 0, coutput1);\r
221\r
222 return task;\r
223 \r
224}\r