Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • R Rec
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 280
    • Issues 280
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Jira
    • Jira
  • Merge requests 50
    • Merge requests 50
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Issue
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • LHCbLHCb
  • Rec
  • Merge requests
  • !2582

Implement a ThOr functor-based monitoring

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Miguel Ramos Pernas requested to merge mramospe-monitor into master Oct 05, 2021
  • Overview 40
  • Commits 13
  • Pipelines 8
  • Changes 5

Implements an algorithm that creates 1D histograms of any functor applied on track-like or composite objects. Small fix to the mass functor, so it works correctly with LHCb v1 particles.

A possible implementation of the monitoring (in the core of a line builder in lhcb/Moore>) is:

from PyConf.Algorithms import Monitor__ParticleRange

def monitor(name, particles, functor, *, histogram_name, range, bins=100):

    assert (len(range) == 2)
    config = dict(
        name=name,
        Input=particles,
        Variable=functor,
        HistogramName=histogram_name,
        Bins=bins,
        Range=range)
    bk = thor_backend()
    if bk == PARTICLE_V1:
        return Monitor__ParticleRange(**config)
    else:
        raise NotImplementedError(
            f'Monitoring not implemented for ThOr backend "{bk}"')


@register_line_builder(all_lines)
@configurable
def ks02pipi_line(name="Hlt2KS02pipiLine", prescale=1):

    pvs = make_pvs()
    pions = filter_decay_products(make_long_pions(), pvs)
    kaons = make_kaons('KS0 -> pi+ pi-', [pions, pions], pvs)

    mass_min, mass_max = 400. * MeV, 600. * MeV

    mass_monitor = monitor(
        f'{name}MassMonitor',
        kaons,
        F.MASS,
        histogram_name='mass',
        range=(mass_min, mass_max))

    return Hlt2Line(
        name=name,
        algs=upfront_reconstruction() + [kaons, mass_monitor],
        prescale=prescale,
    )

Related to LHCb!3278 (merged), Phys!997 (merged), Moore!1046 (merged)

Edited Oct 08, 2021 by Miguel Ramos Pernas
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: mramospe-monitor