67fdcf9835c5f834ef2aa9d6f326dfb1f5922771
[u/mrichter/AliRoot.git] / PWG3 / vertexingHF / AddTaskDs.C
1 AliAnalysisTaskSEDs *AddTaskDs(Bool_t readMC=kTRUE)
2 {
3   //                                                                           
4   // Test macro for the AliAnalysisTaskSE for Ds candidates 
5
6
7   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
8   if (!mgr) {
9     ::Error("AddTaskDs", "No analysis manager to connect to.");
10     return NULL;
11   }
12
13
14
15   //ptbins
16   const Int_t nptbins=4;
17   Float_t ptbins[nptbins+1]={0.,2.,3.,5.,99999.};
18
19   //setting cut values
20   Int_t nvars=14;
21   Float_t** ancutsval;
22   ancutsval=new Float_t*[nvars];
23   for(Int_t ic=0;ic<nvars;ic++){ancutsval[ic]=new Float_t[nptbins];}  
24   for(Int_t ipt=0;ipt<nptbins;ipt++){
25     ancutsval[0][ipt]=0.2;
26     ancutsval[1][ipt]=0.4;
27     ancutsval[2][ipt]=0.4;
28     ancutsval[3][ipt]=0.;
29     ancutsval[4][ipt]=0.;
30     ancutsval[5][ipt]=0.005;
31     ancutsval[6][ipt]=0.038;
32     ancutsval[7][ipt]=0.;
33     ancutsval[8][ipt]=0.;
34     ancutsval[9][ipt]=0.95;
35     ancutsval[10][ipt]=0.;
36     ancutsval[11][ipt]=0.1;
37     ancutsval[12][ipt]=0.004;
38     ancutsval[13][ipt]=0.035;
39   }
40   Float_t** prcutsval;
41   prcutsval=new Float_t*[nvars];
42   for(Int_t ic=0;ic<nvars;ic++){prcutsval[ic]=new Float_t[nptbins];}  
43   for(Int_t ipt=0;ipt<nptbins;ipt++){
44     prcutsval[0][ipt]=0.2;
45     prcutsval[1][ipt]=0.4;
46     prcutsval[2][ipt]=0.4;
47     prcutsval[3][ipt]=0.;
48     prcutsval[4][ipt]=0.;
49     prcutsval[5][ipt]=0.005;
50     prcutsval[6][ipt]=0.06;
51     prcutsval[7][ipt]=0.;
52     prcutsval[8][ipt]=0.;
53     prcutsval[9][ipt]=0.85;
54     prcutsval[10][ipt]=0.;
55     prcutsval[11][ipt]=0.1;
56     prcutsval[12][ipt]=0.1;
57     prcutsval[13][ipt]=0.1;
58   }
59
60   //Analysis cuts
61   AliRDHFCutsDstoKKpi *analysiscuts = new AliRDHFCutsDstoKKpi();
62   analysiscuts->SetPtBins(nptbins+1,ptbins);
63   analysiscuts->SetCuts(nvars,nptbins,ancutsval);
64   AliRDHFCutsDstoKKpi *prodcuts = new AliRDHFCutsDstoKKpi();
65   prodcuts->SetPtBins(nptbins+1,ptbins);
66   prodcuts->SetCuts(nvars,nptbins,prcutsval);
67
68   // Analysis task                                                                                                                     
69   AliAnalysisTaskSEDs *dsTask = new AliAnalysisTaskSEDs("DsAnalysis",prodcuts,analysiscuts);
70   dsTask->SetReadMC(readMC);
71   dsTask->SetDebugLevel(0);
72   mgr->AddTask(dsTask);
73
74   //                                                                                                                                    
75   // Create containers for input/output                                                                                                 
76   AliAnalysisDataContainer *cinputDs = mgr->CreateContainer("cinputDs",TChain::Class(),
77                                                             AliAnalysisManager::kInputContainer);
78
79  TString outputfile = AliAnalysisManager::GetCommonFileName(); 
80  outputfile += ":PWG3_D2H_InvMassDs";
81  
82  AliAnalysisDataContainer *coutputDsCuts = mgr->CreateContainer("coutputDsCuts",TList::Class(),
83                                                             AliAnalysisManager::kOutputContainer,
84                                                                 outputfile.Data());
85
86  
87   AliAnalysisDataContainer *coutputDs = mgr->CreateContainer("coutputDs",TList::Class(),
88                                                              AliAnalysisManager::kOutputContainer,
89                                                              outputfile.Data());
90
91
92   mgr->ConnectInput(dsTask,0,mgr->GetCommonInputContainer());
93
94   mgr->ConnectOutput(dsTask,1,coutputDs);
95
96   mgr->ConnectOutput(dsTask,2,coutputDsCuts);
97   return dsTask;
98 }