8 #include "G4GeometryManager.hh"
9 #include "G4HCofThisEvent.hh"
10 #include "G4LogicalVolumeStore.hh"
11 #include "G4ParallelWorldScoringProcess.hh"
12 #include "G4ParticleTable.hh"
13 #include "G4ProcessManager.hh"
14 #include "G4RegionStore.hh"
16 #include "G4ScoringManager.hh"
17 #include "G4StateManager.hh"
18 #include "G4TransportationManager.hh"
19 #include "G4UImanager.hh"
20 #include "G4UserRunAction.hh"
21 #include "G4Version.hh"
25 G4UImanager *ui = G4UImanager::GetUIpointer();
26 ui->ApplyCommand(
"/run/setCutForAGivenParticle proton 0 mm");
28 G4ScoringManager* ScM = G4ScoringManager::GetScoringManagerIfExist();
32 ui->ApplyCommand(
"/score/create/cylinderMesh cylMesh_1");
34 ui->ApplyCommand(
"/score/mesh/cylinderSize 12. 24. m");
37 ui->ApplyCommand(
"/score/mesh/nBin 120 480 1");
39 ui->ApplyCommand(
"/score/quantity/energyDeposit eDep");
41 ui->ApplyCommand(
"/score/quantity/cellFlux CF_photon");
42 ui->ApplyCommand(
"/score/filter/particle photonFilter gamma");
45 ui->ApplyCommand(
"/score/quantity/cellFlux CF_neutron");
46 ui->ApplyCommand(
"/score/filter/particle neutronFilter neutron");
48 ui->ApplyCommand(
"/score/quantity/cellFlux CF_HEneutron");
49 ui->ApplyCommand(
"/score/filter/particleWithKineticEnergy HEneutronFilter 20 7000000 MeV neutron");
51 ui->ApplyCommand(
"/score/quantity/doseDeposit dose");
53 ui->ApplyCommand(
"/score/close");
54 ui->ApplyCommand(
"/score/list");
56 G4int nPar = ScM->GetNumberOfMesh();
58 if(nPar<1) {
return; }
60 G4ParticleTable::G4PTblDicIterator* particleIterator
61 = G4ParticleTable::GetParticleTable()->GetIterator();
63 for(G4int iw=0;iw<nPar;iw++) {
64 G4VScoringMesh* mesh = ScM->GetMesh(iw);
65 G4VPhysicalVolume* pWorld
66 = G4TransportationManager::GetTransportationManager()
67 ->IsWorldExisting(ScM->GetWorldName(iw));
69 pWorld = G4TransportationManager::GetTransportationManager()
70 ->GetParallelWorld(ScM->GetWorldName(iw));
71 pWorld->SetName(ScM->GetWorldName(iw));
73 G4ParallelWorldScoringProcess* theParallelWorldScoringProcess
74 =
new G4ParallelWorldScoringProcess(ScM->GetWorldName(iw));
75 theParallelWorldScoringProcess->SetParallelWorld(ScM->GetWorldName(iw));
77 particleIterator->reset();
78 while( (*particleIterator)() ) {
79 G4ParticleDefinition*
particle = particleIterator->value();
80 G4ProcessManager* pmanager =
particle->GetProcessManager();
82 pmanager->AddProcess(theParallelWorldScoringProcess);
83 pmanager->SetProcessOrderingToLast(theParallelWorldScoringProcess, idxAtRest);
84 pmanager->SetProcessOrderingToSecond(theParallelWorldScoringProcess, idxAlongStep);
85 pmanager->SetProcessOrderingToLast(theParallelWorldScoringProcess, idxPostStep);
90 mesh->Construct(pWorld);
97 G4ScoringManager* ScM = G4ScoringManager::GetScoringManagerIfExist();
99 G4int nPar = ScM->GetNumberOfMesh();
100 G4HCofThisEvent* HCE = currentEvent->GetHCofThisEvent();
102 G4int nColl = HCE->GetCapacity();
103 for(G4int
i=0;
i<nColl;
i++) {
104 G4VHitsCollection* HC = HCE->GetHC(
i);
105 if(HC) { ScM->Accumulate(HC); }
114 G4UImanager *ui=G4UImanager::GetUIpointer();
115 ui->ApplyCommand(
"/score/dumpQuantityToFile cylMesh_1 eDep edep.txt");
116 ui->ApplyCommand(
"/score/dumpQuantityToFile cylMesh_1 CF_neutron neutron.txt");
117 ui->ApplyCommand(
"/score/dumpQuantityToFile cylMesh_1 CF_HEneutron HEneutron.txt");
118 ui->ApplyCommand(
"/score/dumpQuantityToFile cylMesh_1 CF_photon photon.txt");
119 ui->ApplyCommand(
"/score/dumpQuantityToFile cylMesh_1 dose dose.txt");