Commit f35d7c75 authored by Roel Aaij's avatar Roel Aaij Committed by Christoph Hasse
Browse files

Add efficiency checker test that uses the sequence without a GEC in Allen

parent dfe25537
###############################################################################
# (c) Copyright 2019-2020 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. #
###############################################################################
from Moore import options
from HltEfficiencyChecker.config import run_allen_in_moore_with_tuples
from RecoConf.hlt1_allen import sequence as allen_sequence
decay = ("[${B_s0}B_s0 => "
"( phi(1020) => ${Kplus0}K+ ${Kminus0}K-) "
"( phi(1020) => ${Kplus1}K+ ${Kminus1}K-) ]CC")
options.set_input_from_testfiledb('Upgrade_BsPhiPhi_MD_FTv4_DIGI')
options.evt_max = 100
options.set_conds_from_testfiledb('Upgrade_BsPhiPhi_MD_FTv4_DIGI')
options.ntuple_file = "eff_ntuple_default.root"
with allen_sequence.bind(sequence="hlt1_pp_default"):
run_allen_in_moore_with_tuples(options, decay)
# HltEfficiencyChecker "wizard" example
annotated_decay_descriptor:
"[${B_s0}B_s0 => ( phi(1020) => ${Kplus0}K+ ${Kminus0}K-) ( phi(1020) => ${Kplus1}K+ ${Kminus1}K-) ]CC"
ntuple_path: &NTUPLE eff_ntuple.root
job:
trigger_level: 1
evt_max: 100
testfiledb_key: Upgrade_BsPhiPhi_MD_FTv4_DIGI
#
# You can also define the input files and/or the processing conditions:
#
# input_type: ROOT
# input_files:
# - "root://eoslhcb.cern.ch//eos/lhcb/grid/prod/lhcb/MC/Upgrade/LDST/00070317/0000/00070317_00000033_2.ldst"
# simulation: True
# conddb_tag: conddb-20301313
# dddb_tag: dddb-20301313
allen_sequence: hlt1_pp_default
options:
- $HLTEFFICIENCYCHECKERROOT/options/options_template.py.jinja # first rendered with jinja2
# - $HLTEFFICIENCYCHECKERROOT/options/hlt1_moore_lines_example.py # Allen lines are specified internally to Allen
# One can also write templated options directly as a multi-line string, for example:
# - |
# from Moore import options
# options.ntuple_file = "{{ ntuple_path }}"
analysis:
script: $HLTEFFICIENCYCHECKERROOT/scripts/hlt_line_efficiencies.py
args:
input: *NTUPLE
level: Hlt1
reconstructible_children: Kplus0,Kminus0,Kplus1,Kminus1
# The parent is automatically deduced from the annotated decay descriptor,
# which is passed in a file such as eff_ntuple.root.json, but can also be given:
# parent: B_s0
legend_header: "B^{0}_{s} #rightarrow #phi#phi"
make_plots: true
vars: "PT,Kplus0:PT"
lines: Hlt1TwoTrackMVADecision,Hlt1TrackMVADecision
......@@ -10,6 +10,7 @@
###############################################################################
from Moore import options
from HltEfficiencyChecker.config import run_allen_in_moore_with_tuples
from RecoConf.hlt1_allen import sequence as allen_sequence
decay = ("[${B_s0}B_s0 => "
"( phi(1020) => ${Kplus0}K+ ${Kminus0}K-) "
......@@ -19,6 +20,7 @@ options.set_input_from_testfiledb('Upgrade_BsPhiPhi_MD_FTv4_DIGI')
options.evt_max = 100
options.set_conds_from_testfiledb('Upgrade_BsPhiPhi_MD_FTv4_DIGI')
options.ntuple_file = "eff_ntuple.root"
options.ntuple_file = "eff_ntuple_no_gec.root"
run_allen_in_moore_with_tuples(options, decay)
with allen_sequence.bind(sequence="hlt1_pp_no_gec"):
run_allen_in_moore_with_tuples(options, decay)
......@@ -15,6 +15,7 @@ job:
# simulation: True
# conddb_tag: conddb-20301313
# dddb_tag: dddb-20301313
allen_sequence: hlt1_pp_no_gec
options:
- $HLTEFFICIENCYCHECKERROOT/options/options_template.py.jinja # first rendered with jinja2
# - $HLTEFFICIENCYCHECKERROOT/options/hlt1_moore_lines_example.py # Allen lines are specified internally to Allen
......
###############################################################################
# (c) Copyright 2019-2020 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. #
###############################################################################
from Moore import options
from HltEfficiencyChecker.config import run_allen_in_moore_with_tuples
from RecoConf.hlt1_allen import sequence as allen_sequence
options.set_input_from_testfiledb('upgrade_DC19_01_MinBiasMD')
options.evt_max = 100
options.set_conds_from_testfiledb('upgrade_DC19_01_MinBiasMD')
options.ntuple_file = "rate_ntuple_default.root"
with allen_sequence.bind(sequence="hlt1_pp_default"):
run_allen_in_moore_with_tuples(options)
###############################################################################
# (c) Copyright 2019-2020 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. #
###############################################################################
from Moore import options
from HltEfficiencyChecker.config import run_allen_in_moore_with_tuples
from RecoConf.hlt1_allen import sequence as allen_sequence
options.set_input_from_testfiledb('upgrade_DC19_01_MinBiasMD')
options.evt_max = 100
options.set_conds_from_testfiledb('upgrade_DC19_01_MinBiasMD')
options.ntuple_file = "rate_ntuple_no_gec.root"
with allen_sequence.bind(sequence="hlt1_pp_no_gec"):
run_allen_in_moore_with_tuples(options)
......@@ -3,6 +3,7 @@ from HltEfficiencyChecker.config import run_moore_with_tuples
from HltEfficiencyChecker.config import run_allen_in_moore_with_tuples
from RecoConf.reconstruction_objects import reconstruction
from RecoConf.protoparticles import make_charged_protoparticles
from RecoConf.hlt1_allen import sequence as allen_sequence
{% if annotated_decay_descriptor is defined %}
decay = "{{ annotated_decay_descriptor }}"
......@@ -79,6 +80,11 @@ if level == 2:
options, False, decay, public_tools=[stateProvider_with_simplified_geom()])
else:
if use_allen:
{% if job.allen_sequence is defined %}
with allen_sequence.bind(sequence={{ "{!r}".format(job.allen_sequence) }}):
run_allen_in_moore_with_tuples(options, decay)
{% else %}
run_allen_in_moore_with_tuples(options, decay)
{% endif %}
else:
run_moore_with_tuples(options, True, decay)
......@@ -13,6 +13,7 @@ set -euxo pipefail
default_dir=checker-hlt1-examples-$(date '+%Y%m%d-%H%M%S')
dir=${1:-$default_dir}
sequence=${2:-default}
mkdir -p $dir
cd $dir
......@@ -20,30 +21,29 @@ cd $dir
# Efficiency
gaudirun.py \
$HLTEFFICIENCYCHECKERROOT/options/hlt1_eff_example.py \
-o eff_job.opts.py --all-opts \
2>&1 | tee eff_job.log
"${HLTEFFICIENCYCHECKERROOT}/options/hlt1_eff_${sequence}.py" \
-o "eff_job_${sequence}.opts.py" --all-opts \
2>&1 | tee "eff_job_${sequence}".log
$HLTEFFICIENCYCHECKERROOT/scripts/hlt_line_efficiencies.py \
--level Hlt1 \
--reconstructible-children=Kplus0,Kminus0,Kplus1,Kminus1 \
--legend-header="B^{0}_{s} #rightarrow #phi#phi" \
--make-plots \
eff_ntuple.root \
2>&1 | tee eff_results.log
"eff_ntuple_${sequence}.root" \
2>&1 | tee "eff_results_${sequence}".log
# Rates
gaudirun.py \
$HLTEFFICIENCYCHECKERROOT/options/hlt1_rate_example.py \
-o rate_job.opts.py --all-opts \
2>&1 | tee rate_job.log
"$HLTEFFICIENCYCHECKERROOT/options/hlt1_rate_${sequence}".py \
-o "rate_job_${sequence}.opts.py" --all-opts \
2>&1 | tee "rate_job_${sequence}.log"
$HLTEFFICIENCYCHECKERROOT/scripts/hlt_calculate_rates.py \
--level Hlt1 \
--plot-rates --plot-total-rate --plot-group-rates \
--json Hlt1_rates.json \
rate_ntuple.root \
2>&1 | tee rate_results.log
--json "Hlt1_rates_${sequence}.json" \
"rate_ntuple_${sequence}.root" \
2>&1 | tee "rate_results_${sequence}.log"
......@@ -21,7 +21,8 @@ from Configurables import (TupleToolTrigger, TupleToolEventInfo,
MCTupleToolTOS)
from RecoConf.mc_checking import make_links_lhcbids_mcparticles_tracking_system
from RecoConf.data_from_file import mc_unpackers, make_mc_track_info
from RecoConf.hlt1_allen import make_allen_dec_reports
from RecoConf.hlt1_allen import (make_allen_dec_reports, sequence as
allen_sequence)
def _mc_decay_tree_tuple_input_transform(MCParticles, MCVertices, MCTrackInfo):
......
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE extension PUBLIC '-//QM/2.3/Extension//EN' 'http://www.codesourcery.com/qm/dtds/2.3/-//qm/2.3/extension//en.dtd'>
<!--
(c) Copyright 2020 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.
-->
<!--
Run the example options and ensure they produce no warnings or errors.
-->
<extension class="GaudiTest.GaudiExeTest" kind="test">
<argument name="program"><text>bash</text></argument>
<argument name="args"><set>
<text>$HLTEFFICIENCYCHECKERROOT/options/run_hlt1_allen_examples.sh</text>
<text>test_hlt1_allen_default</text>
<text>default</text>
</set></argument>
<argument name="use_temp_dir"><enumeral>true</enumeral></argument>
<argument name="timeout"><integer>1200</integer></argument>
<argument name="validator"><text>
countErrorLines({"FATAL": 0, "ERROR": 0})
</text></argument>
</extension>
......@@ -16,7 +16,8 @@ Run the example options and ensure they produce no warnings or errors.
<argument name="program"><text>bash</text></argument>
<argument name="args"><set>
<text>$HLTEFFICIENCYCHECKERROOT/options/run_hlt1_allen_examples.sh</text>
<text>test_hlt1_allen_example</text>
<text>test_hlt1_allen_no_gec</text>
<text>no_gec</text>
</set></argument>
<argument name="use_temp_dir"><enumeral>true</enumeral></argument>
......
......@@ -18,7 +18,7 @@ Run the example options and ensure they produce no warnings or errors.
<text>--output=test_hlt1_wizard</text>
<text>--output-suffix=_0</text>
<text>--force</text>
<text>$HLTEFFICIENCYCHECKERROOT/options/hlt1_eff_example.yaml</text>
<text>$HLTEFFICIENCYCHECKERROOT/options/hlt1_eff_default.yaml</text>
</set></argument>
<argument name="use_temp_dir"><enumeral>true</enumeral></argument>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment