3 //**************************************************************************
4 //* This file is property of and copyright by the ALICE Project *
5 //* ALICE Experiment at CERN, All rights reserved. *
7 //* Primary Authors: Matthias Richter <Matthias.Richter@ift.uib.no> *
8 //* Sedat Altinpinar <Sedat.Altinpinar@cern.ch> *
9 //* Hege Erdal <hege.erdal@gmail.com> *
11 //* Permission to use, copy, modify and distribute this software and its *
12 //* documentation strictly for non-commercial purposes is hereby granted *
13 //* without fee, provided that the above copyright notice appears in all *
14 //* copies and that both the copyright notice and this permission notice *
15 //* appear in the supporting documentation. The authors make no claims *
16 //* about the suitability of this software for any purpose. It is *
17 //* provided "as is" without express or implied warranty. *
18 //**************************************************************************
20 /// @file AliAnalysisTaskDxHFEParticleSelection.cxx
21 /// @author Sedat Altinpinar, Hege Erdal, Matthias Richter
23 /// @brief AnalysisTask electron selection for D0 - HFE correlation
26 #include "AliAnalysisTaskDxHFEParticleSelection.h"
27 #include "AliDxHFEParticleSelection.h"
28 #include "AliDxHFEParticleSelectionD0.h"
29 #include "AliAnalysisManager.h"
31 #include "AliESDInputHandler.h"
37 /// ROOT macro for the implementation of ROOT specific class methods
38 ClassImp(AliAnalysisTaskDxHFEParticleSelection)
40 AliAnalysisTaskDxHFEParticleSelection::AliAnalysisTaskDxHFEParticleSelection(const char* opt)
41 : AliAnalysisTaskSE("AliAnalysisTaskDxHFEParticleSelection")
53 int AliAnalysisTaskDxHFEParticleSelection::DefineSlots()
55 // define the data slots
56 DefineInput(0, TChain::Class());
57 DefineOutput(1, TList::Class());
61 AliAnalysisTaskDxHFEParticleSelection::~AliAnalysisTaskDxHFEParticleSelection()
67 // histograms are in the output list and deleted when the output
68 // list is deleted by the TSelector dtor
70 if (fOutput && !AliAnalysisManager::GetAnalysisManager()->IsProofMode()) {
82 void AliAnalysisTaskDxHFEParticleSelection::UserCreateOutputObjects()
84 // create result objects and add to output list
89 fSelector=new AliDxHFEParticleSelectionD0;
90 fSelector->InitControlObjects();
91 fOutput->Add(fSelector);
93 // all tasks must post data once for all outputs
97 void AliAnalysisTaskDxHFEParticleSelection::UserExec(Option_t* /*option*/)
101 // TODO: implement correct input, this is likely not to be the
103 TObject* pInput=InputEvent();
105 AliError("failed to get input");
108 AliVEvent *pEvent = dynamic_cast<AliVEvent*>(pInput);
110 AliError(Form("input of wrong class type %s, expecting AliVEvent", pInput->ClassName()));
114 std::auto_ptr<TObjArray> selectedTracks(fSelector->Select(pEvent));
115 // TODO: use the array of selected track for something, right now
116 // only the control histograms of the selection class are filled
117 // note: the pointer is deleted automatically once the scope is left
118 // if the array should be published, the auto pointer must be released
119 // first, however some other cleanup will be necessary in that case
120 // probably a clone with a reduced AliVParticle implementation is
122 if (selectedTracks.get()) {
125 PostData(1, fOutput);
128 void AliAnalysisTaskDxHFEParticleSelection::FinishTaskOutput()
130 // end of the processing
133 void AliAnalysisTaskDxHFEParticleSelection::Terminate(Option_t *)
135 // last action on the client
136 fOutput = dynamic_cast<TList*> (GetOutputData(1));
138 AliFatal("failed to get output container");