1 /**************************************************************************
2 * Author: Paraskevi Ganoti, University of Athens (pganoti@phys.uoa.gr) *
3 * Contributors are mentioned in the code where appropriate. *
5 * Permission to use, copy, modify and distribute this software and its *
6 * documentation strictly for non-commercial purposes is hereby granted *
7 * without fee, provided that the above copyright notice appears in all *
8 * copies and that both the copyright notice and this permission notice *
9 * appear in the supporting documentation. The authors make no claims *
10 * about the suitability of this software for any purpose. It is *
11 * provided "as is" without express or implied warranty. *
12 **************************************************************************/
14 //----------------------------------------------------------------------------------------------------------------
15 // class AliAnalysisTaskKinkResonance
16 // Example of an analysis task for reconstructing resonances having at least one kaon-kink in their decay
18 //-----------------------------------------------------------------------------------------------------------------
20 #include "AliESDEvent.h"
22 #include "AliAnalysisTaskKinkResonance.h"
23 #include "AliResonanceKink.h"
25 ClassImp(AliAnalysisTaskKinkResonance)
27 //______________________________________________________________________________
28 AliAnalysisTaskKinkResonance::AliAnalysisTaskKinkResonance(const char *dname)
29 : AliAnalysisTaskSE(dname), fList(0), fKinkResonance(0)
34 // Define input and output slots here
35 // Input slot #0 works with a TChain
36 //DefineInput(0, TChain::Class());
37 DefineOutput(1, TList::Class());
40 //________________________________________________________________________
41 void AliAnalysisTaskKinkResonance::UserCreateOutputObjects()
46 fList= fKinkResonance->GetHistogramList();
50 //________________________________________________________________________
51 void AliAnalysisTaskKinkResonance::UserExec(Option_t *)
54 // Called for each event
56 AliVEvent *event = InputEvent();
58 Printf("ERROR: Could not retrieve event");
62 AliESDEvent* esd = dynamic_cast<AliESDEvent*>(event);
64 Printf("ERROR: Could not retrieve esd");
68 AliMCEvent* mcEvent = MCEvent();
70 Printf("ERROR: Could not retrieve MC event");
74 fKinkResonance->SetDebugLevel(fDebug);
75 fKinkResonance->Analyse(esd, mcEvent);
81 //________________________________________________________________________
82 void AliAnalysisTaskKinkResonance::Terminate(Option_t *)
84 // Draw result to the screen
85 // Called once at the end of the query
86 fList = dynamic_cast<TList*> (GetOutputData(1));
89 Printf("ERROR: fList not available");
92 //TH1D* h=(TH1D *) fList->At(15);
93 //TCanvas *c1 = new TCanvas("AliAnalysisTaskKinkResonance","Pt MC",10,10,510,510);
95 //if (h) h->DrawCopy("E");