]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGHF/hfe/macros/configs/pp/ConfigHFEpidEMCAL.C
Merge branch 'feature-movesplit'
[u/mrichter/AliRoot.git] / PWGHF / hfe / macros / configs / pp / ConfigHFEpidEMCAL.C
CommitLineData
d84c68e9 1AliAnalysisTaskHFE* ConfigHFEpidEMCAL(Bool_t useMC, UChar_t TPCcl=120, UChar_t ITScl=4,
2 Double_t DCAxy=1.0, Double_t DCAz=2.0,
3 Double_t TPCs=-1.5, Double_t TPCu=3.0,
4 Double_t Eop_mim = 0.8, Double_t Eop_max = 1.3){
5 //
6 // HFE task configuration (TPC+EMCAL only!)
7 //
8
9 Bool_t kAnalyseTaggedTracks = kTRUE;
10
11 Int_t iDCAxy = (Int_t)(DCAxy*1.);
12 Int_t iDCAz = (Int_t)(DCAz*1.);
13 Int_t iTPCs = (Int_t)(TPCs*10.);
14 Int_t iTPCu = (Int_t)(TPCu*10.);
15 Int_t ieop0 = (Int_t)(Eop_mim*10.);
16 Int_t ieop1 = (Int_t)(Eop_max*10.);
17
18 char cutname[256], taskname[256];
19 sprintf(cutname, "hfeCutsPIDemcal%di%dr%dz%ds%dls%duep0%dmep1%d",TPCcl,ITScl,iDCAxy,iDCAz,iTPCs,iTPCu,ieop0,ieop1);
20 sprintf(taskname, "HFEanalysisPIDemcalt%di%dr%dz%ds%dls%duep0%dmep1%d",TPCcl,ITScl,iDCAxy,iDCAz,iTPCs,iTPCu,ieop0,ieop1);
21 printf("\n %s \n", cutname);
22 AliHFEcuts *hfecuts = new AliHFEcuts(cutname,"HFE cuts EMCAL TPC");
23 hfecuts->CreateStandardCuts();
24 hfecuts->SetMinNClustersTPC(TPCcl);
25 hfecuts->SetMinRatioTPCclusters(0.6);
26 hfecuts->SetTPCmodes(AliHFEextraCuts::kFound, AliHFEextraCuts::kFoundOverFindable);
27 //hfecuts->SetCutITSpixel(AliHFEextraCuts::kFirst);
28
29 hfecuts->SetMinNClustersITS(ITScl);
30 hfecuts->SetCutITSpixel(AliHFEextraCuts::kAny);
31 hfecuts->SetCheckITSLayerStatus(kFALSE);
32 //hfecuts->SetIPcutParam(0,0,0,IpSig,kTRUE); ?
33
34 //hfecuts->SetSigmaToVertex(DCAsi);
35 hfecuts->SetMaxImpactParam(DCAxy,DCAz);
36
37 //hfecuts->SetQAOn();
38 hfecuts->SetUseMixedVertex(kTRUE);
39 hfecuts->SetVertexRange(10.);
40
41 AliAnalysisTaskHFE *task = new AliAnalysisTaskHFE(taskname);
42 printf("task %p\n", task);
43 task->SetHFECuts(hfecuts);
44 task->SetRemovePileUp(kTRUE);
45 task->GetPIDQAManager()->SetHighResolutionHistos();
46
47 // Define Variables
48 //const Int_t kPtBins = 41;
49 const Double_t ptbinning[42] = {0., 0.1, 0.2, 0.3, 0.4,
50 0.5, 0.6, 0.7, 0.8, 0.9,
51 1., 1.1, 1.2, 1.3, 1.4,
52 1.5, 1.75, 2., 2.25, 2.5,
53 2.75, 3., 3.5, 4., 4.5,
54 5., 5.5, 6., 7., 8.,
55 9., 10., 11., 12., 13.,
56 14., 15., 16., 17., 18.,
57 19., 20.};
58
59 const Double_t etabinning[17] = {-0.8,-0.7,-0.6,-0.5,-0.4,-0.3,-0.2,-0.1,0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8};
60
61 AliHFEvarManager *vm = task->GetVarManager();
62 vm->AddVariable("pt", 41, ptbinning);
63 //vm->AddVariable("pt");
64 //vm->AddVariable("eta");
65
66 vm->AddVariable("eta", 16, etabinning);
67
68 vm->AddVariable("phi");
69 vm->AddVariable("charge");
70 vm->AddVariable("source");
71 //vm->AddVariable("centrality");
72
73 if(!useMC){
74 // New background model (LHC10d pass2)
75 TF1 *hBackground = new TF1("hadronicBackgroundFunction", "TMath::Exp(([0]/(x**1.5))+[1])", 0., 20.);
76 // These settings assume that the default is a cut on .ge.120 TPC clusters (Sep 27, 2011)
77 hBackground->SetParameter(0, -55.18);
78 hBackground->SetParameter(1, -0.0026);
79 if (TPCcl == 100){
80 hBackground->SetParameter(0, -39.5);
81 hBackground->SetParameter(1, -0.438);
82 } elseif (TPCcl == 140){
83 hBackground->SetParameter(0, -82.11);
84 hBackground->SetParameter(1, 1.138);
85 }
86
87 //task->SetBackGroundFactorsFunction(hBackground);
88 }
89
90 // Define PID
91 AliHFEpid *pid = task->GetPID();
92 if(useMC) pid->SetHasMCData(kTRUE);
93 pid->AddDetector("EMCAL", 1);
94 pid->AddDetector("TPC", 0);
95 // HERE PUT THE STRAIGHT CUT
96 Double_t params[4];
97 char *cutmodel;
98 if(useMC){
99 // Monte-Carlo needs modelling of the falling mean with momentum at low momentum
100 // for high momentum it is consistent with a flat -0.94
101 //cutmodel = "expo(0)+pol1(2)";//[0]*TMath::Exp([1]*x) + [2] + [3]*x";
102 //Double_t paramsMC[4] = {-1.00625e-01, -2.09446e+00, -4.71247e-01, 1.80301e-02};
103 //for(int ipar = 0; ipar < 4; ipar++) params[ipar] = paramsMC[ipar];
104 cutmodel = "pol0";
105 params[0] = TPCs-1.0;
106 //TPCu = 5.0;
107 } else {
108 // Data is consistent with a flat constant: (Sep 27, 2011)
109 // 100 clusters: mean = -0.076, width = 1.035
110 // 120 clusters: mean = -0.113, width = 1.03
111 // 140 clusters: mean = -0.093, width = 1.004
112 cutmodel = "pol0(0)";
113 params[0] = TPCs;
114 }
115 pid->ConfigureTPCdefaultCut(cutmodel, params, TPCu);
116
117 if(kAnalyseTaggedTracks){
118 AliHFEcuts *v0trackCuts = new AliHFEcuts("V0trackCuts", "Track Cuts for tagged track Analysis");
119 v0trackCuts->CreateStandardCuts();
120 v0trackCuts->SetMinNClustersTPC(TPCcl);
121 v0trackCuts->SetMinRatioTPCclusters(0.6);
122 v0trackCuts->SetTPCmodes(AliHFEextraCuts::kFound, AliHFEextraCuts::kFoundOverFindable);
123 v0trackCuts->SetMinNClustersITS(1);
124 v0trackCuts->SetCutITSpixel(AliHFEextraCuts::kAny);
125 v0trackCuts->SetCheckITSLayerStatus(kFALSE);
126 v0trackCuts->UnsetVertexRequirement();
127 //hfecuts->SetSigmaToVertex(10);
128 //v0trackCuts->SetTOFPIDStep(kTRUE);
129 v0trackCuts->SetQAOn();
130
131 task->SwitchOnPlugin(AliAnalysisTaskHFE::kTaggedTrackAnalysis);
132 task->SetTaggedTrackCuts(v0trackCuts);
133 task->SetCleanTaggedTrack(kTRUE);
134 }
135
136 // change E/p cuts
137 if(useMC && Eop_max>900)Eop_max = -999.9;
138 AliHFEpidEMCAL *emcpid = pid->AliHFEpid::GetDetPID(AliHFEpid::kEMCALpid);
139 //emcpid->SetEoPMax(Eop_mim);
140 //emcpid->SetEoPMim(Eop_max);
141 emcpid->SetEoPMax(Eop_max);
142 emcpid->SetEoPMim(Eop_mim);
143
144 // QA
145 printf("task %p\n", task);
146 task->SetQAOn(AliAnalysisTaskHFE::kPIDqa);
147 //task->SetQAOn(AliAnalysisTaskHFE::kMCqa);
148 //task->SwitchOnPlugin(AliAnalysisTaskHFE::kIsElecBackGround);
149 //task->SwitchOnPlugin(AliAnalysisTaskHFE::kSecVtx);
150 task->SwitchOnPlugin(AliAnalysisTaskHFE::kDEstep);
151
152 printf("*************************************\n");
153 printf("Configuring standard Task:\n");
154 task->PrintStatus();
155 pid->PrintStatus();
156 printf("*************************************\n");
157 return task;
158}