1 /*************************************************************************
2 * Copyright(c) 1998-2008, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
16 #include "Riostream.h" //needed as include
18 #include "TProfile2D.h"
22 class AliAnalysisTaskSE;
23 #include "AliAnalysisManager.h"
24 #include "AliFlowEventSimple.h"
27 #include "AliAnalysisTaskMCEventPlane.h"
28 #include "AliFlowAnalysisWithMCEventPlane.h"
29 #include "AliFlowCommonHist.h"
30 #include "AliFlowCommonHistResults.h"
32 // AliAnalysisTaskMCEventPlane:
34 // analysis task for Monte Carlo Event Plane
36 // Author: Naomi van der Kolk (kolk@nikhef.nl)
40 ClassImp(AliAnalysisTaskMCEventPlane)
42 //________________________________________________________________________
43 AliAnalysisTaskMCEventPlane::AliAnalysisTaskMCEventPlane(const char *name) :
44 AliAnalysisTaskSE(name),
49 fEvaluateMixedHarmonics(kFALSE),
58 cout<<"AliAnalysisTaskMCEventPlane::AliAnalysisTaskMCEventPlane(const char *name)"<<endl;
60 // Define input and output slots here
61 // Input slot #0 works with a TChain
62 DefineInput(0, AliFlowEventSimple::Class());
63 // Output slot #0 writes into a TList container
64 DefineOutput(1, TList::Class());
67 //________________________________________________________________________
68 AliAnalysisTaskMCEventPlane::AliAnalysisTaskMCEventPlane() :
74 fEvaluateMixedHarmonics(kFALSE),
83 cout<<"AliAnalysisTaskMCEventPlane::AliAnalysisTaskMCEventPlane()"<<endl;
87 //________________________________________________________________________
88 AliAnalysisTaskMCEventPlane::~AliAnalysisTaskMCEventPlane()
95 //________________________________________________________________________
96 void AliAnalysisTaskMCEventPlane::UserCreateOutputObjects()
99 cout<<"AliAnalysisTaskMCEventPlane::CreateOutputObjects()"<<endl;
102 fMc = new AliFlowAnalysisWithMCEventPlane() ;
104 fMc->SetHarmonic(fHarmonic);
106 // Setters for mixed harmonics study:
107 fMc->SetEvaluateMixedHarmonics(fEvaluateMixedHarmonics);
108 fMc->SetNinCorrelator(fNinCorrelator);
109 fMc->SetMinCorrelator(fMinCorrelator);
110 fMc->SetXinPairAngle(fXinPairAngle);
111 fMc->SetnBinsMult(fnBinsMult);
112 fMc->SetMinMult(fMinMult);
113 fMc->SetMaxMult(fMaxMult);
118 if (fMc->GetHistList()) {
119 //fMc->GetHistList()->Print();
120 fListHistos = fMc->GetHistList();
121 //fListHistos->Print();
123 else {Printf("ERROR: Could not retrieve histogram list"); }
125 PostData(1,fListHistos);
129 //________________________________________________________________________
130 void AliAnalysisTaskMCEventPlane::UserExec(Option_t *)
133 // Called for each event
135 fEvent = dynamic_cast<AliFlowEventSimple*>(GetInputData(0));
140 cout << "Warning no input data!!!" << endl;
143 PostData(1,fListHistos);
147 //________________________________________________________________________
148 void AliAnalysisTaskMCEventPlane::Terminate(Option_t *)
150 // Called once at the end of the query
151 AliFlowAnalysisWithMCEventPlane* fMcTerm = new AliFlowAnalysisWithMCEventPlane() ;
154 fListHistos = (TList*)GetOutputData(1);
156 fMcTerm->GetOutputHistograms(fListHistos);
158 PostData(1,fListHistos);
161 cout << "histogram list pointer is empty" << endl;