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 // 26 // >> 27 // $Id: G4ScoreSplittingProcess.cc 68733 2013-04-05 09:45:28Z gcosmo $ 27 // 28 // 28 29 29 #include "G4ScoreSplittingProcess.hh" 30 #include "G4ScoreSplittingProcess.hh" 30 31 31 #include "G4EnergySplitter.hh" << 32 #include "G4ios.hh" >> 33 #include "G4SystemOfUnits.hh" >> 34 #include "G4Step.hh" >> 35 #include "G4VTouchable.hh" >> 36 #include "G4VPhysicalVolume.hh" 32 #include "G4ParticleChange.hh" 37 #include "G4ParticleChange.hh" >> 38 #include "G4TransportationManager.hh" 33 #include "G4RegularNavigationHelper.hh" 39 #include "G4RegularNavigationHelper.hh" 34 #include "G4SDManager.hh" << 40 #include "G4ParticleChange.hh" 35 #include "G4Step.hh" << 36 #include "G4StepPoint.hh" 41 #include "G4StepPoint.hh" 37 #include "G4SystemOfUnits.hh" << 42 38 #include "G4TouchableHistory.hh" << 43 #include "G4SDManager.hh" 39 #include "G4TransportationManager.hh" << 40 #include "G4VPhysicalVolume.hh" << 41 #include "G4VSensitiveDetector.hh" 44 #include "G4VSensitiveDetector.hh" 42 #include "G4VTouchable.hh" << 45 43 #include "G4ios.hh" << 46 #include "G4EnergySplitter.hh" >> 47 #include "G4TouchableHistory.hh" 44 48 45 //-------------------------------- 49 //-------------------------------- 46 // Constructor with name and type: 50 // Constructor with name and type: 47 //-------------------------------- 51 //-------------------------------- 48 G4ScoreSplittingProcess::G4ScoreSplittingProce << 52 G4ScoreSplittingProcess:: 49 : G4VProcess(processName, theType) << 53 G4ScoreSplittingProcess(const G4String& processName,G4ProcessType theType) >> 54 :G4VProcess(processName,theType), >> 55 fOldTouchableH(), fNewTouchableH(), fInitialTouchableH(), fFinalTouchableH() 50 { 56 { 51 pParticleChange = &xParticleChange; 57 pParticleChange = &xParticleChange; 52 58 53 fSplitStep = new G4Step(); 59 fSplitStep = new G4Step(); 54 fSplitPreStepPoint = fSplitStep->GetPreStepP << 60 fSplitPreStepPoint = fSplitStep->GetPreStepPoint(); 55 fSplitPostStepPoint = fSplitStep->GetPostSte 61 fSplitPostStepPoint = fSplitStep->GetPostStepPoint(); 56 62 57 if (verboseLevel > 0) { << 63 if (verboseLevel>0) >> 64 { 58 G4cout << GetProcessName() << " is created 65 G4cout << GetProcessName() << " is created " << G4endl; 59 } 66 } 60 fpEnergySplitter = new G4EnergySplitter(); << 67 fpEnergySplitter = new G4EnergySplitter(); 61 } 68 } 62 69 63 // ----------- 70 // ----------- 64 // Destructor: 71 // Destructor: 65 // ----------- 72 // ----------- 66 G4ScoreSplittingProcess::~G4ScoreSplittingProc 73 G4ScoreSplittingProcess::~G4ScoreSplittingProcess() 67 { 74 { 68 delete fSplitStep; 75 delete fSplitStep; 69 delete fpEnergySplitter; << 76 delete fpEnergySplitter; 70 } 77 } 71 78 72 //-------------------------------------------- 79 //------------------------------------------------------ 73 // 80 // 74 // StartTracking 81 // StartTracking 75 // 82 // 76 //-------------------------------------------- 83 //------------------------------------------------------ 77 void G4ScoreSplittingProcess::StartTracking(G4 84 void G4ScoreSplittingProcess::StartTracking(G4Track* trk) 78 { 85 { 79 // Setup initial touchables for the first st << 86 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 80 const G4Step* pStep = trk->GetStep(); << 87 // Setup initial touchables for the first step >> 88 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ >> 89 const G4Step* pStep= trk->GetStep(); 81 90 82 fOldTouchableH = trk->GetTouchableHandle(); 91 fOldTouchableH = trk->GetTouchableHandle(); 83 *fSplitPreStepPoint = *(pStep->GetPreStepPoi << 92 *fSplitPreStepPoint = *(pStep->GetPreStepPoint()); // Best to copy, so as to initialise 84 fSplitPreStepPoint->SetTouchableHandle(fOldT 93 fSplitPreStepPoint->SetTouchableHandle(fOldTouchableH); 85 fNewTouchableH = fOldTouchableH; 94 fNewTouchableH = fOldTouchableH; 86 *fSplitPostStepPoint = *(pStep->GetPostStepP << 95 *fSplitPostStepPoint= *(pStep->GetPostStepPoint()); // Best to copy, so as to initialise 87 fSplitPostStepPoint->SetTouchableHandle(fNew 96 fSplitPostStepPoint->SetTouchableHandle(fNewTouchableH); 88 97 89 /// Initialize << 98 /// Initialize 90 fSplitPreStepPoint->SetStepStatus(fUndefined << 99 fSplitPreStepPoint ->SetStepStatus(fUndefined); 91 fSplitPostStepPoint->SetStepStatus(fUndefine 100 fSplitPostStepPoint->SetStepStatus(fUndefined); 92 } 101 } 93 102 >> 103 94 //-------------------------------------------- 104 //---------------------------------------------------------- 95 // 105 // 96 // PostStepGetPhysicalInteractionLength() 106 // PostStepGetPhysicalInteractionLength() 97 // 107 // 98 //-------------------------------------------- 108 //---------------------------------------------------------- 99 G4double G4ScoreSplittingProcess::PostStepGetP << 109 G4double 100 const G4Track& /*track*/, G4double /*previou << 110 G4ScoreSplittingProcess::PostStepGetPhysicalInteractionLength( >> 111 const G4Track& /*track*/, >> 112 G4double /*previousStepSize*/, >> 113 G4ForceCondition* condition) 101 { 114 { 102 // This process must be invoked anyway to sc 115 // This process must be invoked anyway to score the hit 103 // - to do the scoring if the current volu 116 // - to do the scoring if the current volume is a regular structure, or 104 // - else to toggle the flag so that the S 117 // - else to toggle the flag so that the SteppingManager does the scoring. 105 *condition = StronglyForced; 118 *condition = StronglyForced; 106 119 107 // Future optimisation: check whether in reg << 120 // Future optimisation: check whether in regular structure. 108 // If it is in regular structure, be Stron 121 // If it is in regular structure, be StronglyForced 109 // If not in regular structure, << 122 // If not in regular structure, 110 // ask to be called only if Stepping 123 // ask to be called only if SteppingControl is AvoidHitInvocation 111 // in order to reset it to NormalCon 124 // in order to reset it to NormalCondition 112 125 113 return DBL_MAX; 126 return DBL_MAX; 114 } 127 } 115 128 116 //------------------------------------ 129 //------------------------------------ 117 // 130 // 118 // PostStepDoIt() 131 // PostStepDoIt() 119 // 132 // 120 //------------------------------------ 133 //------------------------------------ 121 G4VParticleChange* G4ScoreSplittingProcess::Po << 134 G4VParticleChange* G4ScoreSplittingProcess::PostStepDoIt( 122 { << 135 const G4Track& track, 123 G4VPhysicalVolume* pCurrentVolume = track.Ge << 136 const G4Step& step) 124 G4LogicalVolume* pLogicalVolume = pCurrentVo << 137 { >> 138 G4VPhysicalVolume* pCurrentVolume= track.GetVolume(); >> 139 G4LogicalVolume* pLogicalVolume= pCurrentVolume->GetLogicalVolume(); 125 G4VSensitiveDetector* ptrSD = pLogicalVolume 140 G4VSensitiveDetector* ptrSD = pLogicalVolume->GetSensitiveDetector(); 126 141 127 pParticleChange->Initialize(track); << 142 pParticleChange->Initialize(track); 128 if ((!pCurrentVolume->IsRegularStructure()) << 143 if( ( ! pCurrentVolume->IsRegularStructure() ) || ( !ptrSD ) 129 || G4RegularNavigationHelper::Instance() << 144 || G4RegularNavigationHelper::Instance()->GetStepLengths().size() <= 1) { 130 { << 145 // Set the flag to make sure that Stepping Manager does the scoring 131 // Set the flag to make sure that Stepping << 146 pParticleChange->ProposeSteppingControl( NormalCondition ); 132 pParticleChange->ProposeSteppingControl(No << 147 } else { 133 } << 148 G4ThreeVector preStepPosition, postStepPosition, direction, finalPostStepPosition; 134 else { << 149 pParticleChange->ProposeSteppingControl( AvoidHitInvocation ); 135 G4ThreeVector preStepPosition, postStepPos << 150 136 pParticleChange->ProposeSteppingControl(Av << 151 G4double totalEnergyDeposit= step.GetTotalEnergyDeposit(); 137 << 152 G4StepStatus fullStepStatus= step.GetPostStepPoint()->GetStepStatus(); 138 G4double totalEnergyDeposit = step.GetTota << 153 139 G4StepStatus fullStepStatus = step.GetPost << 154 CopyStepStart(step); 140 << 155 fSplitPreStepPoint->SetSensitiveDetector(ptrSD); 141 CopyStepStart(step); << 156 fOldTouchableH = fInitialTouchableH; 142 fSplitPreStepPoint->SetSensitiveDetector(p << 157 fNewTouchableH= fOldTouchableH; 143 fOldTouchableH = fInitialTouchableH; << 158 *fSplitPostStepPoint= *(step.GetPreStepPoint()); 144 fNewTouchableH = fOldTouchableH; << 159 145 *fSplitPostStepPoint = *(step.GetPreStepPo << 160 // Split the energy 146 << 161 // ---------------- 147 // Split the energy << 162 G4int numberVoxelsInStep= fpEnergySplitter->SplitEnergyInVolumes( &step ); 148 // ---------------- << 163 149 G4int numberVoxelsInStep = fpEnergySplitte << 164 preStepPosition= step.GetPreStepPoint()->GetPosition(); 150 << 165 finalPostStepPosition= step.GetPostStepPoint()->GetPosition(); 151 preStepPosition = step.GetPreStepPoint()-> << 166 direction= (finalPostStepPosition - preStepPosition).unit(); 152 finalPostStepPosition = step.GetPostStepPo << 167 153 direction = (finalPostStepPosition - preSt << 168 fFinalTouchableH= track.GetNextTouchableHandle(); 154 << 169 155 fFinalTouchableH = track.GetNextTouchableH << 170 postStepPosition= preStepPosition; 156 << 171 // Loop over the sub-parts of this step 157 postStepPosition = preStepPosition; << 172 G4int iStep; 158 // Loop over the sub-parts of this step << 173 for ( iStep=0; iStep < numberVoxelsInStep; iStep++ ){ 159 G4int iStep; << 174 G4int idVoxel= -1; // Voxel ID 160 for (iStep = 0; iStep < numberVoxelsInStep << 175 G4double stepLength=0.0, energyLoss= 0.0; 161 G4int idVoxel = -1; // Voxel ID << 176 162 G4double stepLength = 0.0, energyLoss = << 177 *fSplitPreStepPoint = *fSplitPostStepPoint; 163 << 178 fOldTouchableH = fNewTouchableH; 164 *fSplitPreStepPoint = *fSplitPostStepPoi << 179 165 fOldTouchableH = fNewTouchableH; << 180 preStepPosition= postStepPosition; 166 << 181 fSplitPreStepPoint->SetPosition( preStepPosition ); 167 preStepPosition = postStepPosition; << 182 fSplitPreStepPoint->SetTouchableHandle(fOldTouchableH); 168 fSplitPreStepPoint->SetPosition(preStepP << 183 169 fSplitPreStepPoint->SetTouchableHandle(f << 184 fpEnergySplitter->GetLengthAndEnergyDeposited( iStep, idVoxel, stepLength, energyLoss); 170 << 185 171 fpEnergySplitter->GetLengthAndEnergyDepo << 186 // Correct the material, so that the track->GetMaterial gives correct answer 172 << 187 pLogicalVolume->SetMaterial( fpEnergySplitter->GetVoxelMaterial( iStep) ); // idVoxel) ); 173 // Correct the material, so that the tra << 188 174 pLogicalVolume->SetMaterial(fpEnergySpli << 189 postStepPosition= preStepPosition + stepLength * direction; 175 << 190 fSplitPostStepPoint->SetPosition(postStepPosition); 176 postStepPosition = preStepPosition + ste << 191 177 fSplitPostStepPoint->SetPosition(postSte << 192 // Load the Step with the new values 178 << 193 fSplitStep->SetStepLength(stepLength); 179 // Load the Step with the new values << 194 fSplitStep->SetTotalEnergyDeposit(energyLoss); 180 fSplitStep->SetStepLength(stepLength); << 195 if( iStep < numberVoxelsInStep -1 ){ 181 fSplitStep->SetTotalEnergyDeposit(energy << 196 fSplitStep->GetPostStepPoint()->SetStepStatus( fGeomBoundary ); 182 if (iStep < numberVoxelsInStep - 1) { << 197 G4int nextVoxelId= -1; 183 fSplitStep->GetPostStepPoint()->SetSte << 198 fpEnergySplitter->GetVoxelID( iStep+1, nextVoxelId ); 184 G4int nextVoxelId = -1; << 199 185 fpEnergySplitter->GetVoxelID(iStep + 1 << 200 // Create new "next" touchable for each section ?? 186 << 201 G4VTouchable* fNewTouchablePtr= 187 // Create new "next" touchable for eac << 202 CreateTouchableForSubStep( nextVoxelId, postStepPosition ); 188 G4VTouchable* fNewTouchablePtr = Creat << 203 fNewTouchableH= G4TouchableHandle(fNewTouchablePtr); 189 fNewTouchableH = G4TouchableHandle(fNe << 204 fSplitPostStepPoint->SetTouchableHandle( fNewTouchableH ); 190 fSplitPostStepPoint->SetTouchableHandl << 205 } else { 191 } << 206 fSplitStep->GetPostStepPoint()->SetStepStatus( fullStepStatus ); 192 else { << 207 fSplitPostStepPoint->SetTouchableHandle( fFinalTouchableH ); 193 fSplitStep->GetPostStepPoint()->SetSte << 208 } 194 fSplitPostStepPoint->SetTouchableHandl << 209 195 } << 210 196 << 211 // As first approximation, split the NIEL in the same fractions as the energy deposit 197 // As first approximation, split the NIE << 212 G4double eLossFraction; 198 G4double eLossFraction; << 213 eLossFraction= (totalEnergyDeposit>0.0) ? energyLoss / totalEnergyDeposit : 1.0 ; 199 eLossFraction = (totalEnergyDeposit > 0. << 214 fSplitStep->SetNonIonizingEnergyDeposit(step.GetNonIonizingEnergyDeposit()*eLossFraction); 200 fSplitStep->SetNonIonizingEnergyDeposit( << 215 201 << 216 fSplitPostStepPoint->SetSensitiveDetector( ptrSD ); 202 fSplitPostStepPoint->SetSensitiveDetecto << 203 217 204 // Call the Sensitive Detector << 218 // Call the Sensitive Detector 205 ptrSD->Hit(fSplitStep); << 219 ptrSD->Hit(fSplitStep); 206 220 207 if (verboseLevel > 1) Verbose(step); << 221 if (verboseLevel>1) Verbose(step); 208 } << 222 } 209 } 223 } 210 224 211 // This must change the Stepping Control 225 // This must change the Stepping Control 212 return pParticleChange; 226 return pParticleChange; 213 } 227 } 214 228 215 G4TouchableHistory* G4ScoreSplittingProcess::C << 229 G4TouchableHistory* 216 << 230 G4ScoreSplittingProcess::CreateTouchableForSubStep( G4int newVoxelNum, G4ThreeVector ) 217 { 231 { 218 auto oldTouchableHistory = dynamic_cast<G4To << 232 // G4cout << " Creating touchable handle for voxel-no " << newVoxelNum << G4endl; 219 G4TouchableHistory* ptrTouchableHistory = << 220 G4TransportationManager::GetTransportation << 221 ->GetNavigatorForTracking() << 222 ->CreateTouchableHistory(oldTouchableHis << 223 233 >> 234 G4TouchableHistory* oldTouchableHistory= dynamic_cast<G4TouchableHistory*>(fOldTouchableH()); >> 235 G4TouchableHistory* ptrTouchableHistory= G4TransportationManager::GetTransportationManager()-> >> 236 GetNavigatorForTracking()->CreateTouchableHistory(oldTouchableHistory->GetHistory()); >> 237 224 // Change the history 238 // Change the history 225 auto ptrNavHistory = const_cast<G4Navigation << 239 G4NavigationHistory* ptrNavHistory= const_cast<G4NavigationHistory*>(ptrTouchableHistory->GetHistory()); 226 G4VPhysicalVolume* curPhysicalVol = ptrNavHi << 240 G4VPhysicalVolume* curPhysicalVol= ptrNavHistory->GetTopVolume(); 227 241 228 EVolume curVolumeType = ptrNavHistory->GetTo << 242 EVolume curVolumeType= ptrNavHistory->GetTopVolumeType(); 229 if (curVolumeType == kParameterised) { << 243 if( curVolumeType == kParameterised ) 230 ptrNavHistory->BackLevel(); << 244 { >> 245 ptrNavHistory->BackLevel(); 231 // G4VPVParameterised parameterisedPV= pNe 246 // G4VPVParameterised parameterisedPV= pNewMother 232 G4VPVParameterisation* curParamstn = curPh << 247 G4VPVParameterisation* curParamstn= curPhysicalVol->GetParameterisation(); 233 248 234 // From G4ParameterisedNavigation::Identif 249 // From G4ParameterisedNavigation::IdentifyAndPlaceSolid() inline method 235 G4VSolid* sampleSolid = curParamstn->Compu 250 G4VSolid* sampleSolid = curParamstn->ComputeSolid(newVoxelNum, curPhysicalVol); 236 sampleSolid->ComputeDimensions(curParamstn 251 sampleSolid->ComputeDimensions(curParamstn, newVoxelNum, curPhysicalVol); 237 curParamstn->ComputeTransformation(newVoxe 252 curParamstn->ComputeTransformation(newVoxelNum, curPhysicalVol); 238 253 239 ptrNavHistory->NewLevel(curPhysicalVol, kP << 254 ptrNavHistory->NewLevel( curPhysicalVol, kParameterised, newVoxelNum ); 240 } 255 } 241 else { << 256 else 242 G4cout << " Current volume type is not Par << 257 { 243 G4Exception( << 258 G4cout << " Current volume type is not Parameterised. " << G4endl; 244 "G4ScoreSplittingProcess::CreateTouchabl << 259 G4Exception("G4ScoreSplittingProcess::CreateTouchableForSubStep", 245 JustWarning, << 260 "ErrorRegularParamaterisation", JustWarning, 246 "Score Splitting Process is used for Reg << 261 "Score Splitting Process is used for Regular Structure - but did not find one here."); 247 } 262 } 248 return ptrTouchableHistory; << 263 return ptrTouchableHistory; 249 } 264 } 250 265 251 void G4ScoreSplittingProcess::CopyStepStart(co << 266 void G4ScoreSplittingProcess::CopyStepStart(const G4Step & step) 252 { 267 { 253 fSplitStep->SetTrack(step.GetTrack()); 268 fSplitStep->SetTrack(step.GetTrack()); 254 fSplitStep->SetStepLength(step.GetStepLength 269 fSplitStep->SetStepLength(step.GetStepLength()); 255 fSplitStep->SetTotalEnergyDeposit(step.GetTo 270 fSplitStep->SetTotalEnergyDeposit(step.GetTotalEnergyDeposit()); 256 fSplitStep->SetNonIonizingEnergyDeposit(step 271 fSplitStep->SetNonIonizingEnergyDeposit(step.GetNonIonizingEnergyDeposit()); 257 fSplitStep->SetControlFlag(step.GetControlFl 272 fSplitStep->SetControlFlag(step.GetControlFlag()); 258 273 259 *fSplitPreStepPoint = *(step.GetPreStepPoint << 274 *fSplitPreStepPoint = *(step.GetPreStepPoint()); 260 275 261 fInitialTouchableH = (step.GetPreStepPoint() << 276 fInitialTouchableH= (step.GetPreStepPoint()) ->GetTouchableHandle(); 262 fFinalTouchableH = (step.GetPostStepPoint()) << 277 fFinalTouchableH = (step.GetPostStepPoint())->GetTouchableHandle(); 263 } 278 } 264 279 265 void G4ScoreSplittingProcess::Verbose(const G4 280 void G4ScoreSplittingProcess::Verbose(const G4Step& step) const 266 { 281 { 267 G4cout << "In mass geometry ---------------- 282 G4cout << "In mass geometry ------------------------------------------------" << G4endl; 268 G4cout << " StepLength : " << step.GetStepLe << 283 G4cout << " StepLength : " << step.GetStepLength()/mm << " TotalEnergyDeposit : " 269 << " TotalEnergyDeposit : " << s << 284 << step.GetTotalEnergyDeposit()/MeV << G4endl; 270 G4cout << " PreStepPoint : " << step.GetPreS << 285 G4cout << " PreStepPoint : " 271 if (step.GetPreStepPoint()->GetProcessDefine << 286 << step.GetPreStepPoint()->GetPhysicalVolume()->GetName() << " - "; 272 G4cout << step.GetPreStepPoint()->GetProce << 287 if(step.GetPreStepPoint()->GetProcessDefinedStep()) 273 } << 288 { G4cout << step.GetPreStepPoint()->GetProcessDefinedStep()->GetProcessName(); } 274 else { << 289 else 275 G4cout << "NoProcessAssigned"; << 290 { G4cout << "NoProcessAssigned"; } 276 } << 277 G4cout << G4endl; 291 G4cout << G4endl; 278 G4cout << " " << step.GetPreS 292 G4cout << " " << step.GetPreStepPoint()->GetPosition() << G4endl; 279 G4cout << " PostStepPoint : "; 293 G4cout << " PostStepPoint : "; 280 if (step.GetPostStepPoint()->GetPhysicalVolu << 294 if(step.GetPostStepPoint()->GetPhysicalVolume()) 281 G4cout << step.GetPostStepPoint()->GetPhys << 295 { G4cout << step.GetPostStepPoint()->GetPhysicalVolume()->GetName(); } 282 } << 296 else 283 else { << 297 { G4cout << "OutOfWorld"; } 284 G4cout << "OutOfWorld"; << 285 } << 286 G4cout << " - "; 298 G4cout << " - "; 287 if (step.GetPostStepPoint()->GetProcessDefin << 299 if(step.GetPostStepPoint()->GetProcessDefinedStep()) 288 G4cout << step.GetPostStepPoint()->GetProc << 300 { G4cout << step.GetPostStepPoint()->GetProcessDefinedStep()->GetProcessName(); } 289 } << 301 else 290 else { << 302 { G4cout << "NoProcessAssigned"; } 291 G4cout << "NoProcessAssigned"; << 292 } << 293 G4cout << G4endl; 303 G4cout << G4endl; 294 G4cout << " " << step.GetPos 304 G4cout << " " << step.GetPostStepPoint()->GetPosition() << G4endl; 295 305 296 G4cout << "In ghost geometry --------------- 306 G4cout << "In ghost geometry ------------------------------------------------" << G4endl; 297 G4cout << " StepLength : " << fSplitStep->Ge << 307 G4cout << " StepLength : " << fSplitStep->GetStepLength()/mm 298 << " TotalEnergyDeposit : " << f << 308 << " TotalEnergyDeposit : " 299 G4cout << " PreStepPoint : " << fSplitStep-> << 309 << fSplitStep->GetTotalEnergyDeposit()/MeV << G4endl; 300 << " [" << fSplitStep->GetPreStepPoin << 310 G4cout << " PreStepPoint : " 301 << " - "; << 311 << fSplitStep->GetPreStepPoint()->GetPhysicalVolume()->GetName() << " [" 302 if (fSplitStep->GetPreStepPoint()->GetProces << 312 << fSplitStep->GetPreStepPoint()->GetTouchable()->GetReplicaNumber() 303 G4cout << fSplitStep->GetPreStepPoint()->G << 313 << " ]" << " - "; 304 } << 314 if(fSplitStep->GetPreStepPoint()->GetProcessDefinedStep()) 305 else { << 315 { G4cout << fSplitStep->GetPreStepPoint()->GetProcessDefinedStep()->GetProcessName(); } 306 G4cout << "NoProcessAssigned"; << 316 else 307 } << 317 { G4cout << "NoProcessAssigned"; } 308 G4cout << G4endl; 318 G4cout << G4endl; 309 G4cout << " " << fSplitStep-> 319 G4cout << " " << fSplitStep->GetPreStepPoint()->GetPosition() << G4endl; 310 G4cout << " PostStepPoint : "; 320 G4cout << " PostStepPoint : "; 311 if (fSplitStep->GetPostStepPoint()->GetPhysi << 321 if(fSplitStep->GetPostStepPoint()->GetPhysicalVolume()) >> 322 { 312 G4cout << fSplitStep->GetPostStepPoint()-> 323 G4cout << fSplitStep->GetPostStepPoint()->GetPhysicalVolume()->GetName() << " [" 313 << fSplitStep->GetPostStepPoint()-> << 324 << fSplitStep->GetPostStepPoint()->GetTouchable()->GetReplicaNumber() 314 } << 325 << " ]"; 315 else { << 316 G4cout << "OutOfWorld"; << 317 } 326 } >> 327 else >> 328 { G4cout << "OutOfWorld"; } 318 G4cout << " - "; 329 G4cout << " - "; 319 if (fSplitStep->GetPostStepPoint()->GetProce << 330 if(fSplitStep->GetPostStepPoint()->GetProcessDefinedStep()) 320 G4cout << fSplitStep->GetPostStepPoint()-> << 331 { G4cout << fSplitStep->GetPostStepPoint()->GetProcessDefinedStep()->GetProcessName(); } 321 } << 332 else 322 else { << 333 { G4cout << "NoProcessAssigned"; } 323 G4cout << "NoProcessAssigned"; << 324 } << 325 G4cout << G4endl; 334 G4cout << G4endl; 326 G4cout << " " << fSplitStep- << 335 G4cout << " " << fSplitStep->GetPostStepPoint()->GetPosition() << " == " 327 << " == " << fSplitStep->GetTrack()-> << 336 << fSplitStep->GetTrack()->GetMomentumDirection() >> 337 << G4endl; >> 338 328 } 339 } 329 340 >> 341 330 //-------------------------------------------- 342 //---------------------------------------------------------- 331 // 343 // 332 // AtRestGetPhysicalInteractionLength() 344 // AtRestGetPhysicalInteractionLength() 333 // 345 // 334 //-------------------------------------------- 346 //---------------------------------------------------------- 335 G4double G4ScoreSplittingProcess::AtRestGetPhy << 347 G4double 336 << 348 G4ScoreSplittingProcess::AtRestGetPhysicalInteractionLength( >> 349 const G4Track& /*track*/, >> 350 G4ForceCondition* condition) 337 { 351 { 338 *condition = NotForced; // Was Forced 352 *condition = NotForced; // Was Forced 339 return DBL_MAX; 353 return DBL_MAX; 340 } 354 } 341 355 >> 356 342 //--------------------------------------- 357 //--------------------------------------- 343 // AlongStepGetPhysicalInteractionLength 358 // AlongStepGetPhysicalInteractionLength 344 //--------------------------------------- 359 //--------------------------------------- 345 G4double << 360 G4double G4ScoreSplittingProcess::AlongStepGetPhysicalInteractionLength( 346 G4ScoreSplittingProcess::AlongStepGetPhysicalI << 361 const G4Track& , // track, 347 << 362 G4double , // previousStepSize, 348 << 363 G4double , // currentMinimumStep, 349 << 364 G4double& , // proposedSafety, 350 << 365 G4GPILSelection* selection) 351 { 366 { 352 *selection = NotCandidateForSelection; 367 *selection = NotCandidateForSelection; 353 return DBL_MAX; 368 return DBL_MAX; 354 } 369 } 355 370 356 //------------------------------------ 371 //------------------------------------ 357 // AlongStepDoIt() 372 // AlongStepDoIt() 358 //------------------------------------ 373 //------------------------------------ 359 374 360 G4VParticleChange* G4ScoreSplittingProcess::Al << 375 G4VParticleChange* G4ScoreSplittingProcess::AlongStepDoIt( >> 376 const G4Track& track, const G4Step& ) 361 { 377 { 362 // Dummy ParticleChange ie: does nothing 378 // Dummy ParticleChange ie: does nothing 363 // Expecting G4Transportation to move the tr 379 // Expecting G4Transportation to move the track 364 dummyParticleChange.Initialize(track); 380 dummyParticleChange.Initialize(track); 365 return &dummyParticleChange; 381 return &dummyParticleChange; 366 } 382 } 367 383 368 //------------------------------------ 384 //------------------------------------ 369 // AtRestDoIt() 385 // AtRestDoIt() 370 //------------------------------------ 386 //------------------------------------ 371 G4VParticleChange* G4ScoreSplittingProcess::At << 387 G4VParticleChange* G4ScoreSplittingProcess::AtRestDoIt( 372 { << 388 const G4Track& track, >> 389 const G4Step&) >> 390 { 373 pParticleChange->Initialize(track); 391 pParticleChange->Initialize(track); 374 return pParticleChange; 392 return pParticleChange; 375 } 393 } 376 394