Hi,
I have attached my root program where I plot the energy deposit vs depth. I use Geant4 simulation to generate data files. If I plot for 100000 events from my data file this program works fine. But I need to run 140009 events. Then I get this error.
root [0] .x TotEVsXYZAll_hexc.C
Number of events process: 100001
Error: Symbol x5et[i] is not defined in current scope FILE:TotEVsXYZAll_hexc.C LINE:85
Error: Binary operator oprand missing FILE:TotEVsXYZAll_hexc.C LINE:85
*** Break *** segmentation violation
My data file is about 40 MB.
Will you be able to help me.
Thank you
Pushpa TotEVsXYZAll_hexc.C (3.15 KB)
ACLiC is the Automatic Compiler of Libraries for CINT. You will need
to modify your code in few ways:
Remove the “gROOT->Reset();”, if you leave this in it will unload
your code before it gets a chance to run.
Add #include’s for each data type you use in your code,
otherwise the compiler will be very unhappy.
Make your script into a function returning void by adding
"void myfunc()" just before the curly braces at the beginning.
Load and compile your code with “.L source_file.C+”, where
the plus sign is what causes ACLiC to be used.
Run your code by calling your function from the command line,
like this: “myfunc();”
Note: You can use .x with the plus sign, but then your function
name has to be the same name as your source code file without
the .C extension, which is not exactly obvious. This is what I
usually do, just because I can do everything with one command,
so it is more convenient.