value_or(bool) not working in composition when it should have
Hello,
I am writing a DV script with lines similar to this DV example: https://gitlab.cern.ch/lhcb/DaVinci/-/blob/master/DaVinciExamples/python/DaVinciExamples/tupling/option_davinci_tupling_from_hlt2_with_matching.py#L86
However, I want to select only VELO-track particles to use them in a VeloIDOverlapRelationTable
object.
Therefore, I wrote
flattened_input_decay_tree = FlattenDecayTree(
InputParticles=input_data, name="MyFlattenDecayTree")
probe_particles = ParticleFilter(
flattened_input_decay_tree.OutputParticles,
F.FILTER(F.require_all(F.ISBASICPARTICLE, F.VALUE_OR( False) @ F.TRACKISVELO @ F.TRACK))
)
The part F.VALUE_OR( False) @ F.TRACKISVELO @ F.TRACK
breaks and gives an error
FUNCTORS_FunctorFactory_0001.cpp: In function 'std::unique_ptr<Functors::AnyFunctor> {anonymous}::factory_0x1bf7bff5c52be44d()':
FUNCTORS_FunctorFactory_0001.cpp:319:430: error: no matching function for call to 'all_of(Functors::Particle::IsBasicParticle, Functors::detail::ComposedFunctor<Functors::detail::composition::chain, Functors::Function, Functors::Function, Functors::Functional::ValueOr<std::integral_constant<bool, false> >, Functors::Track::IsTrackType<LHCb::Event::Enum::Track::Type::Velo>, Functors::Particle::GetTrack>)'
319 | ::Particle const*> > > > const&)>(::Functors::Filter( /* Predicate to filter the container with. */ Functors::all_of( ::Functors::Particle::IsBasicParticle{}, Functors::chain( ::Functors::Functional::ValueOr( /* The default value. */ std::bool_constant<false>{} ), ::Functors::Track::IsTrackType<LHCb::Event::Enum::Track::Type::Velo>{}, ::Functors::Particle::GetTrack{} ) ) ))};
| ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The weird thing is that the hack (F.VALUE_OR(-1) @ F.TRACKISVELO @ F.TRACK)==1
works when Gerhard tells me it should not.
We thought that it would be important to report this as an issue.
EDIT: The piece of code F.FILTER(F.VALUE_OR( False) @ F.TRACKISVELO @ F.TRACK)
also breaks, so it's not linked to putting the code within a F.require_all
.