Building example B1 to output ROOT file

I have been digging around and attempting to use the G4AnalysisManager to create a .ROOT output for basic example one by editing the RunAction.hh, EventAction.hh files and creating an analysis.hh file (as done here https://indico.cern.ch/event/776050/contributions/3241822/attachments/1789267/2921102/Analysis-v3.pdf).

On my OS X system running VS Code, the root commands contained within these header files don’t seem to be understood by VS Code, and therefore the example can’t be built. What would I have to do to build the example to output a root file?

What errors are you seeing, and which example/Geant4 version are you using?

Fairly new to Geant, using latest 11.0 version, attempting to alter B1 to output a ROOT file instead of the usual output. Im getting dozens of errors when attempting to build the example through VS 2019 in CMake. The only edits to B1’s include header files I made are the ones listed in the link I provided. I tried to build the example after making these edits and the build fails

Thanks, but we still need details of the errors (you can cut and paste the messages here), and can you also post the modifications to the code please?

Note that the tutorial you linked to is for Geant4 10.5 rather than 11. It’s probably best to consult the latest Application Developer Guide, and in particular the section on Analysis

Hello,

In addition, you can also take a look at the example B4 or B5, where analysis is used and do similar in B1.

Best regards,

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.