]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EVGEN/AliGenDoubleScan.cxx
Fix for event mixing, when it was selecting events out of range of multiplicity cut
[u/mrichter/AliRoot.git] / EVGEN / AliGenDoubleScan.cxx
index d1f0c1ce73f8ad47aba89bdd0b6dccd0da0998cb..c10bfc0cf84f007f83f702659f7cba1c2f6e0611 100644 (file)
  ClassImp(AliGenDoubleScan)
     
  AliGenDoubleScan::AliGenDoubleScan()
-        :AliGenScan(-1)
+     :AliGenScan(-1),
+      fDistance(0.)
 {
+    // Default constructor
 }
 
 AliGenDoubleScan::AliGenDoubleScan(Int_t npart)
-    :AliGenScan(npart)
+    :AliGenScan(npart),
+     fDistance(0.)
 {
 // Constructor
     fName = "Double Scan";
@@ -93,23 +96,23 @@ void AliGenDoubleScan::Generate()
              p[0] = pmom*TMath::Cos(phi)*TMath::Sin(theta);
              p[1] = pmom*TMath::Sin(phi)*TMath::Sin(theta);
              p[2] = pmom*TMath::Cos(theta);
-             SetTrack(fTrackIt,-1,fIpart,p,origin,polar,0,kPPrimary,nt);
+             PushTrack(fTrackIt,-1,fIpart,p,origin,polar,0,kPPrimary,nt);
 //
 // Generate 2nd particle at distance fDistance from  the first
 //
              Rndm(random,6);
              Float_t phi2=2.*TMath::Pi()*random[0];
-             Float_t dx  =fDistance*TMath::Sin(phi2);
-             Float_t dy  =fDistance*TMath::Cos(phi2);        
-             origin[0]=origin[0]+dx;
-             origin[1]=origin[1]+dy        
+             Float_t dx2  =fDistance*TMath::Sin(phi2);
+             Float_t dy2  =fDistance*TMath::Cos(phi2);       
+             origin[0]=origin[0]+dx2;
+             origin[1]=origin[1]+dy2;        
              pmom=fPMin+random[1]*(fPMax-fPMin);
              theta=fThetaMin+random[2]*(fThetaMax-fThetaMin);
              phi=fPhiMin+random[3]*(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);
-             SetTrack(fTrackIt,-1,fIpart,p,origin,polar,0,kPPrimary,nt);
+             PushTrack(fTrackIt,-1,fIpart,p,origin,polar,0,kPPrimary,nt);
          }
       }
   }