From c8d7259e76c4559e220606f5123bca3f2cc56969 Mon Sep 17 00:00:00 2001
From: Eduardo Rodrigues <eduardo.rodrigues@cern.ch>
Date: Fri, 12 Mar 2021 16:01:02 +0000
Subject: [PATCH] Fixed formatting

patch generated by https://gitlab.cern.ch/lhcb/DaVinci/-/jobs/12534305
---
 .../debugging/example-PrintDecayTree.py       | 44 +++++++++++++++++++
 .../test_example-PrintDecayTree.qmt           | 36 +++++++++++++++
 .../python/DaVinci/common_particles.py        |  6 +--
 .../python/DaVinci/filters_selectors.py       |  2 +-
 .../python/DaVinci/standard_particles.py      |  4 +-
 5 files changed, 86 insertions(+), 6 deletions(-)
 create mode 100644 DaVinciExamples/python/DaVinciExamples/debugging/example-PrintDecayTree.py
 create mode 100755 DaVinciExamples/tests/qmtest/debugging.qms/test_example-PrintDecayTree.qmt

diff --git a/DaVinciExamples/python/DaVinciExamples/debugging/example-PrintDecayTree.py b/DaVinciExamples/python/DaVinciExamples/debugging/example-PrintDecayTree.py
new file mode 100644
index 000000000..a60d57fbf
--- /dev/null
+++ b/DaVinciExamples/python/DaVinciExamples/debugging/example-PrintDecayTree.py
@@ -0,0 +1,44 @@
+###############################################################################
+# (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))
diff --git a/DaVinciExamples/tests/qmtest/debugging.qms/test_example-PrintDecayTree.qmt b/DaVinciExamples/tests/qmtest/debugging.qms/test_example-PrintDecayTree.qmt
new file mode 100755
index 000000000..c283e92e0
--- /dev/null
+++ b/DaVinciExamples/tests/qmtest/debugging.qms/test_example-PrintDecayTree.qmt
@@ -0,0 +1,36 @@
+<?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>
diff --git a/Phys/DaVinci/python/DaVinci/common_particles.py b/Phys/DaVinci/python/DaVinci/common_particles.py
index f8783effe..4d463b545 100644
--- a/Phys/DaVinci/python/DaVinci/common_particles.py
+++ b/Phys/DaVinci/python/DaVinci/common_particles.py
@@ -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
 
diff --git a/Phys/DaVinci/python/DaVinci/filters_selectors.py b/Phys/DaVinci/python/DaVinci/filters_selectors.py
index b301bbb7b..84d92fa40 100644
--- a/Phys/DaVinci/python/DaVinci/filters_selectors.py
+++ b/Phys/DaVinci/python/DaVinci/filters_selectors.py
@@ -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
 
diff --git a/Phys/DaVinci/python/DaVinci/standard_particles.py b/Phys/DaVinci/python/DaVinci/standard_particles.py
index 36e38bcb3..69e5b1bb1 100644
--- a/Phys/DaVinci/python/DaVinci/standard_particles.py
+++ b/Phys/DaVinci/python/DaVinci/standard_particles.py
@@ -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
-- 
GitLab