]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG/FLOW/Tasks/AliAnalysisTaskTemplate.cxx
PWGPP-3, PWGPP-4, ATO-20, ATO-71 - Extended test to check integrity AliAnalysistask...
[u/mrichter/AliRoot.git] / PWG / FLOW / Tasks / AliAnalysisTaskTemplate.cxx
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 // AliAnalysisTaskTemplate
17 // 
18 // author: Redmer A. Bertens, Utrecht University, 2013
19 // rbertens@cern.ch, rbertens@nikhef.nl, rbertens@uu.nl
20 //
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/
24
25 // aliroot include
26 #include "AliFlowEventSimple.h"
27 #include "AliAnalysisTaskTemplate.h"
28 #include "AliFlowAnalysisTemplate.h"
29 #include "AliFlowCommonHist.h"
30 #include "AliFlowCommonHistResults.h"
31 #include "AliLog.h"
32
33 using std::endl;
34 using std::cout;
35
36 ClassImp(AliAnalysisTaskTemplate)
37
38 //_____________________________________________________________________________
39 AliAnalysisTaskTemplate::AliAnalysisTaskTemplate() : AliAnalysisTaskSE(), 
40     fFlowTask(NULL),
41     fOutputList(NULL),
42     fUsePhiWeights(kFALSE),
43     fListWeights(NULL),
44     fApplyCorrectionForNUA(kFALSE),
45     fHarmonic(2) { /* constructor for ROOT IO */ }
46 //_____________________________________________________________________________
47 AliAnalysisTaskTemplate::AliAnalysisTaskTemplate(const char *name, Bool_t usePhiWeights) : AliAnalysisTaskSE(name), 
48     fFlowTask(NULL),
49     fOutputList(NULL),
50     fUsePhiWeights(usePhiWeights),
51     fListWeights(NULL),
52     fApplyCorrectionForNUA(kFALSE),
53     fHarmonic(2)
54 {
55     // constructor
56     DefineInput(0, AliFlowEventSimple::Class());
57     if(usePhiWeights) {
58         DefineInput(1, TList::Class()); 
59     }
60     DefineOutput(1, TList::Class());
61 }
62 //_____________________________________________________________________________
63 AliAnalysisTaskTemplate::~AliAnalysisTaskTemplate()
64 {
65     // destructor
66 }
67 //_____________________________________________________________________________
68 void AliAnalysisTaskTemplate::UserCreateOutputObjects() 
69 {
70     // create output objects
71     fFlowTask = new AliFlowAnalysisTemplate();
72     if (fApplyCorrectionForNUA) fFlowTask->SetApplyCorrectionForNUA(fApplyCorrectionForNUA);
73     fFlowTask->SetHarmonic(fHarmonic);
74     fFlowTask-> Init();
75     // connect the output list of the flow task to the output slot of this task
76     if( !(fOutputList = fFlowTask->GetHistList()) ) {
77         return;
78     } else fOutputList->SetOwner(kTRUE);
79     PostData(1,fOutputList);
80 }
81 //_____________________________________________________________________________
82 void AliAnalysisTaskTemplate::UserExec(Option_t *) 
83 {
84     if(dynamic_cast<AliFlowEventSimple*>(GetInputData(0))) {
85         fFlowTask->Make(static_cast<AliFlowEventSimple*>(GetInputData(0)));
86         PostData(1,fOutputList);
87     }
88
89 //_____________________________________________________________________________
90 void AliAnalysisTaskTemplate::Terminate(Option_t *) 
91 {
92     // terminate
93 }
94 //_____________________________________________________________________________