Geant4-11
pyPhysicsLists.cc
Go to the documentation of this file.
1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
10// * *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
17// * *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
25//
26// ====================================================================
27// pyPhysicsLists.cc
28//
29// 2007 Q
30// ====================================================================
31#include <boost/python.hpp>
32#include <vector>
33#include <algorithm>
34#include "FTFP_BERT.hh"
35#include "FTFP_BERT_ATL.hh"
36#include "FTFP_BERT_HP.hh"
37#include "FTFP_BERT_TRV.hh"
38#include "FTFP_INCLXX.hh"
39#include "FTFP_INCLXX_HP.hh"
40#include "FTF_BIC.hh"
41#include "LBE.hh"
42#include "NuBeam.hh"
43#include "QBBC.hh"
44#include "QGSP_BERT.hh"
45#include "QGSP_BERT_HP.hh"
46#include "QGSP_BIC.hh"
47#include "QGSP_BIC_AllHP.hh"
48#include "QGSP_BIC_HP.hh"
49#include "QGSP_FTFP_BERT.hh"
50#include "QGSP_INCLXX.hh"
51#include "QGSP_INCLXX_HP.hh"
52#include "QGS_BIC.hh"
53#include "Shielding.hh"
54
55
56// macro for adding physics lists
57#define ADD_PHYSICS_LIST(plname) \
58 class_<plname, plname*, bases<G4VUserPhysicsList>, boost::noncopyable> \
59 (#plname, #plname " physics list") \
60 ; \
61 AddPhysicsList(#plname);
62
63using namespace boost::python;
64
65// ====================================================================
66// thin wrappers
67// ====================================================================
68namespace pyPhysicsLists {
69
70 static std::vector<std::string> plList;
71
72void AddPhysicsList(const G4String& plname) {
73 plList.push_back(plname);
74}
75
77 for (const auto& p : plList) {
78 G4cout << p << G4endl;
79 }
80}
81
82}
83
84using namespace pyPhysicsLists;
85
86// ====================================================================
87// module definition
88// ====================================================================
90{
91 def("ListPhysicsList", ListPhysicsList);
92
113
114 // sort PL vector
115 std::sort(plList.begin(), plList.end());
116}
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
Definition: LBE.hh:59
Definition: NuBeam.hh:42
Definition: QBBC.hh:44
void ListPhysicsList()
static std::vector< std::string > plList
void AddPhysicsList(const G4String &plname)
void export_PhysicsLists()
#define ADD_PHYSICS_LIST(plname)