+void AliGenGeVSim::DetermineReactionPlane() {
+ //
+ // private function used by Generate()
+ //
+ // Retermines Reaction Plane angle and set this value
+ // as a parameter [0] in fPhiFormula
+ //
+ // Note: if "gevsimPsiRndm" function is found it override both
+ // "gevsimPhi" function and initial fPsi value
+ //
+
+ TF1 *form;
+
+ form = 0;
+ form = (TF1 *)gROOT->GetFunction("gevsimPsi");
+ if (form) fPsi = form->Eval(gAlice->GetEvNumber()) * TMath::Pi() / 180;
+
+ form = 0;
+ form = (TF1 *)gROOT->GetFunction("gevsimPsiRndm");
+ if (form) fPsi = form->GetRandom() * TMath::Pi() / 180;
+
+
+ cout << "Psi = " << fPsi << "\t" << (Int_t)(fPsi*180./TMath::Pi()) << endl;
+
+ fPhiFormula->SetParameter(0, fPsi);
+}
+
+//////////////////////////////////////////////////////////////////////////////////
+
+Float_t AliGenGeVSim::GetdNdYToTotal() {
+ //
+ // Private, helper function used by Generate()
+ //
+ // Returns total multiplicity to dN/dY ration using current distribution.
+ // The function have to be called after setting distribution and its
+ // parameters (like temperature).
+ //
+
+ Float_t integ, mag;
+ const Double_t kMaxPt = 3.0, kMaxY = 2.;
+
+ if (fModel == 1) {
+
+ integ = fYFormula->Integral(-kMaxY, kMaxY);
+ mag = fYFormula->Eval(0);
+ return integ/mag;
+ }
+
+ // 2D formula standard or custom
+
+ if (fModel > 1 && fModel < 6) {
+
+ integ = ((TF2*)fCurrentForm)->Integral(0,kMaxPt, -kMaxY, kMaxY);
+ mag = ((TF2*)fCurrentForm)->Integral(0, kMaxPt, -0.1, 0.1) / 0.2;
+ return integ/mag;
+ }
+
+ // 2 1D histograms
+
+ if (fModel == 6) {
+
+ integ = fHist[1]->Integral();
+ mag = fHist[0]->GetBinContent(fHist[0]->FindBin(0.));
+ mag /= fHist[0]->GetBinWidth(fHist[0]->FindBin(0.));
+ return integ/mag;
+ }
+
+ // 2D histogram
+
+ if (fModel == 7) {
+
+ // Not tested ...
+ Int_t yBins = fPtYHist->GetNbinsY();
+ Int_t ptBins = fPtYHist->GetNbinsX();
+
+ integ = fPtYHist->Integral(0, ptBins, 0, yBins);
+ mag = fPtYHist->Integral(0, ptBins, (yBins/2)-1, (yBins/2)+1 ) / 2;
+ return integ/mag;
+ }
+
+ return 1;
+}
+
+//////////////////////////////////////////////////////////////////////////////////
+
+void AliGenGeVSim::SetFormula(Int_t pdg) {
+ //
+ // Private function used by Generate()
+ //
+ // Configure a formula for a given particle type and model Id (in fModel).
+ // If custom formula or histogram was selected the function tries
+ // to find it.
+ //
+ // The function implements naming conventions for custom distributions names
+ //
+
+ char buff[40];
+ const char* msg[4] = {
+ "Custom Formula for Pt Y distribution not found [pdg = %d]",
+ "Histogram for Pt distribution not found [pdg = %d]",
+ "Histogram for Y distribution not found [pdg = %d]",
+ "HIstogram for Pt Y dostribution not found [pdg = %d]"
+ };