Skip to content

Commit

Permalink
Merge pull request #276 from JeffersonLab/bugfix-events-generated-dow…
Browse files Browse the repository at this point in the history
…nstream-of-pivot

Bugfix: Fix event generator to be in the target, not downstream (MAJOR)
  • Loading branch information
wdconinc committed Oct 2, 2019
2 parents 55716c0 + 8f1a1aa commit 292cfda
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/remollBeamTarget.cc
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ void remollBeamTarget::UpdateInfo()
if (!fTargetMother) {
return;
}
fMotherTargetAbsolutePosition = fTargetMother->GetFrameTranslation().z();
fMotherTargetAbsolutePosition = fTargetMother->GetTranslation().z();

for (std::vector<G4VPhysicalVolume *>::iterator
it = fTargetVolumes.begin(); it != fTargetVolumes.end(); it++) {
Expand Down Expand Up @@ -154,7 +154,7 @@ void remollBeamTarget::UpdateInfo()
fActiveTargetEffectiveLength = tubs->GetZHalfLength()*2.0
* material->GetDensity();

fActiveTargetRelativePosition = (*it)->GetFrameTranslation().z();
fActiveTargetRelativePosition = (*it)->GetTranslation().z();

fTotalTargetEffectiveLength += tubs->GetZHalfLength()*2.0
* material->GetDensity();
Expand Down Expand Up @@ -245,7 +245,7 @@ remollVertex remollBeamTarget::SampleVertex(SampType_t samp)
it = fTargetVolumes.begin(); it != fTargetVolumes.end() && !found_active_volume; it++ ){

// Relative position of this target volume in mother volume
//G4double relative_position = (*it)->GetFrameTranslation().z();
G4double volume_relative_position = (*it)->GetTranslation().z();

// Try to cast the target volume into its tubs solid
G4LogicalVolume* volume = (*it)->GetLogicalVolume();
Expand Down Expand Up @@ -304,9 +304,10 @@ remollVertex remollBeamTarget::SampleVertex(SampType_t samp)
// For our own info
fTravelledLength = actual_position_in_volume;
fRadiationLength = cumulative_radiation_length;
fVer = G4ThreeVector( rasx, rasy,
actual_position_in_volume - (*it)->GetFrameTranslation().z() + fMotherTargetAbsolutePosition
- tubs->GetZHalfLength() );
fVer = G4ThreeVector( rasx, rasy,
fMotherTargetAbsolutePosition
+ volume_relative_position - tubs->GetZHalfLength()
+ actual_position_in_volume );

G4double masssum = 0.0;
const G4int *atomvec = material->GetAtomsVector();
Expand Down

0 comments on commit 292cfda

Please sign in to comment.