.so cleanup: removed from gSystem->Load()
[u/mrichter/AliRoot.git] / PWGHF / hfe / macros / AddTaskHFEtpctofPbPb.C
1 AliAnalysisTask *AddTaskHFEtpctofPbPb(Bool_t isaod, Bool_t isMC,Int_t aodfilter=16,Int_t clusterdef=AliHFEextraCuts::kFoundAll, Int_t clusterrdef=AliHFEextraCuts::kFoundAllOverFindable,Int_t tpcCls=130,  Int_t tpcClsPID = 80, Double_t tpcClsRatio = 0.6, Double_t tpcClShared = 1.1, Bool_t rejectkinkmother = kFALSE, Int_t itsCls=4,Double_t itsChi2PerClusters=-1,Int_t itspixelcut=AliHFEextraCuts::kBoth, Double_t dcaxy=1.0, Double_t dcaz=2.0, Bool_t usetof=kTRUE, Double_t tofs=3.,Bool_t etacor=kFALSE,TString listname="",Double_t tpceff=0.5, Float_t prodlow=0., Float_t prodhigh=3.,Bool_t kNoPhotonic = kTRUE){
2
3   // libraries in case
4   gSystem->Load("libANALYSIS");
5   gSystem->Load("libANALYSISalice");
6
7
8   //set config file name
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());
14
15   
16   // Name 
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);
25   Int_t itof = 0;
26   Int_t iNoPhotonic = 0;
27   Int_t ietacor = 0;
28   Int_t itpceff = (Int_t) (tpceff*10);
29   Int_t irejectkinkmother = 0;
30   if(usetof) itof=kTRUE;
31   if(kNoPhotonic) iNoPhotonic = 1;
32   if(etacor) ietacor = 1;
33   if(rejectkinkmother) irejectkinkmother = 1;
34   
35   TString appendix(TString::Format("f%dcd%dcr%dt%dtp%dtr%dts%dkm%di%dic%di%ddcaxy%dz%dtof%dts%de%dtpc%dprodlow%dhigh%dnhfe%d",aodfilter,clusterdef,clusterrdef,tpcCls,tpcClsPID,itpcClsRatio,itpcClShared,irejectkinkmother,itsCls,iitsChi2PerClusters,itspixelcut,idcaxy,idcaz,itof,itofs,ietacor,itpceff,iprodlow,iprodhigh,iNoPhotonic));
36   printf("appendix %s\n", appendix.Data());
37   
38
39   // ESD or AOD
40   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
41   if (!mgr->GetInputEventHandler()) {
42     printf("AddTaskEventplane", "This task requires an input event handler");
43     return NULL;
44   }
45   TString inputDataType = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
46   Bool_t isaod = kFALSE;
47   if (inputDataType == "AOD") isaod = kTRUE;
48
49   
50   // TPC cut 2010
51   // 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
52   // http://www.physi.uni-heidelberg.de/~pachmay/projects/hfe/pid/tpc/
53   // without eta correction 50%
54   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};
55   // with eta correction 50%
56   // 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};
57   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};
58
59
60   // Task
61   AliAnalysisDataContainer *cinput  = mgr->GetCommonInputContainer();
62   AliAnalysisTaskHFE *task = ConfigHFEpbpb(isaod,isMC,appendix,aodfilter,clusterdef,clusterrdef,tpcCls,tpcClsPID,tpcClsRatio,tpcClShared,irejectkinkmother,itsCls,itsChi2PerClusters,itspixelcut,dcaxy,dcaz,usetof,tofs,etacor,listname,tpcdEdxcutlow,tpcdEdxcuthigh,prodlow,prodhigh,kNoPhotonic);  
63
64   mgr->AddTask(task);
65
66
67   // Write Output 
68   TString containerName = mgr->GetCommonFileName();
69   containerName += ":";
70   containerName += appendix.Data();
71
72   AliAnalysisDataContainer *cinput  = mgr->GetCommonInputContainer();
73   mgr->ConnectOutput(task,1, mgr->CreateContainer(Form("HFE_Results_%s", appendix.Data()), TList::Class(),AliAnalysisManager::kOutputContainer,containerName.Data()));
74   mgr->ConnectOutput(task,2, mgr->CreateContainer(Form("HFE_QA_%s", appendix.Data()), TList::Class(),AliAnalysisManager::kOutputContainer,containerName.Data()));
75   mgr->ConnectInput(task,0, cinput );    
76
77   return NULL;
78   
79 }