]>
Commit | Line | Data |
---|---|---|
699a38d6 | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-2008, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
7 | * Permission to use, copy, modify and distribute this software and its * | |
8 | * documentation strictly for non-commercial purposes is hereby granted * | |
9 | * without fee, provided that the above copyright notice appears in all * | |
10 | * copies and that both the copyright notice and this permission notice * | |
11 | * appear in the supporting documentation. The authors make no claims * | |
12 | * about the suitability of this software for any purpose. It is * | |
13 | * provided "as is" without express or implied warranty. * | |
14 | **************************************************************************/ | |
15 | ||
16 | ///////////////////////////////////////////////////////////// | |
17 | // | |
18 | // AliAnalysisTaskSE for the reconstruction of heavy flavor | |
19 | // decays, using the class AliAnalysisVertexingHF. | |
20 | // | |
21 | // Author: A.Dainese, andrea.dainese@lnl.infn.it | |
22 | ///////////////////////////////////////////////////////////// | |
23 | ||
24 | #include <TROOT.h> | |
25 | #include <TSystem.h> | |
26 | #include <TClonesArray.h> | |
a9b75906 | 27 | #include <TList.h> |
28 | #include <TString.h> | |
699a38d6 | 29 | |
dcb444c9 | 30 | #include "AliVEvent.h" |
699a38d6 | 31 | #include "AliAODEvent.h" |
32 | #include "AliESDEvent.h" | |
33 | #include "AliAnalysisVertexingHF.h" | |
34 | #include "AliAnalysisTaskSE.h" | |
6ed0d659 | 35 | #include "AliAnalysisManager.h" |
699a38d6 | 36 | #include "AliAnalysisTaskSEVertexingHF.h" |
37 | ||
4569a83a | 38 | #include "AliESDUtils.h" |
39 | #include "AliAODHFUtil.h" | |
40 | ||
41 | ||
699a38d6 | 42 | ClassImp(AliAnalysisTaskSEVertexingHF) |
43 | ||
44 | ||
45 | //________________________________________________________________________ | |
46 | AliAnalysisTaskSEVertexingHF::AliAnalysisTaskSEVertexingHF(): | |
47 | AliAnalysisTaskSE(), | |
48 | fVHF(0), | |
a9b75906 | 49 | fListOfCuts(0), |
50 | fDeltaAODFileName("AliAOD.VertexingHF.root"), | |
699a38d6 | 51 | fVerticesHFTClArr(0), |
52 | fD0toKpiTClArr(0), | |
53 | fJPSItoEleTClArr(0), | |
54 | fCharm3ProngTClArr(0), | |
2ff20727 | 55 | fCharm4ProngTClArr(0), |
dc963de9 | 56 | fDstarTClArr(0), |
a07ad8e0 | 57 | fCascadesTClArr(0), |
423fb9ae | 58 | fLikeSign2ProngTClArr(0), |
4569a83a | 59 | fLikeSign3ProngTClArr(0), |
60 | fHFUtilInfo(0) | |
699a38d6 | 61 | { |
62 | // Default constructor | |
63 | } | |
64 | ||
65 | //________________________________________________________________________ | |
66 | AliAnalysisTaskSEVertexingHF::AliAnalysisTaskSEVertexingHF(const char *name): | |
67 | AliAnalysisTaskSE(name), | |
68 | fVHF(0), | |
a9b75906 | 69 | fListOfCuts(0), |
70 | fDeltaAODFileName("AliAOD.VertexingHF.root"), | |
699a38d6 | 71 | fVerticesHFTClArr(0), |
72 | fD0toKpiTClArr(0), | |
73 | fJPSItoEleTClArr(0), | |
74 | fCharm3ProngTClArr(0), | |
2ff20727 | 75 | fCharm4ProngTClArr(0), |
dc963de9 | 76 | fDstarTClArr(0), |
a07ad8e0 | 77 | fCascadesTClArr(0), |
423fb9ae | 78 | fLikeSign2ProngTClArr(0), |
4569a83a | 79 | fLikeSign3ProngTClArr(0), |
80 | fHFUtilInfo(0) | |
699a38d6 | 81 | { |
a9b75906 | 82 | // Standard constructor |
83 | ||
84 | DefineOutput(1,TList::Class()); // analysis cuts | |
699a38d6 | 85 | } |
86 | ||
87 | //________________________________________________________________________ | |
88 | AliAnalysisTaskSEVertexingHF::~AliAnalysisTaskSEVertexingHF() | |
89 | { | |
90 | // Destructor | |
a9b75906 | 91 | |
92 | if(fListOfCuts) { | |
93 | delete fListOfCuts; | |
94 | fListOfCuts=NULL; | |
95 | } | |
96 | ||
699a38d6 | 97 | } |
98 | ||
99 | //________________________________________________________________________ | |
100 | void AliAnalysisTaskSEVertexingHF::Init() | |
101 | { | |
102 | // Initialization | |
103 | // Instanciates vHF and loads its parameters | |
104 | ||
105 | if(fDebug > 1) printf("AnalysisTaskSEVertexingHF::Init() \n"); | |
106 | ||
423fb9ae | 107 | if(gROOT->LoadMacro("ConfigVertexingHF.C")) { |
108 | printf("AnalysisTaskSEVertexingHF::Init() \n Using $ALICE_ROOT/PWG3/vertexingHF/ConfigVertexingHF.C\n"); | |
109 | gROOT->LoadMacro("$ALICE_ROOT/PWG3/vertexingHF/ConfigVertexingHF.C"); | |
110 | } | |
699a38d6 | 111 | |
112 | fVHF = (AliAnalysisVertexingHF*)gROOT->ProcessLine("ConfigVertexingHF()"); | |
113 | fVHF->PrintStatus(); | |
a9b75906 | 114 | |
115 | ||
116 | // write the objects AliRDHFCuts to a list to store in the output | |
117 | ||
118 | fListOfCuts = fVHF->FillListOfCuts(); | |
119 | ||
120 | PostData(1,fListOfCuts); | |
121 | ||
122 | AliAnalysisManager::GetAnalysisManager()->RegisterExtraFile(fDeltaAODFileName.Data()); | |
699a38d6 | 123 | |
124 | return; | |
125 | } | |
126 | ||
127 | //________________________________________________________________________ | |
128 | void AliAnalysisTaskSEVertexingHF::UserCreateOutputObjects() | |
129 | { | |
130 | // Create the output container | |
131 | // | |
132 | if(fDebug > 1) printf("AnalysisTaskSEVertexingHF::UserCreateOutPutData() \n"); | |
0392e556 | 133 | // Support both the case when the AOD + deltaAOD are produced in an ESD |
134 | // analysis or if the deltaAOD is produced on an analysis on AOD's. (A.G. 27/04/09) | |
5a0b85ff | 135 | if(!AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler()) { |
136 | Fatal("UserCreateOutputObjects", "This task needs an AOD handler"); | |
137 | return; | |
0392e556 | 138 | } |
a9b75906 | 139 | TString filename = fDeltaAODFileName; |
5a0b85ff | 140 | // When running on standard AOD to produce deltas, IsStandardAOD is never set, |
141 | // If AODEvent is NULL, new branches have to be added to the new file(s) (A.G. 15/01/10) | |
142 | if(!IsStandardAOD() && AODEvent()) filename = ""; | |
699a38d6 | 143 | if(!fVHF) { |
144 | printf("AnalysisTaskSEVertexingHF::UserCreateOutPutData() \n ERROR! no fvHF!\n"); | |
145 | return; | |
146 | } | |
147 | ||
148 | fVerticesHFTClArr = new TClonesArray("AliAODVertex", 0); | |
149 | fVerticesHFTClArr->SetName("VerticesHF"); | |
0392e556 | 150 | AddAODBranch("TClonesArray", &fVerticesHFTClArr, filename); |
699a38d6 | 151 | |
dc963de9 | 152 | if(fVHF->GetD0toKpi()) { |
699a38d6 | 153 | fD0toKpiTClArr = new TClonesArray("AliAODRecoDecayHF2Prong", 0); |
154 | fD0toKpiTClArr->SetName("D0toKpi"); | |
0392e556 | 155 | AddAODBranch("TClonesArray", &fD0toKpiTClArr, filename); |
699a38d6 | 156 | } |
157 | ||
158 | if(fVHF->GetJPSItoEle()) { | |
159 | fJPSItoEleTClArr = new TClonesArray("AliAODRecoDecayHF2Prong", 0); | |
160 | fJPSItoEleTClArr->SetName("JPSItoEle"); | |
0392e556 | 161 | AddAODBranch("TClonesArray", &fJPSItoEleTClArr, filename); |
699a38d6 | 162 | } |
163 | ||
164 | if(fVHF->Get3Prong()) { | |
165 | fCharm3ProngTClArr = new TClonesArray("AliAODRecoDecayHF3Prong", 0); | |
166 | fCharm3ProngTClArr->SetName("Charm3Prong"); | |
0392e556 | 167 | AddAODBranch("TClonesArray", &fCharm3ProngTClArr, filename); |
699a38d6 | 168 | } |
169 | ||
170 | if(fVHF->Get4Prong()) { | |
171 | fCharm4ProngTClArr = new TClonesArray("AliAODRecoDecayHF4Prong", 0); | |
172 | fCharm4ProngTClArr->SetName("Charm4Prong"); | |
0392e556 | 173 | AddAODBranch("TClonesArray", &fCharm4ProngTClArr, filename); |
699a38d6 | 174 | } |
175 | ||
2ff20727 | 176 | if(fVHF->GetDstar()) { |
177 | fDstarTClArr = new TClonesArray("AliAODRecoCascadeHF", 0); | |
178 | fDstarTClArr->SetName("Dstar"); | |
0392e556 | 179 | AddAODBranch("TClonesArray", &fDstarTClArr, filename); |
2ff20727 | 180 | } |
181 | ||
a07ad8e0 | 182 | if(fVHF->GetCascades()){ |
183 | fCascadesTClArr = new TClonesArray("AliAODRecoCascadeHF", 0); | |
184 | fCascadesTClArr->SetName("CascadesHF"); | |
185 | AddAODBranch("TClonesArray", &fCascadesTClArr, filename); | |
186 | } | |
187 | ||
dc963de9 | 188 | if(fVHF->GetLikeSign()) { |
423fb9ae | 189 | fLikeSign2ProngTClArr = new TClonesArray("AliAODRecoDecayHF2Prong", 0); |
190 | fLikeSign2ProngTClArr->SetName("LikeSign2Prong"); | |
0392e556 | 191 | AddAODBranch("TClonesArray", &fLikeSign2ProngTClArr, filename); |
423fb9ae | 192 | } |
193 | ||
194 | if(fVHF->GetLikeSign() && fVHF->Get3Prong()) { | |
195 | fLikeSign3ProngTClArr = new TClonesArray("AliAODRecoDecayHF3Prong", 0); | |
196 | fLikeSign3ProngTClArr->SetName("LikeSign3Prong"); | |
0392e556 | 197 | AddAODBranch("TClonesArray", &fLikeSign3ProngTClArr, filename); |
dc963de9 | 198 | } |
199 | ||
4569a83a | 200 | //---Way to pass information temporarily not available in AOD--- |
201 | // no if() { | |
202 | fHFUtilInfo = new AliAODHFUtil("fHFUtilInfoC"); | |
203 | fHFUtilInfo->SetName("fHFUtilInfo"); | |
204 | AddAODBranch( "AliAODHFUtil", &fHFUtilInfo, filename); | |
205 | // } | |
206 | //-------------------------------------------------------------- | |
207 | ||
699a38d6 | 208 | return; |
209 | } | |
210 | ||
211 | //________________________________________________________________________ | |
212 | void AliAnalysisTaskSEVertexingHF::UserExec(Option_t */*option*/) | |
213 | { | |
214 | // Execute analysis for current event: | |
215 | // heavy flavor vertexing | |
216 | ||
dcb444c9 | 217 | AliVEvent *event = dynamic_cast<AliVEvent*> (InputEvent()); |
0392e556 | 218 | // In case there is an AOD handler writing a standard AOD, use the AOD |
219 | // event in memory rather than the input (ESD) event. (A.G. 27/04/09) | |
220 | if (AODEvent() && IsStandardAOD()) event = dynamic_cast<AliVEvent*> (AODEvent()); | |
699a38d6 | 221 | |
222 | // heavy flavor vertexing | |
dcb444c9 | 223 | fVHF->FindCandidates(event, |
224 | fVerticesHFTClArr, | |
225 | fD0toKpiTClArr, | |
226 | fJPSItoEleTClArr, | |
227 | fCharm3ProngTClArr, | |
2ff20727 | 228 | fCharm4ProngTClArr, |
dc963de9 | 229 | fDstarTClArr, |
a07ad8e0 | 230 | fCascadesTClArr, |
423fb9ae | 231 | fLikeSign2ProngTClArr, |
232 | fLikeSign3ProngTClArr); | |
699a38d6 | 233 | |
4569a83a | 234 | //---Way to pass information temporarily not available in AOD--- |
235 | AliESDEvent *eventE = dynamic_cast<AliESDEvent*> (InputEvent()); | |
236 | if(eventE) { | |
237 | Float_t *vChCorr = new Float_t[64]; | |
238 | Float_t dummy; | |
239 | AliESDUtils::GetCorrV0(eventE,dummy,vChCorr); | |
240 | fHFUtilInfo->SetVZERO( vChCorr ); | |
fd20854c | 241 | delete [] vChCorr; |
4569a83a | 242 | } |
243 | //-------------------------------------------------------------- | |
244 | ||
699a38d6 | 245 | return; |
246 | } | |
247 | ||
248 | //________________________________________________________________________ | |
249 | void AliAnalysisTaskSEVertexingHF::Terminate(Option_t */*option*/) | |
250 | { | |
251 | // Terminate analysis | |
252 | // | |
253 | if(fDebug > 1) printf("AnalysisTaskSEVertexingHF: Terminate() \n"); | |
254 | } |