]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG2/FLOW/AliFlowTasks/AliAnalysisTaskMCEventPlane.cxx
Fixed bug in p/pi for MC, cosmetic changes, using new method to compute mean (using...
[u/mrichter/AliRoot.git] / PWG2 / FLOW / AliFlowTasks / AliAnalysisTaskMCEventPlane.cxx
CommitLineData
f1d945a1 1/*************************************************************************
2* Copyright(c) 1998-2008, ALICE Experiment at CERN, All rights reserved. *
3* *
4* Author: The ALICE Off-line Project. *
5* Contributors are mentioned in the code where appropriate. *
6* *
7* Permission to use, copy, modify and distribute this software and its *
8* documentation strictly for non-commercial purposes is hereby granted *
9* without fee, provided that the above copyright notice appears in all *
10* copies and that both the copyright notice and this permission notice *
11* appear in the supporting documentation. The authors make no claims *
12* about the suitability of this software for any purpose. It is *
13* provided "as is" without express or implied warranty. *
14**************************************************************************/
15
16#include "Riostream.h" //needed as include
9d062fe3 17#include "TProfile.h"
9cc9e6cc 18#include "TProfile2D.h"
f1d945a1 19#include "TList.h"
20
21
22063257 22class AliAnalysisTaskSE;
f1d945a1 23#include "AliAnalysisManager.h"
d7671632 24#include "AliFlowEventSimple.h"
f1d945a1 25
f1d945a1 26
27#include "AliAnalysisTaskMCEventPlane.h"
d7671632 28#include "AliFlowAnalysisWithMCEventPlane.h"
9d062fe3 29#include "AliFlowCommonHist.h"
30#include "AliFlowCommonHistResults.h"
f1d945a1 31
32// AliAnalysisTaskMCEventPlane:
33//
34// analysis task for Monte Carlo Event Plane
35//
36// Author: Naomi van der Kolk (kolk@nikhef.nl)
37
38ClassImp(AliAnalysisTaskMCEventPlane)
39
40//________________________________________________________________________
d7671632 41AliAnalysisTaskMCEventPlane::AliAnalysisTaskMCEventPlane(const char *name) :
22063257 42 AliAnalysisTaskSE(name),
d7671632 43 fEvent(NULL),
44 fMc(NULL),
4740c6b8 45 fListHistos(NULL),
46 fEvaluateMixedHarmonics(kTRUE),
47 fnBinsMult(10000),
48 fMinMult(0.),
49 fMaxMult(10000.),
50 fNinCorrelator(2),
51 fMinCorrelator(2),
52 fXinPairAngle(0.5)
f1d945a1 53{
54 // Constructor
55 cout<<"AliAnalysisTaskMCEventPlane::AliAnalysisTaskMCEventPlane(const char *name)"<<endl;
56
57 // Define input and output slots here
58 // Input slot #0 works with a TChain
d7671632 59 DefineInput(0, AliFlowEventSimple::Class());
f1d945a1 60 // Output slot #0 writes into a TList container
22063257 61 DefineOutput(1, TList::Class());
f1d945a1 62}
63
28ca24ad 64//________________________________________________________________________
65AliAnalysisTaskMCEventPlane::AliAnalysisTaskMCEventPlane() :
22063257 66 AliAnalysisTaskSE(),
d7671632 67 fEvent(NULL),
68 fMc(NULL),
4740c6b8 69 fListHistos(NULL),
70 fEvaluateMixedHarmonics(kFALSE),
71 fnBinsMult(0),
72 fMinMult(0.0),
73 fMaxMult(0.0),
74 fNinCorrelator(0),
75 fMinCorrelator(0),
76 fXinPairAngle(0.0)
28ca24ad 77{
78 // Constructor
79 cout<<"AliAnalysisTaskMCEventPlane::AliAnalysisTaskMCEventPlane()"<<endl;
80
81}
82
83//________________________________________________________________________
84AliAnalysisTaskMCEventPlane::~AliAnalysisTaskMCEventPlane()
85{
86
87 //destructor
88
89}
90
f1d945a1 91//________________________________________________________________________
22063257 92void AliAnalysisTaskMCEventPlane::UserCreateOutputObjects()
f1d945a1 93{
94 // Called once
95 cout<<"AliAnalysisTaskMCEventPlane::CreateOutputObjects()"<<endl;
96
f1d945a1 97 //Analyser
98 fMc = new AliFlowAnalysisWithMCEventPlane() ;
4740c6b8 99
100 // Setters for mixed harmonics study:
101 fMc->SetEvaluateMixedHarmonics(fEvaluateMixedHarmonics);
102 fMc->SetNinCorrelator(fNinCorrelator);
103 fMc->SetMinCorrelator(fMinCorrelator);
104 fMc->SetXinPairAngle(fXinPairAngle);
105 fMc->SetnBinsMult(fnBinsMult);
106 fMc->SetMinMult(fMinMult);
107 fMc->SetMaxMult(fMaxMult);
108
109 // Initialized:
f1d945a1 110 fMc-> Init();
111
28ca24ad 112 if (fMc->GetHistList()) {
9d062fe3 113 //fMc->GetHistList()->Print();
7b88dba1 114 fListHistos = fMc->GetHistList();
115 //fListHistos->Print();
28ca24ad 116 }
117 else {Printf("ERROR: Could not retrieve histogram list"); }
f1d945a1 118
61e0c8c0 119 PostData(1,fListHistos);
120
f1d945a1 121}
122
123//________________________________________________________________________
22063257 124void AliAnalysisTaskMCEventPlane::UserExec(Option_t *)
f1d945a1 125{
126 // Main loop
127 // Called for each event
128
d7671632 129 fEvent = dynamic_cast<AliFlowEventSimple*>(GetInputData(0));
130 if (fEvent){
131 fMc->Make(fEvent);
f1d945a1 132 }
d7671632 133 else {
134 cout << "Warning no input data!!!" << endl;
f1d945a1 135 }
136
22063257 137 PostData(1,fListHistos);
f1d945a1 138}
139
9d062fe3 140
f1d945a1 141//________________________________________________________________________
142void AliAnalysisTaskMCEventPlane::Terminate(Option_t *)
143{
144 // Called once at the end of the query
9d062fe3 145 AliFlowAnalysisWithMCEventPlane* fMcTerm = new AliFlowAnalysisWithMCEventPlane() ;
146
147 //Get output data
22063257 148 fListHistos = (TList*)GetOutputData(1);
9d062fe3 149 if (fListHistos) {
22063257 150 fMcTerm->GetOutputHistograms(fListHistos);
151 fMcTerm->Finish();
152 PostData(1,fListHistos);
153 } else
154 {
155 cout << "histogram list pointer is empty" << endl;
156 }
f1d945a1 157}
d7671632 158