ATLAS Offline Software
List of all members
ISFFluxRecorder Class Reference

#include <ISFFluxRecorder.h>

Inheritance diagram for ISFFluxRecorder:
Collaboration diagram for ISFFluxRecorder:

Public Member Functions

Methods related to flux recording

Initialize flux recording

void InitializeFluxRecording () override final
 
void RecordFlux (const G4Event *) override final
 Record fluxes from current event. More...
 
void WriteFluxInformation () override final
 Dump flux information to text files. More...
 

Detailed Description

Definition at line 10 of file ISFFluxRecorder.h.

Member Function Documentation

◆ InitializeFluxRecording()

void ISFFluxRecorder::InitializeFluxRecording ( )
finaloverridevirtual

Implements IFluxRecorder.

Definition at line 23 of file ISFFluxRecorder.cxx.

24 {
25  G4UImanager *ui = G4UImanager::GetUIpointer();
26  ui->ApplyCommand("/run/setCutForAGivenParticle proton 0 mm");
27 
28  G4ScoringManager* ScM = G4ScoringManager::GetScoringManagerIfExist();
29 
30  if(!ScM) { return; }
31 
32  ui->ApplyCommand("/score/create/cylinderMesh cylMesh_1");
33  // R Z(-24 to 24)
34  ui->ApplyCommand("/score/mesh/cylinderSize 12. 24. m");
35  // iR iZ
36  //ui->ApplyCommand("/score/mesh/nBin 1 1 1");
37  ui->ApplyCommand("/score/mesh/nBin 120 480 1");
38 
39  ui->ApplyCommand("/score/quantity/energyDeposit eDep");
40 
41  ui->ApplyCommand("/score/quantity/cellFlux CF_photon");
42  ui->ApplyCommand("/score/filter/particle photonFilter gamma");
43  // above 2 line crete tally for cell flux for gamma
44 
45  ui->ApplyCommand("/score/quantity/cellFlux CF_neutron");
46  ui->ApplyCommand("/score/filter/particle neutronFilter neutron");
47 
48  ui->ApplyCommand("/score/quantity/cellFlux CF_HEneutron");
49  ui->ApplyCommand("/score/filter/particleWithKineticEnergy HEneutronFilter 20 7000000 MeV neutron");
50 
51  ui->ApplyCommand("/score/quantity/doseDeposit dose");
52 
53  ui->ApplyCommand("/score/close");
54  ui->ApplyCommand("/score/list");
55 
56  G4int nPar = ScM->GetNumberOfMesh();
57 
58  if(nPar<1) { return; }
59 
60  G4ParticleTable::G4PTblDicIterator* particleIterator
61  = G4ParticleTable::GetParticleTable()->GetIterator();
62 
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));
68  if(!pWorld) {
69  pWorld = G4TransportationManager::GetTransportationManager()
70  ->GetParallelWorld(ScM->GetWorldName(iw));
71  pWorld->SetName(ScM->GetWorldName(iw));
72 
73  G4ParallelWorldScoringProcess* theParallelWorldScoringProcess
74  = new G4ParallelWorldScoringProcess(ScM->GetWorldName(iw));
75  theParallelWorldScoringProcess->SetParallelWorld(ScM->GetWorldName(iw));
76 
77  particleIterator->reset();
78  while( (*particleIterator)() ) {
79  G4ParticleDefinition* particle = particleIterator->value();
80  G4ProcessManager* pmanager = particle->GetProcessManager();
81  if(pmanager) {
82  pmanager->AddProcess(theParallelWorldScoringProcess);
83  pmanager->SetProcessOrderingToLast(theParallelWorldScoringProcess, idxAtRest);
84  pmanager->SetProcessOrderingToSecond(theParallelWorldScoringProcess, idxAlongStep);
85  pmanager->SetProcessOrderingToLast(theParallelWorldScoringProcess, idxPostStep);
86  }
87  }
88  }
89 
90  mesh->Construct(pWorld);
91  }
92  return;
93 }

◆ RecordFlux()

void ISFFluxRecorder::RecordFlux ( const G4Event *  currentEvent)
finaloverridevirtual

Record fluxes from current event.

Implements IFluxRecorder.

Definition at line 95 of file ISFFluxRecorder.cxx.

96 {
97  G4ScoringManager* ScM = G4ScoringManager::GetScoringManagerIfExist();
98  if(ScM) {
99  G4int nPar = ScM->GetNumberOfMesh();
100  G4HCofThisEvent* HCE = currentEvent->GetHCofThisEvent();
101  if(HCE && nPar>0) {
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); }
106  }
107  }
108  }
109  return;
110 }

◆ WriteFluxInformation()

void ISFFluxRecorder::WriteFluxInformation ( )
finaloverridevirtual

Dump flux information to text files.

Implements IFluxRecorder.

Definition at line 112 of file ISFFluxRecorder.cxx.

113 {
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");
120  return;
121 }

The documentation for this class was generated from the following files:
Trk::ParticleSwitcher::particle
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:76
lumiFormat.i
int i
Definition: lumiFormat.py:85