Skip to content
Snippets Groups Projects

Update tupling example including LoKi and now ThOr functors

Merged Abhijit Mathad requested to merge update_tuple_algo into master

Merge request reports

Pipeline #2583416 passed

Pipeline passed for 86431771 on update_tuple_algo

Merged by Patrick KoppenburgPatrick Koppenburg 3 years ago (May 21, 2021 12:35pm UTC)

Loading

Pipeline #2632771 passed

Pipeline passed for d5932306 on master

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Eduardo Rodrigues
  • 53
    54 #FunTuple: Jpsi info
    55 ParticleJpsi = ParticleTupleProp(
    56 branch_name_prefix="Jpsi",
    57 decay_descriptor="[J/psi(1S) -> mu+ mu-]CC",
    58 #Dict -> {name:functor}
    59 particle_code_loki={
    60 'LOKI_P': 'P',
    61 'LOKI_PT': 'PT',
    62 'LOKI_Muonp_PT': 'CHILD(PT, 1)',
    63 'LOKI_Muonm_PT': 'CHILD(PT, 2)',
    64 'LOKI_MAXPT': 'TRACK_MAX_PT',
    65 'LOKI_N_HIHGPT_TRCKS': 'NINTREE(ISBASIC & HASTRACK & (PT > 1500*MeV))'
    66 },
    67 particle_code_thor={
    68 'THOR_P': P,
    • Excellent to see these calls to LoKi and ThOr functions! Not sure if that is done somewhere in the ThOr framework but this gives the possibility to check the equalness of, say here, the P and PT calculated via two types of functors :-).

    • Author Developer

      It was planned (here), but Alex told me that this was dropped.

    • Alex told me that this was dropped.

      My apologies if that's what I said or if it was the impression I gave. It has not been dropped, and it would (still) be nice to have, but we do not have anyone actively working on it today.

    • Thanks for the pointer. To me also this is something relevant. Maybe you @amathad can talk to Niklas and Martina to see if something can be "uplifted" as it would benefit us all?

    • changed this line in version 6 of the diff

    • Author Developer

      @apearce Yes sorry thats what you conveyed, I was just lazy to type that :smile:. @erodrigu A fix without "touching" DumpContainer might be to have some sort of ThOr wrappers for LoKi functors and adapting the ThOr factory to invoke LoKi factory when we hit a LoKi functor. This could be helpful for us too. I can talk to Niklas about it, but can't see a straight forward "uplifting" of this code to DumpContainer.

      Is DumpContainer being used anywhere at the moment? Or I guess it will be used soon? (@apearce )

      Edited by Abhijit Mathad
    • Sounds interesting to me as an idea :thumbsup:. We have to have in mind how analysts will write selections and use functors. Unless ThOr can provide "100%" coverage, solutions such as what you are saying can be a fallback alternative to achieve coverage.

      I can't comment on DumpContainer.

    • You successfully nerd-sniped me with the LoKi adapter; see Rec!2429 (closed) and Phys!935 (closed) for an example implementation.

      With those, these two filters produce identical results (code embedded within Moore!821 (merged)):

      ParticleFilter(Input=pions, Cut=F.FILTER(F.PT > 250 * MeV))
      ParticleFilter(Input=pions, Cut=F.FILTER(F.LOKI("PT") > 250 * MeV))

      I'm not sure I'll have time to push this through to something polished; hopefully it serves as inspiration at least.

    • Morning Alex, that is brilliant, and fast!

    • Please register or sign in to reply
  • Apologies for a speedy review. Am with lack of time today. Looks great and I only make some trivial suggestions. Approving ahead :-).

  • Eduardo Rodrigues approved this merge request

    approved this merge request

  • Abhijit Mathad added 1 commit

    added 1 commit

    • c942af92 - Apply 1 suggestion(s) to 1 file(s)

    Compare with previous version

  • Abhijit Mathad added 1 commit

    added 1 commit

    • 0a4c3a0f - Apply 1 suggestion(s) to 1 file(s)

    Compare with previous version

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