Message: RE: Brachytherapy example: TG43_relative_dose.C issue Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None RE: Brachytherapy example: TG43_relative_dose.C issue 

Forum: Medical Applications
Re: Question Brachytherapy example: TG43_relative_dose.C issue (Lara Mason)
Date: 10 Apr, 2018
From: Susanna <Susanna>

Dear Lara,

I executed the example and I did not find any problem.
I list here the steps to undertake:
1) compile the brachytherapy with the analysis component on, e.g.:
> cmake -DWITH_ANALYSIS_USE=ON -DGeant4_DIR=PATH/TO/geant4.10.03 PATH_TO/brachytherapy 
> make
2) run :
./Brachy FlexiSourceMacro.mac  (I suggest to increase the number of events, e.g. 10^6 at least)
The output of the simulation is brachytherapy.root. Check you have it. 
3) root TG43_relative_dose.C
Execute the root macro in the same directory where you have brachytherapy.root. This will generate geant4_dose.txt from reading brachytherapy.root.  
4) Finally you can use the macro compare.C in the directory "comparison" to compare your simulation results to reference data (granero.txt).  Just copy  your geant4_dose.txt in the comparison directory and execute: root comparison.C
To have a statistically meaningful comparison, you need to generate at least 300 million events in the simulation.

I hope this helps you,

Kind Regards,

-----Original Message-----
From: Lara Mason <> 
Sent: Tuesday, 10 April 2018 10:30 PM
Subject: Brachytherapy example: TG43_relative_dose.C issue

*** Discussion title: Medical Applications

Hi experts,

I'm attempting to use the ROOT macro TG43_relative_dose.C to compare to reference data. When I try to run it out of the box I get the error

Processing TG43_relative_dose.C...
input_line_13:2:6: error: member reference type 'TH2F *' is a pointer; did you mean to use '->'?
libc++abi.dylib: terminating with uncaught exception of type 
libc++cling::CompilationException: Error evaluating expression 

This is complaining about the lines

   Double_t xx_histo = h20.GetXaxis()->GetBinCenter(k);
   Double_t yy_histo = h20.GetYaxis()->GetBinCenter(m);
   Double_t edep_histo=h20.GetBinContent(k, m);

However, when I switch them to

   Double_t xx_histo = h20->GetXaxis()->GetBinCenter(k);
   Double_t yy_histo = h20->GetYaxis()->GetBinCenter(m);
   Double_t edep_histo=h20->GetBinContent(k, m);

And try

root -l TG43_relative_dose.C

again, it just runs indefinitely, returning no output and no errors and never completing.

What am I doing wrong here?

Thanks in advance for your help.


Visit this GEANT4 at message (to reply or unsubscribe) at: 

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 None: Re: Brachytherapy example: TG43_relative_dose.C issue   (Lara Mason - 10 Apr, 2018)
 Add Message Add Message
to: "RE: Brachytherapy example: TG43_relative_dose.C issue"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews

[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]