Git Product home page Git Product logo

Comments (7)

fmauger avatar fmauger commented on September 25, 2024

Hi Lowerce,
I'm preparing a specific example program with an implementation of a vertex generator based on a Box volume of the G4 geometry... Stay tune !
Regards
frc

from bxdecay0.

fmauger avatar fmauger commented on September 25, 2024

There is now a new example named bxdecay0_g4_ex02 (develop branch).
Please let me know if it helps you as is.
Regards
frc

from bxdecay0.

fmauger avatar fmauger commented on September 25, 2024

Example https://github.com/BxCppDev/bxdecay0/tree/develop/extensions/bxdecay0_g4/examples/bxdecay0_g4_ex02 has been updated and now includes a vertex generator class which loads vertex coordinates from a file. See the main program bxdecay0_g4_ex02.cc to activate or not this feature.

from bxdecay0.

Lowerce avatar Lowerce commented on September 25, 2024

Thanks a lot for your example!
I learned a lot about vertex generator from your ex02.

P.S.
It seems that AddDaughter in DetectorConstruction.cc is not needed which causes double Source and SourceHole in World which are shown in Scene tree of Geant4 UI. And maybe some visual settings in vis.mac or Co60.mac should be changed to display the trajectory correctly (I can not use default visual settings to show that in my G4 environment).

Best regards,
Lowerce

from bxdecay0.

fmauger avatar fmauger commented on September 25, 2024

I understand that AddDaughter is redundant to declare a daughter physical volume and probably bad practise in new version of G4... so I'll remove it. Thanks for the hint.
Best
frc

from bxdecay0.

Lowerce avatar Lowerce commented on September 25, 2024

Thanks again for your detailed example about vertex generator ! So I will close this issue now.
And sorry for my ignorance of the feature in early version of Geant4.

Best regards,
Lowerce

from bxdecay0.

fmauger avatar fmauger commented on September 25, 2024

You're welcome.
In fact, it was my ignorance of new practises in G4.10.X .
Basically, the management of some dynamically objects in G4 craps ("x = new XXX" but no "delete x", and no usage of smart pointers or references which would make things safer). That is not really orthodox programming in terms of memory management sanity and standard OOP practises but we have to live with that!
Regards
frc

from bxdecay0.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.