Upload
kelley-hardy
View
232
Download
0
Tags:
Embed Size (px)
Citation preview
Tabular Editors for Geant4Geant4 Geometry Editor and
Geant4 Physics Editor
CHEP 2000 at Padova
Hajime Yoshida
Naruto University of Education
Tabular Editors
• Geant4 provides the base abstract classes for the user mandatory classes : – G4VUserDetectorConstructionG4VUserDetectorConstruction
– G4VUserPhysicsListG4VUserPhysicsList
• GGE and GPE generate the concrete implementation classes automatically from the tables filled by a user
• It is assumed that a user has enough knowledge on the problem domain; the concept of volumes, particle interactions etc. to fill the tables, but has little experience of C++ programming.
• Tradeoffs in the design are inevitable;– general use patterns; materials, solids, logical volumes, particles
– typical use patterns; physical volumes, processes
Geant4 Geometry Editor• Material editor
– Table of materials from scratch
– Table of compound materials
• Volume editors– Table of logical volumes
• definition of solids
• material
• visualization attribute
• Boolean operation not supported
– Tables of Physical volumes• Single positioning
• Repeated positioning with copy numbers– translation
– axially symmetric
• Replica or slicing– along an axis
– axial
GGE’s snapshot on Windows-98
Material editor
• Default values of Geant4 are filled in the cells
• User’s selection with list-boxes for units, states, etc..
• Persistent Data Base file to load, save and append
Material editor
• Copy multiple elements to the material table
Volume Editor• Listbox to choose solid types
• Guidance to define the parameters of solids
• Mark the materials used by the logical volumes
Single Positioned Volumes
• Only one physical world has its mother type NULL.
• Body/frame rotation around an axis
• Translation (X0, Y0, Z0)
• From each row are generated a group of C++ statements
Repeated positioning: Axially symmetric
• Rotation types ; body or frame
• Mother type ; logical or physical
• Coordinates of the center of rotation
• Axis of rotation and radius
• Incremental angle and number of copies
GGE: Generation of C++ codes
• Includes all relevant header files
• G4VPhysicalVolume* MyDetector::Construct() {– G4Element* elementN = new G4Element(…);
– G4Material* Air = new G4Material(…);• Air->AddElement(..);
– G4Material* Al = new G4Material(..);
– G4VisAttributes* lightblue = new G4VisAttributes(…);
– G4Box* solidbox = new G4Box(...);
– G4LogicalVolume* logicalbox = new G4LogicalVolume(…);• logicalbox->SetVisAttributes(..);
– G4VPhysicalVolume* physicalworld = new G4PVPlacement(…);
– repeated translation
– repeated rotation• set up the rotation matrix with G4RotationMatrix• for loop • G4VPhysicalVolume* physicalrottrap = new
G4PVPlacement(G4Transform3D(rotationMatrix), G4THreeVector(…),…);
C++ code generation - continued
• Replica; translation G4PVReplica(..);
• Replica; axially sliced
• return physicalworld;
• }
• Naming convention: if X, Y are names in the tables, their instances have names like; – elementX
– solidY
– logicalY
– physicalY
– rotMatrixY
– copyY
– etc.
Compile and visualize
• Compile the generated C++ codes and link with the Geant4 libraries• Any visualization system provided by Geant4 can be used• Rapid cycling of edit, compile and view
An example visualized
GPE: Geant4 Physics Editor
• Doublets of a particle and an associated process
• Three methods; ConstructParticle(), ConstructProcess() and SetCuts() must be implemented.
• Two separate physics tables– Electromagnetic physics table
• Table of relevant particles
• Table of electromagnetic processes
– Hadronic physics table (under construction)• Table of relevant particles
• Table of hadronic processes
• Two processes; transportation and decay are included by default.
• Two processes; parametrization and optical photons are not implemented.
GPE• Particles and processes can be copied from the
respective tables.
• The default ordering parameters are copied.
Table of particles for electromagnetic and “default” processes
• Select a particle
• select all particles of a category
• select all “shortlived” particles
Table of electromagnetic processes• Standard, muon, X rays, low energy electromagnetic processes are visua
lly classified in the table.
• “Null” is to reset to the default (transportation and decay) processes
• The default ordering parameters (AtRest, AlongStep and PostStep) of a process are copied to the physics table.
Generation of C++ codes; particle
• ConstructParticle(){– ConstructBosons();
• G4Gamma::GammaDefinition(); etc.
– ConstructLeptons();• G4AntiNeutrinoMu::AntiNeutrinoMuDefinition(); etc.
– ConstructMesons();
– ConstructBaryons();
– ConstructIons();
– ConstructShortLiveds();
– }
• Scan through the first column and call static member functions only once for respective particle
Generation of C++ codes; processes• ConstructProcess(){
– AddTransportation(); // always included
– ConstructEM(); // code generated as below
– ConstructGeneral(); } // always included
• Include all necessary class definition files by scanning the second column.– #include “G4eplusAnnihilation.hh” etc.
• Start the particle iterator– if (particleName == “e-”){pmanager->AddProcess(new G4eIonisation(),
ordInactive, 2, 2); for each row in the physics table
– HadronIonisation and MultipleScattering are always added for relevant particles.
• SetCuts(){– SetCutsWithDefault();}
Platforms for GGE and GPE
• JDK1.2.2 on Windows/95/98/NT
• JDK1.2.2 on Linux with glibc2.1.2, f.e., Redhat-6.1
• JDK1.2-preview2 on Linux with older glibc2.0
• Outputs: – *.cc and *.hh files
– persistent files ; material, geometry, physics
Conclusions
• Tabular editors are not only pedagogic but also practical
• Scope and limit of applicability were shown
• Reuse; material and logical volume– MGA for STEP input file by Southampton group
• Possible directions of development– libraries of common detectors like chambers etc.
– how to incorporate hit and digitization for such libraries
Particle table for hadronic processes
Table of the hadronic Particles
•