====== Geometry ====== The geometry files (which are root files) can be found in primasoft/geant4/geometry. The geometry you want to use in your simulation can be set in the primaf4sim.conf file. ===== Compiling and creating a root geometry file ===== In order to create the root geometry files, go to the according directory and do: cd primasoft/geant4/geometry cmake . make Now your output should be something like this: [ 45%] Built target PrimaGeom [ 63%] Built target test_proto16 [ 81%] Built target build_tchamber [100%] Built target build_proto16 Here, the executables are listed. By executing for example: ./build_tchamber the file targetChamber.root is created, which can be used in the simulation. ===== How to include a new part ===== - Check for the material you want to use in PRIMAMaterials.h and PRIMAMaterials.cc. If the material does not exist, add it - Make a new .h and .cc file according to PRIMAProto16Constructor, where the geometry of your object is defined - Create a new build.cxx, where your new TGeoVolumeAssembly is included - Modify your CmakeLists.txt - Make and execute your new executable → a new .root file is created - Use cmake --build. and ./"your executable here" Useful links: * [[https://root.cern.ch/how/how-draw-objects|how-to-draw-objects]] * [[https://root.cern.ch/root/htmldoc/guides/users-guide/ROOTUsersGuide.html#the-geometry-package|geometry-package]] * [[https://cmake.org/cmake/help/latest/guide/tutorial/index.html]] * [[https://root.cern.ch/root/htmldoc/guides/users-guide/Geometry.html]] ==== Have a look at the geometry ==== To check, weather your geometry is correct, have look at it. Open the root file and the TBrowser: primasoft/geant4/geometry$ root -l targetChamber.root root [1] TBrowser b Now open the folders until you can see the different Volume folders.\\ With a right-click on for example Master Volume you can select Draw and a new window will be opened. Enter "ogl" as option and press "OK". Now your geometry is displayed by the GL viewer. == Scene interaction with GL viewer: == * Left mouse button: ROTATE (ORBIT) the scene by holding the mouse button and moving the mouse * w: wireframe mode * e: switch between dark/light color-set * r: filled polygons mode * t: outline mode More interaction modes are explained in the help menu.