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 #define AliFlowAnalysisTemplate_CXX
24 #include "AliFlowCommonConstants.h"
25 #include "AliFlowEventSimple.h"
26 #include "AliFlowTrackSimple.h"
27 #include "AliFlowCommonHist.h"
28 #include "AliFlowCommonHistResults.h"
29 #include "AliFlowAnalysisTemplate.h"
31 // Description: Template maker to serve as a starting point for flow analysis
32 // Author: Redmer Alexander Bertens, Utrecht University, 2013
33 // rbertens@cern.ch, rbertens@nikhef.nl, r.a.bertens@uu.nl
36 ClassImp(AliFlowAnalysisTemplate)
38 AliFlowAnalysisTemplate::AliFlowAnalysisTemplate() :
40 fUsePhiWeights (kFALSE),
41 fApplyCorrectionForNUA (kFALSE),
48 //_____________________________________________________________________________
49 AliFlowAnalysisTemplate::~AliFlowAnalysisTemplate()
53 //_____________________________________________________________________________
54 void AliFlowAnalysisTemplate::Init()
56 // initialize the histograms
57 fHistList = new TList();
58 fHistList->SetName("TemplateList");
59 fHistList->SetOwner();
61 // common histogram container
62 fCommonHists = new AliFlowCommonHist("AliFlowCommonHist_Template","AliFlowCommonHist");
63 (fCommonHists->GetHarmonic())->Fill(0.5,fHarmonic); // store harmonic
64 fHistList->Add(fCommonHists);
66 // common results container
67 fCommonHistsRes = new AliFlowCommonHistResults("AliFlowCommonHistResults_Template","",fHarmonic);
68 fHistList->Add(fCommonHistsRes);
70 //_____________________________________________________________________________
71 void AliFlowAnalysisTemplate::Make(AliFlowEventSimple* anEvent)
73 // core method, called for each event
76 printf("Numer of POIs %i", anEvent->NumberOfTracks());
78 //_____________________________________________________________________________
79 void AliFlowAnalysisTemplate::GetOutputHistograms(TList *outputListHistos)
81 //get pointers to all output histograms (called before Finish())
82 fHistList = outputListHistos;
83 fCommonHists = (AliFlowCommonHist*) fHistList->FindObject("AliFlowCommonHist_SP");
84 fCommonHistsRes = (AliFlowCommonHistResults*) fHistList->FindObject("AliFlowCommonHistResults_SP");
86 //_____________________________________________________________________________
87 void AliFlowAnalysisTemplate::Finish() {
88 // calculate flow and fill the AliFlowCommonHistResults
90 //_____________________________________________________________________________
91 void AliFlowAnalysisTemplate::WriteHistograms(TDirectoryFile *outputFileName) const {
92 // store the final results in output .root file
93 outputFileName->Add(fHistList);
94 outputFileName->Write(outputFileName->GetName(), TObject::kSingleKey);
96 //_____________________________________________________________________________