New FMD analysis correction files
[u/mrichter/AliRoot.git] / FMD / analysis / AliFMDAnalysisTaskSE.cxx
CommitLineData
7c3e5162 1#include "AliFMDAnalysisTaskSE.h"
2#include "AliESDEvent.h"
3#include "iostream"
4#include "AliESDFMD.h"
5
6ClassImp(AliFMDAnalysisTaskSE)
7
8//_____________________________________________________________________
9AliFMDAnalysisTaskSE::AliFMDAnalysisTaskSE():
10AliAnalysisTaskSE(),
11 fListOfHistos(0),
12 fSharing("Sharing",kFALSE),
13 fDensity("Density",kFALSE),
14 fBackground("BackgroundCorrected",kFALSE),
15 fDndeta("dNdeta",kFALSE)
16{
17 // Default constructor
18}
19//_____________________________________________________________________
20AliFMDAnalysisTaskSE::AliFMDAnalysisTaskSE(const char* name):
21 AliAnalysisTaskSE(name),
22 fListOfHistos(0),
23 fSharing("Sharing",kFALSE),
24 fDensity("Density",kFALSE),
25 fBackground("BackgroundCorrected",kFALSE),
26 fDndeta("dNdeta",kFALSE)
27{
1282ce49 28
7c3e5162 29 DefineOutput(1, TList::Class());
30}
31//_____________________________________________________________________
32void AliFMDAnalysisTaskSE::UserCreateOutputObjects()
33{
1282ce49 34// Create the output containers
7c3e5162 35//
36 fListOfHistos = new TList();
37
38 AliESDFMD* fmd = new AliESDFMD();
39 AliESDVertex* vertex = new AliESDVertex();
40
41 TObjString* vtxString1 = new TObjString();
42
43 TList* densitylist = new TList();
44
45 TList* bgcorlist = new TList();
46
47 fSharing.SetFMDData(fmd);
48 fSharing.SetVertex(vertex);
49
50 fDensity.SetOutputList(densitylist);
51 fDensity.SetInputESDFMD(fmd) ;
52 fDensity.SetInputVertex(vertex);
53
54 fBackground.SetInputList(densitylist);
55 fBackground.SetOutputList(bgcorlist);
cc066cb9 56 fBackground.SetHitList(fListOfHistos);
7c3e5162 57 fBackground.SetOutputVertex(vtxString1);
58
59 fDndeta.SetInputVertex(vtxString1);
60 fDndeta.SetInputList(bgcorlist);
61 fDndeta.SetOutputList(fListOfHistos);
62
63 fSharing.CreateOutputObjects();
64 fDensity.CreateOutputObjects();
65 fBackground.CreateOutputObjects();
66 fDndeta.CreateOutputObjects();
67
68
69
70}
71//_____________________________________________________________________
72void AliFMDAnalysisTaskSE::Init()
73{
74 std::cout<<"Init"<<std::endl;
75}
76//_____________________________________________________________________
77void AliFMDAnalysisTaskSE::UserExec(Option_t */*option*/)
78{
79 // Execute analysis for current event
80 //
81 AliESDEvent* fESD = (AliESDEvent*)InputEvent();
82 fSharing.SetInputESD(fESD);
83
84 fSharing.Exec("");
bb8a464f 85 if(fSharing.GetEventStatus()) {
86 fDensity.Exec("");
87 if(fDensity.GetEventStatus()) {
88 fBackground.Exec("");
89 AliMCEvent* mcevent = MCEvent();
90 fDndeta.SetMCEvent(mcevent);
91 fDndeta.Exec("");
92 }
93 }
94 else
95 return;
96
7c3e5162 97 //fListOfHistos = fBackground.GetOutputList();
98
99 PostData(1, fListOfHistos);
100}
1282ce49 101//_____________________________________________________________________
102void AliFMDAnalysisTaskSE::Terminate(Option_t */*option*/)
103{
104 fDndeta.Terminate("");
7c3e5162 105
1282ce49 106}
7c3e5162 107//_____________________________________________________________________
108//
109// EOF
110//