LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
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 
63 using namespace boost::python;
64 
65 // ====================================================================
66 // thin wrappers
67 // ====================================================================
68 namespace pyPhysicsLists {
69 
70  static std::vector<std::string> plList;
71 
72 void AddPhysicsList(const G4String& plname) {
73  plList.push_back(plname);
74 }
75 
77  for (G4int i=0; i< plList.size(); i++) {
78  G4cout << plList[i] << G4endl;
79  }
80 }
81 
82 }
83 
84 using namespace pyPhysicsLists;
85 
86 // ====================================================================
87 // module definition
88 // ====================================================================
90 {
91  def("ListPhysicsList", ListPhysicsList);
92 
93  ADD_PHYSICS_LIST(FTFP_BERT);
94  ADD_PHYSICS_LIST(FTFP_BERT_ATL);
95  ADD_PHYSICS_LIST(FTFP_BERT_HP);
96  ADD_PHYSICS_LIST(FTFP_BERT_TRV);
97  ADD_PHYSICS_LIST(FTFP_INCLXX);
98  ADD_PHYSICS_LIST(FTFP_INCLXX_HP);
99  ADD_PHYSICS_LIST(FTF_BIC);
100  ADD_PHYSICS_LIST(LBE);
101  ADD_PHYSICS_LIST(NuBeam);
102  ADD_PHYSICS_LIST(QBBC);
103  ADD_PHYSICS_LIST(QGSP_BERT);
104  ADD_PHYSICS_LIST(QGSP_BERT_HP);
105  ADD_PHYSICS_LIST(QGSP_BIC);
106  ADD_PHYSICS_LIST(QGSP_BIC_AllHP);
107  ADD_PHYSICS_LIST(QGSP_BIC_HP);
108  ADD_PHYSICS_LIST(QGSP_FTFP_BERT);
109  ADD_PHYSICS_LIST(QGSP_INCLXX);
110  ADD_PHYSICS_LIST(QGSP_INCLXX_HP);
111  ADD_PHYSICS_LIST(QGS_BIC);
112  ADD_PHYSICS_LIST(Shielding);
113 
114  // sort PL vector
115  std::sort(plList.begin(), plList.end());
116 }
static std::vector< std::string > plList
void AddPhysicsList(const G4String &plname)
#define ADD_PHYSICS_LIST(plname)
void ListPhysicsList()
void export_PhysicsLists()