Skip to content
Snippets Groups Projects
Commit b6dd72e1 authored by Sebastien Ponce's avatar Sebastien Ponce
Browse files

Merge branch 'tfulghes-flattening-relations' into 'master'

Follows Rec!2959

See merge request !721
parents 2c19b25f 854d8b40
No related branches found
No related tags found
2 merge requests!1103Draft: Add AnalysisHelpers to DaVinci Stack,!721Follows Rec!2959
Pipeline #4225857 failed
......@@ -132,7 +132,6 @@ def all_variables(pvs, DTFR, mctruth, ptype):
all_vars['DTF_BPVIPCHI2'] = F.MAP_INPUT(
Functor=F.BPVIPCHI2(pvs), Relations=DTFR)
# MAP_INPUT_ARRAY
# MAP_RANGE
all_vars['MASS'] = F.MASS
if top: # B
......
......@@ -9,12 +9,11 @@
# or submit itself to any jurisdiction. #
###############################################################################
"""
Option file for testing the ParticleTaggerAlg algorithm and the related ThOr functors MAP_ARRAY and MAP_RANGE.
Option file for testing the ParticleTaggerAlg algorithm and the related ThOr functors MAP_INPUT_ARRAY.
The job runs over a spruced sample and retrieves a set of B0 -> Ds K+ candidates. For each candidate the ParticleTaggerAlg
looks at the TES location defined via the 'make_long_pions_from_spruce' function and creates a 'one-to-many' relation map
relating all the available tracks to the B candidate of the events.
Then the MAP_ARRAY functor takes in input this relation map and for each entry stores the output of an external functor (i.e F.P, F.PT)
in a vector via the MAP_RANGE functor.
Then the MAP_INPUT_ARRAY functor takes in input this relation map and for each entry stores the output of an external functor (i.e F.P, F.PT) in a vector.
This example is meant to be run with
$ ./run davinci run-mc --inputfiledb Spruce_all_lines_dst Phys/DaVinci/options/DaVinciDB-Example.yaml --user_algorithms DaVinciExamples/python/DaVinciExamples/tupling/option_davinci_tupling_array_taggers:main
......@@ -49,12 +48,11 @@ variables_B = FunctorCollection({
'THOR_MASS':
F.MASS,
"TagTr_P":
F.MAP_INPUT_ARRAY(Functor=F.MAP_RANGE(Functor=F.P), Relations=tagAlg_rels),
F.MAP_INPUT_ARRAY(Functor=F.P, Relations=tagAlg_rels),
# Currently this stores a branch called "indx" which corresponds to nPVs.
# You can give a custom name for this via following
"TagTr_PT[nTags]":
F.MAP_INPUT_ARRAY(
Functor=F.MAP_RANGE(Functor=F.PT), Relations=tagAlg_rels),
F.MAP_INPUT_ARRAY(Functor=F.PT, Relations=tagAlg_rels),
})
#make collection of functors for Muplus
......
......@@ -17,7 +17,7 @@
# SUMMARY OF THIS TEST
# ...................
# Author: dfazzini
# Purpose: Test for the ParticleTaggerAlg algorithm and the related MAP_ARRAY and MAP_RANGE functors
# Purpose: Test for the ParticleTaggerAlg algorithm and the related MAP_INPUT_ARRAY functor
# Prerequisites: None
# inputfiledb Spruce_all_lines_dst $DAVINCIROOT/options/DaVinciDB-Example.yaml
# user_algorithms ../../python/DaVinciExamples/tupling/option_davinci_tupling_array_taggers:main
......
......@@ -49,12 +49,11 @@ variables_B = FunctorCollection({
'THOR_MASS':
F.MASS,
"TagTr_P":
F.MAP_INPUT_ARRAY(Functor=F.MAP_RANGE(Functor=F.P), Relations=tagAlg_rels),
F.MAP_INPUT_ARRAY(Functor=F.P, Relations=tagAlg_rels),
# Currently this stores a branch called "indx" which corresponds to nPVs.
# You can give a custom name for this via following
"TagTr_PT[nTags]":
F.MAP_INPUT_ARRAY(
Functor=F.MAP_RANGE(Functor=F.PT), Relations=tagAlg_rels),
F.MAP_INPUT_ARRAY(Functor=F.PT, Relations=tagAlg_rels),
})
# Defining fields and variables we want to store in our tuple
......
This diff is collapsed.
<FunctorCollection object at 0x########:
DTF_M: ('Functors::bind( ::Functors::Adapters::MapRelInputToFunOutput( /* The functor to apply to the particle. */ ::Functors::Composite::Mass{} ), ::Functors::Common::TES<LHCb::Relation1D<LHCb::Particle,LHCb::Particle>>( /* List of DataHandles */ std::vector{std::string{"/Event/DecayTreeFitterAlg/OutputRelations"}} ), ::Functors::Common::ForwardArgs{} )', "_MAP_INPUT(Functor=MASS).bind( TES(DataHandles=[DataHandle('/Event/DecayTreeFitterAlg/OutputRelations')], DataTypes=['LHCb::Relation1D<LHCb::Particle,LHCb::Particle>']), FORWARDARGS )")
DTF_P: ('Functors::bind( ::Functors::Adapters::MapRelInputToFunOutput( /* The functor to apply to the particle. */ Functors::chain( ::Functors::Common::Magnitude{}, ::Functors::Track::ThreeMomentum{} ) ), ::Functors::Common::TES<LHCb::Relation1D<LHCb::Particle,LHCb::Particle>>( /* List of DataHandles */ std::vector{std::string{"/Event/DecayTreeFitterAlg/OutputRelations"}} ), ::Functors::Common::ForwardArgs{} )', "_MAP_INPUT(Functor=( MAGNITUDE @ THREEMOMENTUM )).bind( TES(DataHandles=[DataHandle('/Event/DecayTreeFitterAlg/OutputRelations')], DataTypes=['LHCb::Relation1D<LHCb::Particle,LHCb::Particle>']), FORWARDARGS )")
DTF_PT: ('Functors::bind( ::Functors::Adapters::MapRelInputToFunOutput( /* The functor to apply to the particle. */ Functors::chain( ::Functors::Common::Rho_Coordinate{}, ::Functors::Track::ThreeMomentum{} ) ), ::Functors::Common::TES<LHCb::Relation1D<LHCb::Particle,LHCb::Particle>>( /* List of DataHandles */ std::vector{std::string{"/Event/DecayTreeFitterAlg/OutputRelations"}} ), ::Functors::Common::ForwardArgs{} )', "_MAP_INPUT(Functor=( RHO_COORDINATE @ THREEMOMENTUM )).bind( TES(DataHandles=[DataHandle('/Event/DecayTreeFitterAlg/OutputRelations')], DataTypes=['LHCb::Relation1D<LHCb::Particle,LHCb::Particle>']), FORWARDARGS )")
DTF_PX: ('Functors::bind( ::Functors::Adapters::MapRelInputToFunOutput( /* The functor to apply to the particle. */ Functors::chain( ::Functors::Common::X_Coordinate{}, ::Functors::Track::ThreeMomentum{} ) ), ::Functors::Common::TES<LHCb::Relation1D<LHCb::Particle,LHCb::Particle>>( /* List of DataHandles */ std::vector{std::string{"/Event/DecayTreeFitterAlg/OutputRelations"}} ), ::Functors::Common::ForwardArgs{} )', "_MAP_INPUT(Functor=( X_COORDINATE @ THREEMOMENTUM )).bind( TES(DataHandles=[DataHandle('/Event/DecayTreeFitterAlg/OutputRelations')], DataTypes=['LHCb::Relation1D<LHCb::Particle,LHCb::Particle>']), FORWARDARGS )")
DTF_PY: ('Functors::bind( ::Functors::Adapters::MapRelInputToFunOutput( /* The functor to apply to the particle. */ Functors::chain( ::Functors::Common::Y_Coordinate{}, ::Functors::Track::ThreeMomentum{} ) ), ::Functors::Common::TES<LHCb::Relation1D<LHCb::Particle,LHCb::Particle>>( /* List of DataHandles */ std::vector{std::string{"/Event/DecayTreeFitterAlg/OutputRelations"}} ), ::Functors::Common::ForwardArgs{} )', "_MAP_INPUT(Functor=( Y_COORDINATE @ THREEMOMENTUM )).bind( TES(DataHandles=[DataHandle('/Event/DecayTreeFitterAlg/OutputRelations')], DataTypes=['LHCb::Relation1D<LHCb::Particle,LHCb::Particle>']), FORWARDARGS )")
DTF_PZ: ('Functors::bind( ::Functors::Adapters::MapRelInputToFunOutput( /* The functor to apply to the particle. */ Functors::chain( ::Functors::Common::Z_Coordinate{}, ::Functors::Track::ThreeMomentum{} ) ), ::Functors::Common::TES<LHCb::Relation1D<LHCb::Particle,LHCb::Particle>>( /* List of DataHandles */ std::vector{std::string{"/Event/DecayTreeFitterAlg/OutputRelations"}} ), ::Functors::Common::ForwardArgs{} )', "_MAP_INPUT(Functor=( Z_COORDINATE @ THREEMOMENTUM )).bind( TES(DataHandles=[DataHandle('/Event/DecayTreeFitterAlg/OutputRelations')], DataTypes=['LHCb::Relation1D<LHCb::Particle,LHCb::Particle>']), FORWARDARGS )")
DTF_ENERGY: ('Functors::bind( ::Functors::Adapters::MapRelInputToFunOutput( /* The functor to apply to the particle. */ Functors::chain( ::Functors::Common::E_Coordinate{}, ::Functors::Track::FourMomentum{} ) ), ::Functors::Common::TES<LHCb::Relation1D<LHCb::Particle,LHCb::Particle>>( /* List of DataHandles */ std::vector{std::string{"/Event/DecayTreeFitterAlg/OutputRelations"}} ), ::Functors::Common::ForwardArgs{} )', "_MAP_INPUT(Functor=( E_COORDINATE @ FOURMOMENTUM )).bind( TES(DataHandles=[DataHandle('/Event/DecayTreeFitterAlg/OutputRelations')], DataTypes=['LHCb::Relation1D<LHCb::Particle,LHCb::Particle>']), FORWARDARGS )")
DTF_M: ('Functors::chain( ::Functors::Composite::Mass{}, ::Functors::Common::To{}, ::Functors::Functional::Front{}, Functors::bind( ::Functors::Common::Relations{}, ::Functors::Common::TES<LHCb::Relation1D<LHCb::Particle,LHCb::Particle>>( /* List of DataHandles */ std::vector{std::string{"/Event/DecayTreeFitterAlg/OutputRelations"}} ), ::Functors::Common::ForwardArgs{} ) )', "( MASS @ TO @ FRONT @ RELATIONS.bind( TES(DataHandles=[DataHandle('/Event/DecayTreeFitterAlg/OutputRelations')], DataTypes=['LHCb::Relation1D<LHCb::Particle,LHCb::Particle>']), FORWARDARGS ) )")
DTF_P: ('Functors::chain( ::Functors::Common::Magnitude{}, ::Functors::Track::ThreeMomentum{}, ::Functors::Common::To{}, ::Functors::Functional::Front{}, Functors::bind( ::Functors::Common::Relations{}, ::Functors::Common::TES<LHCb::Relation1D<LHCb::Particle,LHCb::Particle>>( /* List of DataHandles */ std::vector{std::string{"/Event/DecayTreeFitterAlg/OutputRelations"}} ), ::Functors::Common::ForwardArgs{} ) )', "( MAGNITUDE @ THREEMOMENTUM @ TO @ FRONT @ RELATIONS.bind( TES(DataHandles=[DataHandle('/Event/DecayTreeFitterAlg/OutputRelations')], DataTypes=['LHCb::Relation1D<LHCb::Particle,LHCb::Particle>']), FORWARDARGS ) )")
DTF_PT: ('Functors::chain( ::Functors::Common::Rho_Coordinate{}, ::Functors::Track::ThreeMomentum{}, ::Functors::Common::To{}, ::Functors::Functional::Front{}, Functors::bind( ::Functors::Common::Relations{}, ::Functors::Common::TES<LHCb::Relation1D<LHCb::Particle,LHCb::Particle>>( /* List of DataHandles */ std::vector{std::string{"/Event/DecayTreeFitterAlg/OutputRelations"}} ), ::Functors::Common::ForwardArgs{} ) )', "( RHO_COORDINATE @ THREEMOMENTUM @ TO @ FRONT @ RELATIONS.bind( TES(DataHandles=[DataHandle('/Event/DecayTreeFitterAlg/OutputRelations')], DataTypes=['LHCb::Relation1D<LHCb::Particle,LHCb::Particle>']), FORWARDARGS ) )")
DTF_PX: ('Functors::chain( ::Functors::Common::X_Coordinate{}, ::Functors::Track::ThreeMomentum{}, ::Functors::Common::To{}, ::Functors::Functional::Front{}, Functors::bind( ::Functors::Common::Relations{}, ::Functors::Common::TES<LHCb::Relation1D<LHCb::Particle,LHCb::Particle>>( /* List of DataHandles */ std::vector{std::string{"/Event/DecayTreeFitterAlg/OutputRelations"}} ), ::Functors::Common::ForwardArgs{} ) )', "( X_COORDINATE @ THREEMOMENTUM @ TO @ FRONT @ RELATIONS.bind( TES(DataHandles=[DataHandle('/Event/DecayTreeFitterAlg/OutputRelations')], DataTypes=['LHCb::Relation1D<LHCb::Particle,LHCb::Particle>']), FORWARDARGS ) )")
DTF_PY: ('Functors::chain( ::Functors::Common::Y_Coordinate{}, ::Functors::Track::ThreeMomentum{}, ::Functors::Common::To{}, ::Functors::Functional::Front{}, Functors::bind( ::Functors::Common::Relations{}, ::Functors::Common::TES<LHCb::Relation1D<LHCb::Particle,LHCb::Particle>>( /* List of DataHandles */ std::vector{std::string{"/Event/DecayTreeFitterAlg/OutputRelations"}} ), ::Functors::Common::ForwardArgs{} ) )', "( Y_COORDINATE @ THREEMOMENTUM @ TO @ FRONT @ RELATIONS.bind( TES(DataHandles=[DataHandle('/Event/DecayTreeFitterAlg/OutputRelations')], DataTypes=['LHCb::Relation1D<LHCb::Particle,LHCb::Particle>']), FORWARDARGS ) )")
DTF_PZ: ('Functors::chain( ::Functors::Common::Z_Coordinate{}, ::Functors::Track::ThreeMomentum{}, ::Functors::Common::To{}, ::Functors::Functional::Front{}, Functors::bind( ::Functors::Common::Relations{}, ::Functors::Common::TES<LHCb::Relation1D<LHCb::Particle,LHCb::Particle>>( /* List of DataHandles */ std::vector{std::string{"/Event/DecayTreeFitterAlg/OutputRelations"}} ), ::Functors::Common::ForwardArgs{} ) )', "( Z_COORDINATE @ THREEMOMENTUM @ TO @ FRONT @ RELATIONS.bind( TES(DataHandles=[DataHandle('/Event/DecayTreeFitterAlg/OutputRelations')], DataTypes=['LHCb::Relation1D<LHCb::Particle,LHCb::Particle>']), FORWARDARGS ) )")
DTF_ENERGY: ('Functors::chain( ::Functors::Common::E_Coordinate{}, ::Functors::Track::FourMomentum{}, ::Functors::Common::To{}, ::Functors::Functional::Front{}, Functors::bind( ::Functors::Common::Relations{}, ::Functors::Common::TES<LHCb::Relation1D<LHCb::Particle,LHCb::Particle>>( /* List of DataHandles */ std::vector{std::string{"/Event/DecayTreeFitterAlg/OutputRelations"}} ), ::Functors::Common::ForwardArgs{} ) )', "( E_COORDINATE @ FOURMOMENTUM @ TO @ FRONT @ RELATIONS.bind( TES(DataHandles=[DataHandle('/Event/DecayTreeFitterAlg/OutputRelations')], DataTypes=['LHCb::Relation1D<LHCb::Particle,LHCb::Particle>']), FORWARDARGS ) )")
>
ApplicationMgr SUCCESS
ApplicationMgr SUCCESS
====================================================================================================================================
====================================================================================================================================
ApplicationMgr INFO Application Manager Configured successfully
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment