Tabular Editors for Geant4 Geant4 Geometry Editor and Geant4 Physics Editor

23
Tabular Editors for Geant4 Geant4 Geometry Editor and Geant4 Physics Editor CHEP 2000 at Padova Hajime Yoshida Naruto University of Education

description

Tabular Editors for Geant4 Geant4 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 : G4VUserDetectorConstruction G4VUserPhysicsList - PowerPoint PPT Presentation

Transcript of Tabular Editors for Geant4 Geant4 Geometry Editor and Geant4 Physics Editor

Page 1: Tabular Editors for Geant4 Geant4 Geometry Editor and Geant4 Physics Editor

Tabular Editors for Geant4Geant4 Geometry Editor and

Geant4 Physics Editor

CHEP 2000 at PadovaHajime Yoshida

Naruto University of Education

Page 2: Tabular Editors for Geant4 Geant4 Geometry Editor and Geant4 Physics Editor

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

Page 3: Tabular Editors for Geant4 Geant4 Geometry Editor and Geant4 Physics Editor

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

Page 4: Tabular Editors for Geant4 Geant4 Geometry Editor and Geant4 Physics Editor

GGE’s snapshot on Windows-98

Page 5: Tabular Editors for Geant4 Geant4 Geometry Editor and Geant4 Physics Editor

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

Page 6: Tabular Editors for Geant4 Geant4 Geometry Editor and Geant4 Physics Editor

Material editor• Copy multiple elements to the material table

Page 7: Tabular Editors for Geant4 Geant4 Geometry Editor and Geant4 Physics Editor

Volume Editor• Listbox to choose solid types• Guidance to define the parameters of solids• Mark the materials used by the logical volumes

Page 8: Tabular Editors for Geant4 Geant4 Geometry Editor and Geant4 Physics Editor

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

Page 9: Tabular Editors for Geant4 Geant4 Geometry Editor and Geant4 Physics Editor

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

Page 10: Tabular Editors for Geant4 Geant4 Geometry Editor and Geant4 Physics Editor

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(…),…);

Page 11: Tabular Editors for Geant4 Geant4 Geometry Editor and Geant4 Physics Editor

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.

Page 12: Tabular Editors for Geant4 Geant4 Geometry Editor and Geant4 Physics Editor

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

Page 13: Tabular Editors for Geant4 Geant4 Geometry Editor and Geant4 Physics Editor

An example visualized

Page 14: Tabular Editors for Geant4 Geant4 Geometry Editor and Geant4 Physics Editor

GPE: Geant4 Physics Editor• Doublets of a particle and an associated process• Three methods; ConstructParticle(), ConstructProcess() and Set

Cuts() 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 impl

emented.

Page 15: Tabular Editors for Geant4 Geant4 Geometry Editor and Geant4 Physics Editor

GPE• Particles and processes can be copied from the

respective tables.• The default ordering parameters are copied.

Page 16: Tabular Editors for Geant4 Geant4 Geometry Editor and Geant4 Physics Editor

Table of particles for electromagnetic and “default” processes

• Select a particle• select all particles of a category• select all “shortlived” particles

Page 17: Tabular Editors for Geant4 Geant4 Geometry Editor and Geant4 Physics Editor

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.

Page 18: Tabular Editors for Geant4 Geant4 Geometry Editor and Geant4 Physics Editor

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

Page 19: Tabular Editors for Geant4 Geant4 Geometry Editor and Geant4 Physics Editor

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 part

icles.

• SetCuts(){– SetCutsWithDefault();}

Page 20: Tabular Editors for Geant4 Geant4 Geometry Editor and Geant4 Physics Editor

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

Page 21: Tabular Editors for Geant4 Geant4 Geometry Editor and Geant4 Physics Editor

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

Page 22: Tabular Editors for Geant4 Geant4 Geometry Editor and Geant4 Physics Editor

Particle table for hadronic processes

Page 23: Tabular Editors for Geant4 Geant4 Geometry Editor and Geant4 Physics Editor

Table of the hadronic Particles