]>
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" |
70d74659 | 9 | #include "AliFMDDndeta.h" |
10 | #include "TDirectory.h" | |
7c3e5162 | 11 | ClassImp(AliFMDAnalysisTaskSE) |
12 | ||
13 | //_____________________________________________________________________ | |
14 | AliFMDAnalysisTaskSE::AliFMDAnalysisTaskSE(): | |
15 | AliAnalysisTaskSE(), | |
16 | fListOfHistos(0), | |
17 | fSharing("Sharing",kFALSE), | |
18 | fDensity("Density",kFALSE), | |
19 | fBackground("BackgroundCorrected",kFALSE), | |
85da855f | 20 | fDndeta("dNdeta",kFALSE), |
1c038f67 | 21 | fBFCorrelation("BFCorrelation",kFALSE), |
85da855f | 22 | fParams(0) |
7c3e5162 | 23 | { |
24 | // Default constructor | |
25 | } | |
26 | //_____________________________________________________________________ | |
27 | AliFMDAnalysisTaskSE::AliFMDAnalysisTaskSE(const char* name): | |
28 | AliAnalysisTaskSE(name), | |
29 | fListOfHistos(0), | |
30 | fSharing("Sharing",kFALSE), | |
31 | fDensity("Density",kFALSE), | |
32 | fBackground("BackgroundCorrected",kFALSE), | |
85da855f | 33 | fDndeta("dNdeta",kFALSE), |
1c038f67 | 34 | fBFCorrelation("BFCorrelation",kFALSE), |
85da855f | 35 | fParams(0) |
7c3e5162 | 36 | { |
85da855f | 37 | SetParams(AliFMDAnaParameters::Instance()); |
7c3e5162 | 38 | DefineOutput(1, TList::Class()); |
39 | } | |
40 | //_____________________________________________________________________ | |
41 | void AliFMDAnalysisTaskSE::UserCreateOutputObjects() | |
42 | { | |
1282ce49 | 43 | // Create the output containers |
7c3e5162 | 44 | // |
45 | fListOfHistos = new TList(); | |
46 | ||
47 | AliESDFMD* fmd = new AliESDFMD(); | |
48 | AliESDVertex* vertex = new AliESDVertex(); | |
49 | ||
7c3e5162 | 50 | TList* densitylist = new TList(); |
51 | ||
52 | TList* bgcorlist = new TList(); | |
53 | ||
54 | fSharing.SetFMDData(fmd); | |
55 | fSharing.SetVertex(vertex); | |
a38d1871 | 56 | fSharing.SetOutputList(fListOfHistos); |
da0805e2 | 57 | |
58 | fDensity.Init(); | |
7c3e5162 | 59 | fDensity.SetOutputList(densitylist); |
60 | fDensity.SetInputESDFMD(fmd) ; | |
61 | fDensity.SetInputVertex(vertex); | |
62 | ||
63 | fBackground.SetInputList(densitylist); | |
64 | fBackground.SetOutputList(bgcorlist); | |
cc066cb9 | 65 | fBackground.SetHitList(fListOfHistos); |
9f55be54 | 66 | |
7c3e5162 | 67 | fDndeta.SetInputList(bgcorlist); |
68 | fDndeta.SetOutputList(fListOfHistos); | |
1c038f67 | 69 | fBFCorrelation.SetInputList(bgcorlist); |
70 | fBFCorrelation.SetOutputList(fListOfHistos); | |
9f55be54 | 71 | |
7c3e5162 | 72 | fSharing.CreateOutputObjects(); |
73 | fDensity.CreateOutputObjects(); | |
74 | fBackground.CreateOutputObjects(); | |
75 | fDndeta.CreateOutputObjects(); | |
1c038f67 | 76 | fBFCorrelation.CreateOutputObjects(); |
7c3e5162 | 77 | |
78 | ||
79 | } | |
80 | //_____________________________________________________________________ | |
81 | void AliFMDAnalysisTaskSE::Init() | |
82 | { | |
83 | std::cout<<"Init"<<std::endl; | |
84 | } | |
85 | //_____________________________________________________________________ | |
86 | void AliFMDAnalysisTaskSE::UserExec(Option_t */*option*/) | |
87 | { | |
88 | // Execute analysis for current event | |
89 | // | |
2380f57c | 90 | |
91 | //AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance(); | |
92 | ||
93 | ||
7c3e5162 | 94 | AliESDEvent* fESD = (AliESDEvent*)InputEvent(); |
1c038f67 | 95 | //std::cout<<fESD->GetBeamEnergy()<<" "<<fESD->GetBeamType()<<" "<<fESD->GetCurrentL3()<<std::endl; |
7c3e5162 | 96 | fSharing.SetInputESD(fESD); |
97 | ||
98 | fSharing.Exec(""); | |
bb8a464f | 99 | if(fSharing.GetEventStatus()) { |
100 | fDensity.Exec(""); | |
101 | if(fDensity.GetEventStatus()) { | |
102 | fBackground.Exec(""); | |
bb8a464f | 103 | fDndeta.Exec(""); |
1c038f67 | 104 | fBFCorrelation.Exec(""); |
bb8a464f | 105 | } |
da0805e2 | 106 | else return; |
bb8a464f | 107 | } |
da0805e2 | 108 | else return; |
bb8a464f | 109 | |
2380f57c | 110 | PostData(1, fListOfHistos); |
111 | ||
7c3e5162 | 112 | //fListOfHistos = fBackground.GetOutputList(); |
113 | ||
9346c920 | 114 | |
7c3e5162 | 115 | } |
1282ce49 | 116 | //_____________________________________________________________________ |
117 | void AliFMDAnalysisTaskSE::Terminate(Option_t */*option*/) | |
118 | { | |
da0805e2 | 119 | |
120 | TList* outputList = (TList*)GetOutputData(1); | |
121 | ||
122 | ||
123 | fSharing.SetOutputList(outputList); | |
124 | fBackground.SetHitList(outputList); | |
125 | fDndeta.SetOutputList(outputList); | |
1c038f67 | 126 | fBFCorrelation.SetOutputList(outputList); |
da0805e2 | 127 | fSharing.Terminate(""); |
18d4b9ae | 128 | fBackground.Terminate(""); |
1282ce49 | 129 | fDndeta.Terminate(""); |
1c038f67 | 130 | fBFCorrelation.Terminate(""); |
da0805e2 | 131 | |
70d74659 | 132 | AliFMDDndeta t; |
133 | t.SetNbinsToCut(2); | |
134 | t.Init(outputList); | |
135 | t.GenerateMult(AliFMDDndeta::kMult); | |
136 | ||
137 | TList* dNdetalist = t.GetMultList(AliFMDDndeta::kMult); | |
138 | TList* cloneList = (TList*)dNdetalist->Clone("dNdeta"); | |
139 | cloneList->SetName("dNdeta"); | |
140 | outputList->Add(cloneList); | |
141 | ||
142 | t.GenerateMult(AliFMDDndeta::kMultTrVtx); | |
143 | TList* dNdetalist2 = t.GetMultList(AliFMDDndeta::kMultTrVtx); | |
144 | TList* cloneList2 = (TList*)dNdetalist2->Clone("dNdetaTrVtx"); | |
145 | cloneList2->SetName("dNdetaTrVtx"); | |
146 | outputList->Add(cloneList2); | |
147 | ||
148 | t.GenerateMult(AliFMDDndeta::kHits); | |
149 | TList* dNdetalist3 = t.GetMultList(AliFMDDndeta::kHits); | |
150 | TList* cloneList3 = (TList*)dNdetalist3->Clone("Hits"); | |
151 | cloneList3->SetName("Hits"); | |
152 | outputList->Add(cloneList3); | |
153 | t.GenerateMult(AliFMDDndeta::kHitsTrVtx); | |
154 | TList* dNdetalist4 = t.GetMultList(AliFMDDndeta::kHits); | |
155 | TList* cloneList4 = (TList*)dNdetalist3->Clone("HitsTrVtx"); | |
156 | cloneList4->SetName("HitsTrVtx"); | |
157 | outputList->Add(cloneList4); | |
da0805e2 | 158 | // TFile file("fmd_ana_histos_tmp.root","RECREATE"); |
159 | // fListOfHistos->Write(); | |
160 | // file.Close(); | |
1282ce49 | 161 | } |
85da855f | 162 | |
163 | //_____________________________________________________________________ | |
164 | void AliFMDAnalysisTaskSE::Print(Option_t* option) const | |
165 | { | |
166 | AliInfo(Form("FMD Single Event Analysis Task\n" | |
167 | "Parameters set to %p", fParams)); | |
168 | TString opt(option); | |
169 | opt.ToLower(); | |
170 | if (opt.Contains("s")) { | |
171 | fSharing.Print(option); | |
172 | fDensity.Print(option); | |
173 | fBackground.Print(option); | |
1c038f67 | 174 | fDndeta.Print(option); |
175 | fBFCorrelation.Print(option); | |
85da855f | 176 | } |
177 | if (opt.Contains("p") && fParams) | |
178 | fParams->Print(option); | |
179 | } | |
180 | ||
7c3e5162 | 181 | //_____________________________________________________________________ |
182 | // | |
183 | // EOF | |
184 | // |