-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #422 from axelrannou/carm_contrib
C-arm contrib
- Loading branch information
Showing
15 changed files
with
386 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
core/opengate_core/opengate_lib/GateSPSAngDistribution.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* -------------------------------------------------- | ||
Copyright (C): OpenGate Collaboration | ||
This software is distributed under the terms | ||
of the GNU Lesser General Public Licence (LGPL) | ||
See LICENSE.md for further details | ||
-------------------------------------------------- */ | ||
|
||
#include "GateSPSAngDistribution.h" | ||
#include "GateHelpers.h" | ||
|
||
G4ThreeVector GateSPSAngDistribution::VGenerateOne() { | ||
// return GenerateOne(); | ||
auto direction = GenerateOne(); | ||
if (fDirectionRelativeToAttachedVolume) { | ||
direction = direction / direction.mag(); | ||
direction = fGlobalRotation * direction; | ||
} | ||
return direction; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* -------------------------------------------------- | ||
Copyright (C): OpenGATE Collaboration | ||
This software is distributed under the terms | ||
of the GNU Lesser General Public Licence (LGPL) | ||
See LICENSE.md for further details | ||
-------------------------------------------------- */ | ||
|
||
#ifndef GateSPSAngDistribution_h | ||
#define GateSPSAngDistribution_h | ||
|
||
#include "G4ParticleDefinition.hh" | ||
#include "G4SPSAngDistribution.hh" | ||
|
||
class GateSPSAngDistribution : public G4SPSAngDistribution { | ||
|
||
public: | ||
virtual ~GateSPSAngDistribution() = default; | ||
|
||
// Cannot inherit from GenerateOne, so we consider VGenerateOne instead | ||
virtual G4ThreeVector VGenerateOne(); | ||
|
||
// Store the global orientation that may be applied to the direction | ||
// in the GenerateOne function. | ||
// (Must be updated each run) | ||
bool fDirectionRelativeToAttachedVolume; | ||
G4ThreeVector fGlobalTranslation; | ||
G4RotationMatrix fGlobalRotation; | ||
}; | ||
|
||
#endif // GateSPSAngDistribution_h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Oops, something went wrong.