Warning, /east/Components/README.md is written in an unsupported language. File is not indexed.
0001 # eAST detector components
0002
0003 ## Overview
0004 *eAST* (eA simulation toolkit) assumes each detector component is descrived by a concrete class derived from _eASTVDetectoComponent_ base class.
0005 Base classes and utility classes that should be used by a detector component are stored in `/Components/Base` sub-directory.
0006
0007 All volumes of a detector component should be fully contained by a mother volume that represents the component, and this mother volume must have a unique region.
0008
0009 ## eASTVDetectorComponentbase class
0010
0011 _eASTVDetectoComponent_ may represent both detector component (i.e. including sensitive detector) and support structure.
0012 A concrete class should implement the following vertual methods.
0013
0014 ### void SetUP()
0015
0016 UI commands necessary to configure the detector component must be defined in this method. The base-class data member _commandDir_ is already created.
0017 Also, _locate_ and _rotate_ commands are by default created via the base class to locate/rotate the envelope of the detector component to the world volume.
0018 Commands can be for input file name or switching complexities.
0019 In the future, commands for physics options will be added as well.
0020
0021
0022 ### void Construct(G4VPhysicalVolume* worldPhys)
0023
0024 All the volumes should be constructed in this method, and the top level envelope(s) should be located to _worldPhys_ world volume.
0025 You can assume all the UI commands needed for configuration defined in above-mentioned _SetUp()_ method have already been applied.
0026 For the convenience,
0027 ```
0028 void Locate(G4LogicalVolume* compLogVol, G4VPhysicalVolume* worldPhys);
0029 ```
0030 is provided placing top level envelope(s) to _worldPhys_. This method takes _locate_ and _rotate_ UI commands into account.
0031
0032 If geometry is read from a GDML file and it does not have material definitions to each volume, a utility method is provided.
0033 ```
0034 void ReadMaterialFile(G4String fileName);
0035 ```
0036 Here, the input file is an ASCII file, and each line of the file should have the name of a logical volume and its material name.
0037 Material name must be a name that appears in G4NistManager.
0038
0039 A dedicated _G4Region_ object must be instantiated and set to the logical volume(s) of the envelope(s).
0040 The pointer to this dedicated _G4Region_ object should be kept to _pRegion_ base-class pointer data member.
0041
0042 ### void ConstructSD()
0043
0044 This method is invoked for each worker threads, and sensitive detector(s) should be constructed here. If the component is a structure, you don't need to implement this method.
0045
0046 ### void ConstructActions()
0047
0048 This method is invoked for each worker threads. If the component needs any of UserRunAction, UserEventAction, UserStackingAction, UserTrackingAction and/or UserSteppingAction, they must be instantiated in this method and registered by the following utility methods.
0049 ```
0050 void RegisterUserAction(G4UserRunAction*);
0051 void RegisterUserAction(G4UserEventAction*);
0052 void RegisterUserAction(G4UserStackingAction*);
0053 void RegisterUserAction(G4UserTrackingAction*);
0054 void RegisterUserAction(G4UserSteppingAction*);
0055 ```
0056
0057 ### void ConstructActionForMaster()
0058
0059 This method is invoked only in the master thread, and the component needs UserRunAction for the global run, it must be instantiated in this method and registered by the following utility method.
0060 ```
0061 void RegisterUserAction(G4UserRunAction*);
0062 ```
0063
0064 ## Defining a component
0065
0066 A component has to be instantiated in [_eASTInitialization_](../Core/src/eASTInitialization.cc) with its unique component name.
0067
0068 The component is actually constructed only if a user issues a UI command
0069 ```
0070 /eAST/component/<_componentName_> <_verboseLevel_>
0071 ```
0072
0073
0074
0075
0076
0077
0078