From e30534940f9a9bd3f6d3218d8f3d4eeda4445167 Mon Sep 17 00:00:00 2001 From: fca Date: Wed, 7 Jun 2000 16:29:58 +0000 Subject: [PATCH 1/1] Adding check for pt range in AliGenBox --- EVGEN/AliSimpleGen.cxx | 18 ++++++++++++------ STEER/AliGenerator.h | 2 +- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/EVGEN/AliSimpleGen.cxx b/EVGEN/AliSimpleGen.cxx index ad736ff3e29..39b07693cae 100644 --- a/EVGEN/AliSimpleGen.cxx +++ b/EVGEN/AliSimpleGen.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.6 1999/11/03 17:43:20 fca +New version from G.Martinez & A.Morsch + Revision 1.5 1999/09/29 09:24:14 fca Introduction of the Copyright and cvs Log @@ -387,12 +390,15 @@ void AliGenBox::Generate() } for(i=0;iRndm(random,3); - pmom=fPMin+random[0]*(fPMax-fPMin); - theta=fThetaMin+random[1]*(fThetaMax-fThetaMin); - phi=fPhiMin+random[2]*(fPhiMax-fPhiMin); - p[0] = pmom*TMath::Cos(phi)*TMath::Sin(theta); - p[1] = pmom*TMath::Sin(phi)*TMath::Sin(theta); - p[2] = pmom*TMath::Cos(theta); + do { + pmom=fPMin+random[0]*(fPMax-fPMin); + theta=fThetaMin+random[1]*(fThetaMax-fThetaMin); + phi=fPhiMin+random[2]*(fPhiMax-fPhiMin); + p[0] = pmom*TMath::Cos(phi)*TMath::Sin(theta); + p[1] = pmom*TMath::Sin(phi)*TMath::Sin(theta); + p[2] = pmom*TMath::Cos(theta); + } while (fPtMin<=TMath::Sqrt(p[0]*p[0]+p[1]*p[1]) && + TMath::Sqrt(p[0]*p[0]+p[1]*p[1])<=fPtMax); if(fVertexSmear==perTrack) { gMC->Rndm(random,6); for (j=0;j<3;j++) { diff --git a/STEER/AliGenerator.h b/STEER/AliGenerator.h index d151fdd3ccc..5975a4ea74a 100644 --- a/STEER/AliGenerator.h +++ b/STEER/AliGenerator.h @@ -59,7 +59,7 @@ protected: {fOsigma[0]=sx;fOsigma[1]=sy;fOsigma[2]=sz;} virtual void SetMomentumRange(Float_t pmin=0, Float_t pmax=1.e10) {fPMin = pmin; fPMax = pmax;} - virtual void SetPtRange(Float_t ptmin=0, Float_t ptmax=20.) + virtual void SetPtRange(Float_t ptmin=0, Float_t ptmax=1.e10) {fPtMin = ptmin; fPtMax = ptmax;} virtual void SetPhiRange(Float_t phimin=-180., Float_t phimax=180) {fPhiMin = TMath::Pi()*phimin/180; -- 2.39.3