]>
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 | ||
38 | ClassImp(AliAnalysisTaskSEVertexingHF) | |
39 | ||
40 | ||
41 | //________________________________________________________________________ | |
42 | AliAnalysisTaskSEVertexingHF::AliAnalysisTaskSEVertexingHF(): | |
43 | AliAnalysisTaskSE(), | |
44 | fVHF(0), | |
a9b75906 | 45 | fListOfCuts(0), |
46 | fDeltaAODFileName("AliAOD.VertexingHF.root"), | |
699a38d6 | 47 | fVerticesHFTClArr(0), |
48 | fD0toKpiTClArr(0), | |
49 | fJPSItoEleTClArr(0), | |
50 | fCharm3ProngTClArr(0), | |
2ff20727 | 51 | fCharm4ProngTClArr(0), |
dc963de9 | 52 | fDstarTClArr(0), |
a07ad8e0 | 53 | fCascadesTClArr(0), |
423fb9ae | 54 | fLikeSign2ProngTClArr(0), |
55 | fLikeSign3ProngTClArr(0) | |
699a38d6 | 56 | { |
57 | // Default constructor | |
58 | } | |
59 | ||
60 | //________________________________________________________________________ | |
61 | AliAnalysisTaskSEVertexingHF::AliAnalysisTaskSEVertexingHF(const char *name): | |
62 | AliAnalysisTaskSE(name), | |
63 | fVHF(0), | |
a9b75906 | 64 | fListOfCuts(0), |
65 | fDeltaAODFileName("AliAOD.VertexingHF.root"), | |
699a38d6 | 66 | fVerticesHFTClArr(0), |
67 | fD0toKpiTClArr(0), | |
68 | fJPSItoEleTClArr(0), | |
69 | fCharm3ProngTClArr(0), | |
2ff20727 | 70 | fCharm4ProngTClArr(0), |
dc963de9 | 71 | fDstarTClArr(0), |
a07ad8e0 | 72 | fCascadesTClArr(0), |
423fb9ae | 73 | fLikeSign2ProngTClArr(0), |
74 | fLikeSign3ProngTClArr(0) | |
699a38d6 | 75 | { |
a9b75906 | 76 | // Standard constructor |
77 | ||
78 | DefineOutput(1,TList::Class()); // analysis cuts | |
699a38d6 | 79 | } |
80 | ||
81 | //________________________________________________________________________ | |
82 | AliAnalysisTaskSEVertexingHF::~AliAnalysisTaskSEVertexingHF() | |
83 | { | |
84 | // Destructor | |
a9b75906 | 85 | |
86 | if(fListOfCuts) { | |
87 | delete fListOfCuts; | |
88 | fListOfCuts=NULL; | |
89 | } | |
90 | ||
699a38d6 | 91 | } |
92 | ||
93 | //________________________________________________________________________ | |
94 | void AliAnalysisTaskSEVertexingHF::Init() | |
95 | { | |
96 | // Initialization | |
97 | // Instanciates vHF and loads its parameters | |
98 | ||
99 | if(fDebug > 1) printf("AnalysisTaskSEVertexingHF::Init() \n"); | |
100 | ||
423fb9ae | 101 | if(gROOT->LoadMacro("ConfigVertexingHF.C")) { |
102 | printf("AnalysisTaskSEVertexingHF::Init() \n Using $ALICE_ROOT/PWG3/vertexingHF/ConfigVertexingHF.C\n"); | |
103 | gROOT->LoadMacro("$ALICE_ROOT/PWG3/vertexingHF/ConfigVertexingHF.C"); | |
104 | } | |
699a38d6 | 105 | |
106 | fVHF = (AliAnalysisVertexingHF*)gROOT->ProcessLine("ConfigVertexingHF()"); | |
107 | fVHF->PrintStatus(); | |
a9b75906 | 108 | |
109 | ||
110 | // write the objects AliRDHFCuts to a list to store in the output | |
111 | ||
112 | fListOfCuts = fVHF->FillListOfCuts(); | |
113 | ||
114 | PostData(1,fListOfCuts); | |
115 | ||
116 | AliAnalysisManager::GetAnalysisManager()->RegisterExtraFile(fDeltaAODFileName.Data()); | |
699a38d6 | 117 | |
118 | return; | |
119 | } | |
120 | ||
121 | //________________________________________________________________________ | |
122 | void AliAnalysisTaskSEVertexingHF::UserCreateOutputObjects() | |
123 | { | |
124 | // Create the output container | |
125 | // | |
126 | if(fDebug > 1) printf("AnalysisTaskSEVertexingHF::UserCreateOutPutData() \n"); | |
0392e556 | 127 | // Support both the case when the AOD + deltaAOD are produced in an ESD |
128 | // analysis or if the deltaAOD is produced on an analysis on AOD's. (A.G. 27/04/09) | |
5a0b85ff | 129 | if(!AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler()) { |
130 | Fatal("UserCreateOutputObjects", "This task needs an AOD handler"); | |
131 | return; | |
0392e556 | 132 | } |
a9b75906 | 133 | TString filename = fDeltaAODFileName; |
5a0b85ff | 134 | // When running on standard AOD to produce deltas, IsStandardAOD is never set, |
135 | // If AODEvent is NULL, new branches have to be added to the new file(s) (A.G. 15/01/10) | |
136 | if(!IsStandardAOD() && AODEvent()) filename = ""; | |
699a38d6 | 137 | if(!fVHF) { |
138 | printf("AnalysisTaskSEVertexingHF::UserCreateOutPutData() \n ERROR! no fvHF!\n"); | |
139 | return; | |
140 | } | |
141 | ||
142 | fVerticesHFTClArr = new TClonesArray("AliAODVertex", 0); | |
143 | fVerticesHFTClArr->SetName("VerticesHF"); | |
0392e556 | 144 | AddAODBranch("TClonesArray", &fVerticesHFTClArr, filename); |
699a38d6 | 145 | |
dc963de9 | 146 | if(fVHF->GetD0toKpi()) { |
699a38d6 | 147 | fD0toKpiTClArr = new TClonesArray("AliAODRecoDecayHF2Prong", 0); |
148 | fD0toKpiTClArr->SetName("D0toKpi"); | |
0392e556 | 149 | AddAODBranch("TClonesArray", &fD0toKpiTClArr, filename); |
699a38d6 | 150 | } |
151 | ||
152 | if(fVHF->GetJPSItoEle()) { | |
153 | fJPSItoEleTClArr = new TClonesArray("AliAODRecoDecayHF2Prong", 0); | |
154 | fJPSItoEleTClArr->SetName("JPSItoEle"); | |
0392e556 | 155 | AddAODBranch("TClonesArray", &fJPSItoEleTClArr, filename); |
699a38d6 | 156 | } |
157 | ||
158 | if(fVHF->Get3Prong()) { | |
159 | fCharm3ProngTClArr = new TClonesArray("AliAODRecoDecayHF3Prong", 0); | |
160 | fCharm3ProngTClArr->SetName("Charm3Prong"); | |
0392e556 | 161 | AddAODBranch("TClonesArray", &fCharm3ProngTClArr, filename); |
699a38d6 | 162 | } |
163 | ||
164 | if(fVHF->Get4Prong()) { | |
165 | fCharm4ProngTClArr = new TClonesArray("AliAODRecoDecayHF4Prong", 0); | |
166 | fCharm4ProngTClArr->SetName("Charm4Prong"); | |
0392e556 | 167 | AddAODBranch("TClonesArray", &fCharm4ProngTClArr, filename); |
699a38d6 | 168 | } |
169 | ||
2ff20727 | 170 | if(fVHF->GetDstar()) { |
171 | fDstarTClArr = new TClonesArray("AliAODRecoCascadeHF", 0); | |
172 | fDstarTClArr->SetName("Dstar"); | |
0392e556 | 173 | AddAODBranch("TClonesArray", &fDstarTClArr, filename); |
2ff20727 | 174 | } |
175 | ||
a07ad8e0 | 176 | if(fVHF->GetCascades()){ |
177 | fCascadesTClArr = new TClonesArray("AliAODRecoCascadeHF", 0); | |
178 | fCascadesTClArr->SetName("CascadesHF"); | |
179 | AddAODBranch("TClonesArray", &fCascadesTClArr, filename); | |
180 | } | |
181 | ||
dc963de9 | 182 | if(fVHF->GetLikeSign()) { |
423fb9ae | 183 | fLikeSign2ProngTClArr = new TClonesArray("AliAODRecoDecayHF2Prong", 0); |
184 | fLikeSign2ProngTClArr->SetName("LikeSign2Prong"); | |
0392e556 | 185 | AddAODBranch("TClonesArray", &fLikeSign2ProngTClArr, filename); |
423fb9ae | 186 | } |
187 | ||
188 | if(fVHF->GetLikeSign() && fVHF->Get3Prong()) { | |
189 | fLikeSign3ProngTClArr = new TClonesArray("AliAODRecoDecayHF3Prong", 0); | |
190 | fLikeSign3ProngTClArr->SetName("LikeSign3Prong"); | |
0392e556 | 191 | AddAODBranch("TClonesArray", &fLikeSign3ProngTClArr, filename); |
dc963de9 | 192 | } |
193 | ||
699a38d6 | 194 | return; |
195 | } | |
196 | ||
197 | //________________________________________________________________________ | |
198 | void AliAnalysisTaskSEVertexingHF::UserExec(Option_t */*option*/) | |
199 | { | |
200 | // Execute analysis for current event: | |
201 | // heavy flavor vertexing | |
202 | ||
dcb444c9 | 203 | AliVEvent *event = dynamic_cast<AliVEvent*> (InputEvent()); |
0392e556 | 204 | // In case there is an AOD handler writing a standard AOD, use the AOD |
205 | // event in memory rather than the input (ESD) event. (A.G. 27/04/09) | |
206 | if (AODEvent() && IsStandardAOD()) event = dynamic_cast<AliVEvent*> (AODEvent()); | |
699a38d6 | 207 | |
208 | // heavy flavor vertexing | |
dcb444c9 | 209 | fVHF->FindCandidates(event, |
210 | fVerticesHFTClArr, | |
211 | fD0toKpiTClArr, | |
212 | fJPSItoEleTClArr, | |
213 | fCharm3ProngTClArr, | |
2ff20727 | 214 | fCharm4ProngTClArr, |
dc963de9 | 215 | fDstarTClArr, |
a07ad8e0 | 216 | fCascadesTClArr, |
423fb9ae | 217 | fLikeSign2ProngTClArr, |
218 | fLikeSign3ProngTClArr); | |
699a38d6 | 219 | |
220 | return; | |
221 | } | |
222 | ||
223 | //________________________________________________________________________ | |
224 | void AliAnalysisTaskSEVertexingHF::Terminate(Option_t */*option*/) | |
225 | { | |
226 | // Terminate analysis | |
227 | // | |
228 | if(fDebug > 1) printf("AnalysisTaskSEVertexingHF: Terminate() \n"); | |
229 | } |