* about the suitability of this software for any purpose. It is *
* provided "as is" without express or implied warranty. *
**************************************************************************/
+// 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)
#define AliFlowAnalysisWithMCEventPlane_cxx
-#include "Riostream.h" //needed as include
-#include "TFile.h" //needed as include
-#include "TProfile.h" //needed as include
-#include "TProfile2D.h"
-#include "TComplex.h" //needed as include
+#include "Riostream.h"
+#include "TFile.h"
+#include "TProfile.h"
+#include "TProfile2D.h"
#include "TList.h"
+#include "TH1F.h"
+#include "TMath.h"
+#include "TVector2.h"
-class TH1F;
-
-#include "AliFlowCommonConstants.h" //needed as include
+#include "AliFlowCommonConstants.h"
#include "AliFlowEventSimple.h"
#include "AliFlowTrackSimple.h"
#include "AliFlowCommonHist.h"
#include "AliFlowCommonHistResults.h"
#include "AliFlowAnalysisWithMCEventPlane.h"
+#include "AliFlowVector.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)
//-----------------------------------------------------------------------
fHistProDiffFlowPtPOI(NULL),
fHistProDiffFlowEtaPOI(NULL),
fHistSpreadOfFlow(NULL),
- fHarmonic(2)\r
+ fHarmonic(2)
{
// Constructor.
//Define all histograms
cout<<"---Analysis with the real MC Event Plane---"<<endl;
+ //save old value and prevent histograms from being added to directory
+ //to avoid name clashes in case multiple analaysis objects are used
+ //in an analysis
+ Bool_t oldHistAddStatus = TH1::AddDirectoryStatus();
+ TH1::AddDirectory(kFALSE);
+
Int_t iNbinsPt = AliFlowCommonConstants::GetMaster()->GetNbinsPt();
Double_t dPtMin = AliFlowCommonConstants::GetMaster()->GetPtMin();
Double_t dPtMax = AliFlowCommonConstants::GetMaster()->GetPtMax();
fEventNumber = 0; //set number of events to zero
+ TH1::AddDirectory(oldHistAddStatus);
}
//-----------------------------------------------------------------------
Int_t iNbinsEta = AliFlowCommonConstants::GetMaster()->GetNbinsEta();
// access harmonic:
- if(fCommonHists && fCommonHists->GetHarmonic())\r
+ if(fCommonHists && fCommonHists->GetHarmonic())
{
fHarmonic = (Int_t)(fCommonHists->GetHarmonic())->GetBinContent(1); // to be improved (moved somewhere else?)
}
dErrVRP += dYieldPtRP*dYieldPtRP*dErrvPtRP*dErrvPtRP;
}
}
- if (dSumRP != 0. ) {
+
+ if (!(TMath::AreEqualAbs(dSumRP, 0.0, 1e-10)) ) {
dVRP /= dSumRP; //because pt distribution should be normalised
dErrVRP /= (dSumRP*dSumRP);
dErrVRP = TMath::Sqrt(dErrVRP);
}
}//end of for(Int_t b=0;b<iNbinsPt;b++)
} else { cout<<"fHistProFlow is NULL"<<endl; }
- if (dSumPOI != 0. ) {
+
+ if (!(TMath::AreEqualAbs(dSumPOI, 0.0, 1e-10)) ) {
dVPOI /= dSumPOI; //because pt distribution should be normalised
dErrVPOI /= (dSumPOI*dSumPOI);
dErrVPOI = TMath::Sqrt(dErrVPOI);