Added possibility to run without reading the MC (Andrea)
[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");
bf74e6db 31 hfTask->SetReadMC(kTRUE);
624c07ab 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 ##############à
c387e585 93 containername="clistNCsign";
0df0132a 94 containername.Append(str.Data());
c387e585 95 AliAnalysisDataContainer *clistNCsign = mgr->CreateContainer(containername.Data(),TList::Class(),
0df0132a 96 AliAnalysisManager::kOutputContainer,
97 fileout);
c387e585 98 mgr->ConnectOutput(hfTask,last,clistNCsign);
624c07ab 99 last++;
0df0132a 100
624c07ab 101
c387e585 102 containername="clistNCback";
0df0132a 103 containername.Append(str.Data());
c387e585 104 AliAnalysisDataContainer *clistNCback = mgr->CreateContainer(containername.Data(),TList::Class(),
0df0132a 105 AliAnalysisManager::kOutputContainer,
106 fileout);
c387e585 107 mgr->ConnectOutput(hfTask,last,clistNCback);
624c07ab 108 last++;
0df0132a 109
c387e585 110 containername="clistNCfromB";
0df0132a 111 containername.Append(str.Data());
c387e585 112 AliAnalysisDataContainer *clistNCfromB = mgr->CreateContainer(containername.Data(),TList::Class(),
0df0132a 113 AliAnalysisManager::kOutputContainer,
114 fileout);
c387e585 115 mgr->ConnectOutput(hfTask,last,clistNCfromB);
624c07ab 116 last++;
117
0df0132a 118
c387e585 119 containername="clistNCfromDstar";
0df0132a 120 containername.Append(str.Data());
c387e585 121 AliAnalysisDataContainer *clistNCfromDstar = mgr->CreateContainer(containername.Data(),TList::Class(),
0df0132a 122 AliAnalysisManager::kOutputContainer,
123 fileout);
c387e585 124 mgr->ConnectOutput(hfTask,last,clistNCfromDstar);
624c07ab 125 last++;
0df0132a 126
127
c387e585 128 containername="clistNCother";
0df0132a 129 containername.Append(str.Data());
c387e585 130 AliAnalysisDataContainer *clistNCother = mgr->CreateContainer(containername.Data(),TList::Class(),
0df0132a 131 AliAnalysisManager::kOutputContainer,
132 fileout);
c387e585 133 mgr->ConnectOutput(hfTask,last,clistNCother);
624c07ab 134 last++;
0df0132a 135
136
624c07ab 137 //######### LOOSE CUTS TLISTS CONTAINER #############
c387e585 138 containername="clistLSCsign";
0df0132a 139 containername.Append(str.Data());
c387e585 140 AliAnalysisDataContainer *clistLSCsign = mgr->CreateContainer(containername.Data(),TList::Class(),
0df0132a 141 AliAnalysisManager::kOutputContainer,
142 fileout);
c387e585 143 mgr->ConnectOutput(hfTask,last,clistLSCsign);
624c07ab 144 last++;
0df0132a 145
146
c387e585 147 containername="clistLSCback";
0df0132a 148 containername.Append(str.Data());
c387e585 149 AliAnalysisDataContainer *clistLSCback = mgr->CreateContainer(containername.Data(),TList::Class(),
0df0132a 150 AliAnalysisManager::kOutputContainer,
151 fileout);
c387e585 152 mgr->ConnectOutput(hfTask,last,clistLSCback);
624c07ab 153 last++;
0df0132a 154
c387e585 155 containername="clistLSCfromB";
0df0132a 156 containername.Append(str.Data());
c387e585 157 AliAnalysisDataContainer *clistLSCfromB = mgr->CreateContainer(containername.Data(),TList::Class(),
0df0132a 158 AliAnalysisManager::kOutputContainer,
624c07ab 159 fileout);
c387e585 160 mgr->ConnectOutput(hfTask,last,clistLSCfromB);
624c07ab 161 last++;
0df0132a 162
163
c387e585 164 containername="clistLSCfromDstar";
624c07ab 165 containername.Append(str.Data());
c387e585 166 AliAnalysisDataContainer *clistLSCfromDstar = mgr->CreateContainer(containername.Data(),TList::Class(),
0df0132a 167 AliAnalysisManager::kOutputContainer,
624c07ab 168 fileout);
c387e585 169 mgr->ConnectOutput(hfTask,last,clistLSCfromDstar);
624c07ab 170 last++;
0df0132a 171
0df0132a 172
c387e585 173 containername="clistLSCother";
624c07ab 174 containername.Append(str.Data());
c387e585 175 AliAnalysisDataContainer *clistLSCother = mgr->CreateContainer(containername.Data(),TList::Class(),
0df0132a 176 AliAnalysisManager::kOutputContainer,
624c07ab 177 fileout);
c387e585 178 mgr->ConnectOutput(hfTask,last,clistLSCother);
624c07ab 179 last++;
0df0132a 180
0df0132a 181
0df0132a 182
624c07ab 183 //######### TIGHT CUTS TLISTS CONTAINER #############
c387e585 184 containername="clistTGHCsign";
624c07ab 185 containername.Append(str.Data());
c387e585 186 AliAnalysisDataContainer *clistTGHCsign = mgr->CreateContainer(containername.Data(),TList::Class(),
0df0132a 187 AliAnalysisManager::kOutputContainer,
624c07ab 188 fileout);
c387e585 189 mgr->ConnectOutput(hfTask,last,clistTGHCsign);
624c07ab 190 last++;
0df0132a 191
192
c387e585 193 containername="clistTGHCback";
624c07ab 194 containername.Append(str.Data());
c387e585 195 AliAnalysisDataContainer *clistTGHCback = mgr->CreateContainer(containername.Data(),TList::Class(),
0df0132a 196 AliAnalysisManager::kOutputContainer,
624c07ab 197 fileout);
c387e585 198 mgr->ConnectOutput(hfTask,last,clistTGHCback);
624c07ab 199 last++;
0df0132a 200
c387e585 201 containername="clistTGHCfromB";
624c07ab 202 containername.Append(str.Data());
c387e585 203 AliAnalysisDataContainer *clistTGHCfromB = mgr->CreateContainer(containername.Data(),TList::Class(),
0df0132a 204 AliAnalysisManager::kOutputContainer,
624c07ab 205 fileout);
c387e585 206 mgr->ConnectOutput(hfTask,last,clistTGHCfromB);
624c07ab 207 last++;
0df0132a 208
209
c387e585 210 containername="clistTGHCfromDstar";
624c07ab 211 containername.Append(str.Data());
c387e585 212 AliAnalysisDataContainer *clistTGHCfromDstar = mgr->CreateContainer(containername.Data(),TList::Class(),
0df0132a 213 AliAnalysisManager::kOutputContainer,
624c07ab 214 fileout);
c387e585 215 mgr->ConnectOutput(hfTask,last,clistTGHCfromDstar);
624c07ab 216 last++;
0df0132a 217
0df0132a 218
c387e585 219 containername="clistTGHCother";
624c07ab 220 containername.Append(str.Data());
c387e585 221 AliAnalysisDataContainer *clistTGHCother = mgr->CreateContainer(containername.Data(),TList::Class(),
0df0132a 222 AliAnalysisManager::kOutputContainer,
624c07ab 223 fileout);
c387e585 224 mgr->ConnectOutput(hfTask,last,clistTGHCother);
624c07ab 225
0df0132a 226
0df0132a 227
228 return hfTask;
229}