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 // AliAnalysisTaskTemplate
18 // author: Redmer A. Bertens, Utrecht University, 2013
19 // rbertens@cern.ch, rbertens@nikhef.nl, rbertens@uu.nl
21 // template task for flow analysis in the flow package
22 // can be used as a basis for a general flow analysis task
23 // see corresponding task in $ALICE_ROOT/PWG/FLOW/Base/
26 #include "AliFlowEventSimple.h"
27 #include "AliAnalysisTaskTemplate.h"
28 #include "AliFlowAnalysisTemplate.h"
29 #include "AliFlowCommonHist.h"
30 #include "AliFlowCommonHistResults.h"
36 ClassImp(AliAnalysisTaskTemplate)
38 //_____________________________________________________________________________
39 AliAnalysisTaskTemplate::AliAnalysisTaskTemplate() : AliAnalysisTaskSE(),
42 fUsePhiWeights(kFALSE),
44 fApplyCorrectionForNUA(kFALSE),
45 fHarmonic(2) { /* constructor for ROOT IO */ }
46 //_____________________________________________________________________________
47 AliAnalysisTaskTemplate::AliAnalysisTaskTemplate(const char *name, Bool_t usePhiWeights) : AliAnalysisTaskSE(name),
50 fUsePhiWeights(usePhiWeights),
52 fApplyCorrectionForNUA(kFALSE),
56 DefineInput(0, AliFlowEventSimple::Class());
58 DefineInput(1, TList::Class());
60 DefineOutput(1, TList::Class());
62 //_____________________________________________________________________________
63 AliAnalysisTaskTemplate::~AliAnalysisTaskTemplate()
67 //_____________________________________________________________________________
68 void AliAnalysisTaskTemplate::UserCreateOutputObjects()
70 // create output objects
71 fFlowTask = new AliFlowAnalysisTemplate();
72 if (fApplyCorrectionForNUA) fFlowTask->SetApplyCorrectionForNUA(fApplyCorrectionForNUA);
73 fFlowTask->SetHarmonic(fHarmonic);
75 // connect the output list of the flow task to the output slot of this task
76 if( !(fOutputList = fFlowTask->GetHistList()) ) {
78 } else fOutputList->SetOwner(kTRUE);
79 PostData(1,fOutputList);
81 //_____________________________________________________________________________
82 void AliAnalysisTaskTemplate::UserExec(Option_t *)
84 if(dynamic_cast<AliFlowEventSimple*>(GetInputData(0))) {
85 fFlowTask->Make(static_cast<AliFlowEventSimple*>(GetInputData(0)));
86 PostData(1,fOutputList);
89 //_____________________________________________________________________________
90 void AliAnalysisTaskTemplate::Terminate(Option_t *)
94 //_____________________________________________________________________________