]>
Commit | Line | Data |
---|---|---|
f9afc48d | 1 | /************************************************************************** |
2 | * Author: Paraskevi Ganoti, University of Athens (pganoti@phys.uoa.gr) * | |
3 | * Contributors are mentioned in the code where appropriate. * | |
4 | * * | |
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 | **************************************************************************/ | |
13 | ||
14 | //---------------------------------------------------------------------------------------------------------------- | |
15 | // class AliAnalysisTaskKinkResonance | |
16 | // Example of an analysis task for reconstructing resonances having at least one kaon-kink in their decay | |
92adf4f6 | 17 | // products. |
f9afc48d | 18 | //----------------------------------------------------------------------------------------------------------------- |
f9afc48d | 19 | #include "TChain.h" |
20 | #include "TTree.h" | |
21 | #include "TH2D.h" | |
22 | ||
f9afc48d | 23 | #include "AliAnalysisManager.h" |
f9afc48d | 24 | #include "AliMCEvent.h" |
92adf4f6 | 25 | #include "AliVEvent.h" |
26 | #include "AliESDEvent.h" | |
f9afc48d | 27 | #include "AliResonanceKink.h" |
28 | #include "AliAnalysisTaskKinkResonance.h" | |
29 | ||
30 | ClassImp(AliAnalysisTaskKinkResonance) | |
31 | ||
f9afc48d | 32 | //______________________________________________________________________________ |
92adf4f6 | 33 | AliAnalysisTaskKinkResonance::AliAnalysisTaskKinkResonance(const char *dname) |
34 | : AliAnalysisTaskSE(dname), fList(0), fKinkResonance(0) | |
f9afc48d | 35 | |
36 | { | |
37 | // Constructor | |
38 | ||
39 | // Define input and output slots here | |
40 | // Input slot #0 works with a TChain | |
92adf4f6 | 41 | //DefineInput(0, TChain::Class()); |
f9afc48d | 42 | DefineOutput(1, TList::Class()); |
43 | } | |
44 | ||
45 | //________________________________________________________________________ | |
92adf4f6 | 46 | void AliAnalysisTaskKinkResonance::UserCreateOutputObjects() |
f9afc48d | 47 | { |
48 | // Create histograms | |
49 | // Called once | |
50 | ||
f9afc48d | 51 | fList= fKinkResonance->GetHistogramList(); |
52 | ||
53 | } | |
54 | ||
55 | //________________________________________________________________________ | |
92adf4f6 | 56 | void AliAnalysisTaskKinkResonance::UserExec(Option_t *) |
f9afc48d | 57 | { |
58 | // Main loop | |
59 | // Called for each event | |
60 | ||
92adf4f6 | 61 | AliVEvent *event = InputEvent(); |
62 | if (!event) { | |
63 | Printf("ERROR: Could not retrieve event"); | |
64 | return; | |
65 | } | |
66 | ||
67 | AliESDEvent* esd = dynamic_cast<AliESDEvent*>(event); | |
68 | if (!esd) { | |
69 | Printf("ERROR: Could not retrieve esd"); | |
70 | return; | |
71 | } | |
72 | ||
73 | AliMCEvent* mcEvent = MCEvent(); | |
74 | if (!mcEvent) { | |
75 | Printf("ERROR: Could not retrieve MC event"); | |
76 | return; | |
77 | } | |
78 | ||
0aa3a5b9 | 79 | fKinkResonance->SetDebugLevel(fDebug); |
80 | fKinkResonance->Analyse(esd, mcEvent); | |
f9afc48d | 81 | |
0aa3a5b9 | 82 | PostData(1, fList); |
f9afc48d | 83 | |
84 | } | |
85 | ||
86 | //________________________________________________________________________ | |
87 | void AliAnalysisTaskKinkResonance::Terminate(Option_t *) | |
88 | { | |
89 | // Draw result to the screen | |
90 | // Called once at the end of the query | |
91 | fList = dynamic_cast<TList*> (GetOutputData(1)); | |
92 | ||
93 | if (!fList) { | |
94 | Printf("ERROR: fList not available"); | |
95 | return; | |
96 | } | |
97 | //TH1D* h=(TH1D *) fList->At(15); | |
98 | //TCanvas *c1 = new TCanvas("AliAnalysisTaskKinkResonance","Pt MC",10,10,510,510); | |
99 | //c1->cd(1); | |
100 | //if (h) h->DrawCopy("E"); | |
101 | ||
102 | } | |
103 |