New version of task for prompt charm fraction analysis (A. Rossi)
[u/mrichter/AliRoot.git] / PWG3 / vertexingHF / AddTaskCharmFraction.C
CommitLineData
624c07ab 1AliAnalysisTaskSECharmFraction* AddTaskCharmFraction(const char* fileout="d0D0.root",Int_t switchMC[5])
0df0132a 2{
3 //
4 // Configuration macro for the task to analyze the fraction of prompt charm
5 // using the D0 impact parameter
6 // andrea.rossi@ts.infn.it
7 //
8 //==========================================================================
624c07ab 9
10 //######## !!! THE SWITCH FOR MC ANALYSIS IS NOT IMPLEMENTED YET!!! ##########à
11 switchMC[0]=1;
12 switchMC[1]=1;
13 switchMC[2]=1;
14 switchMC[3]=1;
15 switchMC[4]=1;
16 Int_t last=0;
17
0df0132a 18 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
19 if (!mgr) {
20 ::Error("AddTaskCharmFraction", "No analysis manager to connect to.");
21 return NULL;
22 }
23
24 TString str=fileout,containername;
25 str.ReplaceAll(".root","");
26 str.Prepend("_");
27
624c07ab 28 AliAnalysisTaskSECharmFraction *hfTask;
29
30 hfTask = new AliAnalysisTaskSECharmFraction("AliAnalysisTaskSECharmFraction");
31
32
33 /* ############### HERE THE POSSIBILITY TO SWITCH ON/OFF THE TLISTS AND MC SELECTION WILL BE SET #########à
0df0132a 34
35 hfTask->SetUseCuts(setD0usecuts);
36 hfTask->SetCheckMC(setcheckMC);
37 hfTask->SetCheckMC_D0(setcheckMC_D0);
38 hfTask->SetCheckMC_2prongs(setcheckMC_2prongs);
39 hfTask->SetCheckMC_prompt(setcheckMC_prompt);
40 hfTask->SetCheckMC_fromB(setcheckMC_fromB);
41 hfTask->SetCheckMC_fromDstar(setSkipD0star);
624c07ab 42 hfTask->SetStudyPureBackground(setStudyPureBack);*/
0df0132a 43 // hfTask->SetSideBands(0);
44 // hfTask->SetDebugLevel(2);
45 mgr->AddTask(hfTask);
46
0df0132a 47
624c07ab 48
0df0132a 49 // Create containers for input/output
624c07ab 50 AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer();
51 //mgr->CreateContainer("cinput",TChain::Class(),AliAnalysisManager::kInputContainer);
0df0132a 52 mgr->ConnectInput(hfTask,0,cinput);
624c07ab 53
0df0132a 54
55 //Now container for general properties histograms
624c07ab 56 containername="coutputNentries";
0df0132a 57 containername.Append(str.Data());
624c07ab 58 AliAnalysisDataContainer *coutputNentries = mgr->CreateContainer(containername.Data(),TH1F::Class(),
0df0132a 59 AliAnalysisManager::kOutputContainer,
60 fileout);
624c07ab 61
62 mgr->ConnectOutput(hfTask,1,coutputNentries);
0df0132a 63
624c07ab 64 containername="coutputSignalType";
0df0132a 65 containername.Append(str.Data());
624c07ab 66 AliAnalysisDataContainer *coutputSignalType = mgr->CreateContainer(containername.Data(),TH1F::Class(),
0df0132a 67 AliAnalysisManager::kOutputContainer,
68 fileout);
624c07ab 69
70 mgr->ConnectOutput(hfTask,2,coutputSignalType);
0df0132a 71
72
624c07ab 73 containername="coutputSignalType_LsCuts";
0df0132a 74 containername.Append(str.Data());
624c07ab 75 AliAnalysisDataContainer *coutputSignalType_LsCuts = mgr->CreateContainer(containername.Data(),TH1F::Class(),
0df0132a 76 AliAnalysisManager::kOutputContainer,
77 fileout);
624c07ab 78
79 mgr->ConnectOutput(hfTask,3,coutputSignalType_LsCuts);
0df0132a 80
624c07ab 81
82 containername="coutputSignalType_TghCuts";
0df0132a 83 containername.Append(str.Data());
624c07ab 84 AliAnalysisDataContainer *coutputSignalType_TghCuts = mgr->CreateContainer(containername.Data(),TH1F::Class(),
0df0132a 85 AliAnalysisManager::kOutputContainer,
86 fileout);
624c07ab 87
88 mgr->ConnectOutput(hfTask,4,coutputSignalType_TghCuts);
0df0132a 89
624c07ab 90 // Now container for TLists
91 last=5;
92 //########## NO CUTS TLISTS CONTAINER ##############à
93 containername="coutput_nc_sign";
0df0132a 94 containername.Append(str.Data());
624c07ab 95 AliAnalysisDataContainer *coutput_nc_sign = mgr->CreateContainer(containername.Data(),TList::Class(),
0df0132a 96 AliAnalysisManager::kOutputContainer,
97 fileout);
624c07ab 98 mgr->ConnectOutput(hfTask,last,coutput_nc_sign);
99 last++;
0df0132a 100
624c07ab 101
102 containername="coutput_nc_back";
0df0132a 103 containername.Append(str.Data());
624c07ab 104 AliAnalysisDataContainer *coutput_nc_back = mgr->CreateContainer(containername.Data(),TList::Class(),
0df0132a 105 AliAnalysisManager::kOutputContainer,
106 fileout);
624c07ab 107 mgr->ConnectOutput(hfTask,last,coutput_nc_back);
108 last++;
0df0132a 109
624c07ab 110 containername="coutput_nc_fromB";
0df0132a 111 containername.Append(str.Data());
624c07ab 112 AliAnalysisDataContainer *coutput_nc_fromB = mgr->CreateContainer(containername.Data(),TList::Class(),
0df0132a 113 AliAnalysisManager::kOutputContainer,
114 fileout);
624c07ab 115 mgr->ConnectOutput(hfTask,last,coutput_nc_fromB);
116 last++;
117
0df0132a 118
624c07ab 119 containername="coutput_nc_fromDstar";
0df0132a 120 containername.Append(str.Data());
624c07ab 121 AliAnalysisDataContainer *coutput_nc_fromDstar = mgr->CreateContainer(containername.Data(),TList::Class(),
0df0132a 122 AliAnalysisManager::kOutputContainer,
123 fileout);
624c07ab 124 mgr->ConnectOutput(hfTask,last,coutput_nc_fromDstar);
125 last++;
0df0132a 126
127
624c07ab 128 containername="coutput_nc_other";
0df0132a 129 containername.Append(str.Data());
624c07ab 130 AliAnalysisDataContainer *coutput_nc_other = mgr->CreateContainer(containername.Data(),TList::Class(),
0df0132a 131 AliAnalysisManager::kOutputContainer,
132 fileout);
624c07ab 133 mgr->ConnectOutput(hfTask,last,coutput_nc_other);
134 last++;
0df0132a 135
136
624c07ab 137 //######### LOOSE CUTS TLISTS CONTAINER #############
138 containername="coutput_ls_sign";
0df0132a 139 containername.Append(str.Data());
624c07ab 140 AliAnalysisDataContainer *coutput_ls_sign = mgr->CreateContainer(containername.Data(),TList::Class(),
0df0132a 141 AliAnalysisManager::kOutputContainer,
142 fileout);
624c07ab 143 mgr->ConnectOutput(hfTask,last,coutput_ls_sign);
144 last++;
0df0132a 145
146
624c07ab 147 containername="coutput_ls_back";
0df0132a 148 containername.Append(str.Data());
624c07ab 149 AliAnalysisDataContainer *coutput_ls_back = mgr->CreateContainer(containername.Data(),TList::Class(),
0df0132a 150 AliAnalysisManager::kOutputContainer,
151 fileout);
624c07ab 152 mgr->ConnectOutput(hfTask,last,coutput_ls_back);
153 last++;
0df0132a 154
624c07ab 155 containername="coutput_ls_fromB";
0df0132a 156 containername.Append(str.Data());
624c07ab 157 AliAnalysisDataContainer *coutput_ls_fromB = mgr->CreateContainer(containername.Data(),TList::Class(),
0df0132a 158 AliAnalysisManager::kOutputContainer,
624c07ab 159 fileout);
160 mgr->ConnectOutput(hfTask,last,coutput_ls_fromB);
161 last++;
0df0132a 162
163
624c07ab 164 containername="coutput_ls_fromDstar";
165 containername.Append(str.Data());
166 AliAnalysisDataContainer *coutput_ls_fromDstar = mgr->CreateContainer(containername.Data(),TList::Class(),
0df0132a 167 AliAnalysisManager::kOutputContainer,
624c07ab 168 fileout);
169 mgr->ConnectOutput(hfTask,last,coutput_ls_fromDstar);
170 last++;
0df0132a 171
0df0132a 172
624c07ab 173 containername="coutput_ls_other";
174 containername.Append(str.Data());
175 AliAnalysisDataContainer *coutput_ls_other = mgr->CreateContainer(containername.Data(),TList::Class(),
0df0132a 176 AliAnalysisManager::kOutputContainer,
624c07ab 177 fileout);
178 mgr->ConnectOutput(hfTask,last,coutput_ls_other);
179 last++;
0df0132a 180
0df0132a 181
0df0132a 182
624c07ab 183 //######### TIGHT CUTS TLISTS CONTAINER #############
184 containername="coutput_tgh_sign";
185 containername.Append(str.Data());
186 AliAnalysisDataContainer *coutput_tgh_sign = mgr->CreateContainer(containername.Data(),TList::Class(),
0df0132a 187 AliAnalysisManager::kOutputContainer,
624c07ab 188 fileout);
189 mgr->ConnectOutput(hfTask,last,coutput_tgh_sign);
190 last++;
0df0132a 191
192
624c07ab 193 containername="coutput_tgh_back";
194 containername.Append(str.Data());
195 AliAnalysisDataContainer *coutput_tgh_back = mgr->CreateContainer(containername.Data(),TList::Class(),
0df0132a 196 AliAnalysisManager::kOutputContainer,
624c07ab 197 fileout);
198 mgr->ConnectOutput(hfTask,last,coutput_tgh_back);
199 last++;
0df0132a 200
624c07ab 201 containername="coutput_tgh_fromB";
202 containername.Append(str.Data());
203 AliAnalysisDataContainer *coutput_tgh_fromB = mgr->CreateContainer(containername.Data(),TList::Class(),
0df0132a 204 AliAnalysisManager::kOutputContainer,
624c07ab 205 fileout);
206 mgr->ConnectOutput(hfTask,last,coutput_tgh_fromB);
207 last++;
0df0132a 208
209
624c07ab 210 containername="coutput_tgh_fromDstar";
211 containername.Append(str.Data());
212 AliAnalysisDataContainer *coutput_tgh_fromDstar = mgr->CreateContainer(containername.Data(),TList::Class(),
0df0132a 213 AliAnalysisManager::kOutputContainer,
624c07ab 214 fileout);
215 mgr->ConnectOutput(hfTask,last,coutput_tgh_fromDstar);
216 last++;
0df0132a 217
0df0132a 218
624c07ab 219 containername="coutput_tgh_other";
220 containername.Append(str.Data());
221 AliAnalysisDataContainer *coutput_tgh_other = mgr->CreateContainer(containername.Data(),TList::Class(),
0df0132a 222 AliAnalysisManager::kOutputContainer,
624c07ab 223 fileout);
224 mgr->ConnectOutput(hfTask,last,coutput_tgh_other);
225
0df0132a 226
0df0132a 227
228 return hfTask;
229}