/************************************************************************** * Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. * * * * Author: The ALICE Off-line Project. * * Contributors are mentioned in the code where appropriate. * * * * Permission to use, copy, modify and distribute this software and its * * documentation strictly for non-commercial purposes is hereby granted * * without fee, provided that the above copyright notice appears in all * * copies and that both the copyright notice and this permission notice * * appear in the supporting documentation. The authors make no claims * * about the suitability of this software for any purpose. It is * * provided "as is" without express or implied warranty. * **************************************************************************/ ///////////////////////////////////////////////////////////// // // AliAnalysisTask for the reconstruction of heavy flavor // decays, using the class AliAnalysisVertexingHF. // // Author: J.Faivre, julien.faivre@pd.infn.it ///////////////////////////////////////////////////////////// #include #include #include #include #include "Riostream.h" #include "AliAnalysisTask.h" #include "AliESDEvent.h" #include "AliAnalysisVertexingHF.h" #include "AliAnalysisTaskVertexingHF.h" ClassImp(AliAnalysisTaskVertexingHF) //________________________________________________________________________ AliAnalysisTaskVertexingHF::AliAnalysisTaskVertexingHF(const char *name) : AliAnalysisTask(name,""), fESD(0), fChain(0), fVHF(0), fTrees(0) { //Constructor //Input slot #0 works with an Ntuple DefineInput(0, TChain::Class()); //Output slots 0 to 3 write into a TTree DefineOutput(0, TTree::Class()); DefineOutput(1, TTree::Class()); DefineOutput(2, TTree::Class()); DefineOutput(3, TTree::Class()); } //________________________________________________________________________ void AliAnalysisTaskVertexingHF::ConnectInputData(Option_t *) { //Implementation of AliAnalysisTask::ConnectInputData Info("ConnectInputData","ConnectInputData of task %s\n",GetName()); fChain = (TChain*)GetInputData(0); fESD = new AliESDEvent(); fESD->ReadFromTree(fChain); return; } //________________________________________________________________________ void AliAnalysisTaskVertexingHF::CreateOutputObjects() { //Implementation of AliAnalysisTask::CreateOutputObjects //4 output trees (D0 in 2-prongs, J/Psi to e+e-, 3-prongs (D+, Ds, /\c), D0 in 4-prongs) fTrees = new TTree[4]; AliAODRecoDecayHF2Prong *rd2=0; AliAODRecoDecayHF3Prong *rd3=0; AliAODRecoDecayHF4Prong *rd4=0; fTrees[0].SetName("NameD0toKpi"); fTrees[0].SetTitle("TitleD0toKpi"); fTrees[1].SetName("NameJPSItoEle"); fTrees[1].SetTitle("TitleJPSItoEle"); fTrees[2].SetName("NameCharmto3Prong"); fTrees[2].SetTitle("TitleCharmto3Prong"); fTrees[3].SetName("NameD0to4Prong"); fTrees[3].SetTitle("TitleD0to4Prong"); fTrees[0].Branch("D0toKpi","AliAODRecoDecayHF2Prong",&rd2); fTrees[1].Branch("JPSItoEle","AliAODRecoDecayHF2Prong",&rd2); fTrees[2].Branch("Charmto3Prong","AliAODRecoDecayHF3Prong",&rd3); fTrees[3].Branch("D0to4Prong","AliAODRecoDecayHF4Prong",&rd4); return; } //________________________________________________________________________ void AliAnalysisTaskVertexingHF::LocalInit() { //Instanciates vHF and loads its parameters gROOT->LoadMacro("ConfigVertexingHF.C"); fVHF = (AliAnalysisVertexingHF*)gROOT->ProcessLine("ConfigVertexingHF()"); fVHF->PrintStatus(); return; } //________________________________________________________________________ void AliAnalysisTaskVertexingHF::Exec(Option_t *) { //Performs heavy flavor vertexing //Transition to new ESD format (from AliRoot v4-06 ?) : fESD->GetAliESDOld(); if (fESD->GetAliESDOld()) fESD->CopyFromOldESD(); //Heavy flavor vertexing : fVHF->FindCandidates(fESD,fTrees); //Post final data. It will be written to a file with option "RECREATE" PostData(0, &fTrees[0]); PostData(1, &fTrees[1]); PostData(2, &fTrees[2]); PostData(3, &fTrees[3]); return; } //________________________________________________________________________ void AliAnalysisTaskVertexingHF::Terminate(Option_t *) { //Implementation of AliAnalysisTask::Terminate return; }