Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer 3 // * License and Disclaimer * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/ 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. 9 // * include a list of copyright holders. * 10 // * 10 // * * 11 // * Neither the authors of this software syst 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitatio 16 // * for the full disclaimer and the limitation of liability. * 17 // * 17 // * * 18 // * This code implementation is the result 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboratio 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distri 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you ag 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publicati 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Sof 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************* 24 // ******************************************************************** 25 // 25 // 26 // G4VSteppingVerbose class implementation << 26 // >> 27 // $Id: G4VSteppingVerbose.cc,v 1.19 2010-07-19 13:41:21 gcosmo Exp $ >> 28 // GEANT4 tag $Name: not supported by cvs2svn $ >> 29 // >> 30 //--------------------------------------------------------------- >> 31 // >> 32 // G4VSteppingVerbose.cc >> 33 // >> 34 // Description: >> 35 // This class manages the vervose outputs in G4SteppingManager. >> 36 // 27 // 37 // 28 // Contact: 38 // Contact: 29 // Questions and comments to this code shoul 39 // Questions and comments to this code should be sent to 30 // Katsuya Amako (e-mail: Katsuya.Amako@k 40 // Katsuya Amako (e-mail: Katsuya.Amako@kek.jp) 31 // Takashi Sasaki (e-mail: Takashi.Sasaki@ 41 // Takashi Sasaki (e-mail: Takashi.Sasaki@kek.jp) 32 // ------------------------------------------- << 42 // >> 43 //--------------------------------------------------------------- 33 44 34 #include "G4VSteppingVerbose.hh" 45 #include "G4VSteppingVerbose.hh" 35 << 36 #include "G4ParticleDefinition.hh" << 37 #include "G4SteppingManager.hh" 46 #include "G4SteppingManager.hh" 38 #include "G4Track.hh" 47 #include "G4Track.hh" >> 48 #include "G4ParticleDefinition.hh" 39 49 40 G4ThreadLocal G4VSteppingVerbose* G4VSteppingV << 50 G4VSteppingVerbose* G4VSteppingVerbose::fInstance = 0; 41 G4VSteppingVerbose* G4VSteppingVerbose::fMaste << 51 G4int G4VSteppingVerbose::Silent = 0; 42 G4ThreadLocal G4int G4VSteppingVerbose::Silent << 52 G4int G4VSteppingVerbose::SilentStepInfo = 0; 43 G4ThreadLocal G4int G4VSteppingVerbose::Silent << 44 53 45 ////////////////////////////////////////////// << 46 G4VSteppingVerbose::G4VSteppingVerbose() 54 G4VSteppingVerbose::G4VSteppingVerbose() 47 ////////////////////////////////////////////// << 55 : fManager(0), fUserSteppingAction(0), >> 56 PhysicalStep(0.), GeometricalStep(0.), CorrectedStep(0.), >> 57 PreStepPointIsGeom(false), FirstStep(false), >> 58 TempInitVelocity(0.), TempVelocity(0.), Mass(0.), sumEnergyChange(0.), >> 59 fParticleChange(0), fTrack(0), fSecondary(0), fStep(0), >> 60 fPreStepPoint(0), fPostStepPoint(0), fCurrentVolume(0), >> 61 fSensitive(0), fCurrentProcess(0), fAtRestDoItVector(0), >> 62 fAlongStepDoItVector(0), fPostStepDoItVector(0), fAtRestGetPhysIntVector(0), >> 63 fAlongStepGetPhysIntVector(0), fPostStepGetPhysIntVector(0), >> 64 MAXofAtRestLoops(0), MAXofAlongStepLoops(0), MAXofPostStepLoops(0), >> 65 currentMinimumStep(0.), numberOfInteractionLengthLeft(0.), >> 66 fAtRestDoItProcTriggered(0), fAlongStepDoItProcTriggered(0), >> 67 fPostStepDoItProcTriggered(0), fN2ndariesAtRestDoIt(0), >> 68 fN2ndariesAlongStepDoIt(0), fN2ndariesPostStepDoIt(0), >> 69 fNavigator(0), verboseLevel(0), fSelectedAtRestDoItVector(0), >> 70 fSelectedAlongStepDoItVector(0), fSelectedPostStepDoItVector(0), >> 71 fPreviousStepSize(0.), physIntLength(0.) 48 { 72 { 49 if (fInstance != nullptr) { << 73 if(fInstance!= 0) 50 G4Exception("G4VSteppingVerbose::G4VSteppi << 74 { 51 "Only one SteppingVerbose class can be i << 75 G4Exception("G4VSteppingVerbose::G4VSteppingVerbose()", >> 76 "Tracking0014", FatalException, >> 77 "Only one SteppingVerbose class can be instantiated."); 52 } 78 } 53 fInstance = this; << 54 if (fMasterInstance == nullptr) fMasterInsta << 55 } << 56 << 57 ////////////////////////////////////////////// << 58 G4VSteppingVerbose::~G4VSteppingVerbose() << 59 ////////////////////////////////////////////// << 60 { << 61 fInstance = nullptr; << 62 } 79 } >> 80 G4VSteppingVerbose::~G4VSteppingVerbose(){;} 63 81 64 ////////////////////////////////////////////// 82 ////////////////////////////////////////////////////////////////// 65 G4VSteppingVerbose* G4VSteppingVerbose::Clone( << 66 ////////////////////////////////////////////// << 67 { << 68 G4Exception("G4VSteppingVerbose::Clone", "TR << 69 "Base class method must not be invoked."); << 70 return nullptr; << 71 } << 72 ////////////////////////////////////////////// << 73 void G4VSteppingVerbose::SetManager(G4Stepping 83 void G4VSteppingVerbose::SetManager(G4SteppingManager* const fMan) 74 ////////////////////////////////////////////// 84 ////////////////////////////////////////////////////////////////// 75 { 85 { 76 fManager = fMan; << 86 fManager=fMan; 77 } 87 } 78 88 79 ////////////////////////////////////////////// 89 ////////////////////////////////////////////////// 80 void G4VSteppingVerbose::CopyState() 90 void G4VSteppingVerbose::CopyState() 81 ////////////////////////////////////////////// 91 ////////////////////////////////////////////////// 82 { 92 { 83 fUserSteppingAction = fManager->GetUserActio << 84 93 85 PhysicalStep = fManager->GetPhysicalStep(); << 94 fUserSteppingAction = fManager->GetUserAction(); 86 GeometricalStep = fManager->GetGeometricalSt << 95 // fVerbose = this; 87 CorrectedStep = fManager->GetCorrectedStep() << 96 88 PreStepPointIsGeom = fManager->GetPreStepPoi << 97 PhysicalStep = fManager->GetPhysicalStep(); 89 FirstStep = fManager->GetFirstStep(); << 98 GeometricalStep = fManager->GetGeometricalStep(); 90 fStepStatus = fManager->GetfStepStatus(); << 99 CorrectedStep = fManager->GetCorrectedStep(); >> 100 PreStepPointIsGeom = fManager->GetPreStepPointIsGeom(); >> 101 FirstStep = fManager->GetFirstStep(); >> 102 fStepStatus = fManager->GetfStepStatus(); 91 103 92 TempInitVelocity = fManager->GetTempInitVelo << 104 TempInitVelocity = fManager->GetTempInitVelocity(); 93 TempVelocity = fManager->GetTempVelocity(); << 105 TempVelocity = fManager->GetTempVelocity(); 94 Mass = fManager->GetMass(); << 106 Mass = fManager->GetMass(); 95 107 96 sumEnergyChange = fManager->GetsumEnergyChan << 108 sumEnergyChange = fManager->GetsumEnergyChange(); 97 109 98 fParticleChange = fManager->GetfParticleChan << 110 fParticleChange = fManager->GetfParticleChange(); 99 fTrack = fManager->GetfTrack(); << 111 fTrack = fManager->GetfTrack(); 100 fSecondary = fManager->GetfSecondary(); << 112 fSecondary = fManager->GetfSecondary(); 101 fStep = fManager->GetfStep(); << 113 fStep = fManager->GetfStep(); 102 fPreStepPoint = fManager->GetfPreStepPoint() << 114 fPreStepPoint = fManager->GetfPreStepPoint(); 103 fPostStepPoint = fManager->GetfPostStepPoint << 115 fPostStepPoint = fManager->GetfPostStepPoint(); 104 116 105 fCurrentVolume = fManager->GetfCurrentVolume << 117 fCurrentVolume = fManager->GetfCurrentVolume(); 106 fSensitive = fManager->GetfSensitive(); << 118 fSensitive = fManager->GetfSensitive(); 107 fCurrentProcess = fManager->GetfCurrentProce << 119 fCurrentProcess = fManager->GetfCurrentProcess(); 108 120 109 fAtRestDoItVector = fManager->GetfAtRestDoIt << 121 fAtRestDoItVector = fManager->GetfAtRestDoItVector(); 110 fAlongStepDoItVector = fManager->GetfAlongSt << 122 fAlongStepDoItVector = fManager->GetfAlongStepDoItVector(); 111 fPostStepDoItVector = fManager->GetfPostStep << 123 fPostStepDoItVector = fManager->GetfPostStepDoItVector(); 112 124 113 fAtRestGetPhysIntVector = fManager->GetfAtRe << 125 fAtRestGetPhysIntVector = fManager->GetfAtRestGetPhysIntVector(); 114 fAlongStepGetPhysIntVector = fManager->GetfA << 126 fAlongStepGetPhysIntVector = fManager->GetfAlongStepGetPhysIntVector(); 115 fPostStepGetPhysIntVector = fManager->GetfPo << 127 fPostStepGetPhysIntVector = fManager->GetfPostStepGetPhysIntVector(); 116 128 117 MAXofAtRestLoops = fManager->GetMAXofAtRestL << 129 MAXofAtRestLoops = fManager->GetMAXofAtRestLoops(); 118 MAXofAlongStepLoops = fManager->GetMAXofAlon << 130 MAXofAlongStepLoops = fManager->GetMAXofAlongStepLoops(); 119 MAXofPostStepLoops = fManager->GetMAXofPostS << 131 MAXofPostStepLoops = fManager->GetMAXofPostStepLoops(); 120 132 121 fAtRestDoItProcTriggered = fManager->GetfAtR << 133 fAtRestDoItProcTriggered = fManager->GetfAtRestDoItProcTriggered(); 122 fAlongStepDoItProcTriggered = fManager->Getf << 134 fAlongStepDoItProcTriggered = fManager->GetfAlongStepDoItProcTriggered(); 123 fPostStepDoItProcTriggered = fManager->GetfP << 135 fPostStepDoItProcTriggered = fManager->GetfPostStepDoItProcTriggered(); 124 136 125 fN2ndariesAtRestDoIt = fManager->GetfN2ndari << 137 fN2ndariesAtRestDoIt = fManager->GetfN2ndariesAtRestDoIt(); 126 fN2ndariesAlongStepDoIt = fManager->GetfN2nd << 138 fN2ndariesAlongStepDoIt = fManager->GetfN2ndariesAlongStepDoIt(); 127 fN2ndariesPostStepDoIt = fManager->GetfN2nda << 139 fN2ndariesPostStepDoIt = fManager->GetfN2ndariesPostStepDoIt(); 128 140 129 fNavigator = fManager->GetfNavigator(); << 141 fNavigator = fManager->GetfNavigator(); 130 142 131 verboseLevel = fManager->GetverboseLevel(); << 143 verboseLevel = fManager->GetverboseLevel(); 132 144 133 fSelectedAtRestDoItVector = fManager->GetfSe << 145 fSelectedAtRestDoItVector = fManager->GetfSelectedAtRestDoItVector(); 134 fSelectedAlongStepDoItVector = fManager->Get << 146 fSelectedAlongStepDoItVector = fManager->GetfSelectedAlongStepDoItVector(); 135 fSelectedPostStepDoItVector = fManager->Getf << 147 fSelectedPostStepDoItVector = fManager->GetfSelectedPostStepDoItVector(); 136 148 137 fPreviousStepSize = fManager->GetfPreviousSt << 149 fPreviousStepSize = fManager->GetfPreviousStepSize(); 138 150 139 fTouchableHandle = fManager->GetTouchableHan << 151 fTouchableHandle = fManager->GetTouchableHandle(); 140 152 141 StepControlFlag = fManager->GetStepControlFl << 153 StepControlFlag = fManager->GetStepControlFlag(); 142 154 143 physIntLength = fManager->GetphysIntLength() << 155 physIntLength = fManager->GetphysIntLength(); 144 fCondition = fManager->GetfCondition(); << 156 fCondition = fManager->GetfCondition(); 145 fGPILSelection = fManager->GetfGPILSelection << 157 fGPILSelection = fManager->GetfGPILSelection(); 146 } 158 } 147 159 148 void G4VSteppingVerbose::SetInstance(G4VSteppi << 160 void G4VSteppingVerbose::SetInstance(G4VSteppingVerbose* Instance) >> 161 { >> 162 fInstance=Instance; >> 163 } 149 164 150 G4VSteppingVerbose* G4VSteppingVerbose::GetIns << 165 G4VSteppingVerbose* G4VSteppingVerbose::GetInstance() >> 166 { >> 167 return fInstance; >> 168 } 151 169 152 G4VSteppingVerbose* G4VSteppingVerbose::GetMas << 170 G4int G4VSteppingVerbose::GetSilent() >> 171 { >> 172 return Silent; >> 173 } 153 174 154 G4int G4VSteppingVerbose::GetSilent() { return << 175 void G4VSteppingVerbose::SetSilent(G4int fSilent) >> 176 { >> 177 Silent=fSilent; >> 178 } 155 179 156 void G4VSteppingVerbose::SetSilent(G4int fSile << 180 G4int G4VSteppingVerbose::GetSilentStepInfo() >> 181 { >> 182 return SilentStepInfo; >> 183 } 157 184 158 G4int G4VSteppingVerbose::GetSilentStepInfo() << 185 void G4VSteppingVerbose::SetSilentStepInfo(G4int fSilent) >> 186 { >> 187 SilentStepInfo=fSilent; >> 188 } 159 189 160 void G4VSteppingVerbose::SetSilentStepInfo(G4i << 161 190