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)
38 ClassImp(AliAnalysisTaskMCEventPlane)
40 //________________________________________________________________________
41 AliAnalysisTaskMCEventPlane::AliAnalysisTaskMCEventPlane(const char *name) :
42 AliAnalysisTaskSE(name),
47 fEvaluateMixedHarmonics(kFALSE),
56 cout<<"AliAnalysisTaskMCEventPlane::AliAnalysisTaskMCEventPlane(const char *name)"<<endl;
58 // Define input and output slots here
59 // Input slot #0 works with a TChain
60 DefineInput(0, AliFlowEventSimple::Class());
61 // Output slot #0 writes into a TList container
62 DefineOutput(1, TList::Class());
65 //________________________________________________________________________
66 AliAnalysisTaskMCEventPlane::AliAnalysisTaskMCEventPlane() :
72 fEvaluateMixedHarmonics(kFALSE),
81 cout<<"AliAnalysisTaskMCEventPlane::AliAnalysisTaskMCEventPlane()"<<endl;
85 //________________________________________________________________________
86 AliAnalysisTaskMCEventPlane::~AliAnalysisTaskMCEventPlane()
93 //________________________________________________________________________
94 void AliAnalysisTaskMCEventPlane::UserCreateOutputObjects()
97 cout<<"AliAnalysisTaskMCEventPlane::CreateOutputObjects()"<<endl;
100 fMc = new AliFlowAnalysisWithMCEventPlane() ;
102 fMc->SetHarmonic(fHarmonic);
104 // Setters for mixed harmonics study:
105 fMc->SetEvaluateMixedHarmonics(fEvaluateMixedHarmonics);
106 fMc->SetNinCorrelator(fNinCorrelator);
107 fMc->SetMinCorrelator(fMinCorrelator);
108 fMc->SetXinPairAngle(fXinPairAngle);
109 fMc->SetnBinsMult(fnBinsMult);
110 fMc->SetMinMult(fMinMult);
111 fMc->SetMaxMult(fMaxMult);
116 if (fMc->GetHistList()) {
117 //fMc->GetHistList()->Print();
118 fListHistos = fMc->GetHistList();
119 //fListHistos->Print();
121 else {Printf("ERROR: Could not retrieve histogram list"); }
123 PostData(1,fListHistos);
127 //________________________________________________________________________
128 void AliAnalysisTaskMCEventPlane::UserExec(Option_t *)
131 // Called for each event
133 fEvent = dynamic_cast<AliFlowEventSimple*>(GetInputData(0));
138 cout << "Warning no input data!!!" << endl;
141 PostData(1,fListHistos);
145 //________________________________________________________________________
146 void AliAnalysisTaskMCEventPlane::Terminate(Option_t *)
148 // Called once at the end of the query
149 AliFlowAnalysisWithMCEventPlane* fMcTerm = new AliFlowAnalysisWithMCEventPlane() ;
152 fListHistos = (TList*)GetOutputData(1);
154 fMcTerm->GetOutputHistograms(fListHistos);
156 PostData(1,fListHistos);
159 cout << "histogram list pointer is empty" << endl;