Created
September 6, 2020 19:42
-
-
Save JeremyMcCormick/36394cab261603e0b6e0b0841326ada7 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
auto vec = step->GetPreStepPoint()->GetPosition(); | |
const double pos[] = {vec[0], vec[1], vec[2]}; | |
double bfield[] = {0, 0, 0, 0}; | |
G4StepPoint* pre = step->GetPreStepPoint(); | |
G4FieldManager* globalFieldMgr = G4TransportationManager::GetTransportationManager()-> GetFieldManager(); | |
globalFieldMgr->GetDetectorField()->GetFieldValue(pos, bfield); | |
std::cout << ">>>> Field val: " << pre->GetPosition() << " -> (" | |
<< bfield[0] << ", " << bfield[1] << ", " << bfield[2] << ") " << std::endl; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment