Next round of upgrades and cleanups of code. The code is now more streamlined and...
[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"
bb0a45c3 5#include "AliMCEventHandler.h"
6#include "AliAnalysisManager.h"
b64db9b1 7#include "AliFMDAnaParameters.h"
7c3e5162 8
9ClassImp(AliFMDAnalysisTaskSE)
10
11//_____________________________________________________________________
12AliFMDAnalysisTaskSE::AliFMDAnalysisTaskSE():
13AliAnalysisTaskSE(),
14 fListOfHistos(0),
15 fSharing("Sharing",kFALSE),
16 fDensity("Density",kFALSE),
17 fBackground("BackgroundCorrected",kFALSE),
b64db9b1 18 fDndeta("dNdeta",kFALSE)
7c3e5162 19{
20 // Default constructor
21}
22//_____________________________________________________________________
23AliFMDAnalysisTaskSE::AliFMDAnalysisTaskSE(const char* name):
24 AliAnalysisTaskSE(name),
25 fListOfHistos(0),
26 fSharing("Sharing",kFALSE),
27 fDensity("Density",kFALSE),
28 fBackground("BackgroundCorrected",kFALSE),
b64db9b1 29 fDndeta("dNdeta",kFALSE)
7c3e5162 30{
b3546e91 31
7c3e5162 32 DefineOutput(1, TList::Class());
33}
34//_____________________________________________________________________
35void AliFMDAnalysisTaskSE::UserCreateOutputObjects()
36{
1282ce49 37// Create the output containers
7c3e5162 38//
39 fListOfHistos = new TList();
40
41 AliESDFMD* fmd = new AliESDFMD();
42 AliESDVertex* vertex = new AliESDVertex();
43
7c3e5162 44 TList* densitylist = new TList();
45
46 TList* bgcorlist = new TList();
47
48 fSharing.SetFMDData(fmd);
49 fSharing.SetVertex(vertex);
a38d1871 50 fSharing.SetOutputList(fListOfHistos);
51
7c3e5162 52 fDensity.SetOutputList(densitylist);
53 fDensity.SetInputESDFMD(fmd) ;
54 fDensity.SetInputVertex(vertex);
55
56 fBackground.SetInputList(densitylist);
57 fBackground.SetOutputList(bgcorlist);
cc066cb9 58 fBackground.SetHitList(fListOfHistos);
9f55be54 59
7c3e5162 60 fDndeta.SetInputList(bgcorlist);
61 fDndeta.SetOutputList(fListOfHistos);
9f55be54 62
7c3e5162 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 //
b64db9b1 81 // AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance();
7c3e5162 82 AliESDEvent* fESD = (AliESDEvent*)InputEvent();
83 fSharing.SetInputESD(fESD);
84
85 fSharing.Exec("");
bb8a464f 86 if(fSharing.GetEventStatus()) {
87 fDensity.Exec("");
88 if(fDensity.GetEventStatus()) {
89 fBackground.Exec("");
bb8a464f 90 fDndeta.Exec("");
78f6f750 91
bb8a464f 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//