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 AliFlowAnalysisWithScalarProduct_cxx
18 #include "Riostream.h" //needed as include
19 //#include "TFile.h" //needed as include
27 #include "AliFlowCommonConstants.h" //needed as include
28 #include "AliFlowEventSimple.h"
29 #include "AliFlowTrackSimple.h"
30 #include "AliFlowCommonHist.h"
31 //#include "AliFlowCommonHistResults.h"
32 #include "AliFlowAnalysisWithScalarProduct.h"
36 // AliFlowAnalysisWithScalarProduct:
38 // Maker to analyze Flow with the Scalar product method.
40 // author: N. van der Kolk (kolk@nikhef.nl)
42 ClassImp(AliFlowAnalysisWithScalarProduct)
44 //-----------------------------------------------------------------------
46 AliFlowAnalysisWithScalarProduct::AliFlowAnalysisWithScalarProduct():
54 fHistList = new TList();
56 //-----------------------------------------------------------------------
59 AliFlowAnalysisWithScalarProduct::~AliFlowAnalysisWithScalarProduct()
66 //-----------------------------------------------------------------------
67 void AliFlowAnalysisWithScalarProduct::Init() {
69 //Define all histograms
70 cout<<"---Analysis with the Scalar Product Method--- Init"<<endl;
72 Int_t iNbinsPt = AliFlowCommonConstants::GetNbinsPt();
73 Double_t dPtMin = AliFlowCommonConstants::GetPtMin();
74 Double_t dPtMax = AliFlowCommonConstants::GetPtMax();
76 fHistProUQ = new TProfile("Flow_UQ_SP","Flow_UQ_SP",iNbinsPt,dPtMin,dPtMax);
77 fHistProUQ->SetXTitle("p_t (GeV)");
78 fHistProUQ->SetYTitle("<uQ>");
79 fHistList->Add(fHistProUQ);
81 fCommonHists = new AliFlowCommonHist("SP");
82 // fHistList->Add(fCommonHists->GetHistList());
84 fHistList->Add(fCommonHists);
85 // commented for test writing full object
86 fHistList->Add(fCommonHists->GetHistMultOrig());
87 fHistList->Add(fCommonHists->GetHistMultInt());
88 fHistList->Add(fCommonHists->GetHistMultDiff());
89 fHistList->Add(fCommonHists->GetHistPtInt());
90 fHistList->Add(fCommonHists->GetHistPtDiff());
91 fHistList->Add(fCommonHists->GetHistPhiInt());
92 fHistList->Add(fCommonHists->GetHistPhiDiff());
93 fHistList->Add(fCommonHists->GetHistEtaInt());
94 fHistList->Add(fCommonHists->GetHistEtaDiff());
95 fHistList->Add(fCommonHists->GetHistProMeanPtperBin());
96 fHistList->Add(fCommonHists->GetHistQ());
99 //fCommonHistsRes = new AliFlowCommonHistResults("SP");
101 fEventNumber = 0; //set number of events to zero
104 //-----------------------------------------------------------------------
106 void AliFlowAnalysisWithScalarProduct::Make(AliFlowEventSimple* anEvent) {
111 //fill control histograms
112 fCommonHists->FillControlHistograms(anEvent);
114 //get the Q vector from the FlowEvent
115 AliFlowVector vQ = anEvent->GetQ();
117 //loop over the tracks of the event
118 AliFlowTrackSimple* pTrack = NULL;
119 Int_t iNumberOfTracks = anEvent->NumberOfTracks();
120 for (Int_t i=0;i<iNumberOfTracks;i++)
122 pTrack = anEvent->GetTrack(i) ;
124 if (pTrack->UseForDifferentialFlow()) {
125 Double_t dPhi = pTrack->Phi();
129 Double_t dUX = TMath::Cos(2*dPhi);
130 Double_t dUY = TMath::Sin(2*dPhi);
132 Double_t dModulus = vU.Mod();
133 if (dModulus!=0.) vU.Set(dUX/dModulus,dUY/dModulus); // make length 1
134 else cerr<<"dModulus is zero!"<<endl;
137 //subtrackt particle from the flowvector if used to define it
138 if (pTrack->UseForIntegratedFlow()) {
139 Double_t dQmX = vQm.X() - dUX;
140 Double_t dQmY = vQm.Y() - dUY;
144 //dUQ = scalar product of vU and vQm
145 Double_t dUQ = vU * vQm;
146 Double_t dPt = pTrack->Pt();
147 //fill the profile histogram
148 fHistProUQ->Fill(dPt,dUQ);
154 cout<<"@@@@@ "<<fEventNumber<<" events processed"<<endl;
158 //--------------------------------------------------------------------
159 void AliFlowAnalysisWithScalarProduct::Finish() {
161 //*************make histograms etc.
162 if (fDebug) cout<<"AliFlowAnalysisWithScalarProduct::Terminate()"<<endl;
166 cout<<".....finished"<<endl;