diff --git a/DDG4/examples/readHEPMC.py b/DDG4/examples/readHEPMC.py index df174fcbea3aa9bc79c2004b38b491b5903c15cb..525d5f0c8a637fa21ebdaf5af1003c5f4c19ee4e 100644 --- a/DDG4/examples/readHEPMC.py +++ b/DDG4/examples/readHEPMC.py @@ -18,10 +18,7 @@ def run(input_file): gen.Input = "Geant4EventReaderHepMC|"+input_file gen.OutputLevel = Output.DEBUG gen.HaveAbort = False - prim_vtx = DDG4.Geant4Vertex() - prim_vtx.x = 0.0 - prim_vtx.y = 0.0 - prim_vtx.z = 0.0 + prim_vtx = DDG4.std_vector('DD4hep::Simulation::Geant4Vertex*')() parts = gen.new_particles() ret = 1 while ret: @@ -31,11 +28,14 @@ def run(input_file): print '\nException: readParticles:',str(X) ret = None if ret: + for v in prim_vtx: + print 'Mask:%04X (X:%8.2g,Y:%8.2g,Z:%8.2g) time:%8.2g Outgoing:%4d particles'%\ + (v.mask,v.x,v.y,v.z,v.time,len(v.out),) for p in parts: - print 'ID:%5d PDG-id:%8d Charge:%1d Mass:%8.3g Momentum:(%8.2g,%8.2g,%8.2g) '\ + print 'Mask:%04X ID:%5d PDG-id:%8d Charge:%1d Mass:%8.3g Momentum:(%8.2g,%8.2g,%8.2g) '\ 'Vertex:(%8.2g,%8.2g,%8.2g) NDau:%2d Status:%08X'%\ - (p.id,p.pdgID,int(p.charge3()),p.mass,p.psx,p.psy,p.psz,\ - p.vsx,p.vsy,p.vsz,len(p.daughters),p.status) + (p.mask,p.id,p.pdgID,int(p.charge3()),p.mass,p.psx,p.psy,p.psz,\ + p.vsx,p.vsy,p.vsz,len(p.daughters),p.status,) parts.clear() else: print '*** End of recordset or read failure.....' diff --git a/DDG4/include/DDG4/Geant4Particle.h b/DDG4/include/DDG4/Geant4Particle.h index f88e083aeba66afb8d4db6b6086efb07b0d5664e..97393a3f769f91acb102cdc52736985b6c511e71 100644 --- a/DDG4/include/DDG4/Geant4Particle.h +++ b/DDG4/include/DDG4/Geant4Particle.h @@ -1,4 +1,3 @@ -// $Id: $ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/DDG4/include/DDG4/Geant4ParticleHandler.h b/DDG4/include/DDG4/Geant4ParticleHandler.h index 35fbf5a70aa370c6ce1d500c724da0467281768e..5bc85a2b08bd2b23f713585992d1b923a69d2b43 100644 --- a/DDG4/include/DDG4/Geant4ParticleHandler.h +++ b/DDG4/include/DDG4/Geant4ParticleHandler.h @@ -1,4 +1,3 @@ -// $Id: $ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/DDG4/include/DDG4/Geant4ParticlePrint.h b/DDG4/include/DDG4/Geant4ParticlePrint.h index c74ef5beeba48d8f7616d4ebbd97a2dd6f76cca7..90e09d00790a32361cee5ffa5f7e8b263407755d 100644 --- a/DDG4/include/DDG4/Geant4ParticlePrint.h +++ b/DDG4/include/DDG4/Geant4ParticlePrint.h @@ -1,4 +1,3 @@ -// $Id: $ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/DDG4/include/DDG4/Geant4PhysicsConstructor.h b/DDG4/include/DDG4/Geant4PhysicsConstructor.h index 796d85437d33fdf075033297a2848c87b4ca90e8..4262a5b36bc1cdede53b2e6c15815866af677efa 100644 --- a/DDG4/include/DDG4/Geant4PhysicsConstructor.h +++ b/DDG4/include/DDG4/Geant4PhysicsConstructor.h @@ -1,3 +1,4 @@ +//========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN) @@ -11,7 +12,6 @@ // \version 1.0 // //========================================================================== -// $Id$ #ifndef DDG4_GEANT4PHYSICSCONSTRUCTOR_H #define DDG4_GEANT4PHYSICSCONSTRUCTOR_H 1 diff --git a/DDG4/include/DDG4/Geant4Primary.h b/DDG4/include/DDG4/Geant4Primary.h index 162e42ea64573b0b146e2a41b75a22ec10a0b0c1..86c1d45203f1b2b2e1acb5370cb0a57b861089ac 100644 --- a/DDG4/include/DDG4/Geant4Primary.h +++ b/DDG4/include/DDG4/Geant4Primary.h @@ -1,4 +1,3 @@ -// $Id: $ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/DDG4/include/DDG4/Geant4PrimaryHandler.h b/DDG4/include/DDG4/Geant4PrimaryHandler.h index 4cb4b7f45ca1d3832c8b2b03b1c846b312b27bbd..726a62c5cb35068766cd83982fbc35bc9bcf0260 100644 --- a/DDG4/include/DDG4/Geant4PrimaryHandler.h +++ b/DDG4/include/DDG4/Geant4PrimaryHandler.h @@ -1,4 +1,3 @@ -// $Id: $ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/DDG4/include/DDG4/Geant4Primitives.h b/DDG4/include/DDG4/Geant4Primitives.h index 917309a5c7ef4f8053e00a482ff9d5baf0b84431..aa4fb192a3e21d41187b57b9a536d4eb9330b260 100644 --- a/DDG4/include/DDG4/Geant4Primitives.h +++ b/DDG4/include/DDG4/Geant4Primitives.h @@ -1,4 +1,3 @@ -// $Id: $ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/DDG4/include/DDG4/Geant4Random.h b/DDG4/include/DDG4/Geant4Random.h index 1085153a402943f14f2728d7b600e0a5a30dd4c6..a1cb78cce6fa2ebeb0011cc549c9a7c0b6d2f83d 100644 --- a/DDG4/include/DDG4/Geant4Random.h +++ b/DDG4/include/DDG4/Geant4Random.h @@ -1,4 +1,3 @@ -// $Id: $ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/DDG4/include/DDG4/Geant4Vertex.h b/DDG4/include/DDG4/Geant4Vertex.h index e3077f49fd0984d95ae0839b8f79d5c7e71ce96e..99887430e96c92dfb561e17f5a698dd3896a0797 100644 --- a/DDG4/include/DDG4/Geant4Vertex.h +++ b/DDG4/include/DDG4/Geant4Vertex.h @@ -1,4 +1,3 @@ -// $Id: $ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/DDG4/python/DD4hep.py b/DDG4/python/DD4hep.py index e869fe74c047d9c6d10b1c3103e8ac5bee4ecfc4..03cfeb764d4b05752570b279803e6ee38b258c0f 100644 --- a/DDG4/python/DD4hep.py +++ b/DDG4/python/DD4hep.py @@ -87,6 +87,18 @@ class _Levels: self.ALWAYS=7 OutputLevel = _Levels() +#------------------------Generic STL stuff can be accessed using std: ----- +# +#-- e.g. Create an instance of std::vector<DD4hep::Simulation::Geant4Vertex*>: +# >>> v=DD4hep.vector('DD4hep::Simulation::Geant4Vertex*')() +# +#--------------------------------------------------------------------------- +import cppyy +std = cppyy.gbl.std +std_vector = std.vector +std_list = std.list +std_map = std.map +std_pair = std.pair #--------------------------------------------------------------------------- Core = DD4hep Geo = DD4hep.Geometry diff --git a/DDG4/python/DDG4.py b/DDG4/python/DDG4.py index 4f4cf4f8d9424bce63c4fd8fa589ceaa682648cc..558750f6d844dd3fdf2f13ebeef9b876effda876 100644 --- a/DDG4/python/DDG4.py +++ b/DDG4/python/DDG4.py @@ -49,6 +49,7 @@ except Exception as X: print '| %-100s |'%(str(X),) print '+--%-100s--+'%(100*'-',) exit(1) + from ROOT import CLHEP as CLHEP Core = DD4hep Sim = DD4hep.Simulation @@ -56,6 +57,7 @@ Simulation = DD4hep.Simulation Kernel = Sim.KernelHandle Interface = Sim.Geant4ActionCreation LCDD = Geo.LCDD +from DD4hep import std, std_vector, std_list, std_map, std_pair #--------------------------------------------------------------------------- def _constant(self,name):