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)
Re: None RE: Brachytherapy example: TG43_relative_dose.C issue (Susanna)
Date: 10 Apr, 2018
From: Lara Mason <Lara Mason>

Dear Susanna,

Thank you so much for your reply. Iíve followed your steps, but I am still getting this error

laramason@Laras-MacBook-Pro:~/Downloads/Geant4/build-brachytherapy$ root TG43_relative_dose.C
   ------------------------------------------------------------
  | Welcome to ROOT 6.12/06                http://root.cern.ch |
  |                               (c) 1995-2017, The ROOT Team |
  | Built for macosx64                                         |
  | From tag v6-12-06, 9 February 2018                         |
  | Try '.help', '.demo', '.license', '.credits', '.quit'/'.q' |
   ------------------------------------------------------------

root [0]
Processing TG43_relative_dose.C...
input_line_13:2:6: error: member reference type 'TH2F *' is a pointer; did you mean to use '->'?
 (h20.GetXaxis()->GetBinCenter(((*(int*)0x7fff5801f280))))
  ~~~^
     ->
libc++abi.dylib: terminating with uncaught exception of type cling::CompilationException: Error evaluating expression (h20.GetXaxis()->GetBinCenter(((*(int*)0x7fff5801f280))))

brachytherapy.root is present and the histograms within it look reasonable. Could I ask you to confirm that in your TG43_relative_dose.C you have the following 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);

in order to build the energy deposition map? These seem to be the issue.

Thank you so much for your help.

Kind regards,

Lara

On 11 Apr 2018, at 07:20, Susanna Guatelli <susanna@uow.edu.au<mailto:susanna@uow.edu.au>> wrote:

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,
Susanna



-----Original Message-----
From: Lara Mason <lara.mason@live.com<mailto:lara.mason@live.com>>
Sent: Tuesday, 10 April 2018 10:30 PM
To: medical_app-g4hn@slac.stanford.edu<mailto:medical_app-g4hn@slac.stanford.edu>
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 '->'?
(h20.GetXaxis()->GetBinCenter(((*(int*)0x7fff503611d0))))
 ~~~^
    ->
libc++abi.dylib: terminating with uncaught exception of type
libc++cling::CompilationException: Error evaluating expression
libc++(h20.GetXaxis()->GetBinCenter(((*(int*)0x7fff503611d0))))

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.

Lara

-------------------------------------------------------------
Visit this GEANT4 at hypernews.slac.stanford.edu<http://hypernews.slac.stanford.edu> message (to reply or unsubscribe) at:
http://hypernews.slac.stanford.edu/HyperNews/geant4/get/medical_app/409.html



 [ MIME part of type text/html without a name stripped ]

 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 ]