JeffersonLab / gluex_root_analysis

9 stars 9 forks source link

tree_to_amptools does not correctly work for final states with multiple charged tracks #141

Closed aaust closed 3 years ago

aaust commented 3 years ago

Line 565 of the modified file https://github.com/JeffersonLab/gluex_root_analysis/blob/dd11da433fa1620493ef053fc6a71335c0d9ef8b/programs/tree_to_amptools/tree_to_amptools.cc#L565

looks for particles with constrained masses or the Proton and gets their P4 from the locDirectP4 array, but how does it handle other charged particles that come from the primary vertex, like a pi+ or pi-? I tried this with the final state proton pi0 pi+ pi+ pi- pi- and the output tree contained only the proton and pi0.

Instead of checking for the Proton specifically, should this be checking if "Decaying" is in the particle name and if not getting the P4 from locDirectP4 with something like

if(locListIndex >= 0 && (((string)locNameObject->GetName()).find("Decaying") == string::npos || locKinFitMassConstrained[(string)locNameObject->GetName()])

For the 5 pion final state above, this seems to work but I haven't checked others.

_Originally posted by @jrstevenjlab in https://github.com/JeffersonLab/gluex_root_analysis/issues/136#issuecomment-733145868_