Cexmc stands for Charge EXchange Monte Carlo. The program was used to simulate real experiments in Petersburg Nuclear Physics Institute (PNPI, Russia). Here are links to detailed User's Manual and explanatory images of the experimental setup:

On the rest of this page only compilation of the program and its run modes will be explained.


Basic modules of Cexmc must compile with Geant4 version 9.4. Cexmc won't compile with older versions of Geant4. Cexmc consists of several optional and mandatory modules, optional modules can be enabled or disabled in the makefile by setting dedicated macros. Modules may involve additional dependencies. In the following table the dependencies and related modules are shown.

Dependency Requirement Makefile Macro Module Comment
boost::serialize Optional CEXMC_USE_PERSISTENCY Persistency used when (de)serialization of events and run data
boost::split Optional CEXMC_USE_PERSISTENCY Main used when parsing command line arguments related to persistency module
boost::spirit Optional CEXMC_USE_CUSTOM_FILTER Custom filter used in custom filter engine
cernlib Optional CEXMC_USE_GENBOD Main user can choose native GENBOD() as phase space generator
CERN ROOT Optional CEXMC_USE_ROOT Histograming used in histograming
CERN ROOT / Qt binding Optional CEXMC_USE_ROOTQT Histograming used for live histograms in Qt sessions

The persistency module is compatible with a pretty old boost::serialize version (compilation was tested under Scientific Linux 4.8 with gcc 3.4.6 and boost version 1.32). Custom filter requires a newer boost as far as it uses modern boost::spirit library which requires boost version 1.37 and higher.

Presence of CERN ROOT libraries is tested automatically in the makefile, but it is possible to disable or enable the histograming framework manually using flag CEXMC_USE_HISTOGRAMING in the makefile. Compilation of visualization modules and interactive sessions depends on whether standard Geant4 macros like G4VIS_USE, G4UI_USE, G4UI_USE_TCSH and G4UI_USE_QT have been set. If boost is installed in a special path in your system then you may need to properly set environment variables BOOST_INCLUDE_PATH and BOOST_LIBRARY_PATH which denote directories where boost include files and libraries are located.

Notice 1: ChargeExchangeMC in Geant4 release 9.4 production has a defect. To compile the program you will need the patch: ChargeExchangeMC.patch

To apply the patch move it into ChargeExchangeMC directory and print in a terminal:

patch -p0 < ChargeExchangeMC.patch

Notice 2: ChargeExchangeMC shipped with Geant4 9.5 may fail to compile with gcc 4.6.x. The following patch fixes the error: ChargeExchange-20111226.patch

Also this patch fixes compilation errors in optional Custom filter module for boost v. 1.47 (but i suspect that it won't fix errors for recent boost v. 1.48 as they moved to the new boost::phoenix version 3.0 which requires using Boost::ResultOf protocol in boost::phoenix::function).

Run modes

Run modes are set from command-line options. To see available command-line options type in terminal cexmc -h or just cexmc. Here is list of run modes categorized by type of interaction with user:
  • Batch mode. The simplest mode without any interaction with user. No command line option is required.
  • Interactive mode. The program provides an interactive shell. To run in the interactive mode command line option -i must be specified.
  • Graphical Qt mode. This mode is specified by command line option -g.

List of run modes categorized by task:

  • Straight mode (or Monte Carlo mode). The program will read preinit and init macros, then calculate acceptances and (optionally) save data in project files. Project files are saved in a directory defined by environment variable CEXMC_PROJECTS_DIR (or in the current directory if it is not defined), name of the project is specified by option -w. Preinit and init macros are set by options -p and -m respectively. In the straight mode preinit macro must be specified explicitly, as far as desired production model can be instantiated only in preinit phase.
  • Replay mode (or Read project mode). In this mode the program will not use common Geant4's event loop. Instead, it will sequentially read event data from an existing project and pass them into CexmcEventAction::EndOfEventAction(). The read project is specified by option -r. This mode is useful when user wants to recalculate data from an existing project with different conditions (for example with different reconstruction parameters) or apply a custom filter. The results of run can be written again into another project.
  • Show results mode (or Output mode). The program will output various data from an existing project (specified by option -r). Type(s) of data are specified in option -o. For example, to show results of a run user can specify -orun in command line. To show events, geometry and run results user can specify -oevents,geom,run.

-- LucianoPandola - 21 Oct 2014

Topic attachments
I Attachment History Action Size Date Who Comment
PDFpdf CexmcSetupImages.pdf r1 manage 704.5 K 2014-10-21 - 13:30 LucianoPandola  
PDFpdf CexmcUsersManual.pdf r1 manage 531.5 K 2014-10-21 - 13:30 LucianoPandola  
Unknown file formatpatch ChargeExchange-20111226.patch r1 manage 5.7 K 2014-10-21 - 13:33 LucianoPandola  
Unknown file formatpatch ChargeExchangeMC.patch r1 manage 7.8 K 2014-10-21 - 13:30 LucianoPandola  
Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r1 - 2014-10-21 - LucianoPandola
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Geant4 All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2022 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback