24.3.2010 Kamil Sedlak

New variable "timeToNextEvent" added in order to simulate time differences between subsequent events.
	1)  /gun/meanarrivaltime meanArrivalTime (defines the mean time difference betweent 
                                                  the subsequent events).
        2)  timeToNextEvent - new variable written out to the root tree.

   This new variable is needed for the pile-up studies
This commit is contained in:
2010-03-24 16:21:08 +00:00
parent 29e49736ea
commit d308d597bd
9 changed files with 48 additions and 17 deletions

View File

@@ -58,7 +58,7 @@ musrPrimaryGeneratorAction::musrPrimaryGeneratorAction(
musrDetectorConstruction* musrDC)
: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),
meanArrivalTime(1./30000.*second), t0(0), tSigma(0),
relativeRMaxAllowed(1e10*mm),
xMaxSource0(0), yMaxSource0(0), zMaxSource0(0),
xMaxSource(1e10*mm), yMaxSource(1e10*mm), zMaxSource(1e10*mm),
@@ -343,9 +343,14 @@ void musrPrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
generatedMuon->SetProperTime(decaytime);
}
// Set the variable "timeToNextEvent", which is the time difference between this event and the next one
// at a continuous muon beam.
G4double timeIntervalBetweenTwoEvents = meanArrivalTime * CLHEP::RandExponential::shoot(1);
// Save variables into ROOT output file:
myRootOutput->SetInitialMuonParameters(x,y,z,px,py,pz,xpolaris,ypolaris,zpolaris,ParticleTime);
myRootOutput->StoreGeantParameter(7,float(numberOfGeneratedEvents));
myRootOutput->SetTimeToNextEvent(timeIntervalBetweenTwoEvents);
if (boolPrintInfoAboutGeneratedParticles) {
G4cout<<"musrPrimaryGeneratorAction::GeneratePrimaries: x="<<x<<", y="<<y<<", z="<<z<<G4endl;
G4cout<<" px="<<px<<", py="<<py<<", pz="<<pz<<", xpolaris="<<xpolaris<<", ypolaris="<<ypolaris<<", zpolaris="<<zpolaris<<G4endl;