X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=EVGEN%2FAliGenDoubleScan.cxx;h=c10bfc0cf84f007f83f702659f7cba1c2f6e0611;hb=a59583d3da6c36ff53ad19d8fd5ca8956d59a89b;hp=3224846770d12dd094a744d38eb53fc4fb9f695b;hpb=94de381804dbc3c6cc154b06fc58284dc8266705;p=u%2Fmrichter%2FAliRoot.git diff --git a/EVGEN/AliGenDoubleScan.cxx b/EVGEN/AliGenDoubleScan.cxx index 3224846770d..c10bfc0cf84 100644 --- a/EVGEN/AliGenDoubleScan.cxx +++ b/EVGEN/AliGenDoubleScan.cxx @@ -13,31 +13,33 @@ * provided "as is" without express or implied warranty. * **************************************************************************/ -/* -$Log$ -Revision 1.2 2000/06/09 20:37:51 morsch -All coding rule violations except RS3 corrected +/* $Id$ */ -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 "AliRun.h" -#include "AliMC.h" 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"; + fTitle= "Particle Generator for two correlated particles on a grid"; } //____________________________________________________________ @@ -64,14 +66,14 @@ void AliGenDoubleScan::Generate() Float_t dx,dy,dz; // - if (fNy > 0) { - dx=(fXmax-fXmin)/fNx; + if (fNx > 0) { + dx=(fXCmax-fXCmin)/fNx; } else { dx=1e10; } if (fNy > 0) { - dy=(fYmax-fYmin)/fNy; + dy=(fYCmax-fYCmin)/fNy; } else { dy=1e10; } @@ -84,9 +86,9 @@ void AliGenDoubleScan::Generate() for (Int_t ix=0; ixRndm(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); @@ -94,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); - gAlice->SetTrack(fTrackIt,-1,fIpart,p,origin,polar,0,"Primary",nt); + PushTrack(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); - 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); - gAlice->SetTrack(fTrackIt,-1,fIpart,p,origin,polar,0,"Primary",nt); + PushTrack(fTrackIt,-1,fIpart,p,origin,polar,0,kPPrimary,nt); } } }