Splitting pt bin 1-3 GeV in two bins (Chiara)
[u/mrichter/AliRoot.git] / PWG3 / vertexingHF / AddTaskD0Mass.C
CommitLineData
4464ce7e 1AliAnalysisTaskSED0Mass *AddTaskD0Mass(Int_t flag=0/*0 = D0,1 = LS*/)
49061176 2{
3 //
a41f6fad 4 // AddTask for the AliAnalysisTaskSE for D0 candidates
49061176 5 // invariant mass histogram and association with MC truth
a41f6fad 6 // (using MC info in AOD) and cut variables distributions
49061176 7 // C.Bianchin chiara.bianchin@pd.infn.it
8 //
9
10
11 // Get the pointer to the existing analysis manager via the static access method.
12 //==============================================================================
13 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
14 if (!mgr) {
feb73eca 15 ::Error("AddTaskD0Distr", "No analysis manager to connect to.");
49061176 16 return NULL;
17 }
18
9de8c723 19 TString filename="",out1name="",out2name="",out3name="",out4name="",inname="";
feb73eca 20 if(flag==0){
21 filename="D0InvMass.root";
6306c90b 22 out1name="coutputmassD01";
23 out2name="coutputmassD02";
24 out3name="nEntriesD0";
25 out4name="coutputmassD0distr";
9de8c723 26 inname="cinputmassD0_0";
6306c90b 27 } else {
9de8c723 28 filename="D0InvMassLikeSign.root";
6306c90b 29 out1name="coutputmassLS1";
30 out2name="coutputmassLS2";
31 out3name="nEntriesLS";
32 out4name="coutputmassLSdistr";
9de8c723 33 inname="cinputmassD0_1";
6306c90b 34 }
feb73eca 35
49061176 36 // Aanalysis task
4464ce7e 37 AliAnalysisTaskSED0Mass *massD0Task = new AliAnalysisTaskSED0Mass("D0MassAndDistrAnalysis");
6306c90b 38 massD0Task->SetDebugLevel(0);
feb73eca 39 massD0Task->SetArray(flag);
49061176 40 mgr->AddTask(massD0Task);
41
42 //
43 // Create containers for input/output
9de8c723 44 AliAnalysisDataContainer *cinputmassD0 = mgr->CreateContainer(inname,TChain::Class(),
49061176 45 AliAnalysisManager::kInputContainer);
a4ae02cd 46
6306c90b 47 AliAnalysisDataContainer *coutputmassD01 = mgr->CreateContainer(out1name,TList::Class(),
a4ae02cd 48 AliAnalysisManager::kOutputContainer,
feb73eca 49 filename.Data());
6306c90b 50 AliAnalysisDataContainer *coutputmassD02 = mgr->CreateContainer(out2name,TList::Class(),
49061176 51 AliAnalysisManager::kOutputContainer,
feb73eca 52 filename.Data());
6306c90b 53 AliAnalysisDataContainer *coutputmassD03 = mgr->CreateContainer(out3name,TH1F::Class(),
a41f6fad 54 AliAnalysisManager::kOutputContainer,
feb73eca 55 filename.Data());
6306c90b 56 AliAnalysisDataContainer *coutputmassD04 = mgr->CreateContainer(out4name,TList::Class(),
a4ae02cd 57 AliAnalysisManager::kOutputContainer,
feb73eca 58 filename.Data());
a4ae02cd 59
49061176 60 mgr->ConnectInput(massD0Task,0,mgr->GetCommonInputContainer());
61
a4ae02cd 62 mgr->ConnectOutput(massD0Task,1,coutputmassD01);
63 mgr->ConnectOutput(massD0Task,2,coutputmassD02);
64 mgr->ConnectOutput(massD0Task,3,coutputmassD03);
a41f6fad 65 mgr->ConnectOutput(massD0Task,4,coutputmassD04);
49061176 66
6306c90b 67
49061176 68 return massD0Task;
69}