]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Some bugs corrected and skip method added. (Rachid Guernane)
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 19 Dec 2001 16:30:24 +0000 (16:30 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 19 Dec 2001 16:30:24 +0000 (16:30 +0000)
EVGEN/AliGenHaloProtvino.cxx
EVGEN/AliGenHaloProtvino.h

index dc01060a543b28daff8694d242ddb29b38010a4a..e030bdf217dca956a8d2bc006a34122b9384b97a 100644 (file)
 
 /*
 $Log$
+Revision 1.3  2001/07/27 17:09:36  morsch
+Use local SetTrack, KeepTrack and SetHighWaterMark methods
+to delegate either to local stack or to stack owned by AliRun.
+(Piotr Skowronski, A.M.)
+
 Revision 1.2  2001/06/14 12:15:27  morsch
 Bugs corrected. SetSide() method added.
 
@@ -104,6 +109,7 @@ void AliGenHaloProtvino::Generate()
   Int_t   inuc;
   //
   Int_t ipart, ncols, nt;
+  Int_t nskip = 0;
   Int_t nread = 0;
   while(1) {
       ncols = fscanf(fFile,"%f %d %d %f %f %f %f %f %f",
@@ -112,23 +118,25 @@ void AliGenHaloProtvino::Generate()
                     &tx, &ty);
 /*
       printf(" \n %f %d %d %f %f %f %f %f %f",
-                    zPrimary, inuc, ipart, wgt, 
-                    ekin, origin[0], origin[1],
-                    tx, ty);
+             zPrimary, inuc, ipart, wgt, 
+             ekin, origin[0], origin[1],
+             tx, ty);
 */
+      
       if (ncols < 0) break;
-      nread++;
 
+      nskip++;
+      if (fNpart !=-1 && nskip <= fNskip) continue;
+      
+      nread++;
       if (fNpart !=-1 && nread > fNpart) break;
 
-
-
       amass = TDatabasePDG::Instance()->GetParticle(ipart)->Mass();
 
       //
       // Momentum vector
       //
-      p0=sqrt(ekin*ekin + 2.*amass);
+      p0=sqrt(ekin*ekin + 2.*amass*ekin);
       
       txy=TMath::Sqrt(tx*tx+ty*ty);
       if (txy == 1.) {
@@ -140,8 +148,8 @@ void AliGenHaloProtvino::Generate()
       p[0]=p0*tx;
       p[1]=p0*ty;
       p[2]=-p0*tz;
-
-      origin[2] = 21.965;
+      
+      origin[2] = -2196.5;
 
       //
       //
@@ -158,7 +166,7 @@ void AliGenHaloProtvino::Generate()
          origin[2]  = -origin[2];
          p[2]       = -p[2];
       }
-      
+
       SetTrack(0,-1,kProton,pP,originP,polar,0,kPNoProcess,ntP);
       KeepTrack(ntP);
       fParentWeight=wgt*GassPressureWeight(zPrimary);
@@ -168,13 +176,14 @@ void AliGenHaloProtvino::Generate()
       //
       // Assume particles come from two directions with same probability
 
-      origin[2]=-origin[2];
-      p[2]=-p[2];
-      fParentWeight=wgt*GassPressureWeight(-zPrimary);
-      SetTrack(fTrackIt,ntP,ipart,p,origin,polar,0,kPNoProcess,nt,fParentWeight);
-      origin[2]=-origin[2];
-      p[2]=-p[2];
-      origin[2]=-origin[2];
+      // Both Side are considered
+      if (fSide > 1) {
+          origin[2]=-origin[2];
+          p[2]=-p[2];
+          fParentWeight=wgt*GassPressureWeight(-zPrimary);
+          SetTrack(fTrackIt,ntP,ipart,p,origin,polar,0,kPNoProcess,nt,fParentWeight);
+      }
+      
   }
 }
  
index ce3b1f7e4f6640f7df3eaafbe8710cf2ca735c78..14bc5ae32ec2380348c1cd86bd0e58c3fdf5b9f4 100644 (file)
@@ -25,13 +25,15 @@ public:
     virtual void Generate();
     virtual Float_t GassPressureWeight(Float_t zPrimary);
     virtual void SetSide(Int_t flag = 1) {fSide = flag;}
-    
+    virtual void SetNskip(Int_t nskip) {fNskip = nskip;}
+
     AliGenHaloProtvino & operator=(const AliGenHaloProtvino & rhs);
 
 protected:
   FILE*    fFile;                       // ! Pointer to file
   TString  fFileName;                   //   Choose the file
   Int_t    fSide;                       //   Muon arm side (1) / Castor side (-1) 
+  Int_t    fNskip;                      //   
   
   ClassDef(AliGenHaloProtvino,1)        //   LHC background boundary source (Protvino Group results)
 };