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 //-----------------------------------------------------------------------------------------------------------------
23 #include "AliAnalysisManager.h"
24 #include "AliMCEvent.h"
25 #include "AliVEvent.h"
26 #include "AliESDEvent.h"
27 #include "AliResonanceKink.h"
28 #include "AliAnalysisTaskKinkResonance.h"
30 ClassImp(AliAnalysisTaskKinkResonance)
32 //______________________________________________________________________________
33 AliAnalysisTaskKinkResonance::AliAnalysisTaskKinkResonance(const char *dname)
34 : AliAnalysisTaskSE(dname), fList(0), fKinkResonance(0)
39 // Define input and output slots here
40 // Input slot #0 works with a TChain
41 //DefineInput(0, TChain::Class());
42 DefineOutput(1, TList::Class());
45 //________________________________________________________________________
46 void AliAnalysisTaskKinkResonance::UserCreateOutputObjects()
51 fList= fKinkResonance->GetHistogramList();
55 //________________________________________________________________________
56 void AliAnalysisTaskKinkResonance::UserExec(Option_t *)
59 // Called for each event
61 AliVEvent *event = InputEvent();
63 Printf("ERROR: Could not retrieve event");
67 AliESDEvent* esd = dynamic_cast<AliESDEvent*>(event);
69 Printf("ERROR: Could not retrieve esd");
73 AliMCEvent* mcEvent = MCEvent();
75 Printf("ERROR: Could not retrieve MC event");
79 fKinkResonance->Analyse(esd, mcEvent);
85 //________________________________________________________________________
86 void AliAnalysisTaskKinkResonance::Terminate(Option_t *)
88 // Draw result to the screen
89 // Called once at the end of the query
90 fList = dynamic_cast<TList*> (GetOutputData(1));
93 Printf("ERROR: fList not available");
96 //TH1D* h=(TH1D *) fList->At(15);
97 //TCanvas *c1 = new TCanvas("AliAnalysisTaskKinkResonance","Pt MC",10,10,510,510);
99 //if (h) h->DrawCopy("E");