ROOT 2D Plot Problems

Hello I am looking to plot the global_end_points from the MCParticle Tree at the anode side of the detector. Is there anyway to parse data outside of ROOT? Or if someone could give me an example of their workflow to extract the data to export to Python or a plain text file that would be great!

Or if anyone can help me understand how to use the TBrowser to get useful plots, I would greatly appreciate it! Attached is the *.root file.

output_source_measurement_122keV.root (25.1 MB)

I am using root 6.32.02 with python 3.12

For anyone interested I had to retro fit the analysisExample.C to output the global endpoints of MCParticle. Not sure if this is correct, but I got a 2D histogram.

Hi @oobie2142 ,

the easiest way to do this is to use the TextWriter module instead of the ROOTObjectWriter. This will generate a plain text file, among others listing the global end point of the MCParticle. See the following example:

--- telescope0 ---

--- Printing MCParticle information (0x77e7946a5860) --------------------
Particle type (PDG ID):     211
Local start point:          6.21875  mm |   5.01963  mm |     -0.15 mm  
Global start point:        0.902269  mm |   1.93853  mm | 0.0432881 mm  
Local end point:            6.17053  mm |   5.06812  mm |      0.15 mm  
Global end point:          0.902269  mm |   1.93853  mm |  0.350983 mm  
Local time:                       0  ns 
Global time:                0.66729  ns 
Linked parent:           <nullptr>
Linked track:            0x77e7946acca0
-------------------------------------------------------------------------

It is of course also possible to extract this from the ROOT file, in case e.g. you rely on a correlation to the rest of the dataset.

Does this help you?

Cheers
Paul

1 Like

Thank you @pschutze I was able to retrofit the the example root script to my needs luckily it was well structured. I will try the TextWriter Module as well to add to the toolbox for future simulations. Thanks!