/************************************************************************* * 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 #include "TList.h" 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(): fQsum(NULL), fQ2sum(0), fEventNumber(0), fDebug(kFALSE), fHistList(NULL), fCommonHists(NULL), fCommonHistsRes(NULL), fHistProFlow(NULL), fHistRP(NULL) { // Constructor. fHistList = new TList(); fQsum = new TVector2; // flow vector sum } //----------------------------------------------------------------------- AliFlowAnalysisWithMCEventPlane::~AliFlowAnalysisWithMCEventPlane() { //destructor delete fHistList; delete fQsum; } //----------------------------------------------------------------------- void AliFlowAnalysisWithMCEventPlane::Init() { //Define all histograms cout<<"---Analysis with the real MC Event Plane---"<Add(fCommonHists->GetHistMultOrig()); fHistList->Add(fCommonHists->GetHistMultInt()); fHistList->Add(fCommonHists->GetHistMultDiff()); fHistList->Add(fCommonHists->GetHistPtInt()); fHistList->Add(fCommonHists->GetHistPtDiff()); fHistList->Add(fCommonHists->GetHistPhiInt()); fHistList->Add(fCommonHists->GetHistPhiDiff()); fHistList->Add(fCommonHists->GetHistEtaInt()); fHistList->Add(fCommonHists->GetHistEtaDiff()); fHistList->Add(fCommonHists->GetHistProMeanPtperBin()); fHistList->Add(fCommonHists->GetHistQ()); fCommonHistsRes = new AliFlowCommonHistResults("MC"); fHistList->Add(fCommonHistsRes->GetHistDiffFlow()); fHistList->Add(fCommonHistsRes->GetHistChi()); fHistList->Add(fCommonHistsRes->GetHistIntFlow()); fHistProFlow = new TProfile("FlowPro_VPt_MC","FlowPro_VPt_MC",iNbinsPt,dPtMin,dPtMax); fHistProFlow->SetXTitle("Pt"); fHistProFlow->SetYTitle("v2 (%)"); fHistList->Add(fHistProFlow); fHistRP = new TH1F("Flow_RP_MC","Flow_RP_MC",100,0.,3.14); fHistRP->SetXTitle("Reaction Plane Angle"); fHistRP->SetYTitle("Counts"); fHistList->Add(fHistRP); fEventNumber = 0; //set number of events to zero } //----------------------------------------------------------------------- void AliFlowAnalysisWithMCEventPlane::Make(AliFlowEventSimple* anEvent, Double_t aRP) { //Calculate v2 from the MC reaction plane if (anEvent) { //fill control histograms fCommonHists->FillControlHistograms(anEvent); //get the Q vector from the FlowEvent AliFlowVector vQ = anEvent->GetQ(); //cout<<"vQ.Mod() = " << vQ.Mod() << endl; //for chi calculation: *fQsum += vQ; //cout<<"fQsum.Mod() = "<GetHistPtDiff(); Double_t dV = 0.; Double_t dErrV = 0.; Double_t dSum = 0.; for(Int_t b=0;bGetBinContent(b); dErrdifcomb = fHistProFlow->GetBinError(b); //fill TH1D fCommonHistsRes->FillDifferentialFlow(b, dv2pro, dErrdifcomb); if (fHistPtDiff){ //integrated flow Double_t dYield = fHistPtDiff->GetBinContent(b); dV += dv2pro/100*dYield ; dSum += dYield; //error on integrated flow dErrV += dYield*dYield*(dErrdifcomb/100)*(dErrdifcomb/100); } } } dV /= dSum; //because pt distribution should be normalised dErrV /= dSum*dSum; dErrV = TMath::Sqrt(dErrV); cout<<"dV is "<FillIntegratedFlow(dV,dErrV); cout<<".....finished"<