9.3.2010 Kamil Sedlak

Changes needed by Pavel Bakule for low energy moun beem excited by laser.
  (The user can restrict a box-like region for the generated particles (muons)).
This commit is contained in:
2010-03-09 16:49:53 +00:00
parent 610abf6591
commit a71842dd81
7 changed files with 73 additions and 13 deletions

View File

@@ -59,6 +59,9 @@ musrPrimaryGeneratorAction::musrPrimaryGeneratorAction(
:musrDetector(musrDC), x0(0), y0(0), z0(-10*cm), xSigma(0), ySigma(0), zSigma(0),
rMaxAllowed(1e10*mm), zMinAllowed(-1e10*mm), zMaxAllowed(1e10*mm),
t0(0), tSigma(0),
relativeRMaxAllowed(1e10*mm),
xMaxSource0(0), yMaxSource0(0), zMaxSource0(0),
xMaxSource(1e10*mm), yMaxSource(1e10*mm), zMaxSource(1e10*mm),
p0(0), pSigma(0), pMinAllowed(0), pMaxAllowed(1e10*mm),
xangle0(0), yangle0(0), xangleSigma(0), yangleSigma(0), pitch(0),
UnpolarisedMuonBeam(false), TransversalyUnpolarisedMuonBeam(false), xPolarisIni(1.), yPolarisIni(0.), zPolarisIni(0.),
@@ -196,10 +199,13 @@ void musrPrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
}
else { // Generate the starting position of the muon by random
// rMaxAllowed ... maximal radius, within which the muon can be generated
// x0, y0, z0 ... central point around which the muons are generated
// rMaxAllowed ... maximal radius, within which the muon can be generated
// relativeRMaxAllowed ... maximal radius, within which the muon can be generated, relative to x0 and y0 position
// xMaxSource0, yMaxSource0...
// xMaxSource, yMaxSource ...
// x0, y0, z0 ... central point around which the muons are generated
// xSigma, ySigma, zSigma ... sigma of the (gaussian) distributions of the beam
// x, y, z ... actual initial position of the generated muon
// x, y, z ... actual initial position of the generated muon
G4int checkNrOfCounts=0;
numberOfGeneratedEvents++;
@@ -220,10 +226,11 @@ void musrPrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
if (checkNrOfCounts>1000) {
G4cout<<"musrPrimaryGeneratorAction::GeneratePrimaries: Too strict requirements on the r or z position!"<<G4endl;
}
} while( ((x*x+y*y)>(rMaxAllowed*rMaxAllowed))||(z>zMaxAllowed)||(z<zMinAllowed) );
// The generated muon has to stay
// within some well defined region,
// e.g. within the beampipe
} while(
((x*x+y*y)>(rMaxAllowed*rMaxAllowed))||(z>zMaxAllowed)||(z<zMinAllowed) ||
(((x-x0)*(x-x0)+(y-y0)*(y-y0))>(relativeRMaxAllowed*relativeRMaxAllowed))||
(fabs(x-xMaxSource0)>xMaxSource)||(fabs(y-yMaxSource0)>yMaxSource)||(fabs(z-zMaxSource0)>zMaxSource)
); // The generated muon has to stay within some well defined region, e.g. within the beampipe
// Now generate the momentum
checkNrOfCounts=0;