+
+ // 2d histogram
+
+ if (fModel == 7) {
+
+ fPtYHist = 0;
+ fPtYHist = (TH2D*)gROOT->FindObject(pattern[6]);
+
+ if (!fPtYHist) {
+
+ sprintf(buff, pattern[7], pdg);
+ fPtYHist = (TH2D*)gROOT->FindObject(buff);
+ }
+
+ if (!fPtYHist) Error(where, msg[4], pdg);
+ }
+
+}
+
+//////////////////////////////////////////////////////////////////////////////////
+
+void AliGenGeVSim:: AdjustFormula() {
+ //
+ // Private Function
+ // Adjust fomula bounds according to acceptance cuts.
+ //
+ // Since GeVSim is producing "thermal" particles Pt
+ // is cut at 3 GeV even when acceptance extends to grater momenta.
+ //
+ // WARNING !
+ // If custom formula was provided function preserves
+ // original cuts.
+ //
+
+ const Double_t kMaxPt = 3.0;
+ const Double_t kMaxY = 2.0;
+ Double_t minPt, maxPt, minY, maxY;
+
+
+ if (fModel > 4) return;
+
+ // max Pt
+ if (TestBit(kPtRange) && fPtMax < kMaxPt ) maxPt = fPtMax;
+ else maxPt = kMaxPt;
+
+ // min Pt
+ if (TestBit(kPtRange)) minPt = fPtMin;
+ else minPt = 0;
+
+ if (TestBit(kPtRange) && fPtMin > kMaxPt )
+ Warning("Acceptance", "Minimum Pt (%3.2f GeV) greater that 3.0 GeV ", fPtMin);
+
+ // Max Pt < Max P
+ if (TestBit(kMomentumRange) && fPtMax < maxPt) maxPt = fPtMax;
+
+ // max and min rapidity
+ if (TestBit(kYRange)) {
+ minY = fYMin;
+ maxY = fYMax;
+ } else {
+ minY = -kMaxY;
+ maxY = kMaxY;
+ }
+
+ // adjust formula
+
+ if (fModel == 1) {
+ fPtFormula->SetRange(fPtMin, maxPt);
+ fYFormula->SetRange(fYMin, fYMax);
+ }
+
+ if (fModel > 1)
+ ((TF2*)fCurrentForm)->SetRange(minPt, minY, maxPt, maxY);
+
+ // azimuthal cut
+
+ if (TestBit(kPhiRange))
+ fPhiFormula->SetRange(fPhiMin, fPhiMax);
+
+}
+
+//////////////////////////////////////////////////////////////////////////////////
+
+void AliGenGeVSim::GetRandomPtY(Double_t &pt, Double_t &y) {
+ //
+ // Private function used by Generate()
+ //
+ // Returns random values of Pt and Y corresponding to selected
+ // distribution.
+ //
+
+ if (fModel == 1) {
+ pt = fPtFormula->GetRandom();
+ y = fYFormula->GetRandom();
+ return;
+ }
+
+ if (fModel > 1 && fModel < 6) {
+ ((TF2*)fCurrentForm)->GetRandom2(pt, y);
+ return;
+ }
+
+ if (fModel == 6) {
+ pt = fHist[0]->GetRandom();
+ y = fHist[1]->GetRandom();
+ }
+
+ if (fModel == 7) {
+ fPtYHist->GetRandom2(pt, y);
+ return;
+ }
+}
+
+//////////////////////////////////////////////////////////////////////////////////
+
+void AliGenGeVSim::Init() {
+ //
+ // Standard AliGenerator initializer.
+ // does nothing
+ //