Page MenuHomeHEPForge

Rewrite EvtFlatSqDalitz model to be more efficient and to avoid cut-off around the edges
ClosedPublic

Authored by kreps on Sep 17 2020, 2:23 PM.

Details

Summary

With new version we have now also opportunity to generate rectangular part of the squared Dalitz plot with same efficiency.
Shuffle part of the code in EvtThreeBodyPhsp model which went from invariant masses squared to momenta of daughters to avoid duplication of the code and to allow reuse of it in EvtSqDalitz.
Improvement of EvtFlatSqDalitz model

Test Plan

Updated FlatSqDalitz model as well as changes to EvtThreeBodyPhsp were validated using test already in repository or new one added here.

Diff Detail

Repository
rEVTGEN evtgen
Branch
kreps_FlatSqDalitzTest
Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 104
Build 104: arc lint + arc unit

Event Timeline

jback requested changes to this revision.Oct 6 2020, 6:19 PM
jback added inline comments.
src/EvtGenModels/EvtFlatSqDalitz.cpp
97

Perhaps reduce some of the code here by introducing variables we can reuse and add functions that calculate equivalent expressions:
const double mDaug1Sq = mDaug1 * mDaug1;
const double part1 = getMtm( m12Sq, mDaug1Sq, mDaug2Sq );
const double part2 = getMtm( m12Sq, mDaug3Sq, mParentSq );

test/evtgenlhc_test1.cc
5785

Different line tab indentations here (and later on); maybe just a browser viewer issue?

5800

We could reuse variables here to make the expression more easier to read.

This revision now requires changes to proceed.Oct 6 2020, 6:19 PM
tlatham added inline comments.
src/EvtGenBase/EvtGenKine.cpp
361–370

Have cross-checked all the expressions with LauKinematics and they agree.

I think it would be helpful to pre-calculate, e.g.
const double mParSq { mParent * mParent };
and similarly for the daughter masses squared since these products appear more than once.

I think also for a small efficiency gain it is better to pre-calculate:
const double invMPar { 1.0 / mParent };
and multiply by that wherever you currently divide by mParent.

Similarly, it should be better to divide by (p1mag * p2mag) rather than do the / p1mag / p2mag.

src/EvtGenModels/EvtFlatSqDalitz.cpp
96–108

Looking at LauKinematics:: updateSqDPMassSquares, this part looks maybe a bit more complicated than it needs to be.

test/evtgenlhc_test1.cc
5785

Looks to be a genuine difference - please run clang-format on all C++ files when preparing the next revision.

5800

Yes, I think this could be simplified along the lines of how c12 is calculated in LauKinematics::calcHelicities

  • Cleanup of few formulas to be more transparent and fix formatting
kreps marked 3 inline comments as done.Dec 8 2020, 6:08 PM

I did run test after all changes and the distribution is still nicely flat. I think it should be ready to go.

src/EvtGenBase/EvtGenKine.cpp
361–370

All should be implemented here.

src/EvtGenModels/EvtFlatSqDalitz.cpp
96–108

I strongly suspect that what I did was basically the same just dumped to a single expression, but I appreciate that it was not very transparent and easy to understand. The new version should fix that.

test/evtgenlhc_test1.cc
5800

I changed to use the same way as is done in Laura++ as it is more transparent compared to the original one.

Many thanks @kreps, looks good to me.

tlatham retitled this revision from - Rewrite EvtFlatSqDalitz model to be more efficient and to avoid cut-off around the edges. With new version we have now also opportunity to generate rectangular part of the squared Dalitz plot with same efficiency. - Shuffle part of the code in... to - Rewrite EvtFlatSqDalitz model to be more efficient and to avoid cut-off around the edges. With new version we have now also opportunity to generate rectangular part of the squared Dalitz plot with same efficiency.- Shuffle part of the code in....Dec 10 2020, 2:28 PM
tlatham changed the visibility from "All Users" to "Public (No Login Required)".
tlatham changed the edit policy from "All Users" to "Restricted Project (Project)".
tlatham added a project: Restricted Project.
tlatham retitled this revision from - Rewrite EvtFlatSqDalitz model to be more efficient and to avoid cut-off around the edges. With new version we have now also opportunity to generate rectangular part of the squared Dalitz plot with same efficiency.- Shuffle part of the code in... to Rewrite EvtFlatSqDalitz model to be more efficient and to avoid cut-off around the edges.Dec 10 2020, 2:31 PM
tlatham edited the summary of this revision. (Show Details)
This revision is now accepted and ready to land.Dec 10 2020, 2:35 PM
This revision was automatically updated to reflect the committed changes.