How to save the deltaR between muon decays

I am running some BSM event collisions with a Higgs and A3 particle decay with a professor of mine. Are there any suggestions on how to save the deltaR = sqrt(deltaEta^2 + deltaPhi^2) between the two generated muons from the A3 decay?
I figured it may be a similar framework to the ResonanceBuilder called in the analysis.py file but am unsure where to start with doing this.

Thanks,
Hayden Shaddix

Hi Hayden,

The general answer is that you should indeed implement a new function that calculates the quantity you are interested in. You can take a look at the short paragraph “Code development” here:

https://github.com/HEP-FCC/FCCeePhysicsPerformance/tree/master/General#code-development

which gives a few indications.

You can also look at example functions that already exist in analyzers/dataframe/MCParticle.cc. If you need to navigate through the history of the MC event, e.g. to check the parent of the muons, you can take a look at:

https://github.com/HEP-FCC/FCCAnalyses/blob/basicexamples/examples/basics/README.md#Navigation-through-the-history-of-the-Monte-Carlo-particles

In some particular cases, for example if your MC file always contains only one mu+ and only one mu-, that come from the a3 decay, you could get your deltaR without having to code anything, for example:

           .Define("stable",  "MCParticle::sel_genStatus(1) ( Particle )")
           .Define("Muminus",  "MCParticle::sel_pdgID( 13, false) ( stable )")
           .Define("Muplus",  "MCParticle::sel_pdgID( -13, false) ( stable )")
           .Define("Muminus_tlv", "MCParticle::get_tlv( Muminus ) ")
           .Define("Muplus_tlv", "MCParticle::get_tlv( Muplus ) ")
           .Define("deltaR", "return Muminus_tlv[0].DeltaR( Muplus_tlv[0] ) ; ")

and then you add “deltaR” to the list of output branches. If you want to protect yourself against cases where no muon was retrieved, you can do e.g.:

           .Define("deltaR", " if ( Muminus_tlv.size() > 0 && Muplus_tlv.size() > 0) return Muminus_tlv[0].DeltaR( Muplus_tlv[0] ) ; else return -9999. ;  ")

but as you see, this easily gets clumsy and C++ code may be better.

Cheers,
E.