removed the dependence on PWG0 introduced by the implementation of the trigger
[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)
19// fPrimary(kTRUE),
20// fRecordHits(kFALSE)
7c3e5162 21{
22 // Default constructor
23}
24//_____________________________________________________________________
25AliFMDAnalysisTaskSE::AliFMDAnalysisTaskSE(const char* name):
26 AliAnalysisTaskSE(name),
27 fListOfHistos(0),
28 fSharing("Sharing",kFALSE),
29 fDensity("Density",kFALSE),
30 fBackground("BackgroundCorrected",kFALSE),
b64db9b1 31 fDndeta("dNdeta",kFALSE)
32 // fPrimary(kTRUE),
33 // fRecordHits(kFALSE)
7c3e5162 34{
b3546e91 35
7c3e5162 36 DefineOutput(1, TList::Class());
37}
38//_____________________________________________________________________
39void AliFMDAnalysisTaskSE::UserCreateOutputObjects()
40{
1282ce49 41// Create the output containers
7c3e5162 42//
43 fListOfHistos = new TList();
44
45 AliESDFMD* fmd = new AliESDFMD();
46 AliESDVertex* vertex = new AliESDVertex();
47
48 TObjString* vtxString1 = new TObjString();
49
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);
57
7c3e5162 58 fDensity.SetOutputList(densitylist);
59 fDensity.SetInputESDFMD(fmd) ;
60 fDensity.SetInputVertex(vertex);
61
62 fBackground.SetInputList(densitylist);
63 fBackground.SetOutputList(bgcorlist);
cc066cb9 64 fBackground.SetHitList(fListOfHistos);
7c3e5162 65 fBackground.SetOutputVertex(vtxString1);
66
67 fDndeta.SetInputVertex(vtxString1);
68 fDndeta.SetInputList(bgcorlist);
69 fDndeta.SetOutputList(fListOfHistos);
b64db9b1 70 //fDndeta.SetAnalyzePrimary(fPrimary);
71 //fDndeta.SetRecordHits(fRecordHits);
7c3e5162 72 fSharing.CreateOutputObjects();
73 fDensity.CreateOutputObjects();
74 fBackground.CreateOutputObjects();
75 fDndeta.CreateOutputObjects();
76
77
78
79}
80//_____________________________________________________________________
81void AliFMDAnalysisTaskSE::Init()
82{
83 std::cout<<"Init"<<std::endl;
84}
85//_____________________________________________________________________
86void AliFMDAnalysisTaskSE::UserExec(Option_t */*option*/)
87{
88 // Execute analysis for current event
89 //
b64db9b1 90 // AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance();
7c3e5162 91 AliESDEvent* fESD = (AliESDEvent*)InputEvent();
92 fSharing.SetInputESD(fESD);
93
94 fSharing.Exec("");
bb8a464f 95 if(fSharing.GetEventStatus()) {
96 fDensity.Exec("");
97 if(fDensity.GetEventStatus()) {
98 fBackground.Exec("");
bb8a464f 99 fDndeta.Exec("");
78f6f750 100
bb8a464f 101 }
102 }
103 else
104 return;
105
7c3e5162 106 //fListOfHistos = fBackground.GetOutputList();
107
108 PostData(1, fListOfHistos);
109}
1282ce49 110//_____________________________________________________________________
111void AliFMDAnalysisTaskSE::Terminate(Option_t */*option*/)
112{
113 fDndeta.Terminate("");
7c3e5162 114
1282ce49 115}
7c3e5162 116//_____________________________________________________________________
117//
118// EOF
119//