/************************************************************************* * Copyright(c) 1998-2008, ALICE Experiment at CERN, All rights reserved. * * * * Author: The ALICE Off-line Project. * * Contributors are mentioned in the code where appropriate. * * * * Permission to use, copy, modify and distribute this software and its * * documentation strictly for non-commercial purposes is hereby granted * * without fee, provided that the above copyright notice appears in all * * copies and that both the copyright notice and this permission notice * * appear in the supporting documentation. The authors make no claims * * about the suitability of this software for any purpose. It is * * provided "as is" without express or implied warranty. * **************************************************************************/ #define AliFlowAnalysisWithMCEventPlane_cxx #include "Riostream.h" //needed as include #include "TFile.h" //needed as include #include "TProfile.h" //needed as include #include "TComplex.h" //needed as include class TH1F; #include "AliFlowCommonConstants.h" //needed as include #include "AliFlowEventSimple.h" #include "AliFlowTrackSimple.h" #include "AliFlowCommonHist.h" #include "AliFlowCommonHistResults.h" #include "AliFlowAnalysisWithMCEventPlane.h" class AliFlowVector; // AliFlowAnalysisWithMCEventPlane: // Description: Maker to analyze Flow from the generated MC reaction plane. // This class is used to get the real value of the flow // to compare the other methods to when analysing simulated events // author: N. van der Kolk (kolk@nikhef.nl) ClassImp(AliFlowAnalysisWithMCEventPlane) //----------------------------------------------------------------------- AliFlowAnalysisWithMCEventPlane::AliFlowAnalysisWithMCEventPlane(): fQ2sum(0), fEventNumber(0), fMult(0), fNbins(0), fTrack(NULL), fDebug(kFALSE), fHistFileName(0), fHistFile(0), fCommonHists(NULL), fCommonHistsRes(NULL), fHistProFlow(NULL), fHistRP(NULL) { // Constructor. fQ.Set(0.,0.); // flow vector fQsum.Set(0.,0.); // flow vector sum } //----------------------------------------------------------------------- AliFlowAnalysisWithMCEventPlane::~AliFlowAnalysisWithMCEventPlane() { //destructor } //----------------------------------------------------------------------- void AliFlowAnalysisWithMCEventPlane::Init() { //Define all histograms cout<<"---Analysis with the real MC Event Plane---"<SetXTitle("Pt"); fHistProFlow->SetYTitle("v2 (%)"); fHistRP = new TH1F("Flow_RP_MC","Flow_RP_MC",100,0.,3.14); fHistRP->SetXTitle("Reaction Plane Angle"); fHistRP->SetYTitle("Counts"); fEventNumber = 0; //set number of events to zero } //----------------------------------------------------------------------- void AliFlowAnalysisWithMCEventPlane::Make(AliFlowEventSimple* anEvent, Double_t fRP) { //Calculate v2 from the MC reaction plane if (anEvent) { //fill control histograms fCommonHists->FillControlHistograms(anEvent); //get the Q vector from the FlowEvent fQ = anEvent->GetQ(); //cout<<"fQ.Mod() = " << fQ.Mod() << endl; //for chi calculation: fQsum += fQ; //cout<<"fQsum.Mod() = "<GetfHistPtDiff(); Double_t fV = 0.; Double_t fErrV = 0.; Double_t fSum = 0.; for(Int_t b=0;bGetBinContent(b); fErrdifcomb = fHistProFlow->GetBinError(b); //fill TH1D fCommonHistsRes->FillDifferentialFlow(b, fv2pro, fErrdifcomb); if (fHistPtDiff){ //integrated flow Double_t fYield = fHistPtDiff->GetBinContent(b); fV += fv2pro/100*fYield ; fSum += fYield; //error on integrated flow fErrV += fYield*fYield*(fErrdifcomb/100)*(fErrdifcomb/100); } } } fV /= fSum; //because pt distribution should be normalised fErrV /= fSum*fSum; fErrV = TMath::Sqrt(fErrV); cout<<"fV is "<FillIntegratedFlow(fV,fErrV); // write to file fHistFile->Write(); cout<<".....finished"<