1 TF1* GetEtaCorrection(TString listname){
3 TString etaMap="$ALICE_ROOT/PWGDQ/dielectron/files/EtaCorrMaps.root";
5 if (gSystem->AccessPathName(gSystem->ExpandPathName(etaMap.Data()))){
6 Error("ConfigHFEpbpb","Eta map not found: %s",etaMap.Data());
10 TFile f(etaMap.Data());
11 if (!f.IsOpen()) return 0;
13 TList *keys=f.GetListOfKeys();
15 for (Int_t i=0; i<keys->GetEntries(); ++i){
16 TString kName=keys->At(i)->GetName();
18 if (reg.MatchB(listname)){
19 printf("Using Eta Correction Function: %s\n",kName.Data());
20 return (TF1*)f.Get(kName.Data());
27 AliAnalysisTaskHFE* ConfigHFEpbpb(Bool_t useMC=kFALSE,
30 UChar_t TPCcl=70, UChar_t TPCclPID = 80,
31 Double_t TPCclRatio = 0.6, Double_t TPCclshared = 1.1,
32 UChar_t ITScl=3, Double_t ITSchi2perclusters=99999999.,
33 Int_t itspixelcut=AliHFEextraCuts::kFirst,
34 Double_t dcaxy=1.0, Double_t dcaz=2.0,
37 Float_t prodlow=0., Float_t prodhigh=100.,
39 Bool_t kMCQA = kFALSE,
40 Bool_t kDEStep = kFALSE,
41 Int_t addflag=0, Int_t ptbin=0,
42 Int_t etacor=0, TString listname="",
43 Int_t nondefaultcentr=0, Float_t* arraycentr=NULL,
44 Double_t* tpcdEdxcut=NULL,Double_t tpcu=3.0){
46 // HFE standard task configuration
49 AliHFEcuts *hfecuts = new AliHFEcuts(appendix,"HFE cuts pbpb TOF TPC");
50 hfecuts->CreateStandardCuts();
52 hfecuts->SetMinNClustersTPC(TPCcl);
53 hfecuts->SetMinNClustersTPCPID(TPCclPID);
54 hfecuts->SetMinRatioTPCclusters(TPCclRatio);
55 hfecuts->SetTPCmodes(AliHFEextraCuts::kFound, AliHFEextraCuts::kFoundOverFindable);
56 hfecuts->SetFractionOfSharedTPCClusters(TPCclshared);
58 hfecuts->SetMinNClustersITS(ITScl);
59 hfecuts->SetMaxChi2perClusterITS(ITSchi2perclusters);
60 hfecuts->SetCutITSpixel(itspixelcut);
61 hfecuts->SetCheckITSLayerStatus(kFALSE);
63 hfecuts->SetIPcutParam(0,0,0,IpSig,kTRUE,kTRUE);
64 // if(useMC && beauty) hfecuts->SetProductionVertex(prodlow,prodhigh,prodlow,prodhigh);
65 if(useMC) hfecuts->SetProductionVertex(prodlow,prodhigh,prodlow,prodhigh);
67 hfecuts->SetMaxImpactParam(dcaxy,dcaz);
70 hfecuts->SetUseMixedVertex(kTRUE);
71 hfecuts->SetVertexRange(10.);
74 hfecuts->SetTOFPIDStep(kTRUE);
75 //hfecuts->SetMaxChi2perClusterITS(36);
76 //hfecuts->SetTOFMISMATCHStep(kTRUE);
77 //hfecuts->SetTPCPIDCleanUpStep(kTRUE);
80 AliAnalysisTaskHFE *task = new AliAnalysisTaskHFE(appendix);
81 task->SetHFECuts(hfecuts);
82 task->SetPbPbAnalysis(kTRUE);
83 task->SetRemovePileUp(kFALSE);
84 task->GetPIDQAManager()->SetHighResolutionHistos();
85 if(useMC) task->SetHasMCData(kTRUE); // necessary for AOD
86 printf("AOD filter %d On/OFF?\n",aodfilter);
88 printf("ON AOD filter %d\n",aodfilter);
89 task->SetUseFilterAOD(kTRUE);
90 task->SetFilter(aodfilter);
94 if((nondefaultcentr!=0) && arraycentr) {
95 for(Int_t i=0;i<12;i++)
97 task->SetPbPbUserCentralityLimit(kTRUE);
98 task->SetPbPbUserCentralityArray(i,arraycentr[i]);
107 Double_t ptbinning[36] = {0., 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1., 1.1, 1.2,
108 1.3, 1.4, 1.5, 1.75, 2., 2.25, 2.5, 2.75, 3., 3.5, 4., 4.5, 5.,
109 5.5, 6., 7., 8., 10., 12., 14., 16., 18., 20.};
114 Double_t ptbinning[19] = {0., 0.1, 0.3, 0.5, 0.7, 0.9, 1.1, 1.3, 1.5, 2., 2.5, 3., 4., 5., 6., 8., 12., 16., 20.};
118 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,
119 0.3, 0.4, 0.5, 0.6, 0.7, 0.8};
120 AliHFEvarManager *vm = task->GetVarManager();
121 Int_t sizept=(sizeof(ptbinning)/sizeof(double))-1;
122 Int_t sizeeta=(sizeof(etabinning)/sizeof(double))-1;
124 // printf("ptbinning: %i \n",sizept);
126 //vm->AddVariable("pt");
127 //vm->AddVariable("eta");
128 vm->AddVariable("pt", sizept, ptbinning);
129 // vm->AddVariable("pt", 18, ptbinning);
130 // vm->AddVariable("eta", 16, etabinning);
131 vm->AddVariable("eta", sizeeta, etabinning);
132 vm->AddVariable("phi");
133 vm->AddVariable("charge");
134 vm->AddVariable("source");
135 vm->AddVariable("centrality");
139 for(Int_t a=0;a<12;a++)
141 TF1 *hBackground = new TF1("hadronicBackgroundFunction","TMath::Exp([0]/x + [1])", 0., 20.);
142 hBackground->SetParameter(0, -43.87);
143 hBackground->SetParameter(1, 2.85);
144 task->SetBackGroundFactorsFunction(hBackground,a);
149 AliHFEpid *pid = task->GetPID();
150 if(useMC) pid->SetHasMCData(kTRUE);
151 pid->AddDetector("TOF", 0);
152 pid->AddDetector("TPC", 1);
153 //pid->ConfigureTPCrejection();
163 Double_t paramsTPCdEdxcut[12] ={0.0, 0.0, 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0};
164 if((nondefaultcentr!=0) && tpcdEdxcut) memcpy(paramsTPCdEdxcut,tpcdEdxcut,sizeof(paramsTPCdEdxcut));
166 if(etacor==1&&nondefaultcentr==0)
168 Double_t tpcdEdxcutetacor[12]={-0.08, 0.016, 0.12,0.22,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3};
169 memcpy(paramsTPCdEdxcut,tpcdEdxcutetacor,sizeof(paramsTPCdEdxcut));
175 for(Int_t a=0;a<11;a++)
177 // cout << a << " " << paramsTPCdEdxcut[a] << endl;
178 Double_t tpcparam[1]={paramsTPCdEdxcut[a]};
180 pid->ConfigureTPCcentralityCut(a,cutmodel,tpcparam,tpcu);
185 // Apply eta correction
186 AliHFEpidTPC *tpcpid = pid->GetDetPID(AliHFEpid::kTPCpid);
187 TF1 *etacorrection = GetEtaCorrection(listname);
188 if(etacorrection) tpcpid->SetEtaCorrection(etacorrection);
193 pid->ConfigureTOF(TOFs);
195 AliHFEpidTOF *tofpid = pid->GetDetPID(AliHFEpid::kTOFpid);
196 if(TOFs<3.) tofpid->SetTOFnSigmaBand(-3,TOFs);
199 task->SetQAOn(AliAnalysisTaskHFE::kPIDqa);
200 //task->SetFillSignalOnly(kFALSE); // for DE pluging for MC
201 if(kMCQA) task->SetQAOn(AliAnalysisTaskHFE::kMCqa);
202 //task->SwitchOnPlugin(AliAnalysisTaskHFE::kIsElecBackGround);
203 //task->SwitchOnPlugin(AliAnalysisTaskHFE::kSecVtx);
204 if(kDEStep) task->SwitchOnPlugin(AliAnalysisTaskHFE::kDEstep);
205 if(useMC && addflag==1) task->SetDebugStreaming();
207 task->SelectCollisionCandidates(AliVEvent::kMB | AliVEvent::kCentral | AliVEvent::kSemiCentral);
211 printf("*************************************\n");
212 printf("Configuring task PbPb \n");
213 //if(isLHC10) printf("Configuring TPC1 Task 2010 :\n");
214 //if(isLHC11) printf("Configuring TPC1 Task 2011 :\n");
217 printf("*************************************\n");