Skip to content
Snippets Groups Projects

New functors to place objects in a vector and to concatenate two vectors

Open Simone Capelli requested to merge sicapell_vector_concat into master

This MR defines two new functors:

  • SINGLE : takes an object of type T and return a std::vector<T> containing such object
  • CONCATENATE : takes two vectors v1,v2of the same type std:vector<T> and return a single std:vector<T> with { v1_elements, v2_elements }

This will help to distinguish two particles with same ID and Charge when using ThorParticleSelection , for example to compute ConeIsolation variables around each final state track

fields = {
        "Tau"   :   "[tau+ -> mu+ mu+ mu-]CC",
        "L1"  :     "[tau+ -> ^mu+ mu+ mu-]CC",
        "L2"  :     "[tau+ -> mu+ ^mu+ mu-]CC",
        "L3"  :     "[tau+ -> mu+ mu+ ^mu-]CC",
}

data = get_particles(f"/Event/HLT2/Hlt2RD_TauToMuMuMu/Particles")
L1_data = ThOrParticleSelection(
        InputParticles=data, Functor=F.SINGLE @ F.VALUE @ F.FIND_DECAY(fields["L1"])
    ).OutputSelection
Edited by Simone Capelli

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
  • Tommaso Fulghesu changed title from New fuctors to place objects in a vector and to concatenate two vectors to New functors to place objects in a vector and to concatenate two vectors

    changed title from New fuctors to place objects in a vector and to concatenate two vectors to New functors to place objects in a vector and to concatenate two vectors

  • Simone Capelli added 1 commit

    added 1 commit

    • 3aa9aa5e - Apply 1 suggestion(s) to 1 file(s)

    Compare with previous version

  • Simone Capelli added 1 commit

    added 1 commit

    • 7d7b1649 - Apply 1 suggestion(s) to 1 file(s)

    Compare with previous version

  • Simone Capelli added 1 commit

    added 1 commit

    Compare with previous version

  • Simone Capelli added 1 commit

    added 1 commit

    • 2c3aa5a4 - remove accidental changes to exampl_test.ref

    Compare with previous version

  • Simone Capelli added 1 commit

    added 1 commit

    • 1665d447 - rename functor PlaceIntoVector to Single

    Compare with previous version

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