]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGHF/hfe/macros/AddTaskFlowTPCEMCalQCSP.C
Merge branch 'feature-movesplit'
[u/mrichter/AliRoot.git] / PWGHF / hfe / macros / AddTaskFlowTPCEMCalQCSP.C
1 ///////////////////////////////////////////////////////////////////
2 //                                                               //
3 // AddTaskFlowTPCEMCalQCSP macro                                 //
4 // Author: Andrea Dubla, Utrecht University, 2012                //
5 //                                                               //
6 ///////////////////////////////////////////////////////////////////
7 class AliAnalysisDataContainer;
8 class AliFlowTrackCuts;
9 class AliFlowTrackSimpleCuts;
10 class AliFlowEventCuts;
11 class AliFlowEventSimpleCuts;
12 class AliAnalysisDataContainer;
13 class AliHFEextraCuts;
14
15 AliAnalysisTaskFlowTPCEMCalQCSP*  AddTaskFlowTPCEMCalQCSP(
16                                                           TString uniqueID = "",
17                                                           Float_t centrMin ,
18                                                           Float_t centrMax ,
19                                                           Double_t InvmassCut,
20                                                           Double_t pTCut,
21                                                           Int_t Trigger,
22                                                           Bool_t multCorrcut,
23                                                           Double_t minTPC,
24                                                           Double_t maxTPC,
25                                                           Double_t minEovP,
26                                                           Double_t maxEovP,
27                                                           Double_t minM20,
28                                                           Double_t maxM20,
29                                                           Double_t minM02,
30                                                           Double_t maxM02,
31                                                           Double_t Dispersion,
32                                                           Int_t minTPCCluster,
33                                                           AliHFEextraCuts::ITSPixel_t pixel,
34                                                           Bool_t Weight = kFALSE,
35                                                           Bool_t withmultetacorrection=kFALSE,
36                                                           Bool_t NUA = kTRUE,
37                                                           Bool_t PhotonicElectronDCA = kFALSE,
38                                                           Int_t TPCClusterforAsso = 80,
39                                                           Bool_t AssoITSref = kTRUE,
40                                                           Double_t ptminassocut = 0.3,
41                                                           Bool_t purity = kTRUE,
42                                                           Bool_t SideBandsFlow = kFALSE,
43                                                           Bool_t Phi_minus_psi = kFALSE,
44                                                           const char *Cent = "V0M",
45                                                           Bool_t QC = kTRUE, // use qc2 and qc4
46                                                           Bool_t SP_TPC = kTRUE, //use tpc sp method
47                                                           Bool_t VZERO_SP = kFALSE, // use vzero sp method
48                                                           Bool_t BaseH = kFALSE, // base histo
49                                                           Int_t harmonic = 2,
50                                                           Bool_t shrinkSP = kTRUE,
51                                                           Bool_t debug = kFALSE,
52                                                           Int_t RPFilterBit = 1,
53                                                           Bool_t op_ang = kFALSE,
54                                                           Double_t op_angle_cut=3.
55                                                           )
56
57 {
58     
59     
60     
61     if(debug) cout << " === Adding Task ElectFlow === " << endl;
62     TString fileName = AliAnalysisManager::GetCommonFileName();
63     fileName += ":ElectroID_";
64     fileName += uniqueID;
65     if(debug) cout << "    --> Reconstruction data container: " << fileName << endl;
66     AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
67     if (!mgr) {
68         if(debug) cout << " Fatal error: no analysis manager found! " << endl;
69         return 0x0;
70     }
71     if (!mgr->GetInputEventHandler()) {
72         if(debug) cout << " Fatal error: no imput event handler found!" << endl;
73         return 0x0;
74     }
75     
76     //create a task
77     AliAnalysisTaskFlowTPCEMCalQCSP *taskHFE = ConfigHFEemcalMod(kFALSE, minTPCCluster, pixel, withmultetacorrection);    //kTRUE if MC
78     
79     if(debug) cout << " === AliAnalysisElectronFlow === " << taskHFE << endl;
80     if(!taskHFE) {
81         if(debug) cout << " --> Unexpected error occurred: NO TASK WAS CREATED! (could be a library problem!) " << endl;
82         return 0x0;
83     }
84     taskHFE->SetTrigger(Trigger);
85     taskHFE->SetEPWeight(Weight);
86
87     
88     TString histoflatname = "alien:///alice/cern.ch/user/a/adubla/CentrDistrBins005.root";
89     if(Trigger==0 || Trigger==4){
90         TFile *fFlat=TFile::Open(histoflatname.Data());
91         TCanvas *c=fFlat->Get("cintegral");
92         TH1F *hfl=(TH1F*)c->FindObject("hint");
93         taskHFE->SetHistoForCentralityFlattening(hfl,centrMin,centrMax,0.,0);
94     }
95     
96     
97     TString histoflatnameEP = "alien:///alice/cern.ch/user/a/adubla/EPVZero010_Smart.root";
98     if(Weight){
99         TFile *fFlatEP=TFile::Open(histoflatnameEP,"READ");
100         TCanvas *cEP=fFlatEP->Get("c1_n7");
101         TH1D *hEPfl=(TH1D*)cEP->FindObject("EPVz");
102         taskHFE->SetHistoForEPFlattWeights(hEPfl);
103     }
104     
105
106     
107     // Set centrality percentiles and method V0M, FMD, TRK, TKL, CL0, CL1, V0MvsFMD, TKLvsV0M, ZEMvsZDC
108     taskHFE->SetCentralityParameters(centrMin, centrMax, Cent);
109     taskHFE->SetInvariantMassCut(InvmassCut);
110     taskHFE->SetIDCuts(minTPC, maxTPC, minEovP, maxEovP, minM20, maxM20, minM02, maxM02, Dispersion);
111     taskHFE->SetFlowSideBands(SideBandsFlow);
112     taskHFE->Setphiminuspsi(Phi_minus_psi);
113     taskHFE->SetPurity(purity);
114     taskHFE->SetpTCuttrack(pTCut);
115     taskHFE->SelectPhotonicElectronMethod(PhotonicElectronDCA);
116     taskHFE->SetOpeningAngleflag(op_ang);
117     taskHFE->SetOpeningAngleCut(op_angle_cut);
118     taskHFE->SetAssoTPCCluster(TPCClusterforAsso);
119     taskHFE->SetAssoITSRefit(AssoITSref);
120     taskHFE->SetMultCorrelationCut(multCorrcut);
121     taskHFE->SetPtMinAssoCut(ptminassocut);
122
123     //set RP cuts for flow package analysis
124     cutsRP = new AliFlowTrackCuts(Form("RFPcuts%s",uniqueID));
125     if(!cutsRP) {
126         if(debug) cout << " Fatal error: no RP cuts found, could be a library problem! " << endl;
127         return 0x0;
128     }
129     
130     if(!VZERO_SP) {
131         AliFlowTrackCuts::trackParameterType rptype = AliFlowTrackCuts::kGlobal;
132         cutsRP->SetParamType(rptype);
133         cutsRP->SetAODfilterBit(RPFilterBit);
134         cutsRP->SetPtRange(0.2, 5.0);
135         cutsRP->SetEtaRange(-0.7, 0.7);
136         cutsRP->SetMinNClustersTPC(70);
137         cutsRP->SetMinChi2PerClusterTPC(0.1);
138         cutsRP->SetMaxChi2PerClusterTPC(4.0);
139         cutsRP->SetRequireTPCRefit(kTRUE);
140         cutsRP->SetMaxDCAToVertexXY(0.3);
141         cutsRP->SetMaxDCAToVertexZ(0.3);
142         cutsRP->SetAcceptKinkDaughters(kFALSE);
143         cutsRP->SetMinimalTPCdedx(10.);
144         if(debug) cout << "    --> kGlobal RP's " << cutsRP << endl;
145     }
146     if(VZERO_SP) { // use vzero sub analysis
147         cutsRP = cutsRP->GetStandardVZEROOnlyTrackCuts(); // select vzero tracks
148         SP_TPC = kFALSE; // disable other methods
149         QC = kFALSE;
150         if(debug) cout << "    --> VZERO RP's " << cutsRP << endl;
151     }
152     
153     AliFlowTrackSimpleCuts *POIfilterLeft = new AliFlowTrackSimpleCuts();
154     AliFlowTrackSimpleCuts *POIfilterRight = new AliFlowTrackSimpleCuts();
155     if(VZERO_SP || SP_TPC){
156         POIfilterLeft->SetEtaMin(-0.7);
157         POIfilterLeft->SetEtaMax(0.0);
158         POIfilterLeft->SetMassMin(263731); POIfilterLeft->SetMassMax(263733);
159         
160         POIfilterRight->SetEtaMin(0.0);
161         POIfilterRight->SetEtaMax(0.7);
162         POIfilterRight->SetMassMin(263731); POIfilterRight->SetMassMax(263733);
163     }
164     
165     
166     AliFlowTrackSimpleCuts *POIfilterQC = new AliFlowTrackSimpleCuts();
167     if(QC){
168         POIfilterQC->SetEtaMin(-0.7);
169         POIfilterQC->SetEtaMax(0.7);
170         POIfilterQC->SetMassMin(263731); POIfilterQC->SetMassMax(263733);
171         
172     }
173     
174     if(SideBandsFlow){
175         
176         AliFlowTrackSimpleCuts *POIfilterLeftH = new AliFlowTrackSimpleCuts();
177         AliFlowTrackSimpleCuts *POIfilterRightH = new AliFlowTrackSimpleCuts();
178         if(SP_TPC){
179             POIfilterLeftH->SetEtaMin(-0.7);
180             POIfilterLeftH->SetEtaMax(0.0);
181             POIfilterLeftH->SetMassMin(2636); POIfilterLeftH->SetMassMax(2638);
182             
183             POIfilterRightH->SetEtaMin(0.0);
184             POIfilterRightH->SetEtaMax(0.7);
185             POIfilterRightH->SetMassMin(2636); POIfilterRightH->SetMassMax(2638);
186         }
187         
188         
189         AliFlowTrackSimpleCuts *POIfilterQCH = new AliFlowTrackSimpleCuts();
190         if(QC){
191             POIfilterQCH->SetEtaMin(-0.7);
192             POIfilterQCH->SetEtaMax(0.7);
193             POIfilterQCH->SetMassMin(2636); POIfilterQCH->SetMassMax(2638);
194             
195         }
196         
197     }
198     
199     taskHFE->SetRPCuts(cutsRP);
200     
201     
202     AliAnalysisDataContainer *coutput3 = mgr->CreateContainer(Form("ccontainer0_%s",uniqueID.Data()),TList::Class(),AliAnalysisManager::kOutputContainer,fileName);
203     
204     mgr->ConnectInput(taskHFE,0,mgr->GetCommonInputContainer());
205     mgr->ConnectOutput(taskHFE,1,coutput3);
206     
207     
208     if(debug) cout << " === RECEIVED REQUEST FOR FLOW ANALYSIS === " << endl;
209     AliAnalysisDataContainer *flowEvent = mgr->CreateContainer(Form("FlowContainer_%s",uniqueID.Data()), AliFlowEventSimple::Class(), AliAnalysisManager::kExchangeContainer);
210     mgr->ConnectOutput(taskHFE, 2, flowEvent);
211     if(debug) cout << "    --> Created IO containers " << flowEvent << endl;
212     
213     if(SideBandsFlow){
214         if(debug) cout << " === RECEIVED REQUEST FOR FLOW ANALYSIS === " << endl;
215         AliAnalysisDataContainer *flowEventCont = mgr->CreateContainer(Form("FlowContainer_Cont_%s",uniqueID.Data()), AliFlowEventSimple::Class(), AliAnalysisManager::kExchangeContainer);
216         mgr->ConnectOutput(taskHFE, 3, flowEventCont);
217         if(debug) cout << "    --> Created IO containers " << flowEventCont << endl;
218     }
219     
220     
221     mgr->AddTask(taskHFE);
222     
223     if (QC) {  // add qc tasks
224         AddQCmethod(Form("QCTPCin_%s",uniqueID.Data()), harmonic, flowEvent,  debug ,uniqueID, -0.7, -0.0, 0.0, 0.7,false,POIfilterQC, NUA, shrinkSP, BaseH);
225         if(debug) cout << "    --> Hanging QC task ...succes! "<< endl;
226     }
227     if (SP_TPC) {  // add sp subevent tasks
228         AddSPmethod(Form("SPTPCQa_in_%s", uniqueID.Data()), -0.7, -.0, .0, +0.7, "Qa", harmonic, flowEvent, false, shrinkSP, debug,uniqueID, false, POIfilterRight, NUA,BaseH);
229         if(debug) cout << "    --> Hanging SP Qa task ... succes!" << endl;
230         AddSPmethod(Form("SPTPCQb_in_%s", uniqueID.Data()), -0.7, -.0, .0, +0.7, "Qb", harmonic, flowEvent,  false, shrinkSP, debug,uniqueID, false, POIfilterLeft, NUA,BaseH);
231         if(debug) cout << "    --> Hanging SP Qb task ... succes!"<< endl;
232     }
233     if (VZERO_SP) {  // add sp subevent tasks
234         AddSPmethod(Form("SPVZEROQa_in_%s", uniqueID.Data()), -0.7, -.0, .0, +0.7, "Qa", harmonic, flowEvent, false, shrinkSP, debug,uniqueID, true, POIfilterRight, NUA,BaseH);
235         if(debug) cout << "    --> Hanging SP Qa task ... succes!" << endl;
236         AddSPmethod(Form("SPVZEROQb_in_%s", uniqueID.Data()), -0.7, -.0, .0, +0.7, "Qb", harmonic, flowEvent,  false, shrinkSP, debug,uniqueID, true, POIfilterLeft, NUA,BaseH);
237         if(debug) cout << "    --> Hanging SP Qb task ... succes!"<< endl;
238     }
239     
240     //=========================================Flow event for elctronContamination==============================================================================================
241     if(SideBandsFlow){
242         if (QC) {  // add qc tasks
243             AddQCmethod(Form("QCTPCCont_%s",uniqueID.Data()), harmonic, flowEventCont,  debug ,uniqueID, -0.7, -0.0, 0.0, 0.7,false,POIfilterQCH, NUA, shrinkSP,BaseH);
244             if(debug) cout << "    --> Hanging QC task ...succes! "<< endl;
245         }
246         if (SP_TPC) {  // add sp subevent tasks
247             AddSPmethod(Form("SPTPCQa_Cont_%s", uniqueID.Data()), -0.7, -.0, .0, +0.7, "Qa", harmonic, flowEventCont, false, shrinkSP, debug,uniqueID, false, POIfilterRightH, NUA,BaseH);
248             if(debug) cout << "    --> Hanging SP Qa task ... succes!" << endl;
249             AddSPmethod(Form("SPTPCQb_Cont_%s", uniqueID.Data()), -0.7, -.0, .0, +0.7, "Qb", harmonic, flowEventCont,  false, shrinkSP, debug,uniqueID, false, POIfilterLeftH, NUA,BaseH);
250             if(debug) cout << "    --> Hanging SP Qb task ... succes!"<< endl;
251         }
252     }
253     //==========================================================================================================================================================================
254     
255     
256     return taskHFE;
257     
258 }
259
260 //_____________________________________________________________________________
261
262
263 //_____________________________________________________________________________
264 void AddSPmethod(char *name, double minEtaA, double maxEtaA, double minEtaB, double maxEtaB, char *Qvector, int harmonic, AliAnalysisDataContainer *flowEvent, bool bEP, bool shrink = false, bool debug, TString uniqueID, Bool_t VZERO_SP = kFALSE,  AliFlowTrackSimpleCuts* POIfilter, Bool_t kNUA, Bool_t kBaseH)
265 {
266     // add sp task and invm filter tasks
267     if(debug) (bEP) ? cout << " ****** Reveived request for EP task ****** " << endl : cout << " ******* Switching to SP task ******* " << endl;
268     TString fileName = AliAnalysisManager::GetCommonFileName();
269     (bEP) ? fileName+=":EP" : fileName+=":SP";
270     //          if(etagap) {
271     //            fileName+="_SUBEVENTS";
272     //          if(debug) cout << "    --> Setting up subevent analysis <-- " << endl;
273     //    }
274     if(debug) cout << "    --> fileName " << fileName << endl;
275     TString myFolder = fileName;
276     if(debug) cout << "    --> myFolder " << myFolder << endl;
277     TString myNameSP;
278     (bEP) ? myNameSP = Form("%sEPv%d%s", name, harmonic, Qvector): myNameSP = Form("%sSPv%d%s", name, harmonic, Qvector);
279     if(debug) cout << " myNameSP " << myNameSP << endl;
280     AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
281     AliAnalysisDataContainer *flowEventOut = mgr->CreateContainer(Form("Filter_%s",myNameSP.Data()),AliFlowEventSimple::Class(),AliAnalysisManager::kExchangeContainer);
282     AliAnalysisTaskFilterFE *tskFilter = new AliAnalysisTaskFilterFE(Form("TaskFilter_%s", myNameSP.Data()), NULL, POIfilter);
283     tskFilter->SetSubeventEtaRange(minEtaA, maxEtaA, minEtaB, maxEtaB);
284     if(VZERO_SP) tskFilter->SetSubeventEtaRange(-10, 0, 0, 10);
285     mgr->AddTask(tskFilter);
286     mgr->ConnectInput(tskFilter, 0, flowEvent);
287     mgr->ConnectOutput(tskFilter, 1, flowEventOut);
288     AliAnalysisDataContainer *outSP = mgr->CreateContainer(myNameSP.Data(), TList::Class(), AliAnalysisManager::kOutputContainer, fileName);
289     AliAnalysisTaskScalarProduct *tskSP = new AliAnalysisTaskScalarProduct(Form("TaskScalarProduct_%s", myNameSP.Data()), kFALSE);
290     tskSP->SetApplyCorrectionForNUA(kNUA);
291     tskSP->SetHarmonic(harmonic);
292     tskSP->SetTotalQvector(Qvector);
293     if (bEP) tskSP->SetBehaveAsEP();
294     if (shrink)tskSP->SetBookOnlyBasicCCH(kBaseH);
295     mgr->AddTask(tskSP);
296     mgr->ConnectInput(tskSP, 0, flowEventOut);
297     mgr->ConnectOutput(tskSP, 1, outSP);
298 }
299 //_____________________________________________________________________________
300 void AddQCmethod(char *name, int harmonic, AliAnalysisDataContainer *flowEvent, Bool_t debug, TString uniqueID,double minEtaA, double maxEtaA, double minEtaB, double maxEtaB,Bool_t VZERO_SP = kFALSE,  AliFlowTrackSimpleCuts* POIfilter, Bool_t kNUA, bool shrink = false, Bool_t kBaseH)
301 {
302     // add qc task and invm filter tasks
303     if(debug) cout << " ****** Received request for QC v" << harmonic << " task " << name << ", IO ****** " << flowEvent << endl;
304     TString fileName = AliAnalysisManager::GetCommonFileName();
305     fileName+=":QC";
306     if(debug) cout << "    --> Common filename: " << fileName << endl;
307     TString myFolder = Form("v%d", harmonic);
308     if(debug) cout << "    --> myFolder: " << myFolder << endl;
309     TString myName = Form("%s", name);
310     if(debug) cout << "    --> myName: " << myName << endl;
311     AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
312     AliAnalysisDataContainer *flowEventOut = mgr->CreateContainer(Form("Filter_%s", myName.Data()), AliFlowEventSimple::Class(),AliAnalysisManager::kExchangeContainer);
313     AliAnalysisTaskFilterFE *tskFilter = new AliAnalysisTaskFilterFE(Form("TaskFilter_%s", myName.Data()), NULL, POIfilter);
314     tskFilter->SetSubeventEtaRange(minEtaA, maxEtaA, minEtaB, maxEtaB);
315     //    if(VZERO_SP) tskFilter->SetSubeventEtaRange(-10, 0, 0, 10);
316     mgr->AddTask(tskFilter);
317     mgr->ConnectInput(tskFilter, 0, flowEvent);
318     mgr->ConnectOutput(tskFilter, 1, flowEventOut);
319     
320     AliAnalysisDataContainer *outQC = mgr->CreateContainer(myName.Data(), TList::Class(), AliAnalysisManager::kOutputContainer, fileName);
321     AliAnalysisTaskQCumulants *tskQC = new AliAnalysisTaskQCumulants(Form("TaskQCumulants_%s", myName.Data()), kFALSE);
322     tskQC->SetApplyCorrectionForNUA(kNUA);
323     tskQC->SetHarmonic(harmonic);
324     if (shrink)tskQC->SetBookOnlyBasicCCH(kBaseH);
325     mgr->AddTask(tskQC);
326     mgr->ConnectInput(tskQC, 0, flowEventOut);
327     mgr->ConnectOutput(tskQC, 1, outQC);
328 }
329 //_____________________________________________________________________________
330
331
332 //_____________________________________________________________________________
333
334 AliAnalysisTaskFlowTPCEMCalQCSP* ConfigHFEemcalMod(Bool_t useMC,Int_t minTPCCulster,AliHFEextraCuts::ITSPixel_t pixel, Bool_t withmultetacorrection1){
335     //
336     // HFE standard task configuration
337     //
338     
339     Bool_t kAnalyseTaggedTracks = kTRUE;
340     
341     AliHFEcuts *hfecuts = new AliHFEcuts("hfeCutsEMCAL","HFE Standard Cuts");  //TODO....change the cuts values to PbPb
342     //  hfecuts->CreateStandardCuts();
343     hfecuts->SetMinNClustersTPC(minTPCCulster);
344     hfecuts->SetMinNClustersITS(3);
345     hfecuts->SetMinNTrackletsTRD(0);
346     hfecuts->SetMinRatioTPCclusters(0.6);
347     
348     //   hfecuts->SetEtaRange(-0.9,0.9);
349     //   hfecuts->SetTPCmodes(AliHFEextraCuts::kFound, AliHFEextraCuts::kFoundOverFindable);
350     hfecuts->SetRequireITSPixel();
351     hfecuts->SetCutITSpixel(pixel);//kAny
352     hfecuts->SetMaxChi2perClusterITS(-1);
353     hfecuts->SetMaxChi2perClusterTPC(3.5);
354     hfecuts->SetCheckITSLayerStatus(kFALSE); // shud be put back
355     //  hfecuts->UnsetVertexRequirement();
356     hfecuts->SetVertexRange(10.);
357     hfecuts->SetRequireSigmaToVertex();
358     //hfecuts->SetSigmaToVertex(10);
359     hfecuts->SetTOFPIDStep(kFALSE);
360     //  hfecuts->SetQAOn();
361     hfecuts->SetPtRange(0, 30);
362     
363     AliAnalysisTaskFlowTPCEMCalQCSP *task = new AliAnalysisTaskFlowTPCEMCalQCSP("HFE_Flow_TPCEMCal");
364     printf("task ------------------------ %p\n ", task);
365     
366     
367     task->SetHFECuts(hfecuts);
368     
369     //   task->SetInvariantMassCut(0.05);
370     //  task->SetRejectKinkMother(kTRUE);
371     //  task->SetRemovePileUp(kTRUE);
372     
373     // Define PID
374     AliHFEpid *pid = task->GetPID();
375     if(useMC) pid->SetHasMCData(kTRUE);
376     pid->AddDetector("TPC", 0);
377     pid->AddDetector("EMCAL", 1);
378     
379     
380     if(withmultetacorrection1) {
381         AliHFEpidTPC *tpcpid = pid->GetDetPID(AliHFEpid::kTPCpid);
382         // Theo
383         //  task->GetPIDQAManager()->SetFillMultiplicity();
384         TF1 *etaCorrMean = GetEtaCorrectionEMCal("LHC11h_etaCorrMean");
385         TF1 *etaCorrWdth = GetEtaCorrectionEMCal("LHC11h_etaCorrWidth");
386         if(etaCorrMean && etaCorrWdth && withmultetacorrection1){
387             tpcpid->SetEtaCorrections(etaCorrMean, etaCorrWdth);
388             printf("TPC dE/dx Eta correction %p %p\n",etaCorrMean,etaCorrWdth);
389         }
390         TF1 *centCorrMean = GetCentralityCorrectionEMCal("LHC11h_multCorrMean");
391         TF1 *centCorrWdth = GetCentralityCorrectionEMCal("LHC11h_multCorrWidth");
392         if(centCorrMean && centCorrWdth && withmultetacorrection1){
393             tpcpid->SetCentralityCorrections(centCorrMean, centCorrWdth);
394             printf("TPC dE/dx multiplicity correction %p %p\n",centCorrMean,centCorrWdth);
395         }
396         task->SetMultCorrectionTheo(withmultetacorrection1);
397         task->SetTPCPID(tpcpid);
398     }
399     
400
401     
402     
403     printf("*************************************\n");
404     printf("Configuring standard Task:\n");
405     //  task->PrintStatus();
406     pid->PrintStatus();
407     printf("*************************************\n");
408     return task;
409     
410     
411 }
412 //_____________________________________________________________________________
413 //_____________________________________________________________________________
414 TF1* GetCentralityCorrectionEMCal(TString listname="LHC11h"){
415     
416     TString etaMap="$ALICE_ROOT/PWGHF/hfe/macros/configs/PbPb/CentCorrMapsTPC.root";
417     
418     if (gSystem->AccessPathName(gSystem->ExpandPathName(etaMap.Data()))){
419         Error("ConfigHFEpbpb","Eta map not found: %s",etaMap.Data());
420         return 0;
421     }
422     
423     TFile f(etaMap.Data());
424     if (!f.IsOpen()) return 0;
425     gROOT->cd();
426     TList *keys=f.GetListOfKeys();
427     
428     for (Int_t i=0; i<keys->GetEntries(); ++i){
429         TString kName=keys->At(i)->GetName();
430         TPRegexp reg(kName);
431         if (reg.MatchB(listname)){
432             printf("Using Eta Correction Function: %s\n",kName.Data());
433             return (TF1*)f.Get(kName.Data());
434         }
435     }
436     return 0;
437 }
438 //_____________________________________________________________________________
439 TF1* GetEtaCorrectionEMCal(TString listname="LHC11h"){
440     
441     TString etaMap="$ALICE_ROOT/PWGHF/hfe/macros/configs/PbPb/EtaCorrMapsTPC.root";
442     
443     if (gSystem->AccessPathName(gSystem->ExpandPathName(etaMap.Data()))){
444         Error("ConfigHFEpbpb","Eta map not found: %s",etaMap.Data());
445         return 0;
446     }
447     
448     TFile f(etaMap.Data());
449     if (!f.IsOpen()) return 0;
450     gROOT->cd();
451     TList *keys=f.GetListOfKeys();
452     
453     for (Int_t i=0; i<keys->GetEntries(); ++i){
454         TString kName=keys->At(i)->GetName();
455         TPRegexp reg(kName);
456         if (reg.MatchB(listname)){
457             printf("Using Eta Correction Function: %s\n",kName.Data());
458             return (TF1*)f.Get(kName.Data());
459         }
460     }
461     return 0;
462 }
463 //_____________________________________________________________________________
464
465
466