dbselect
Loading...
Searching...
No Matches
test_dbselect.cc File Reference

Example program demonstrating how to use the dbselect module in GUI or CLI mode. More...

#include "dbselectView.h"
#include "dbselect_options.h"
#include <QApplication>
#include <QMainWindow>
#include <QTimer>
#include "G4RunManagerFactory.hh"
#include "QBBC.hh"
Include dependency graph for test_dbselect.cc:

Go to the source code of this file.

Functions

int main (int argc, char *argv[])
 Program entry point for the dbselect example.
 

Detailed Description

Summary: This example creates a GOptions instance using dbselect::defineOptions(), initializes logging for the "dbselect" logger, constructs a GDetectorConstruction, and then:

  • if --gui is enabled, creates a Qt window hosting DBSelectView and demonstrates a timed geometry reload and quit,
  • otherwise runs in CLI mode (currently a minimal stub in this example).

Typical usage:

# GUI mode
test_dbselect --gui --sql my_geometry.sqlite --experiment clas12
# CLI mode
test_dbselect --sql my_geometry.sqlite --experiment clas12

Notes:

  • Qt types (e.g. QApplication, QMainWindow, QTimer) are used only when --gui is set.
  • Geant4 initialization in this example uses G4RunManagerFactory and QBBC.

Definition in file test_dbselect.cc.

Function Documentation

◆ main()

int main ( int argc,
char * argv[] )

Responsibilities:

  • Build a shared GOptions configuration from argc/argv using dbselect::defineOptions().
  • Initialize logging using the dbselect logger name.
  • Set up a Geant4 run manager and a physics list (required by the detector construction path).
  • If --gui is enabled:
    • start a Qt application,
    • show a main window hosting DBSelectView,
    • schedule a geometry reload and a timed quit via QTimer.
  • Otherwise:
    • run in CLI mode (currently a minimal stub returning success).
Parameters
argcStandard command-line argument count.
argvStandard command-line argument vector.
Returns
Application exit code (Qt loop exit code in GUI mode, otherwise EXIT_SUCCESS).

Definition at line 62 of file test_dbselect.cc.