]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG3/vertexingHF/AliAnalysisTaskSEVertexingHF.cxx
Change of signature of AddAODBranch.
[u/mrichter/AliRoot.git] / PWG3 / vertexingHF / AliAnalysisTaskSEVertexingHF.cxx
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>
27
28 #include "AliAODEvent.h"
29 #include "AliESDEvent.h"
30 #include "AliAnalysisVertexingHF.h"
31 #include "AliAnalysisTaskSE.h"
32 #include "AliAnalysisTaskSEVertexingHF.h"
33
34 ClassImp(AliAnalysisTaskSEVertexingHF)
35
36
37 //________________________________________________________________________
38 AliAnalysisTaskSEVertexingHF::AliAnalysisTaskSEVertexingHF():
39 AliAnalysisTaskSE(),
40 fVHF(0),
41 fVerticesHFTClArr(0),
42 fD0toKpiTClArr(0),
43 fJPSItoEleTClArr(0),
44 fCharm3ProngTClArr(0),
45 fCharm4ProngTClArr(0)
46 {
47   // Default constructor
48 }
49
50 //________________________________________________________________________
51 AliAnalysisTaskSEVertexingHF::AliAnalysisTaskSEVertexingHF(const char *name):
52 AliAnalysisTaskSE(name),
53 fVHF(0),
54 fVerticesHFTClArr(0),
55 fD0toKpiTClArr(0),
56 fJPSItoEleTClArr(0),
57 fCharm3ProngTClArr(0),
58 fCharm4ProngTClArr(0)
59 {
60   // Default constructor
61 }
62
63 //________________________________________________________________________
64 AliAnalysisTaskSEVertexingHF::~AliAnalysisTaskSEVertexingHF()
65 {
66   // Destructor
67 }  
68
69 //________________________________________________________________________
70 void AliAnalysisTaskSEVertexingHF::Init()
71 {
72   // Initialization
73   // Instanciates vHF and loads its parameters
74
75   if(fDebug > 1) printf("AnalysisTaskSEVertexingHF::Init() \n");
76
77   gROOT->LoadMacro("ConfigVertexingHF.C");
78
79   fVHF = (AliAnalysisVertexingHF*)gROOT->ProcessLine("ConfigVertexingHF()");  
80   fVHF->PrintStatus();
81
82   return;
83 }
84
85 //________________________________________________________________________
86 void AliAnalysisTaskSEVertexingHF::UserCreateOutputObjects()
87 {
88   // Create the output container
89   //
90   if(fDebug > 1) printf("AnalysisTaskSEVertexingHF::UserCreateOutPutData() \n");
91
92   if(!fVHF) {
93     printf("AnalysisTaskSEVertexingHF::UserCreateOutPutData() \n ERROR! no fvHF!\n");
94     return;
95   }
96
97   fVerticesHFTClArr = new TClonesArray("AliAODVertex", 0);
98   fVerticesHFTClArr->SetName("VerticesHF");
99   AddAODBranch("TClonesArray", &fVerticesHFTClArr);
100
101   if(fVHF->GetD0toKpi()) {
102     fD0toKpiTClArr = new TClonesArray("AliAODRecoDecayHF2Prong", 0);
103     fD0toKpiTClArr->SetName("D0toKpi");
104     AddAODBranch("TClonesArray", &fD0toKpiTClArr);
105   }
106
107   if(fVHF->GetJPSItoEle()) {
108     fJPSItoEleTClArr = new TClonesArray("AliAODRecoDecayHF2Prong", 0);
109     fJPSItoEleTClArr->SetName("JPSItoEle");
110     AddAODBranch("TClonesArray", &fJPSItoEleTClArr);
111   }
112
113   if(fVHF->Get3Prong()) {
114     fCharm3ProngTClArr = new TClonesArray("AliAODRecoDecayHF3Prong", 0);
115     fCharm3ProngTClArr->SetName("Charm3Prong");
116     AddAODBranch("TClonesArray", &fCharm3ProngTClArr);
117   }
118
119   if(fVHF->Get4Prong()) {
120     fCharm4ProngTClArr = new TClonesArray("AliAODRecoDecayHF4Prong", 0);
121     fCharm4ProngTClArr->SetName("Charm4Prong");
122     AddAODBranch("TClonesArray", &fCharm4ProngTClArr);
123   }
124
125   return;
126 }
127
128 //________________________________________________________________________
129 void AliAnalysisTaskSEVertexingHF::UserExec(Option_t */*option*/)
130 {
131   // Execute analysis for current event:
132   // heavy flavor vertexing
133   
134   AliESDEvent *esd = dynamic_cast<AliESDEvent*> (InputEvent());
135
136   // heavy flavor vertexing
137   fVHF->FindCandidatesESDtoAOD(esd,
138                                fVerticesHFTClArr,
139                                fD0toKpiTClArr,
140                                fJPSItoEleTClArr,
141                                fCharm3ProngTClArr,
142                                fCharm4ProngTClArr);
143   
144   return;
145 }
146
147 //________________________________________________________________________
148 void AliAnalysisTaskSEVertexingHF::Terminate(Option_t */*option*/)
149 {
150   // Terminate analysis
151   //
152   if(fDebug > 1) printf("AnalysisTaskSEVertexingHF: Terminate() \n");
153 }