]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EVGEN/AliGenDoubleScan.cxx
New options kPi0Flat y kEtaFlat (Gustavo Conesa)
[u/mrichter/AliRoot.git] / EVGEN / AliGenDoubleScan.cxx
index ebb69286e79552be4556df806d23e3e28da9c60f..fc16ebb471b6f01b495a2ac2688ad3e0c7a99aa8 100644 (file)
 
 /*
 $Log$
+Revision 1.7  2001/07/27 17:09:35  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.6  2000/12/21 16:24:06  morsch
+Coding convention clean-up
+
+Revision 1.5  2000/12/06 15:11:38  morsch
+Correct double declared data members.
+
+Revision 1.4  2000/11/30 07:12:50  alibrary
+Introducing new Rndm and QA classes
+
+Revision 1.3  2000/10/02 21:28:06  fca
+Removal of useless dependecies via forward declarations
+
+Revision 1.2  2000/06/09 20:37:51  morsch
+All coding rule violations except RS3 corrected
+
+Revision 1.1  2000/02/23 16:25:14  morsch
+First commit of this file
+
 */
 
+// As AliGenScan,  generation of particles on a 3-dim grid
+// but here double hits with a predefined distance are generated.
+// The second particle is generated at a constant distance but with random phi.
+// Generator can be used to evaluate double hit resolutions.
+// Author: andreas.morsch@cern.ch
+
 #include "AliGenDoubleScan.h"
-#include <stdlib.h>
 #include "AliRun.h"
+
  ClassImp(AliGenDoubleScan)
     
  AliGenDoubleScan::AliGenDoubleScan()
@@ -30,53 +59,58 @@ $Log$
 AliGenDoubleScan::AliGenDoubleScan(Int_t npart)
     :AliGenScan(npart)
 {
+// Constructor
+    fName = "Double Scan";
+    fTitle= "Particle Generator for two correlated particles on a grid";
 }
 
 //____________________________________________________________
 AliGenDoubleScan::~AliGenDoubleScan()
-{}
+{
+// Destructor
+}
 
 //____________________________________________________________
 void AliGenDoubleScan::Generate()
 {
-  //
-  // Generate one trigger
-  //
-  
-  Float_t polar[3]= {0,0,0};
-  //
-  Float_t origin[3];
-  Float_t p[3];
-  Int_t nt;
-  Float_t pmom, theta, phi;
-  //
-  Float_t random[6];
-  Float_t dx,dy,dz;
+    //
+    // Generate one trigger
+    //
   
-  //
-  if (fNy > 0) {
-      dx=(fXmax-fXmin)/fNx;
-  } else {
-      dx=1e10;
-  }
-
-  if (fNy > 0) {
-      dy=(fYmax-fYmin)/fNy;
-  } else {
-      dy=1e10;
-  }
-
-  if (fNz > 0) {
+    Float_t polar[3]= {0,0,0};
+    //
+    Float_t origin[3];
+    Float_t p[3];
+    Int_t nt;
+    Float_t pmom, theta, phi;
+    //
+    Float_t random[6];
+    Float_t dx,dy,dz;
+    
+    //
+    if (fNy > 0) {
+       dx=(fXCmax-fXCmin)/fNx;
+    } else {
+       dx=1e10;
+    }
+
+    if (fNy > 0) {
+       dy=(fYCmax-fYCmin)/fNy;
+    } else {
+       dy=1e10;
+    }
+    
+    if (fNz > 0) {
       dz=(fZmax-fZmin)/fNz;
-  } else {
-      dz=1e10;
-  }
-  for (Int_t ix=0; ix<fNx; ix++) {
+    } else {
+       dz=1e10;
+    }
+    for (Int_t ix=0; ix<fNx; ix++) {
       for (Int_t iy=0; iy<fNy; iy++) {
          for (Int_t iz=0; iz<fNz; iz++){
-             gMC->Rndm(random,6);
-             origin[0]=fXmin+ix*dx+2*(random[0]-0.5)*fOsigma[0];
-             origin[1]=fYmin+iy*dy+2*(random[1]-0.5)*fOsigma[1];
+             Rndm(random,6);
+             origin[0]=fXCmin+ix*dx+2*(random[0]-0.5)*fOsigma[0];
+             origin[1]=fYCmin+iy*dy+2*(random[1]-0.5)*fOsigma[1];
              origin[2]=fZmin+iz*dz+2*(random[2]-0.5)*fOsigma[2];            
              pmom=fPMin+random[3]*(fPMax-fPMin);
              theta=fThetaMin+random[4]*(fThetaMax-fThetaMin);
@@ -84,11 +118,11 @@ 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);
-             gAlice->SetTrack(fTrackIt,-1,fIpart,p,origin,polar,0,"Primary",nt);
+             SetTrack(fTrackIt,-1,fIpart,p,origin,polar,0,kPPrimary,nt);
 //
 // Generate 2nd particle at distance fDistance from  the first
 //
-             gMC->Rndm(random,6);
+             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);        
@@ -100,7 +134,7 @@ 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);
-             gAlice->SetTrack(fTrackIt,-1,fIpart,p,origin,polar,0,"Primary",nt);
+             SetTrack(fTrackIt,-1,fIpart,p,origin,polar,0,kPPrimary,nt);
          }
       }
   }