Update a simulatio to G4 11

Hello, I would update a simulation working on G4 10.7 to G4 11.

Firstly I tried to compile by G411 the simulation as it was for G4 10.7 but I got these errors:

i.e. it couldn’t find
a. g4analysis.hh
b. G4Protoninelasticprocess.hh
c. G4alphaionisation.hh

Then, following what I did for other simulation that I updated from G4 10.7 to G411 (i.e. following this discussion Geant4 11 on cvmf )

I replaced g4analysis.hh by #include "G4AnalysisManager.hh" in addition, in RunAction file I replaced

auto analysisManager = G4Analysis::ManagerInstance("root")

by

auto analysisManager = G4AnalysisManager::Instance();
analysisManager->SetDefaultFileType("root");

now I get these errors

i.e.

  1. G4H1 is not defined (and consequently h1 and h0 are not defined too, because I defined
G4H1* h0 = analysisManager->GetH1(0);
    G4H1* h1 = analysisManager->GetH1(1);
  1. Still missing
    a. G4Protoninelasticprocess.hh
    b. G4alphaionisation.hh

@bmorgan surely you know how to update the simulation
exampleB1.cc (61.0 KB)

B1RunAction.cc (6.0 KB)

Read the Release Notes for both 11.0 and for 11.1. There were many and major changes moving from Geant4 10 to Geant4 11.

If you are looking at examples, then you should be using the examples from the same release, and not from a previous release.

1 Like

Hi @mkelsey sorry I didn’t notice that you replied.

No…I’m not looking to examples. I wrote the simulation for Geant4 10.7, but now I would like to move to update it to Geant4 11…but I get the errors that I wrote in my first message

Please see the first part of my message which you quoted.

This is why the experiment I am on has not yet moved forward to Geant4 11.

Please, replace

G4H1* h0 = analysisManager->GetH1(0);
G4H1* h1 = analysisManager->GetH1(1);

with

auto h0 = analysisManager->GetH1(0);
auto h1 = analysisManager->GetH1(1);

Hello, thanks the both @mkelsey and @ivana
Actually I had to do some important things, then I couldn’t work more to update the simulation (if it is really possible , given that by @mkelsey’s message probably it will be an hard work).
When I’ve time I will check…given that for the moment, it isn’t really needed the update.

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