adding the option for hybrid tracks global+global constrained as well as global+TPC...
[u/mrichter/AliRoot.git] / PWG4 / macros / AddTaskDiHadron.C
CommitLineData
3b7aa4ba 1//#include "exception.h"
2//For running at CERN
3AliAnalysisTask *AddTaskDiHadron(){
4 //get the current analysis manager
5 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
6 if (!mgr) {
7 Error("AddTask_DiHadron", "No analysis manager found.");
8 return 0;
9 }
10
11
12 //========= Set initial parameters=====
13
14 //Track Quality Cuts
15 Int_t MinimumClustersTPC=70;
16 Float_t MinClusterRatio=0.1;//1/2 would remove split tracks if not for sharing of clusters
17 Float_t MaxTPCchi2=4;
18 Int_t MinimumClustersITS=0;
19 Float_t EtaCut=0.8;//Tracks in +/- Eta are used
20 Float_t TriggerEtaCut=0.5;//Smaller trigger for flat acceptance on near-side
21 Float_t NearPhiCut=1.5;//Cut used to seperate near and away side for delta eta plots
22 Float_t XECut=NearPhiCut;//For XE distribution near and away seperation
23 Float_t MaxDCA=3;//Total DCA Cut
24 Float_t MaxDCAXY=2.4;
25 Float_t MaxDCAZ=3.2;
26 Int_t DCAMethod=2;//0 MaxDCA used, 1 MaxDCAXY and MaxDCAZ used 2 pT dependent DCA cut
27 Int_t TPCRefit=1;
28 Int_t ITSRefit=1;//1 for all particles, 2 for particles above 5 GeV/c
29 Int_t SPDCut=1;//check for a point in 1 of first 2 layers of the its
30 Float_t MinimumPt=0.25;//Minimum Pt considered by the code
31 Float_t MaximumPt=50;
32 Float_t ZVertexCut=10;//in cm
33
34 Int_t EfficiencyCorrection=1;//do efficiency corrections in this code
35 Int_t MakeMCHistos=1;//if 0 MC histograms are not made (will be empty if 1 and ran on real data)
36 Int_t DEBUG=0;//for debugging
37
38
39
40 //Binning
41 Int_t nBinPhi=60;//Number of bins for #Delta#phi histograms
42 Int_t nBinEta=54;//Number of bins for #Delta#eta histograms
43 Int_t nBinsPhiEtaPhi=20;//Number of bins for #Delta#phi-#Delta#eta in #Delta#phi
44 Int_t nBinsPhiEtaEta=18;//Number of bins for #Delta#phi-#Delta#eta in #Delta#phi
45 Int_t nBinsPhiPhi=30;//Number of bins for #Delta#phi-#Delta#phi
46 Int_t nBinsEtaEta=27;//Number of bins for #Delta#eta-#Delta#eta
47 const Float_t fPi=3.1415926535898;
48 Float_t PhiPlotMin=-fPi/3;//Min bin edge in #Delta#phi
49 Float_t PhiPlotMax=2*fPi+PhiPlotMin;//Max bin edge
50
51 //Size of some arrays change array contents below
52 const Int_t NTriggerPtBins=12;//max=20
53 const Int_t NEventsToMix=100;//max=100
54 const Int_t NCentralityBins=4;//max=10
55 const Int_t NAssociatedPtBins=25;//max=50
56 const Int_t N3ParticleAssociatedPtBins=10;//max=50
57 const Int_t NZVertexBinsForMixing=7;//max=20
58 const Int_t NXEBins=11;//max=20
59 const Int_t NumberOfTriggerIDs=1;
60 Float_t EffFitPtCut=3;
61
62 TF1 *EfficiencyFitLow=new TF1("EfficiencyFitLow","[0]/[1]*exp(-0.5*pow(x/[1],2))+[2]+[3]*x",MinimumPt,EffFitPtCut);
63 TF1 *EfficiencyFitHigh=new TF1("EfficiencyFitHigh","[0]",EffFitPtCut,MaximumPt);
64 const Int_t NParamFitLow=4;
65 const Int_t NParamFitHigh=1;
66
67 //Not high enough occupancy to worry about the centrality in pp
68 //For overlapping centrality bins efficiencies from first bin are used
69 //7Pythia_LHC10b5
70 Float_t FitLowParam[NCentralityBins*NParamFitLow]={
71 -0.030749, 0.254311, 0.858824, -0.0323708,
72 -0.0304332, 0.252195, 0.851405, -0.03164,
73 -0.0295618, 0.248594, 0.869159, -0.0354148,
74 -0.0300529, 0.236693, 0.875875, -0.0370379};
75
76 Float_t FitHighParam[NCentralityBins*NParamFitHigh]={
77 0.75813,
78 0.750521,
79 0.751902,
80 0.68658};
81
82 /*
83 //LHC10c6_900Pythia
84 Float_t FitLowParam[NCentralityBins*NParamFitLow]={
85 -0.027393, 0.236723, 0.814427, -0.023897,
86 -0.0271116, 0.232689, 0.809889, -0.0246341,
87 -0.0284658, 0.245163, 0.856043, -0.0318309,
88 -0.117114, 0.0355117, 0.828829, -0.0207492}
89
90 Float_t FightHighParam[NCentralityBins*NParamFitHigh]={
91 0.729888,
92 0.719402,
93 0.708409,
94 0.829268}
95 */
96
97
98 Float_t TriggerPtBins[(NTriggerPtBins+1)]={2,2.5,3,4,6,8,10,15,20,30,40,50};
99 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};
100 Float_t AssociatedPtBins31[N3ParticleAssociatedPtBins]={0.5,1.0,1.5,2.0,3,4,1};
101 Float_t AssociatedPtBins32[N3ParticleAssociatedPtBins]={1.0,1.5,2.0,3.0,4,5,2};
102 Int_t CentralityBins1[NCentralityBins]={0, 0, 20, 40};
103 Int_t CentralityBins2[NCentralityBins]={500,20,40,500};
104 Float_t XEBins[(NXEBins+1)]={0,0.05,0.1,0.15,0.2,0.3,0.4,0.5,0.6,0.7,0.8,1};
105 char *TriggerIDArray[NumberOfTriggerIDs]={"CINT1B"};
106
107 //==================================
108 //Add the task
109 //===================================
110 AliAnalysisTaskDiHadron *task = new AliAnalysisTaskDiHadron("DiHadron");
111 task->SetCuts(MinimumClustersTPC,MinClusterRatio,MaxTPCchi2,MinimumClustersITS, EtaCut,TriggerEtaCut,NearPhiCut,XECut,MaxDCA,MaxDCAXY,MaxDCAZ, DCAMethod, TPCRefit,ITSRefit,SPDCut,MinimumPt,MaximumPt,ZVertexCut,NumberOfTriggerIDs,TriggerIDArray);
112 task->SetOptions(EfficiencyCorrection,DEBUG,MakeMCHistos);
113 task->SetBins(nBinPhi,nBinEta,nBinsPhiEtaPhi,nBinsPhiEtaEta,nBinsPhiPhi,nBinsEtaEta,PhiPlotMin,PhiPlotMax,NTriggerPtBins,NEventsToMix,NCentralityBins,NAssociatedPtBins,N3ParticleAssociatedPtBins,NZVertexBinsForMixing,NXEBins,TriggerPtBins,AssociatedPtBins,AssociatedPtBins31,AssociatedPtBins32,CentralityBins1,CentralityBins2,XEBins);
114 task->SetEfficiencies(EffFitPtCut,EfficiencyFitLow,EfficiencyFitHigh,NParamFitLow,NParamFitHigh,FitLowParam,FitHighParam);
115
116 mgr->AddTask(task);
117
118
119 //================================================
120 // data containers
121 //================================================
122 AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer();
123 mgr->ConnectInput(task, 0, cinput);
124
125
126 // define output containers, please use 'username'_'somename'
127 AliAnalysisDataContainer *coutput1 =
128 mgr->CreateContainer("DiHadron", TList::Class(),
129 AliAnalysisManager::kOutputContainer,"DiHadron.root");
130
131 // connect containers
132 mgr->ConnectInput (task, 0, cinput );
133 mgr->ConnectOutput (task, 0, coutput1);
134
135 return task;
136}