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),
46 fEvaluateMixedHarmonics(kFALSE),
55 cout<<"AliAnalysisTaskMCEventPlane::AliAnalysisTaskMCEventPlane(const char *name)"<<endl;
57 // Define input and output slots here
58 // Input slot #0 works with a TChain
59 DefineInput(0, AliFlowEventSimple::Class());
60 // Output slot #0 writes into a TList container
61 DefineOutput(1, TList::Class());
64 //________________________________________________________________________
65 AliAnalysisTaskMCEventPlane::AliAnalysisTaskMCEventPlane() :
70 fEvaluateMixedHarmonics(kFALSE),
79 cout<<"AliAnalysisTaskMCEventPlane::AliAnalysisTaskMCEventPlane()"<<endl;
83 //________________________________________________________________________
84 AliAnalysisTaskMCEventPlane::~AliAnalysisTaskMCEventPlane()
91 //________________________________________________________________________
92 void AliAnalysisTaskMCEventPlane::UserCreateOutputObjects()
95 cout<<"AliAnalysisTaskMCEventPlane::CreateOutputObjects()"<<endl;
98 fMc = new AliFlowAnalysisWithMCEventPlane() ;
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);
112 if (fMc->GetHistList()) {
113 //fMc->GetHistList()->Print();
114 fListHistos = fMc->GetHistList();
115 //fListHistos->Print();
117 else {Printf("ERROR: Could not retrieve histogram list"); }
119 PostData(1,fListHistos);
123 //________________________________________________________________________
124 void AliAnalysisTaskMCEventPlane::UserExec(Option_t *)
127 // Called for each event
129 fEvent = dynamic_cast<AliFlowEventSimple*>(GetInputData(0));
134 cout << "Warning no input data!!!" << endl;
137 PostData(1,fListHistos);
141 //________________________________________________________________________
142 void AliAnalysisTaskMCEventPlane::Terminate(Option_t *)
144 // Called once at the end of the query
145 AliFlowAnalysisWithMCEventPlane* fMcTerm = new AliFlowAnalysisWithMCEventPlane() ;
148 fListHistos = (TList*)GetOutputData(1);
150 fMcTerm->GetOutputHistograms(fListHistos);
152 PostData(1,fListHistos);
155 cout << "histogram list pointer is empty" << endl;