1 AliAnalysisTask *AddTaskHFEtpctofPbPb(Bool_t isaod, Bool_t isMC,Int_t aodfilter=-1, Int_t tpcCls=120, Int_t tpcClsPID = 80, Double_t tpcClsRatio = 0.6, Double_t tpcClShared = 1.1, Int_t itsCls=4,Double_t itsChi2PerClusters=36.,Int_t itspixelcut=AliHFEextraCuts::kBoth, Double_t dcaxy=1.0, Double_t dcaz=2.0, Bool_t usetof=kFALSE, Double_t tofs=3.,Bool_t etacor=kFALSE,TString listname="",Double_t tpceff=0.5, Float_t prodlow=0., Float_t prodhigh=100.,Bool_t kMCQA = kFALSE){
4 gSystem->Load("libANALYSIS.so");
5 gSystem->Load("libANALYSISalice.so");
9 TString configFile("$ALICE_ROOT/PWGHF/hfe/macros/configs/PbPb/ConfigHFEpbpb.C");
10 //TString configFile("/d/alice12/bailhache/AliRootInstallations/07_10_2012/AliRoot/PWGHF/hfe/macros/configs/PbPb/ConfigHFEpbpb.C");
11 TString checkconfig="ConfigHFEpbpb";
12 if (!gROOT->GetListOfGlobalFunctions()->FindObject(checkconfig.Data()))
13 gROOT->LoadMacro(configFile.Data());
17 Int_t itpcClsRatio = (Int_t) (tpcClsRatio*10);
18 Int_t itpcClShared = (Int_t) (tpcClShared*10);
19 Int_t iitsChi2PerClusters = (Int_t) (itsChi2PerClusters*10);
20 Int_t idcaxy = (Int_t) (dcaxy*10);
21 Int_t idcaz = (Int_t) (dcaz*10);
22 Int_t itofs = (Int_t) (tofs*10);
23 Int_t iprodlow = (Int_t) (prodlow*10);
24 Int_t iprodhigh = (Int_t) (prodhigh*10);
28 Int_t itpceff = (Int_t) (tpceff*10);
29 if(usetof) itof=kTRUE;
31 if(etacor) ietacor = 1;
33 TString appendix(TString::Format("f%dt%dtp%dtr%dts%di%dic%di%ddcaxy%dz%dtof%dts%de%dtpc%dprodlow%dhigh%dmc%d",aodfilter,tpcCls,tpcClsPID,itpcClsRatio,itpcClShared,itsCls,iitsChi2PerClusters,itspixelcut,idcaxy,idcaz,itof,itofs,ietacor,itpceff,iprodlow,iprodhigh,iMCQA));
34 printf("appendix %s\n", appendix.Data());
38 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
39 if (!mgr->GetInputEventHandler()) {
40 printf("AddTaskEventplane", "This task requires an input event handler");
43 TString inputDataType = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
44 Bool_t isaod = kFALSE;
45 if (inputDataType == "AOD") isaod = kTRUE;
49 // 0-5,5-10,10-20,20-30,30-40,40-50,50-60,60-70,70-80,80-90,90-100,one more per history
50 // http://www.physi.uni-heidelberg.de/~pachmay/projects/hfe/pid/tpc/
51 // without eta correction 50%
52 Double_t tpcdEdxcutlow[12] = {0.03,0.15,0.24,0.3,0.39,0.48,0.5,0.51,0.5,0.5,0.5,0.5};
53 // with eta correction 50%
54 // Double_t tpcdEdxcutlow[12] = {-0.01,0.076,0.197,0.26,0.298,0.3,0.3,0.3,0.3,0.3,0.3,0.3};
55 Double_t tpcdEdxcuthigh[12] = {3.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0};
59 AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer();
60 AliAnalysisTaskHFE *task = ConfigHFEpbpb(isaod,isMC,appendix,aodfilter,tpcCls,tpcClsPID,tpcClsRatio,tpcClShared,itsCls,itsChi2PerClusters,itspixelcut,dcaxy,dcaz,usetof,tofs,etacor,listname,tpcdEdxcutlow,tpcdEdxcuthigh,prodlow,prodhigh,kMCQA);
66 TString containerName = mgr->GetCommonFileName();
68 containerName += appendix.Data();
70 AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer();
71 mgr->ConnectOutput(task,1, mgr->CreateContainer(Form("HFE_Results_%s", appendix.Data()), TList::Class(),AliAnalysisManager::kOutputContainer,containerName.Data()));
72 mgr->ConnectOutput(task,2, mgr->CreateContainer(Form("HFE_QA_%s", appendix.Data()), TList::Class(),AliAnalysisManager::kOutputContainer,containerName.Data()));
73 mgr->ConnectInput(task,0, cinput );