diff --git a/FullSimLight/src/FSLEventAction.cc b/FullSimLight/src/FSLEventAction.cc index 3756b4d3d16ac1009a2742b01792873360e49c7f..e1c1f0ca4f8256382a7810e52220610864756168 100644 --- a/FullSimLight/src/FSLEventAction.cc +++ b/FullSimLight/src/FSLEventAction.cc @@ -33,7 +33,8 @@ FSLEventAction::FSLEventAction() : G4UserEventAction(), fIsSpecialScoring(false) FSLEventAction::~FSLEventAction() { } -void FSLEventAction::BeginOfEventAction(const G4Event*) { +void FSLEventAction::BeginOfEventAction(const G4Event* evt) { + G4cout<<"FullSimLight, processing event: "<<evt->GetEventID()<<G4endl; fEventData.Clear(); if (fIsSpecialScoring) { fEventDataSpecialRegion.Clear(); diff --git a/GeoModelTools/GMSTATISTICS/.DS_Store b/GeoModelTools/GMSTATISTICS/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..9a874b5768f336915163bb88cd434575b859f936 Binary files /dev/null and b/GeoModelTools/GMSTATISTICS/.DS_Store differ diff --git a/GeoModelTools/GeoModelXML/.DS_Store b/GeoModelTools/GeoModelXML/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..ce5ac80d6eb3fc39e70e3f0a50986c843af8e8d0 Binary files /dev/null and b/GeoModelTools/GeoModelXML/.DS_Store differ diff --git a/GeoModelTools/GeoModelXML/GeoModelXml/.DS_Store b/GeoModelTools/GeoModelXML/GeoModelXml/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..ddc4833b0926a02f2411de57a95b84fbe932f2d3 Binary files /dev/null and b/GeoModelTools/GeoModelXML/GeoModelXml/.DS_Store differ diff --git a/documentation/docs/dev/build_fullsimlight.md b/documentation/docs/dev/build_fullsimlight.md index b7f9fb43193272923006da318b4b9154264d262e..18d1e7e464f5c9d0c553827da8f123e97e5bae72 100644 --- a/documentation/docs/dev/build_fullsimlight.md +++ b/documentation/docs/dev/build_fullsimlight.md @@ -1,11 +1,55 @@ -# How to build FullSimLight +# How to build FullSimLight and FSL # Prerequisites -FullSimLight depends on Geant4, Xerces-C and HDF5. Additionally, the user might want to install [Pythia8] (http://home.thep.lu.se/Pythia/ ) and [HepMC3](https://gitlab.cern.ch/hepmc/HepMC3) as optional dependencies. +FullSimLight depends on Geant4, Xerces-C and HDF5. Additionally, the user might want to install [Pythia8] (http://home.thep.lu.se/Pythia/) and [HepMC3](https://gitlab.cern.ch/hepmc/HepMC3) as optional dependencies. + +## Geant4 +There is no specific requirement for the version of Geant4 to use with FullSimLight. Our team try to keep FullSimLight compatible with the most recent Geant4 versions. If you have any issues with a specific Geant4 version please open a ticket at the following [link](https://gitlab.cern.ch/GeoModelDev/GeoModel/-/issues). + +Before installing Geant4, check at the Geant4 website the pre-requisites needed [here](http://geant4-userdoc.web.cern.ch/geant4-userdoc/UsersGuides/InstallationGuide/html/gettingstarted.html) +An installation of Geant4 including the GDML extension (which requires the XercesC version >=3 package installed in the system) is required, i.e. the Geant4 toolkit must be built with the -DGEANT4_USE_GDML=ON CMake option. + +###Xerces-C installation +Please choose the Xerces-C installation that is required by the Geant4 version that you are installing. As an example here we show how to install xerces-c 3.2.2. + +```bash +wget https://archive.apache.org/dist/xerces/c/3/sources/xerces-c-3.2.2.tar.gz +tar -xf xerces-c-3.2.2.tar.gz +cd xerces-c-3.2.2 ; mkdir build ; cd build +cmake -DCMAKE_INSTALL_PREFIX=../../install ../ +make -j8 ; make install +``` + +Now that you have installed xerces-c, clone the [Geant4 repository](https://gitlab.cern.ch/geant4/geant4.git), then: + +```bash +git clone https://gitlab.cern.ch/geant4/geant4.git +cd geant4 +git tag +``` +Choose the release you want to use, i.e. Geant4-11.2.1, and checkout the corresponding tag: +```bash +git checkout tags/v11.2.1 +mkdir build ; cd build +cmake -DCMAKE_INSTALL_PREFIX=../../install -DCMAKE_BUILD_TYPE=Release ../ -DGEANT4_INSTALL_DATA=ON -DGEANT4_USE_GDML=ON -DGEANT4_BUILD_MULTITHREADED=ON +make -j8 ; make install +``` +We suggest to build Geant4 with the multithreading support on, so that you can take advantage it and run your simulation in multithreaded mode. + +Before running ./fullSimLight and all the tools that depend on Geant4 make sure to source the geant4.sh file to set correctly all the Geant4 environment variables. + +##Pythia installation +If you wish to run FullSimLight with Pythia events you will need to install Pythia in your system. Follow the instructions at the [official website](http://home.thep.lu.se/Pythia/) for that. +In order to build FullSimLight and FSL with Pythia you should then use the following flag: `-DGEOMODEL_USE_PYTHIA=ON` (see the following section for more details). + +##HepMC3 installation +If you wish to run FullSimLight with HepMC3 events you will need to install HepMC3 in your system. Follow the instructions at the [official repository](https://gitlab.cern.ch/hepmc/HepMC3) for that. +In order to build FullSimLight and FSL with HepMC3 you should then use the following flag: `-DGEOMODEL_USE_HEPCM3=ON`(see the following section for more details). + # Standard build -FullSimLight can be built as part of the GeoModel build, by enabling the related configuration flag `GEOMODEL_BUILD_FULLSIMLIGHT`: +FullSimLight can be built as part of the GeoModel build, by enabling the related configuration flag `GEOMODEL_BUILD_FULLSIMLIGHT`. ```bash cmake -DGEOMODEL_BUILD_FULLSIMLIGHT=1 ../GeoModel @@ -17,11 +61,12 @@ That will compile the base GeoModel packages (*i.e.*, `GeoModelCore`, `GeoModelI This will install all the base libraries and the `fullSimLight` executable in the standard installation path (*e.g.*, `/usr/local` on macOS). If you want to have a local installation, see below. + # Local installation You can install FullSimLight in a local folder as well. This let you remove everything by simply deleting the local folder, and lets you have multiple versions of the packages installed. -You can install iFullSimLight locally by using the `CMAKE_INSTALL_PREFIX` option. In the example below, we instruct CMake to install everything inside a local folder named `install` besides the `build` folder where we are launching CMake from: +You can install FullSimLight locally by using the `CMAKE_INSTALL_PREFIX` option. In the example below, we instruct CMake to install everything inside a local folder named `install` besides the `build` folder where we are launching CMake from: ```bash cmake -DGEOMODEL_BUILD_FULLSIMLIGHT=1 -DCMAKE_INSTALL_PREFIX=../install ../GeoModel @@ -35,6 +80,48 @@ At the end, you will find all the libraries and executables installed in: ls ../install ``` +# Build FSL + +FSL is the graphical user interface to FullSimLight. It allows you to configure your simulation and run it by using a json configuration file. Similarly to what said above, if you want to build FSL, you will have to enable the related configuration flag `GEOMODEL_BUILD_FSL`. If you enable the build of FSL automatically also FullSimLight will be built. + +```bash +cmake -DGEOMODEL_BUILD_FSL=1 ../GeoModel +make -j +make install +``` + +## How to build FullSimLight and FSL with Pythia +In order to build FullSimLight and FSL with Pythia you will need to activate the appropriate flag: +```bash +cmake -DGEOMODEL_BUILD_FULLSIMLIGHT=1 -DGEOMODEL_USE_PYTHIA=ON -DCMAKE_INSTALL_PREFIX=../install ../GeoModel +make -j +make install +``` + +If you installed Pythia in a local folder, CMake might not be able to find it. In this case you should specify manually the path to the include directory and to the library. + +```bash +cmake -DGEOMODEL_BUILD_FULLSIMLIGHT=1 -DGEOMODEL_USE_PYTHIA=ON - DPythia_INCLUDE_DIR=<path_to_your_Pythia_install_dir>/include -DPythia_LIBRARY=<path_to_your_Pythia_install_dir>/lib/<library name, i.e. libPythia.so/dylib> -DCMAKE_INSTALL_PREFIX=../install ../GeoModel +make -j +make install +``` + +## How to build FullSimLight and FSL with HepMC3 +In order to build FullSimLight and FSL with HepMC3 you will need to activate the appropriate flag: +```bash +cmake -DGEOMODEL_BUILD_FULLSIMLIGHT=1 -DGEOMODEL_USE_HEPMC3 =ON -DCMAKE_INSTALL_PREFIX=../install ../GeoModel +make -j +make install +``` + +If you installed HepMC3 in a local folder, CMake might not be able to find it. In this case you should specify manually the path to the include directory and to the library. + +```bash +cmake -DGEOMODEL_BUILD_FULLSIMLIGHT=1 -DGEOMODEL_USE_HEPMC3=ON -DHEPMC3_LIB=<path_to_your_HepMC3_install_dir>/lib/<library name, i.e. libHepMC3.so/dylib> -DCMAKE_INSTALL_PREFIX=../install ../GeoModel +make -j +make install +``` + ## How to use a custom version of Xerces-C The Geant4 GDML format depends on the Xerces-C library. Therefore, different Geant4 releases can use different versions of the Xerces-C library.