]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Possibility to set eta-range (needed for CORRFW)
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 30 Jun 2009 11:22:09 +0000 (11:22 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 30 Jun 2009 11:22:09 +0000 (11:22 +0000)
EVGEN/AliGenBox.cxx
EVGEN/AliGenBox.h

index 9c0440b3894f3e6df58344c54a222c552ec368b4..4c3d7975c58d9146f8105e23d81a03112657fa59 100644 (file)
@@ -79,7 +79,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 +96,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);
index 73f0600e7ad1fba8c60827ce673de21525feff11..73d2db9efeeda48b0721e8175f4e25acd304484d 100644 (file)
@@ -21,12 +21,15 @@ class AliGenBox : public AliGenerator
   virtual ~AliGenBox() {}
   virtual void Generate();
   virtual void Init();
+  virtual void SetEtaRange(Float_t etamin, Float_t etamax);
   virtual void SetPart(Int_t part) {fIpart=part;}
+  virtual void SetParticleType(Int_t part) {SetPart(part);}
 protected:
 
   Int_t fIpart; // Particle type
-
-  ClassDef(AliGenBox,1) // Square box random generator
+  Float_t fEtaMin;  // Minimum eta 
+  Float_t fEtaMax;  // Maximum eta
+  ClassDef(AliGenBox,2) // Square box random generator
 };
 
 #endif