Skip to content

Commit

Permalink
Merge pull request #172 from JeffersonLab/check_for_missing_PhotonBea…
Browse files Browse the repository at this point in the history
…mGenerator_rtj

* add checks that fPrimaryGenerator and fPhotonBeamGenerator are
  • Loading branch information
rjones30 authored Aug 10, 2020
2 parents cd76220 + a13b7b7 commit 6e3737e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/GlueXPrimaryGeneratorAction.cc
Original file line number Diff line number Diff line change
Expand Up @@ -490,12 +490,12 @@ GlueXPrimaryGeneratorAction &GlueXPrimaryGeneratorAction::operator=(const
if (fSourceType == SOURCE_TYPE_HDDM) {
fPrimaryGenerator = new GlueXPrimaryGenerator(fHDDMistream);
}
else if (fSourceType == SOURCE_TYPE_COBREMS_GEN) {
clone_photon_beam_generator();
}
else if (fSourceType == SOURCE_TYPE_PARTICLE_GUN) {
fParticleGun->SetParticleDefinition(fGunParticle.partDef);
}
if (fPhotonBeamGenerator) {
clone_photon_beam_generator();
}
fBeamvertex = src.fBeamvertex;
fBeamvertex_activated = src.fBeamvertex_activated;
return *this;
Expand Down Expand Up @@ -882,6 +882,8 @@ void GlueXPrimaryGeneratorAction::GeneratePrimariesHDDM(G4Event* anEvent)
}
z = fTargetCenterZ + (G4UniformRand() - 0.5) * fTargetLength;
}
assert (fPrimaryGenerator != 0);
assert (fPhotonBeamGenerator != 0);
double ttag = fPhotonBeamGenerator->GenerateTriggerTime(anEvent);
double trel = (z - fRFreferencePlaneZ) / beamVelocity;
fPrimaryGenerator->SetParticlePosition(G4ThreeVector(x,y,z));
Expand Down

0 comments on commit 6e3737e

Please sign in to comment.