Skip to content
Snippets Groups Projects
Commit 8981c9fd authored by Patrick Koppenburg's avatar Patrick Koppenburg :leaves:
Browse files

Merge branch 'erodrigu-pyconf-4' into 'master'

Add example usage of PrintDecayTree algo to DaVinciExamples package

See merge request !512
parents f8a1206e c8d7259e
No related branches found
No related tags found
2 merge requests!1103Draft: Add AnalysisHelpers to DaVinci Stack,!512Add example usage of PrintDecayTree algo to DaVinciExamples package
Pipeline #2395255 passed
###############################################################################
# (c) Copyright 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. #
###############################################################################
"""
Example of a DaVinci job printing decay trees via `PrintDecayTree`.
"""
__author__ = "Eduardo Rodrigues"
__date__ = "2021-03-02"
from PyConf.application import configure, configure_input
from PyConf.control_flow import CompositeNode, NodeLogic
from PyConf.Algorithms import PrintDecayTree
from DaVinci import options
from DaVinci.reco_objects import upfront_reconstruction_from_file as upfront_reconstruction
from DaVinci.common_particles import make_std_loose_jpsi2mumu
# Following line sets options data_type, simulation and DB tags, and the inputs
options.set_input_and_conds_from_testfiledb("Upgrade_Bd2KstarMuMu")
options.evt_max = 100
options.print_freq = 1
options.msg_svc_format = "% F%40W%S%7W%R%T %0W%M"
jpsis = make_std_loose_jpsi2mumu()
pdt = PrintDecayTree(name="PrintJpsis", Input=jpsis)
# the "upfront_reconstruction" is what unpacks reconstruction objects, particles and primary vertices
# from file and creates protoparticles.
algs = upfront_reconstruction() + [jpsis, pdt]
node = CompositeNode(
"PrintJpsiNode", children=algs, combine_logic=NodeLogic.NONLAZY_AND)
config = configure_input(options)
config.update(configure(options, node))
<?xml version="1.0" ?>
<!--
(c) Copyright 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>gaudirun.py</text></argument>
<argument name="timeout"><integer>3600</integer></argument>
<argument name="args"><set>
<text>$DAVINCIEXAMPLESROOT/python/DaVinciExamples/debugging/example-PrintDecayTree.py</text>
</set></argument>
<argument name="validator"><text>
findReferenceBlock("""
PrintJpsis.PrintDecayTreeTool INFO Name E M P Pt phi Vz P(C/K) PP(C/K)
PrintJpsis.PrintDecayTreeTool INFO MeV MeV MeV MeV mrad mm
PrintJpsis.PrintDecayTreeTool INFO J/psi(1S) 64348.53 3151.00 64271.34 5490.37 -280.39 -51.66 0/0 N/A
PrintJpsis.PrintDecayTreeTool INFO +-->mu+ 9627.27 105.66 9626.69 387.30 2023.68 -53.56 1/4 2/4
PrintJpsis.PrintDecayTreeTool INFO +-->mu- 54723.91 105.66 54723.81 5756.74 -330.64 -51.01 1/40 2/40
PrintJpsis.PrintDecayTreeTool INFO
PrintJpsis.PrintDecayTreeTool INFO Used TES locations :-
PrintJpsis.PrintDecayTreeTool INFO 1 = '/Event/FunctionalParticleMaker/Particles'
PrintJpsis.PrintDecayTreeTool INFO 2 = '/Event/Rec/ProtoP/Charged'
PrintJpsis.PrintDecayTreeTool INFO 0 = '/Event/StdLooseJpsi2MuMu/Particles'
PrintJpsis.PrintDecayTreeTool INFO
""", stdout, result, causes, signature_offset = 0)
countErrorLines({"FATAL":0, "ERROR":0})
<argument name="exit_code"><integer>1</integer></argument>
</text></argument>
</extension>
......@@ -20,9 +20,9 @@ from .reco_objects import make_charged_protoparticles as _make_charged_protopart
from .reco_objects import make_neutral_protoparticles as _make_neutral_protoparticles
from .reco_objects import make_pvs as _make_pvs
from .selectors import default_particle_cuts, default_track_cuts
from .selectors import get_long_track_selector, get_down_track_selector
from .filters import all_protoparticle_filter as standard_protoparticle_filter
from .filters_selectors import default_particle_cuts, default_track_cuts
from .filters_selectors import get_long_track_selector, get_down_track_selector
from .filters_selectors import all_protoparticle_filter as standard_protoparticle_filter
from .algorithms_pyconf import ParticleFilterWithPVs, ParticleCombinerWithPVs
......
......@@ -13,7 +13,7 @@ Definitions of:
- `Particle` and `ProtoParticle` filters.
- Track selectors.
- Default cuts à la runs 1&2 common particles.
- Default cuts a la runs 1&2 common particles.
"""
from __future__ import absolute_import, division, print_function
......
......@@ -35,8 +35,8 @@ from .algorithms_pyconf import (
NeutralParticleCombinerWithPVs,
)
from .selectors import get_all_track_selector, get_long_track_selector, get_down_track_selector
from .filters import all_protoparticle_filter as standard_protoparticle_filter
from .filters_selectors import get_all_track_selector, get_long_track_selector, get_down_track_selector
from .filters_selectors import all_protoparticle_filter as standard_protoparticle_filter
from .reco_objects import (
make_charged_protoparticles as _make_charged_protoparticles, make_pvs as
......
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