Event reconstruction Root

Dear all, I’ve this Root file https://we.tl/t-vep6uNg07w

It’s a Geant4 simulation about a positron beam 45 GeV hitting a target and I’ve to study particles produced by interaction between the positron beam and the target. In particular I’m interested to count how many e-e+ -> e-e+ and how many e-e+ -> mu- mu+ events I get in the detector.
For the event reconstruction I’ve this macro

LEMMAEventBuilder.C (3.6 KB) LEMMAEventBuilder.h (12.9 KB)

I runned it in this way

but you can see I get error (moreover, the root file HighStatRottoTargLemmaEventBuilder.root generated by the macro is just 1Kb file…)

Does some know how to get the e+/- and mu+/- numbers in each simulated subdetector?


EDIT July 27, 2019: I did a mistake to upload the file. now I changed the download link

ROOT Version: 5.34 36
Platform: Windows
Compiler: Not Provided

What you try to use, requires C++11 so, ROOT 6.

Hi @Wile_E_Coyote I installed Root 6.18/00
Now this is the log

Log.txt (4.9 KB)

and this is the generated root file

HighStatRootTargLemmaEventBuilder.root (23.9 KB)

As you can see, the macro is runned, but no events are triggered…

You do not increment your TriggerCounter variable.
Also, in the destructor, you should call delete outputfile;.

Hi @Wile_E_Coyote what do you mean? I never used Root for event reconstruction…then
What I need is that:
This is the detector layout

We have a positron beam hitting a target (the target is the number 25 in the layout) . By interaction e-e+ (the e- are the electrons in the target) we can produce e-e+ -> e-e+ or e-e+ -> mu-mu+
We are interested to calculate the ratio mu/e of produced mu+/- and e+/-

I calculated the ration mu/e by experimental data (test beam), by studying the released energies in the bottom part of the detector in the subdetectors from 39 to 64. Now I’ve to compare the experimental data with the simulated ones. To do it, they gave me files about Geant4 simulations and the macro. Then I just need to count how many e and mu are produced.

ps. I did a mistake to upload the file…this is the correct one https://we.tl/t-vep6uNg07w

hi @Wile_E_Coyote no idea?

Try: LEMMAnew->Scan("*");

1 Like

Hi @Wile_E_Coyote sorry for the late reply. By following your reply, I solved!
thank you

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