]>
Commit | Line | Data |
---|---|---|
7c3e5162 | 1 | #include "AliFMDAnalysisTaskSE.h" |
2 | #include "AliESDEvent.h" | |
3 | #include "iostream" | |
4 | #include "AliESDFMD.h" | |
bb0a45c3 | 5 | #include "AliMCEventHandler.h" |
6 | #include "AliAnalysisManager.h" | |
b64db9b1 | 7 | #include "AliFMDAnaParameters.h" |
85da855f | 8 | #include "AliLog.h" |
7c3e5162 | 9 | |
10 | ClassImp(AliFMDAnalysisTaskSE) | |
11 | ||
12 | //_____________________________________________________________________ | |
13 | AliFMDAnalysisTaskSE::AliFMDAnalysisTaskSE(): | |
14 | AliAnalysisTaskSE(), | |
15 | fListOfHistos(0), | |
16 | fSharing("Sharing",kFALSE), | |
17 | fDensity("Density",kFALSE), | |
18 | fBackground("BackgroundCorrected",kFALSE), | |
85da855f | 19 | fDndeta("dNdeta",kFALSE), |
20 | fParams(0) | |
7c3e5162 | 21 | { |
22 | // Default constructor | |
23 | } | |
24 | //_____________________________________________________________________ | |
25 | AliFMDAnalysisTaskSE::AliFMDAnalysisTaskSE(const char* name): | |
26 | AliAnalysisTaskSE(name), | |
27 | fListOfHistos(0), | |
28 | fSharing("Sharing",kFALSE), | |
29 | fDensity("Density",kFALSE), | |
30 | fBackground("BackgroundCorrected",kFALSE), | |
85da855f | 31 | fDndeta("dNdeta",kFALSE), |
32 | fParams(0) | |
7c3e5162 | 33 | { |
85da855f | 34 | SetParams(AliFMDAnaParameters::Instance()); |
7c3e5162 | 35 | DefineOutput(1, TList::Class()); |
36 | } | |
37 | //_____________________________________________________________________ | |
38 | void AliFMDAnalysisTaskSE::UserCreateOutputObjects() | |
39 | { | |
1282ce49 | 40 | // Create the output containers |
7c3e5162 | 41 | // |
42 | fListOfHistos = new TList(); | |
43 | ||
44 | AliESDFMD* fmd = new AliESDFMD(); | |
45 | AliESDVertex* vertex = new AliESDVertex(); | |
46 | ||
7c3e5162 | 47 | TList* densitylist = new TList(); |
48 | ||
49 | TList* bgcorlist = new TList(); | |
50 | ||
51 | fSharing.SetFMDData(fmd); | |
52 | fSharing.SetVertex(vertex); | |
a38d1871 | 53 | fSharing.SetOutputList(fListOfHistos); |
da0805e2 | 54 | |
55 | fDensity.Init(); | |
7c3e5162 | 56 | fDensity.SetOutputList(densitylist); |
57 | fDensity.SetInputESDFMD(fmd) ; | |
58 | fDensity.SetInputVertex(vertex); | |
59 | ||
60 | fBackground.SetInputList(densitylist); | |
61 | fBackground.SetOutputList(bgcorlist); | |
cc066cb9 | 62 | fBackground.SetHitList(fListOfHistos); |
9f55be54 | 63 | |
7c3e5162 | 64 | fDndeta.SetInputList(bgcorlist); |
65 | fDndeta.SetOutputList(fListOfHistos); | |
9f55be54 | 66 | |
7c3e5162 | 67 | fSharing.CreateOutputObjects(); |
68 | fDensity.CreateOutputObjects(); | |
69 | fBackground.CreateOutputObjects(); | |
70 | fDndeta.CreateOutputObjects(); | |
71 | ||
72 | ||
73 | ||
74 | } | |
75 | //_____________________________________________________________________ | |
76 | void AliFMDAnalysisTaskSE::Init() | |
77 | { | |
78 | std::cout<<"Init"<<std::endl; | |
79 | } | |
80 | //_____________________________________________________________________ | |
81 | void AliFMDAnalysisTaskSE::UserExec(Option_t */*option*/) | |
82 | { | |
83 | // Execute analysis for current event | |
84 | // | |
b64db9b1 | 85 | // AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance(); |
9346c920 | 86 | PostData(1, fListOfHistos); |
7c3e5162 | 87 | AliESDEvent* fESD = (AliESDEvent*)InputEvent(); |
88 | fSharing.SetInputESD(fESD); | |
89 | ||
90 | fSharing.Exec(""); | |
bb8a464f | 91 | if(fSharing.GetEventStatus()) { |
92 | fDensity.Exec(""); | |
93 | if(fDensity.GetEventStatus()) { | |
94 | fBackground.Exec(""); | |
bb8a464f | 95 | fDndeta.Exec(""); |
78f6f750 | 96 | |
bb8a464f | 97 | } |
da0805e2 | 98 | else return; |
bb8a464f | 99 | } |
da0805e2 | 100 | else return; |
bb8a464f | 101 | |
7c3e5162 | 102 | //fListOfHistos = fBackground.GetOutputList(); |
103 | ||
9346c920 | 104 | |
7c3e5162 | 105 | } |
1282ce49 | 106 | //_____________________________________________________________________ |
107 | void AliFMDAnalysisTaskSE::Terminate(Option_t */*option*/) | |
108 | { | |
da0805e2 | 109 | |
110 | TList* outputList = (TList*)GetOutputData(1); | |
111 | ||
112 | ||
113 | fSharing.SetOutputList(outputList); | |
114 | fBackground.SetHitList(outputList); | |
115 | fDndeta.SetOutputList(outputList); | |
116 | fSharing.Terminate(""); | |
18d4b9ae | 117 | fBackground.Terminate(""); |
1282ce49 | 118 | fDndeta.Terminate(""); |
da0805e2 | 119 | |
120 | ||
121 | // TFile file("fmd_ana_histos_tmp.root","RECREATE"); | |
122 | // fListOfHistos->Write(); | |
123 | // file.Close(); | |
1282ce49 | 124 | } |
85da855f | 125 | |
126 | //_____________________________________________________________________ | |
127 | void AliFMDAnalysisTaskSE::Print(Option_t* option) const | |
128 | { | |
129 | AliInfo(Form("FMD Single Event Analysis Task\n" | |
130 | "Parameters set to %p", fParams)); | |
131 | TString opt(option); | |
132 | opt.ToLower(); | |
133 | if (opt.Contains("s")) { | |
134 | fSharing.Print(option); | |
135 | fDensity.Print(option); | |
136 | fBackground.Print(option); | |
137 | fDndeta.Print(option); | |
138 | } | |
139 | if (opt.Contains("p") && fParams) | |
140 | fParams->Print(option); | |
141 | } | |
142 | ||
7c3e5162 | 143 | //_____________________________________________________________________ |
144 | // | |
145 | // EOF | |
146 | // |