]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EVGEN/AliGenBox.cxx
The "static" was removed from the definition of some variables,
[u/mrichter/AliRoot.git] / EVGEN / AliGenBox.cxx
index 9c0440b3894f3e6df58344c54a222c552ec368b4..5869d034441d56608529b2ec843d05da36b44480 100644 (file)
@@ -35,7 +35,9 @@ ClassImp(AliGenBox)
 //_____________________________________________________________________________
 AliGenBox::AliGenBox()
     :AliGenerator(), 
-     fIpart(0)
+     fIpart(0),
+     fEtaMin(0),
+     fEtaMax(0)
 {
   //
   // Default constructor
@@ -45,7 +47,9 @@ AliGenBox::AliGenBox()
 //_____________________________________________________________________________
 AliGenBox::AliGenBox(Int_t npart)
     :AliGenerator(npart),
-     fIpart(kProton)
+     fIpart(kProton),
+     fEtaMin(0),
+     fEtaMax(0)
 {
   //
   // Standard constructor
@@ -79,7 +83,15 @@ void AliGenBox::Generate()
 
     for(i=0;i<fNpart;i++) {
        Rndm(random,3);
-       theta=fThetaMin+random[0]*(fThetaMax-fThetaMin);
+       
+       if (TestBit(kThetaRange)) {
+           theta = fThetaMin+random[0]*(fThetaMax-fThetaMin);
+       } else {
+           Float_t eta = fEtaMin+random[0]*(fEtaMax-fEtaMin);
+           theta = 2. * TMath::ATan(TMath::Exp(-eta));
+       }
+           
+           
        if(TestBit(kMomentumRange)) {
            pmom=fPMin+random[1]*(fPMax-fPMin);
            pt=pmom*TMath::Sin(theta);
@@ -88,6 +100,7 @@ void AliGenBox::Generate()
            pt=fPtMin+random[1]*(fPtMax-fPtMin);
            pmom=pt/TMath::Sin(theta);
        }
+
        phi=fPhiMin+random[2]*(fPhiMax-fPhiMin);
        p[0] = pt*TMath::Cos(phi);
        p[1] = pt*TMath::Sin(phi);