Skip to content
Snippets Groups Projects
Commit a20c4497 authored by Patrick Koppenburg's avatar Patrick Koppenburg :leaves: Committed by Eduardo Rodrigues
Browse files

Add an exception in DecayTreeFit - test

parent 120f090f
No related branches found
No related tags found
2 merge requests!1103Draft: Add AnalysisHelpers to DaVinci Stack,!759Add an exception in DecayTreeFit - test
###############################################################################
# (c) Copyright 2021-2022 CERN for the benefit of the LHCb Collaboration #
# #
# This software is distributed under the terms of the GNU General Public #
# Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". #
# #
# In applying this licence, CERN does not waive the privileges and immunities #
# granted to it by virtue of its status as an Intergovernmental Organization #
# or submit itself to any jurisdiction. #
###############################################################################
"""
Example of a typical DaVinci job:
- selection of two detached opposite-charge muons
- tuple of the selected candidates
- runs DecayTreeFitterAlg and stores some output
"""
import Functors as F
from Hlt2Conf.standard_particles import make_detached_mumu
from RecoConf.reconstruction_objects import upfront_reconstruction
from FunTuple import FunctorCollection
from FunTuple import FunTuple_Particles as Funtuple
from DecayTreeFitter import DTFAlg
from DaVinci import Options, make_config
def main(options: Options):
# Prepare the node with the selection
dimuons = make_detached_mumu()
# DecayTreeFitter Algorithm.
# One with PV constraint and one without
DTF = DTFAlg(
Input=dimuons, MassConstraints=["J/psi(1S)", "psi(2S)"], OutputLevel=3)
# DTFParts = DTF.Output # Particles
DTFRelations = DTF.OutputRelations # Relations
#FunTuple: Jpsi info
fields = {}
fields['Jpsi'] = 'J/psi(1S) -> mu+ mu-'
#make collection of functors for Jpsi
variables_jpsi = FunctorCollection({
'THOR_MASS':
F.MASS,
'DTF_PT':
F.MAP_INPUT(Functor=F.PT, Relations=DTFRelations),
'DTF_MASS':
F.MAP_INPUT(Functor=F.MASS, Relations=DTFRelations),
})
#associate FunctorCollection to field (branch) name
variables = {}
variables['Jpsi'] = variables_jpsi
#FunTuple: define list of preambles for loki
loki_preamble = ['TRACK_MAX_PT = MAXTREE(ISBASIC & HASTRACK, PT, -1)']
#Configure Funtuple algorithm
tuple_dimuons = Funtuple(
name="DimuonsTuple",
tuple_name="DecayTree",
fields=fields,
variables=variables,
loki_preamble=loki_preamble,
inputs=dimuons)
return make_config(options, upfront_reconstruction() + [tuple_dimuons])
<?xml version="1.0" ?>
<!--
###############################################################################
# (c) Copyright 2020-2021 CERN for the benefit of the LHCb Collaboration #
# #
# This software is distributed under the terms of the GNU General Public #
# Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". #
# #
# In applying this licence, CERN does not waive the privileges and immunities #
# granted to it by virtue of its status as an Intergovernmental Organization #
# or submit itself to any jurisdiction. #
###############################################################################
-->
<!DOCTYPE extension PUBLIC '-//QM/2.3/Extension//EN' 'http://www.codesourcery.com/qm/dtds/2.3/-//qm/2.3/extension//en.dtd'>
<extension class="GaudiTest.GaudiExeTest" kind="test">
<argument name="program"><text>lbexec</text></argument>
<argument name="args"><set>
<text>DaVinciTests.DTF_test:main</text>
</set></argument>
<argument name="options_yaml_fn"><text>$DAVINCIEXAMPLESROOT/example_data/Upgrade_Bd2KstarMuMu_ldst.yaml</text></argument>
<argument name="extra_options_yaml"><text>
enable_unpack: False
evt_max: 10
histo_file: DV-example-tupling-DTF-his.root
input_raw_format: 4.3
ntuple_file: DV-example-tupling-DTF-ntp.root
process: Turbo
</text></argument>
<argument name="exit_code"><integer>3</integer></argument>
<argument name="exit_value"><text>Failed</text></argument>
<argument name="validator"><text>
findReferenceBlock("""DecayTreeFitterAlg ERROR DecayTreeFitter::DecayChain : To-be constrained particle is not in chain.""")
countErrorLines({"FATAL":14, "ERROR":9})
</text></argument>
</extension>
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