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