1 /**************************************************************************
2 * Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
16 /////////////////////////////////////////////////////////////
18 // AliAnalysisTask for the reconstruction of heavy flavor
19 // decays, using the class AliAnalysisVertexingHF.
21 // Author: J.Faivre, julien.faivre@pd.infn.it
22 /////////////////////////////////////////////////////////////
28 #include "Riostream.h"
30 #include "AliAnalysisTask.h"
31 #include "AliESDEvent.h"
32 #include "AliESDInputHandler.h"
33 #include "AliAnalysisVertexingHF.h"
34 #include "AliAnalysisTaskVertexingHF.h"
36 ClassImp(AliAnalysisTaskVertexingHF)
39 //________________________________________________________________________
40 AliAnalysisTaskVertexingHF::AliAnalysisTaskVertexingHF(const char *name) :
41 AliAnalysisTask(name,""),
49 //Input slot #0 works with an Ntuple
50 DefineInput(0, TChain::Class());
51 //Output slots 0 to 3 write into a TTree
52 DefineOutput(0, TTree::Class());
53 DefineOutput(1, TTree::Class());
54 DefineOutput(2, TTree::Class());
55 DefineOutput(3, TTree::Class());
57 //________________________________________________________________________
58 AliAnalysisTaskVertexingHF::~AliAnalysisTaskVertexingHF()
61 if (fTrees) delete [] fTrees;
63 //________________________________________________________________________
64 void AliAnalysisTaskVertexingHF::ConnectInputData(Option_t *)
66 //Implementation of AliAnalysisTask::ConnectInputData
68 Info("ConnectInputData","ConnectInputData of task %s\n",GetName());
69 fChain = (TChain*)GetInputData(0);
72 printf("ERROR: Could not read chain from input slot 0\n");
76 //fESD = new AliESDEvent();
77 //fESD->ReadFromTree(fChain);
79 AliESDInputHandler *esdH = dynamic_cast<AliESDInputHandler*> (AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());
82 printf("ERROR: Could not get ESDInputHandler\n");
84 fESD = esdH->GetEvent();
85 if (!fESD) printf("ERROR: Could not get ESD object\n");
90 //________________________________________________________________________
91 void AliAnalysisTaskVertexingHF::CreateOutputObjects()
93 //Implementation of AliAnalysisTask::CreateOutputObjects
94 //4 output trees (D0 in 2-prongs, J/Psi to e+e-, 3-prongs (D+, Ds, /\c), D0 in 4-prongs)
96 fTrees = new TTree*[4];
97 AliAODRecoDecayHF2Prong *rd2=0;
98 AliAODRecoDecayHF3Prong *rd3=0;
99 AliAODRecoDecayHF4Prong *rd4=0;
100 fTrees[0] = new TTree("NameD0toKpi","TitleD0toKpi");
101 fTrees[0]->Branch("D0toKpi","AliAODRecoDecayHF2Prong",&rd2);
102 fTrees[1] = new TTree("NameJPSItoEle", "TitleJPSItoEle");
103 fTrees[1]->Branch("JPSItoEle","AliAODRecoDecayHF2Prong",&rd2);
104 fTrees[2] = new TTree("NameCharmto3Prong", "TitleCharmto3Prong");
105 fTrees[2]->Branch("Charmto3Prong","AliAODRecoDecayHF3Prong",&rd3);
106 fTrees[3] = new TTree("NameD0to4Prong","TitleD0to4Prong");
107 fTrees[3]->Branch("D0to4Prong","AliAODRecoDecayHF4Prong",&rd4);
111 //________________________________________________________________________
112 void AliAnalysisTaskVertexingHF::LocalInit()
114 //Instanciates vHF and loads its parameters
116 gROOT->LoadMacro("ConfigVertexingHF.C");
118 fVHF = (AliAnalysisVertexingHF*)gROOT->ProcessLine("ConfigVertexingHF()");
123 //________________________________________________________________________
124 void AliAnalysisTaskVertexingHF::Exec(Option_t *)
126 //Performs heavy flavor vertexing
128 //Heavy flavor vertexing :
129 //fVHF->FindCandidates(fESD,fTrees);
131 printf(" NOTHING DONE, THIS CLASS IS OBSOLETE, PLEASE USE AliAnalysisTaskSEVertexingHF\n");
133 //Post final data. It will be written to a file with option "RECREATE"
134 PostData(0, fTrees[0]);
135 PostData(1, fTrees[1]);
136 PostData(2, fTrees[2]);
137 PostData(3, fTrees[3]);
141 //________________________________________________________________________
142 void AliAnalysisTaskVertexingHF::Terminate(Option_t *)
144 //Implementation of AliAnalysisTask::Terminate