Skip to content
Snippets Groups Projects

Add algorithm for calculating and persisting related info (e.g. isolation information)

Merged Thomas Latham requested to merge tlatham_run3_isolation_to_master into master

Created an algorithm (FunctorsToRelTable) to calculate and store information in a RelatedInfoMap and add that map to a relation table to be persisted as extra_output in an HLT2/Spruce line.

Depends on LHCb!4921 (merged), which adds a versioned dictionary that relates the variable labels, e.g. CONE_PX, to the indices that will be used to store them in the RelatedInfoMap and provides tests to ensure the integrity of that dictionary. That functionality is extended here by the following changes:

  • Created in the C++ a compile-time-constant versioned dictionary that, for each version number, relates a set of labels (of string type, e.g. "CONE_PX") to the functors that should be used to calculate the corresponding values
  • Added also a compile-time constant that indicates the latest version of the dictionary
  • Version 0 of the dictionary is intentionally empty
  • The integrity of this versioned dictionary is guaranteed by tests that ensure that a) the structure of this dictionary matches that of the label -> index dictionary in the LHCb project, b) the values computed by the functors do not change for a given set of inputs

The algorithm is configured with a list of variable labels and, optionally, a label -> index/functor dictionary version number that defaults to whatever is the latest version. At initialisation, the algorithm uses the dictionary and the version number to convert the list of labels into the functors to be used to calculate the values and the indices to be used to store them.

Added some functors to be used with the algorithm to make cuts and calculate cone and vertex isolation information:

  • Functors for calculating IP and IPCHI2 of particle wrt end-vertex of another particle

  • Asym and Diff functors in C++ for calculating the Asymmetry/Delta of some quantity related to the 3- or 4-momentum of a particle and the combination of a vector of particles (e.g. those in a given cone around the reference particle)

  • A functor has been composed for calculating the minimum IPCHI2 wrt a composite's decay vertex - a replacement for the SMALLEST_DELTA_CHI2

  • Added a functor to retrieve quantities from a persisted RelatedInfoMap that uses the label-based accessor added in LHCb!4921 (merged)

A previous implementation of the algorithm used with_functor_maps but with a short int key, so with_functor_maps has been modified so that the key type is templated - this is retained here as a potentially useful generalisation.

MRs in Moore and DaVinci that demonstrate the use of this algorithm in HLT2/Spruce lines and how to tuple the output:

cc: @mmonk @fswystun @malehura @ghallett @tfulghes

Edited by Thomas Latham

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Francesca Swystun changed the description

    changed the description

  • Thomas Latham mentioned in merge request LHCb!4921 (merged)

    mentioned in merge request LHCb!4921 (merged)

  • Thomas Latham added 1 commit

    added 1 commit

    • d0c2e6aa - Use new optional-based access to RelatedInfoMap

    Compare with previous version

  • mentioned in merge request Moore!4461 (merged)

  • mentioned in merge request Moore!4319 (merged)

  • Francesca Swystun added 86 commits

    added 86 commits

    • d0c2e6aa...3e09b408 - 74 commits from branch master
    • 3e09b408...dc84e26a - 2 earlier commits
    • f14a7010 - Add functor for retrieving info from a RelatedInfoMap
    • 4dd8cca5 - Add functors for use with new isolation algorithm, still WIP
    • be71b22b - Adjust CONE_DELTA functors
    • de73ac7b - Add test of RelatedInfoMapInfo functor
    • ea4b4dca - Add cone px,py,pz,p,pt functors
    • e1d31ccf - Minor doc string update
    • a8cafea0 - Change name of new SMALLEST_DELTACHI2 functor to SMALLEST_REF_ENDVERTEX_IPCHI2 to avoid name clash
    • 380e3b81 - Drop ADJUST_ANGLE for CONE_DELTA_ETA
    • a928561a - Use new optional-based access to RelatedInfoMap
    • eae6c408 - Revert "Use new optional-based access to RelatedInfoMap"

    Compare with previous version

  • Edited by Software for LHCb
  • Thomas Latham added 5 commits

    added 5 commits

    • 598e517f - Use new label-based access to RelatedInfoMap returning an Optional
    • b2cffdbe - Add versioned dictionary that relates labels to functors
    • 43afdf1b - Modify RelatedInfoTables algorithm to use new dictionaries
    • 0789fdd7 - Add Diff and Asym functors in C++ and adapt RelatedInfoFunctors dictionary to use them
    • 700fa3d2 - Drop the python functors that are no longer needed

    Compare with previous version

  • Thomas Latham added 27 commits

    added 27 commits

    • 700fa3d2...0eba35da - 12 commits from branch master
    • 0eba35da...83f1a332 - 5 earlier commits
    • 0d84f9ed - Add test of RelatedInfoMapInfo functor
    • f588ceba - Add cone px,py,pz,p,pt functors
    • 4a608cce - Minor doc string update
    • 1f367b99 - Change name of new SMALLEST_DELTACHI2 functor to SMALLEST_REF_ENDVERTEX_IPCHI2 to avoid name clash
    • 8fafdcf3 - Drop ADJUST_ANGLE for CONE_DELTA_ETA
    • 65d68dab - Use new label-based access to RelatedInfoMap returning an Optional
    • c06b60ea - Add versioned dictionary that relates labels to functors
    • c7539699 - Modify RelatedInfoTables algorithm to use new dictionaries
    • acf6b9db - Add Diff and Asym functors in C++ and adapt RelatedInfoFunctors dictionary to use them
    • 6c2e5b43 - Drop the python functors that are no longer needed

    Compare with previous version

  • Author Developer

    Since our algorithm no longer has with_functor_maps as a base class, the changes made to with_functor_maps.h to make the key type of the map a template parameter (and the associated changes in two files in SelAlgorithms/src) could be dropped since they are no longer needed for what is done here. Or they could be kept as a potentially useful generalisation. Does anyone have a strong opinion?

  • mentioned in merge request DaVinci!1229 (merged)

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading