Skip to content
This repository was archived by the owner on Feb 11, 2026. It is now read-only.
This repository was archived by the owner on Feb 11, 2026. It is now read-only.

event-level filtering #352

@c-dilks

Description

@c-dilks

Algorithms should be able to filter out entire events, for example:

  • QADB will need this
  • InclusiveKinematics could use this for when no scattered lepton is found

Proposal:

  • make Algorithm::Run return bool; a value of false will stop AlgorithmSequence::Run (which can also return false)
  • handling action functions:
    • filter returns false(s)
    • transformers and creators need thought; ideas:
      • std::optional, but may not bind well
      • add a bool lvalue reference to all action functions
      • add a bool created member to creator-action-functions' return value structs

Example analysis, but with external event-level filters:

    /*****/
    iguana_InclusiveKinematics.Run(hipo_banks);
    // event filter: if no DIS electron found, skip event
    if(bank_inclusive_kin.getRowList().size() != 1) {
      iguana_InclusiveKinematics.GetLog()->Trace("event filtered out");
      continue;
    }
    /*****/
    iguana_SectorFinder.Run(hipo_banks);
    iguana_TrajLinker.Run(hipo_banks);
    iguana_CalorimeterLinker.Run(hipo_banks);
    iguana_FiducialFilter.Run(hipo_banks);
    // event filter: if Fiducial cuts filtered out DIS electron, skip event
    if(std::find(
          bank_particle.getRowList().begin(),
          bank_particle.getRowList().end(),
          bank_inclusive_kin.getShort("pindex", 0)
          ) == bank_particle.getRowList().end())
    {
      iguana_FiducialFilter.GetLog()->Trace("event filtered out");
      continue;
    }
    /*****/
    iguana_DihadronKinematics.Run(hipo_banks);
    // event filter: if no dihadrons found, skip event
    if(bank_dihadron_kin.getRowList().size() == 0) {
      iguana_DihadronKinematics.GetLog()->Trace("event filtered out");
      continue;
    }
    /*****/
    iguana_SingleHadronKinematics.Run(hipo_banks);
    // event filter: if no single hadrons found, skip event
    if(bank_single_hadron_kin.getRowList().size() == 0) {
      iguana_SingleHadronKinematics.GetLog()->Trace("event filtered out");
      continue;
    }
    /*****/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions