]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGHF/hfe/macros/AddTaskHFEtpctof.C
d5e91e6942a5cd971e5a2d12379d471561ac5754
[u/mrichter/AliRoot.git] / PWGHF / hfe / macros / AddTaskHFEtpctof.C
1 AliAnalysisTask *AddTaskHFEtpctof(Bool_t beauty=kTRUE, Int_t tpcCls=110,  Int_t tpcClsPID = 70, Double_t tpcClsRatio = 0.6, Double_t tpcClShared = 0.1, Int_t itsCls=4, Double_t itsChi2PerClusters=36., Double_t dcaxy=1.0, Double_t dcaz=2.0, Double_t tofs=3., Double_t ipSig=3.0, Bool_t syst = kFALSE, Int_t itspixelcut=AliHFEextraCuts::kBoth, Float_t prodlow=0., Float_t prodhigh=100., Int_t addflag=0.){
2
3   // libraries in case
4   gSystem->Load("libANALYSIS.so");
5   gSystem->Load("libANALYSISalice.so");
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/18_05_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   TString appendix(TString::Format("TPC%dpid%dClShared%dratio%dITS%dITSChi%dITScut%dDCAr%dz%dIP%dTOF%dProdlow%dProdhigh%daddflag%i",
16                                    tpcCls,tpcClsPID,(Int_t)(tpcClShared*100),(Int_t)(tpcClsRatio*100),itsCls,(Int_t)itsChi2PerClusters,itspixelcut,(Int_t)dcaxy,(Int_t)dcaz,(Int_t)ipSig,(Int_t)(tofs*10),(Int_t)prodlow,(Int_t)prodhigh,addflag));
17   printf("appendix %s\n", appendix.Data());
18   
19   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
20
21   // Check the analysis type using the event handlers connected to the analysis manager.
22   //==============================================================================
23   if (!mgr->GetInputEventHandler()) {
24     ::Error("AddTaskEventplane", "This task requires an input event handler");
25     return NULL;
26   }
27   TString inputDataType = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
28
29   AliAnalysisDataContainer *cinput  = mgr->GetCommonInputContainer();
30   AliAnalysisTaskHFE *task = ConfigHFEpbpb(kFALSE,beauty,tpcCls,tpcClsPID,tpcClsRatio,tpcClShared,itsCls,itsChi2PerClusters,dcaxy,dcaz,tofs,ipSig,itspixelcut,appendix,prodlow,prodhigh,addflag);  
31
32   if (inputDataType == "AOD"){
33     task->SetFillNoCuts(kTRUE);
34     task->SetUseFlagAOD(kFALSE);
35     task->SetApplyCutAOD(kTRUE);
36   }  
37   
38   mgr->AddTask(task);
39
40   TString containerName = mgr->GetCommonFileName();
41   containerName += ":";
42   containerName += appendix.Data();
43
44   AliAnalysisDataContainer *cinput  = mgr->GetCommonInputContainer();
45   mgr->ConnectOutput(task,1, mgr->CreateContainer(Form("HFEtpctof_%s", appendix.Data()), TList::Class(),AliAnalysisManager::kOutputContainer,containerName.Data()));
46   mgr->ConnectInput(task,0, cinput );    
47
48   return NULL;
49   
50 }