Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 // $Id: pyPhysicsLists.cc 76884 2013-11-18 12:54:03Z gcosmo $
27 // ====================================================================
28 // pyPhysicsLists.cc
29 //
30 // 2007 Q
31 // ====================================================================
32 #include <boost/python.hpp>
33 #include <vector>
34 #include <algorithm>
35 #include "FTF_BIC.hh"
36 #include "FTFP_BERT.hh"
37 #include "FTFP_BERT_HP.hh"
38 #include "FTFP_BERT_TRV.hh"
39 #include "FTFP_INCLXX.hh"
40 #include "FTFP_INCLXX_HP.hh"
41 #include "LBE.hh"
42 #include "QBBC.hh"
43 #include "QGS_BIC.hh"
44 #include "QGSP_BERT.hh"
45 #include "QGSP_BERT_HP.hh"
46 #include "QGSP_BIC.hh"
47 #include "QGSP_BIC_HP.hh"
48 #include "QGSP_FTFP_BERT.hh"
49 #include "QGSP_INCLXX.hh"
50 #include "QGSP_INCLXX_HP.hh"
51 #include "Shielding.hh"
52 
53 // macro for adding physics lists
54 #define ADD_PHYSICS_LIST(plname) \
55  class_<plname, plname*, bases<G4VUserPhysicsList>, boost::noncopyable> \
56  (#plname, #plname " physics list") \
57  ; \
58  AddPhysicsList(#plname);
59 
60 using namespace boost::python;
61 
62 // ====================================================================
63 // thin wrappers
64 // ====================================================================
65 namespace pyPhysicsLists {
66 
67  static std::vector<std::string> plList;
68 
69 void AddPhysicsList(const G4String& plname) {
70  plList.push_back(plname);
71 }
72 
74  for (G4int i=0; i< plList.size(); i++) {
75  G4cout << plList[i] << G4endl;
76  }
77 }
78 
79 }
80 
81 using namespace pyPhysicsLists;
82 
83 // ====================================================================
84 // module definition
85 // ====================================================================
87 {
88  def("ListPhysicsList", ListPhysicsList);
89 
107 
108  // sort PL vector
109  std::sort(plList.begin(), plList.end());
110 }
subroutine sort(A, N)
Definition: dpm25nuc7.f:4670
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
void export_PhysicsLists()
#define ADD_PHYSICS_LIST(plname)
#define G4endl
Definition: G4ios.hh:61
void ListPhysicsList()
Definition: LBE.hh:61
Definition: QBBC.hh:44
void AddPhysicsList(const G4String &plname)