Geant4  9.6.p02
 All Classes 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,v 1.13 2010-12-02 08:24:22 kmura Exp $
27 // $Name: not supported by cvs2svn $
28 // ====================================================================
29 // pyPhysicsLists.cc
30 //
31 // 2007 Q
32 // ====================================================================
33 #include <boost/python.hpp>
34 #include "G4Version.hh"
35 #include <vector>
36 #include <algorithm>
37 
40 
41 #include "CHIPS.hh"
42 #include "CHIPS_HP.hh"
43 #include "FTFP_BERT.hh"
44 //#include "FTFP_BERT_EMV.hh"
45 #include "FTFP_BERT_EMX.hh"
46 #include "FTFP_BERT_TRV.hh"
47 #include "FTF_BIC.hh"
48 #include "LBE.hh"
49 #include "LHEP.hh"
50 #include "LHEP_EMV.hh"
51 #include "QBBC.hh"
52 #include "QGSC_BERT.hh"
53 #include "QGSC_CHIPS.hh"
54 #include "QGSP.hh"
55 #include "QGSP_BERT.hh"
56 #include "QGSP_BERT_95.hh"
57 #include "QGSP_BERT_95XS.hh"
58 #include "QGSP_BERT_CHIPS.hh"
59 #include "QGSP_BERT_EMV.hh"
60 #include "QGSP_BERT_EMX.hh"
61 #include "QGSP_BERT_HP.hh"
62 #include "QGSP_BERT_NOLEP.hh"
63 #include "QGSP_BERT_TRV.hh"
64 #include "QGSP_BIC.hh"
65 #include "QGSP_BIC_EMY.hh"
66 #include "QGSP_BIC_HP.hh"
67 #include "QGSP_FTFP_BERT.hh"
68 #include "QGSP_FTFP_BERT_95.hh"
69 #include "QGSP_FTFP_BERT_95XS.hh"
70 #include "QGSP_INCLXX.hh"
71 //#include "QGSP_QEL.hh"
72 #include "QGS_BIC.hh"
73 
74 
75 // macro for adding physics lists
76 #define ADD_PHYSICS_LIST(plname) \
77  class_<plname, plname*, bases<G4VUserPhysicsList>, boost::noncopyable> \
78  (#plname, #plname " physics list") \
79  ; \
80  AddPhysicsList(#plname);
81 
82 using namespace boost::python;
83 
84 // ====================================================================
85 // thin wrappers
86 // ====================================================================
87 namespace pyPhysicsLists {
88 
89  static std::vector<std::string> plList;
90 
91 void AddPhysicsList(const G4String& plname) {
92  plList.push_back(plname);
93 }
94 
96  for (G4int i=0; i< plList.size(); i++) {
97  G4cout << plList[i] << G4endl;
98  }
99 }
100 
101 };
102 
103 using namespace pyPhysicsLists;
104 
105 // ====================================================================
106 // module definition
107 // ====================================================================
109 {
110  def("ListPhysicsList", ListPhysicsList);
111 
115  //ADD_PHYSICS_LIST(FTFP_BERT_EMV);
142  //ADD_PHYSICS_LIST(QGSP_QEL);
144 
145  // sort PL vector
146  std::sort(plList.begin(), plList.end());
147 }