Download Geant4 User's Guide for Application Developers

Transcript
Detector Definition and Response
G4ProcessManager* pmanager = particle->GetProcessManager();
pmanager->AddProcess(theParallelWorldScoringProcess);
pmanager->SetProcessOrderingToLast(theParallelWorldScoringProcess, idxAtRest);
pmanager->SetProcessOrdering(theParallelWorldScoringProcess, idxAlongStep, 1);
pmanager->SetProcessOrderingToLast(theParallelWorldScoringProcess, idxPostStep);
}
}
At the end of processing an event, all hits collections made for the parallel world are stored in
G4HCofThisEvent as well as those for the mass geometry.
4.8. Command-based scoring
4.8.1. Introduction
Command-based scoring in Geant4 utilizes parallel navigation in a parallel world volume as descibed in the previous sections. Through interactive commands, the user can define :
• A parallel world for scoring and three-dimensional mesh in it
• Arbitrary number of physics quantities to be scored and filters
After scoring (i.e. a run), the user can visualize the score and dump scores into a file. All available UI commands
are listed in List of built-in commands.
Command-based scoring is an optional functionality and the user has to explicity define its use in the main().
To do this, the method G4ScoringManager::GetScoringManager() must be invoked right after the
instantiation of G4RunManager. The scoring manager is a singleton object, and the pointer accessed above
should not be deleted by the user.
Example 4.21. A user main() to use the command-based scoring
#include "G4RunManager.hh"
#include "G4ScoringManager.hh"
int main(int argc,char** argv)
{
// Construct the run manager
G4RunManager * runManager = new G4RunManager;
// Activate command-based scorer
G4ScoringManager::GetScoringManager();
...
}
4.8.2. Defining a scoring mesh
To define a scoring mesh, the user has to specify the followings.
•
•
•
•
Shape and name of the 3D scoring mesh. Currently, box is the only available shape.
Size of the scoring mesh. Mesh size must be specified as "half width" similar to the arguments of G4Box.
Number of bins for each axes. Note that too hugh number causes immense memory consumption.
Optionally, position and rotation of the mesh. If not specified, the mesh is positioned at the center of the world
volume without rotation.
For a scoring mesh the user can have arbitrary number of quantities to be scored for each cell of the mesh. For each
scoring quantity, the use can set one filter. Please note that /score/filter affects on the preceding scorer.
Names of scorers and filters must be unique for the mesh. It is possible to define more than one scorer of same
kind with different names and, likely, with different filters.
Defining a scoring mesh and scores in the mesh should terminate with the /score/close command. The following sample UI commands define a scoring mesh named boxMesh_1, size of which is 2 m * 2 m * 2 m, and
169