Skip to content
Snippets Groups Projects
Commit 350d862e authored by Ozlem Ozcelik's avatar Ozlem Ozcelik :snail: Committed by Sebastien Ponce
Browse files

Tests for new functor to access Hlt1 TIS/TOS information

parent cbd15eac
No related branches found
No related tags found
2 merge requests!1103Draft: Add AnalysisHelpers to DaVinci Stack,!771Tests for new functor to access Hlt1 TIS/TOS information
Showing
with 497 additions and 28 deletions
......@@ -5,4 +5,4 @@ input_type: ROOT
simulation: true
conddb_tag: sim-20171127-vc-md100
dddb_tag: dddb-20171126
input_process: Hlt2
\ No newline at end of file
input_process: Hlt2
input_files:
- "root://eoslhcb.cern.ch//eos/lhcb/wg/dpa/wp3/tests/moore_bs2phiphi_Hlt2filter.dst"
data_type: Upgrade
simulation: True
input_type: ROOT
dddb_tag: 'dddb-20210617'
conddb_tag: 'sim-20210617-vc-mu100'
input_manifest_file: 'root://eoslhcb.cern.ch//eos/lhcb/wg/dpa/wp3/tests/hlt2overhlt1_tck-phiphi.json'
ntuple_file: tuple_tistos.root
evt_max: -1
write_fsr: False
print_freq: 1000
input_process: 'Hlt2'
###############################################################################
# (c) Copyright 2021-2022 CERN for the benefit of the LHCb Collaboration #
# (c) Copyright 2021-2023 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". #
......@@ -24,6 +24,11 @@ from PyConf.Algorithms import WeightedRelTableAlg
from Gaudi.Configuration import INFO
from PyConf.reading import get_particles, get_mc_particles, get_mc_track_info
#define functor collections that need to be excluded.
#Delete the collection "HltTisTos" since the
# sample against which this options file is tested does not contain the Hlt1 selreports
exclude_functor_collections = ['HltTisTos']
class check_wrapper:
def __init__(self, functorcollection):
......@@ -36,7 +41,11 @@ class check_wrapper:
return func
def number_of_functor_collection(self):
return len(self.functorcollection.__all__)
fc = tuple([
entry for entry in self.functorcollection.__all__
if entry not in exclude_functor_collections
])
return len(fc)
def number_of_called_functor_collection(self):
return len(self.called)
......@@ -45,7 +54,11 @@ class check_wrapper:
if self.number_of_functor_collection(
) != self.number_of_called_functor_collection():
return False
sorted_set_all = sorted(set(self.functorcollection.__all__))
sorted_set_all = sorted(
set([
entry for entry in self.functorcollection.__all__
if entry not in exclude_functor_collections
]))
sorted_set_called = sorted(self.called)
if sorted_set_all != sorted_set_called:
return False
......@@ -65,7 +78,7 @@ def main(options: Options):
mcrted_all = MCReconstructed(MC_data, use_best_mcmatch=True)
# get configured "MCTruthAndBkgCatAlg" algorithm for HLT2 output
mctruth = configured_MCTruthAndBkgCatAlg(inputs=d02kpi_data)
mctruth_alg = configured_MCTruthAndBkgCatAlg(inputs=d02kpi_data)
# configure "WeightedRelTableAlg" algorithm for HLT2 output
iso_rel_table = WeightedRelTableAlg(
......@@ -80,10 +93,10 @@ def main(options: Options):
# use functorcollections to add variables, please expand when there's new collections :)
collections = [
functorcollections.Kinematics(),
functorcollections.MCHierarchy(mctruth=mctruth),
functorcollections.MCKinematics(mctruth=mctruth),
functorcollections.MCVertexInfo(mctruth=mctruth),
functorcollections.MCPromptDecay(mctruth=mctruth),
functorcollections.MCHierarchy(mctruth_alg=mctruth_alg),
functorcollections.MCKinematics(mctruth_alg=mctruth_alg),
functorcollections.MCVertexInfo(mctruth_alg=mctruth_alg),
functorcollections.MCPromptDecay(mctruth_alg=mctruth_alg),
functorcollections.TrackIsolation(iso_rel_table=iso_rel_table),
]
......@@ -100,7 +113,7 @@ def main(options: Options):
evt_collections = [
functorcollections.EventInfo(),
functorcollections.SelectionInfo(
sel_type="Hlt2", line_names=[line_name])
selection_type="Hlt2", trigger_lines=[line_name])
]
assert functorcollections.check(
......
###############################################################################
# (c) Copyright 2021-2022 CERN for the benefit of the LHCb Collaboration #
# (c) Copyright 2021-2023 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". #
......@@ -101,7 +101,8 @@ def main(options: Options):
"RUNNUMBER": F.RUNNUMBER(odin),
"EVENTNUMBER": F.EVENTNUMBER(odin)
})
evt_variables += SelectionInfo(sel_type="Hlt2", line_names=[line_name])
evt_variables += SelectionInfo(
selection_type="Hlt2", trigger_lines=[line_name])
#For now remove: The 'Hlt2' line decision tuples fine but breaks unit test with an error. (Why?)
#see linked issue here: https://gitlab.cern.ch/lhcb/DaVinci/-/merge_requests/654#note_5320732
evt_variables.pop('Hlt2')
......
###############################################################################
# (c) Copyright 2023 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 DaVinci import Options, make_config
from FunTuple import FunTuple_Particles as Funtuple
from DaVinci.algorithms import add_filter
from PyConf.reading import get_particles
from FunTuple import FunctorCollection as FC
import Functors as F
from FunTuple.functorcollections import HltTisTos, SelectionInfo
def main(options: Options):
# define feilds for candidates in the Hlt2 line
fields = {
"Bs": "[B_s0 -> (phi(1020) -> K+ K-) (phi(1020) -> K+ K-)]CC",
"phi1": "[B_s0 -> ^(phi(1020) -> K+ K-) (phi(1020) -> K+ K-)]CC",
"phi2": "[B_s0 -> (phi(1020) -> K+ K-) ^(phi(1020) -> K+ K-)]CC",
"Kp1": "[B_s0 -> (phi(1020) -> ^K+ K-) (phi(1020) -> K+ K-)]CC",
"Km1": "[B_s0 -> (phi(1020) -> K+ ^K-) (phi(1020) -> K+ K-)]CC",
"Kp2": "[B_s0 -> (phi(1020) -> K+ K-) (phi(1020) -> ^K+ K-)]CC",
"Km2": "[B_s0 -> (phi(1020) -> K+ K-) (phi(1020) -> K+ ^K-)]CC"
}
#define variables to be added to all fields
variables_all = FC({"PT": F.PT})
#specify line name to get data and define a filter for that line
line_name = "Hlt2BnoC_BdsToPhiPhi"
data = get_particles(f"/Event/HLT2/{line_name}/Particles")
my_filter = add_filter("HDRFilter_test", f"HLT_PASS('{line_name}')")
#specify Hlt1 line names for which TIS/TOS information is requested.
# Note that the Hlt2 Tis/Tos information is work-in-progress and
# only Hlt1 Tis/Tos information is available at the moment.
Hlt1_decisions = ['Hlt1TrackMVADecision', 'Hlt1TwoTrackMVADecision']
#Use the functorcollection "HltTisTos"
# 1st argument is selection type: "Hlt1" or "Hlt2". Currently only "Hlt1" is supported.
# 2nd argument is the list of Hlt1 line names for which TIS/TOS information is requested.
# 3rd argument is the TES location of the reconstructed particles.
variables_all += HltTisTos(
selection_type="Hlt1", trigger_lines=Hlt1_decisions, data=data)
variables = {'ALL': variables_all}
#When the TIS and TOS information of candidate wrt a line is negative but the event has still fired a Hlt1 line,
#then the trigger category for candidates wrt to that line is TOB (Trigger On Both) i.e. (!TIS && !TOS && event_decision).
# To store "event_decision" of Hlt1 lines and check for "TOB", we use "SelectionInfo" functor collection.
evt_variables = SelectionInfo(
selection_type="Hlt1", trigger_lines=Hlt1_decisions)
#define funtuple instance
my_tuple = Funtuple(
name="Tuple",
tuple_name="DecayTree",
fields=fields,
variables=variables,
event_variables=evt_variables,
inputs=data)
return make_config(options, [my_filter, my_tuple])
###############################################################################
# (c) Copyright 2021-2022 CERN for the benefit of the LHCb Collaboration #
# (c) Copyright 2021-2023 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". #
......@@ -40,7 +40,8 @@ def main(options: Options):
]
#define event level variables
evt_variables = SelectionInfo(sel_type="Hlt1", line_names=Hlt1_decisions)
evt_variables = SelectionInfo(
selection_type="Hlt1", trigger_lines=Hlt1_decisions)
#define FunTuple instance
my_tuple = Funtuple(
......
<?xml version="1.0" ?>
<!--
###############################################################################
# (c) Copyright 2021-2023 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>DaVinciExamples.tupling.option_davinci_tupling_tistos:main</text>
</set></argument>
<argument name="options_yaml_fn"><text>$DAVINCIEXAMPLESROOT/example_data/test_tistos.yaml</text></argument>
<argument name="extra_options_yaml"><text>
histo_file: tistos_histos.root
ntuple_file: tistos_ntuple.root
print_freq: 1
</text></argument>
<argument name="reference"><text>../refs/test_davinci_tupling_tistos.ref</text></argument>
<argument name="error_reference"><text>../refs/empty.ref</text></argument>
<argument name="validator"><text>
from DaVinciTests.QMTest.DaVinciExclusions import preprocessor, counter_preprocessor
##validator complains about long TTreeNames so comment out(see https://gitlab.cern.ch/lhcb/DaVinci/-/issues/46)
#validateWithReference(preproc = preprocessor, counter_preproc = counter_preprocessor)
import sys, os, glob
from ROOT import TFile
B_vars_stored =['phi2_Hlt1_Hlt1TwoTrackMVADecision_TIS', 'Km2_Hlt1_Hlt1TwoTrackMVADecision_TOS', 'Km2_PT', 'Kp2_PT', 'Bs_Hlt1_Hlt1TrackMVADecision_TOS', 'Bs_PT', 'Kp2_Hlt1_Hlt1TwoTrackMVADecision_TIS', 'Km1_Hlt1_Hlt1TwoTrackMVADecision_TIS', 'phi1_Hlt1_Hlt1TwoTrackMVADecision_TOS', 'phi1_Hlt1_Hlt1TwoTrackMVADecision_TIS', 'Kp2_Hlt1_Hlt1TrackMVADecision_TOS', 'Kp2_Hlt1_Hlt1TrackMVADecision_TIS', 'Kp2_Hlt1_Hlt1TwoTrackMVADecision_TOS', 'Bs_Hlt1_Hlt1TrackMVADecision_TIS', 'phi1_Hlt1_Hlt1TrackMVADecision_TOS', 'phi2_Hlt1_Hlt1TrackMVADecision_TOS', 'Kp1_Hlt1_Hlt1TwoTrackMVADecision_TOS', 'Km2_Hlt1_Hlt1TwoTrackMVADecision_TIS', 'Kp1_Hlt1_Hlt1TrackMVADecision_TOS', 'Km1_Hlt1_Hlt1TrackMVADecision_TIS', 'Km1_Hlt1_Hlt1TwoTrackMVADecision_TOS', 'phi2_PT', 'Kp1_Hlt1_Hlt1TwoTrackMVADecision_TIS', 'phi1_Hlt1_Hlt1TrackMVADecision_TIS', 'phi2_Hlt1_Hlt1TrackMVADecision_TIS', 'phi1_PT', 'Hlt1_Hlt1TrackMVADecision', 'Hlt1_TCK', 'Kp1_Hlt1_Hlt1TrackMVADecision_TIS', 'Hlt1_Hlt1TwoTrackMVADecision', 'Kp1_PT', 'Km2_Hlt1_Hlt1TrackMVADecision_TIS', 'Bs_Hlt1_Hlt1TwoTrackMVADecision_TOS', 'Km1_Hlt1_Hlt1TrackMVADecision_TOS', 'Km2_Hlt1_Hlt1TrackMVADecision_TOS', 'Km1_PT', 'Bs_Hlt1_Hlt1TwoTrackMVADecision_TIS', 'phi2_Hlt1_Hlt1TwoTrackMVADecision_TOS']
#sort the expected vars
B_vars_stored = sorted(B_vars_stored)
#open the TFile and TTree
ntuple = './tuple_tistos.root'
if not os.path.isfile(ntuple): raise Exception(f"File: {ntuple} does not exist!")
f = TFile.Open(ntuple)
t_B = f.Get('Tuple/DecayTree')
#sort the stores vars
b_names = sorted([b.GetName() for b in t_B.GetListOfLeaves()])
B_excluded_1 = set(B_vars_stored) - set(b_names)
B_excluded_2 = set(b_names) - set(B_vars_stored)
if len(B_excluded_1) != 0: raise Exception('Number of stored variables is less than what is expected. The extra variables expected are: ' , B_excluded_1)
if len(B_excluded_2) != 0: raise Exception('Number of stored variables is greater than what is expected. The extra variables stored are: ', B_excluded_2)
entry_num = 0
for entry in t_B:
tos = entry.Bs_Hlt1_Hlt1TrackMVADecision_TOS
tis = entry.Bs_Hlt1_Hlt1TrackMVADecision_TIS
dec = entry.Hlt1_Hlt1TrackMVADecision
#None of the candidates we ran are TOB i.e. (!tis and !tos and dec)
# we check that (tis | tos) == dec
tos_or_tis = tos or tis
if tos_or_tis != dec:
raise Exception(f'The entry # {entry_num} is perhaps TOB? i.e. (tis | tos) is {tos_or_tis} and decision is {dec}. However we did not run over a sample with TOB candidates. Please check!')
entry_num += 1
f.Close()
countErrorLines({"FATAL":0, "ERROR":0})
</text></argument>
</extension>
# WARNING: Created new key fc063a81 - to publish the corresponding decoding table, please do `git -C /disk/users/amathad/stack_moore/lhcb-metainfo/.git push origin key-fc063a81`
ApplicationMgr SUCCESS
====================================================================================================================================
Welcome to DaVinci version 63.2
running on grid-ui.physik.uzh.ch on Wed Nov 30 16:20:48 2022
====================================================================================================================================
ApplicationMgr INFO Application Manager Configured successfully
ToolSvc.GitDDDB INFO opening Git repository '/cvmfs/lhcb.cern.ch/lib/lhcb/git-conddb/DDDB.git'
ToolSvc.GitDDDB INFO using commit 'upgrade/dddb-20210617' corresponding to 1871f1bb5c0d68c81dda62e84cf1eb3a45513521
ToolSvc.GitSIMCOND INFO opening Git repository '/cvmfs/lhcb.cern.ch/lib/lhcb/git-conddb/SIMCOND.git'
ToolSvc.GitSIMCOND INFO using commit 'upgrade/sim-20210617-vc-mu100' corresponding to 869557e04541c3250ce6b4d35ec4bffe66820c60
DetectorPersistencySvc INFO Added successfully Conversion service:XmlCnvSvc
DetectorDataSvc SUCCESS Detector description database: git:/lhcb.xml
EventClockSvc.FakeEventTime INFO Event times generated from 0 with steps of 0
EventClockSvc.FakeEventTime INFO Run numbers generated from 0 every 0 events
MagneticFieldGridReader INFO Opened magnetic field file: /cvmfs/lhcb.cern.ch/lib/lhcb/DBASE/FieldMap/v5r7/cdf//field.v5r0.c1.up.cdf
MagneticFieldGridReader INFO Opened magnetic field file: /cvmfs/lhcb.cern.ch/lib/lhcb/DBASE/FieldMap/v5r7/cdf//field.v5r0.c2.up.cdf
MagneticFieldGridReader INFO Opened magnetic field file: /cvmfs/lhcb.cern.ch/lib/lhcb/DBASE/FieldMap/v5r7/cdf//field.v5r0.c3.up.cdf
MagneticFieldGridReader INFO Opened magnetic field file: /cvmfs/lhcb.cern.ch/lib/lhcb/DBASE/FieldMap/v5r7/cdf//field.v5r0.c4.up.cdf
MagneticFieldSvc INFO Map scaled by factor 1 with polarity internally used: 1 signed relative current: 1
NTupleSvc INFO Added stream file:outputDV_selrep_bs2phiphi.root as FILE1
HLTControlFlowMgr INFO Start initialization
RootHistSvc INFO Writing ROOT histograms to: outputDV_selrep_bs2phiphi.root
HistogramPersistencySvc INFO Added successfully Conversion service:RootHistSvc
HLTControlFlowMgr INFO Concurrency level information:
HLTControlFlowMgr INFO o Number of events slots: 1
HLTControlFlowMgr INFO o TBB thread pool size: 'ThreadPoolSize':1
HLTControlFlowMgr INFO ---> End of Initialization. This took 15288 ms
ApplicationMgr INFO Application Manager Initialized successfully
FunctorFactory INFO New functor library will be created.
FunctorFactory INFO Compilation of functor library took 25 seconds
DeFTDetector INFO Current FT geometry version = 64
ApplicationMgr INFO Application Manager Started successfully
EventPersistencySvc INFO Added successfully Conversion service:RootCnvSvc
EventSelector INFO Stream:EventSelector.DataStreamTool_1 Def:DATAFILE='root://eoslhcb.cern.ch//eos/lhcb/user/o/oozcelik/tistos/moore_bs2phiphi_Hlt2filter.dst' SVC='Gaudi::RootEvtSelector' OPT='READ' IgnoreChecksum='YES'
HLTControlFlowMgr INFO Will measure time between events 10 and 2147483647 (stop might be some events later)
HLTControlFlowMgr INFO Starting loop on events
EventSelector SUCCESS Reading Event record 1. Record number within stream 1: 1
HltANNSvc WARNING key 0x2b4c499d has an explicitly configured overrule -- using that...
HltANNSvc WARNING key 0xfc063a81 has an explicitly configured overrule -- using that...
HltANNSvc WARNING key 0x86a1c9c0 has an explicitly configured overrule -- using that...
HltANNSvc WARNING key 0x86a1c9c0 has an explicitly configured overrule -- using that...
RFileCnv INFO opening Root file "outputDV_selrep_bs2phiphi.root" for writing
RCWNTupleCnv INFO Booked TTree with ID: DecayTree "DecayTree" in directory outputDV_selrep_bs2phiphi.root:/Tuple
HLTControlFlowMgr INFO Timing started at: 16:22:30
HLTControlFlowMgr INFO No more events in event selection
HLTControlFlowMgr INFO ---> Loop over 39 Events Finished - WSS 1559.77, timed 29 Events: 1070 ms, Evts/s = 27.1028
HDRFilter_test INFO Number of counters : 1
| Counter | # | sum | mean/eff^* | rms/err^* | min | max |
|*"#passed" | 39 | 39 |( 100.0000 +- 0.000000)% |
ParticleUnpacker INFO Number of counters : 2
| Counter | # | sum | mean/eff^* | rms/err^* | min | max |
| "# Linked BufferData" | 351 | 4651666 | 13253.0 |
| "# UnpackedData" | 78 | 64286 | 824.18 |
ToolSvc.HltFactory INFO Number of counters : 1
| Counter | # | sum | mean/eff^* | rms/err^* | min | max |
| "# loaded from PYTHON" | 1 |
Tuple INFO Number of counters : 15
| Counter | # | sum | mean/eff^* | rms/err^* | min | max |
| "# events with multiple candidates for field Bs"| 39 |
| "# events with multiple candidates for field Km1"| 39 |
| "# events with multiple candidates for field Km2"| 39 |
| "# events with multiple candidates for field Kp1"| 39 |
| "# events with multiple candidates for field Kp2"| 39 |
| "# events with multiple candidates for field phi1"| 39 |
| "# events with multiple candidates for field phi2"| 39 |
| "# non-empty events for field Bs" | 39 |
| "# non-empty events for field Km1" | 39 |
| "# non-empty events for field Km2" | 39 |
| "# non-empty events for field Kp1" | 39 |
| "# non-empty events for field Kp2" | 39 |
| "# non-empty events for field phi1" | 39 |
| "# non-empty events for field phi2" | 39 |
| "# processed events" | 39 |
ApplicationMgr INFO Application Manager Stopped successfully
Tuple SUCCESS Booked 1 N-Tuples and 0 Event Tag Collections
Tuple SUCCESS List of booked N-Tuples in directory "FILE1/Tuple"
Tuple SUCCESS ID=DecayTree Title="DecayTree" #items=38 {Hlt1_Hlt1TrackMVADecision,Hlt1_Hlt1TwoTrackMVADecision,Hlt1_TCK,Bs_PT,Bs_Hlt1_Hlt}
HLTControlFlowMgr INFO Memory pool: used 0.00851832 +/- 0.000275936 MiB (min: 0, max: 0) in 1 +/- 0 blocks (allocated >once in 0 +/- 0% events). Allocated capacity was 10 +/- 0 MiB (min: 10, max: 10) and 139.564 +/- 4.52094 (min: 133, max: 261) requests were served
HLTControlFlowMgr INFO Timing table:
HLTControlFlowMgr INFO
| Name of Algorithm | Execution Count | Total Time / s | Avg. Time / us |
| Sum of all Algorithms | 39 | 2.499 | 64077.564 |
| "Tuple" | 39 | 1.373 | 35207.936 |
| "Gaudi__Hive__FetchDataFromFile" | 39 | 1.018 | 26104.642 |
| "ParticleUnpacker" | 39 | 0.040 | 1015.964 |
| "HltTisTosAlgName#1" | 39 | 0.029 | 735.246 |
| "reserveIOV" | 39 | 0.017 | 426.193 |
| "HltPackedBufferDecoder" | 39 | 0.016 | 408.237 |
| "HltSelReportsDecoder#1" | 39 | 0.003 | 73.079 |
| "Hlt2DecReportsDecoder#1" | 39 | 0.002 | 39.401 |
| "Hlt1DecReportsDecoder#1" | 39 | 0.001 | 26.599 |
| "LHCb__UnpackRawEvent#3" | 39 | 0.001 | 20.979 |
| "HDRFilter_test" | 39 | 0.000 | 7.183 |
| "LHCb__UnpackRawEvent#5" | 39 | 0.000 | 4.865 |
| "DummyEventTime" | 39 | 0.000 | 4.290 |
| "LHCb__UnpackRawEvent#4" | 39 | 0.000 | 3.097 |
HLTControlFlowMgr INFO StateTree: CFNode #executed #passed
LAZY_AND: DaVinci #=39 Sum=39 Eff=|( 100.0000 +- 0.00000 )%|
NONLAZY_OR: UserAnalysis #=39 Sum=39 Eff=|( 100.0000 +- 0.00000 )%|
LAZY_AND: default #=39 Sum=39 Eff=|( 100.0000 +- 0.00000 )%|
LoKi__HDRFilter/HDRFilter_test #=39 Sum=39 Eff=|( 100.0000 +- 0.00000 )%|
FunTupleBase_Particles/Tuple #=39 Sum=39 Eff=|( 100.0000 +- 0.00000 )%|
HLTControlFlowMgr INFO Histograms converted successfully according to request.
ToolSvc INFO Removing all tools created by ToolSvc
RootCnvSvc INFO Disconnected data IO:BA6260D4-6CCA-11ED-825C-FA163E74EFE7 [root://eoslhcb.cern.ch//eos/lhcb/user/o/oozcelik/tistos/moore_bs2phiphi_Hlt2filter.dst]
RFileCnv INFO dumping contents of /NTUPLES/FILE1
TFile: name=outputDV_selrep_bs2phiphi.root, title=Gaudi Trees, option=CREATE
******************************************************************************
*Tree :DecayTree : DecayTree *
*Entries : 328 : Total = 76485 bytes File Size = 13606 *
* : : Tree compression factor = 4.83 *
******************************************************************************
*Br 0 :Hlt1_Hlt1TrackMVADecision : Hlt1_Hlt1TrackMVADecision/i *
*Entries : 328 : Total Size= 1982 bytes File Size = 175 *
*Baskets : 1 : Basket Size= 32000 bytes Compression= 8.05 *
*............................................................................*
*Br 1 :Hlt1_Hlt1TwoTrackMVADecision : Hlt1_Hlt1TwoTrackMVADecision/i *
*Entries : 328 : Total Size= 1997 bytes File Size = 145 *
*Baskets : 1 : Basket Size= 32000 bytes Compression= 9.74 *
*............................................................................*
*Br 2 :Hlt1_TCK : Hlt1_TCK/i *
*Entries : 328 : Total Size= 1897 bytes File Size = 113 *
*Baskets : 1 : Basket Size= 32000 bytes Compression= 12.32 *
*............................................................................*
*Br 3 :Bs_PT : Bs_PT/F *
*Entries : 328 : Total Size= 1882 bytes File Size = 327 *
*Baskets : 1 : Basket Size= 32000 bytes Compression= 4.25 *
*............................................................................*
*Br 4 :Bs_Hlt1_Hlt1TrackMVADecision_TIS : *
* | Bs_Hlt1_Hlt1TrackMVADecision_TIS/I *
*Entries : 328 : Total Size= 2017 bytes File Size = 147 *
*Baskets : 1 : Basket Size= 32000 bytes Compression= 9.63 *
*............................................................................*
*Br 5 :Bs_Hlt1_Hlt1TrackMVADecision_TOS : *
* | Bs_Hlt1_Hlt1TrackMVADecision_TOS/I *
*Entries : 328 : Total Size= 2017 bytes File Size = 184 *
*Baskets : 1 : Basket Size= 32000 bytes Compression= 7.70 *
*............................................................................*
*Br 6 :Bs_Hlt1_Hlt1TwoTrackMVADecision_TIS : *
* | Bs_Hlt1_Hlt1TwoTrackMVADecision_TIS/I *
*Entries : 328 : Total Size= 2032 bytes File Size = 163 *
*Baskets : 1 : Basket Size= 32000 bytes Compression= 8.71 *
*............................................................................*
*Br 7 :Bs_Hlt1_Hlt1TwoTrackMVADecision_TOS : *
* | Bs_Hlt1_Hlt1TwoTrackMVADecision_TOS/I *
*Entries : 328 : Total Size= 2032 bytes File Size = 152 *
*Baskets : 1 : Basket Size= 32000 bytes Compression= 9.34 *
*............................................................................*
*Br 8 :phi1_PT : phi1_PT/F *
*Entries : 328 : Total Size= 1892 bytes File Size = 585 *
*Baskets : 1 : Basket Size= 32000 bytes Compression= 2.38 *
*............................................................................*
*Br 9 :phi1_Hlt1_Hlt1TrackMVADecision_TIS : *
* | phi1_Hlt1_Hlt1TrackMVADecision_TIS/I *
*Entries : 328 : Total Size= 2027 bytes File Size = 226 *
*Baskets : 1 : Basket Size= 32000 bytes Compression= 6.27 *
*............................................................................*
*Br 10 :phi1_Hlt1_Hlt1TrackMVADecision_TOS : *
* | phi1_Hlt1_Hlt1TrackMVADecision_TOS/I *
*Entries : 328 : Total Size= 2027 bytes File Size = 227 *
*Baskets : 1 : Basket Size= 32000 bytes Compression= 6.25 *
*............................................................................*
*Br 11 :phi1_Hlt1_Hlt1TwoTrackMVADecision_TIS : *
* | phi1_Hlt1_Hlt1TwoTrackMVADecision_TIS/I *
*Entries : 328 : Total Size= 2042 bytes File Size = 256 *
*Baskets : 1 : Basket Size= 32000 bytes Compression= 5.55 *
*............................................................................*
*Br 12 :phi1_Hlt1_Hlt1TwoTrackMVADecision_TOS : *
* | phi1_Hlt1_Hlt1TwoTrackMVADecision_TOS/I *
*Entries : 328 : Total Size= 2042 bytes File Size = 263 *
*Baskets : 1 : Basket Size= 32000 bytes Compression= 5.40 *
*............................................................................*
*Br 13 :phi2_PT : phi2_PT/F *
*Entries : 328 : Total Size= 1892 bytes File Size = 588 *
*Baskets : 1 : Basket Size= 32000 bytes Compression= 2.37 *
*............................................................................*
*Br 14 :phi2_Hlt1_Hlt1TrackMVADecision_TIS : *
* | phi2_Hlt1_Hlt1TrackMVADecision_TIS/I *
*Entries : 328 : Total Size= 2027 bytes File Size = 229 *
*Baskets : 1 : Basket Size= 32000 bytes Compression= 6.19 *
*............................................................................*
*Br 15 :phi2_Hlt1_Hlt1TrackMVADecision_TOS : *
* | phi2_Hlt1_Hlt1TrackMVADecision_TOS/I *
*Entries : 328 : Total Size= 2027 bytes File Size = 221 *
*Baskets : 1 : Basket Size= 32000 bytes Compression= 6.42 *
*............................................................................*
*Br 16 :phi2_Hlt1_Hlt1TwoTrackMVADecision_TIS : *
* | phi2_Hlt1_Hlt1TwoTrackMVADecision_TIS/I *
*Entries : 328 : Total Size= 2042 bytes File Size = 255 *
*Baskets : 1 : Basket Size= 32000 bytes Compression= 5.57 *
*............................................................................*
*Br 17 :phi2_Hlt1_Hlt1TwoTrackMVADecision_TOS : *
* | phi2_Hlt1_Hlt1TwoTrackMVADecision_TOS/I *
*Entries : 328 : Total Size= 2042 bytes File Size = 264 *
*Baskets : 1 : Basket Size= 32000 bytes Compression= 5.38 *
*............................................................................*
*Br 18 :Kp1_PT : Kp1_PT/F *
*Entries : 328 : Total Size= 1887 bytes File Size = 839 *
*Baskets : 1 : Basket Size= 32000 bytes Compression= 1.66 *
*............................................................................*
*Br 19 :Kp1_Hlt1_Hlt1TrackMVADecision_TIS : *
* | Kp1_Hlt1_Hlt1TrackMVADecision_TIS/I *
*Entries : 328 : Total Size= 2022 bytes File Size = 218 *
*Baskets : 1 : Basket Size= 32000 bytes Compression= 6.50 *
*............................................................................*
*Br 20 :Kp1_Hlt1_Hlt1TrackMVADecision_TOS : *
* | Kp1_Hlt1_Hlt1TrackMVADecision_TOS/I *
*Entries : 328 : Total Size= 2022 bytes File Size = 221 *
*Baskets : 1 : Basket Size= 32000 bytes Compression= 6.41 *
*............................................................................*
*Br 21 :Kp1_Hlt1_Hlt1TwoTrackMVADecision_TIS : *
* | Kp1_Hlt1_Hlt1TwoTrackMVADecision_TIS/I *
*Entries : 328 : Total Size= 2037 bytes File Size = 233 *
*Baskets : 1 : Basket Size= 32000 bytes Compression= 6.09 *
*............................................................................*
*Br 22 :Kp1_Hlt1_Hlt1TwoTrackMVADecision_TOS : *
* | Kp1_Hlt1_Hlt1TwoTrackMVADecision_TOS/I *
*Entries : 328 : Total Size= 2037 bytes File Size = 141 *
*Baskets : 1 : Basket Size= 32000 bytes Compression= 10.07 *
*............................................................................*
*Br 23 :Km1_PT : Km1_PT/F *
*Entries : 328 : Total Size= 1887 bytes File Size = 840 *
*Baskets : 1 : Basket Size= 32000 bytes Compression= 1.65 *
*............................................................................*
*Br 24 :Km1_Hlt1_Hlt1TrackMVADecision_TIS : *
* | Km1_Hlt1_Hlt1TrackMVADecision_TIS/I *
*Entries : 328 : Total Size= 2022 bytes File Size = 212 *
*Baskets : 1 : Basket Size= 32000 bytes Compression= 6.68 *
*............................................................................*
*Br 25 :Km1_Hlt1_Hlt1TrackMVADecision_TOS : *
* | Km1_Hlt1_Hlt1TrackMVADecision_TOS/I *
*Entries : 328 : Total Size= 2022 bytes File Size = 218 *
*Baskets : 1 : Basket Size= 32000 bytes Compression= 6.50 *
*............................................................................*
*Br 26 :Km1_Hlt1_Hlt1TwoTrackMVADecision_TIS : *
* | Km1_Hlt1_Hlt1TwoTrackMVADecision_TIS/I *
*Entries : 328 : Total Size= 2037 bytes File Size = 236 *
*Baskets : 1 : Basket Size= 32000 bytes Compression= 6.02 *
*............................................................................*
*Br 27 :Km1_Hlt1_Hlt1TwoTrackMVADecision_TOS : *
* | Km1_Hlt1_Hlt1TwoTrackMVADecision_TOS/I *
*Entries : 328 : Total Size= 2037 bytes File Size = 141 *
*Baskets : 1 : Basket Size= 32000 bytes Compression= 10.07 *
*............................................................................*
*Br 28 :Kp2_PT : Kp2_PT/F *
*Entries : 328 : Total Size= 1887 bytes File Size = 846 *
*Baskets : 1 : Basket Size= 32000 bytes Compression= 1.64 *
*............................................................................*
*Br 29 :Kp2_Hlt1_Hlt1TrackMVADecision_TIS : *
* | Kp2_Hlt1_Hlt1TrackMVADecision_TIS/I *
*Entries : 328 : Total Size= 2022 bytes File Size = 209 *
*Baskets : 1 : Basket Size= 32000 bytes Compression= 6.78 *
*............................................................................*
*Br 30 :Kp2_Hlt1_Hlt1TrackMVADecision_TOS : *
* | Kp2_Hlt1_Hlt1TrackMVADecision_TOS/I *
*Entries : 328 : Total Size= 2022 bytes File Size = 220 *
*Baskets : 1 : Basket Size= 32000 bytes Compression= 6.44 *
*............................................................................*
*Br 31 :Kp2_Hlt1_Hlt1TwoTrackMVADecision_TIS : *
* | Kp2_Hlt1_Hlt1TwoTrackMVADecision_TIS/I *
*Entries : 328 : Total Size= 2037 bytes File Size = 230 *
*Baskets : 1 : Basket Size= 32000 bytes Compression= 6.17 *
*............................................................................*
*Br 32 :Kp2_Hlt1_Hlt1TwoTrackMVADecision_TOS : *
* | Kp2_Hlt1_Hlt1TwoTrackMVADecision_TOS/I *
*Entries : 328 : Total Size= 2037 bytes File Size = 141 *
*Baskets : 1 : Basket Size= 32000 bytes Compression= 10.07 *
*............................................................................*
*Br 33 :Km2_PT : Km2_PT/F *
*Entries : 328 : Total Size= 1887 bytes File Size = 845 *
*Baskets : 1 : Basket Size= 32000 bytes Compression= 1.64 *
*............................................................................*
*Br 34 :Km2_Hlt1_Hlt1TrackMVADecision_TIS : *
* | Km2_Hlt1_Hlt1TrackMVADecision_TIS/I *
*Entries : 328 : Total Size= 2022 bytes File Size = 216 *
*Baskets : 1 : Basket Size= 32000 bytes Compression= 6.56 *
*............................................................................*
*Br 35 :Km2_Hlt1_Hlt1TrackMVADecision_TOS : *
* | Km2_Hlt1_Hlt1TrackMVADecision_TOS/I *
*Entries : 328 : Total Size= 2022 bytes File Size = 217 *
*Baskets : 1 : Basket Size= 32000 bytes Compression= 6.53 *
*............................................................................*
*Br 36 :Km2_Hlt1_Hlt1TwoTrackMVADecision_TIS : *
* | Km2_Hlt1_Hlt1TwoTrackMVADecision_TIS/I *
*Entries : 328 : Total Size= 2037 bytes File Size = 233 *
*Baskets : 1 : Basket Size= 32000 bytes Compression= 6.09 *
*............................................................................*
*Br 37 :Km2_Hlt1_Hlt1TwoTrackMVADecision_TOS : *
* | Km2_Hlt1_Hlt1TwoTrackMVADecision_TOS/I *
*Entries : 328 : Total Size= 2037 bytes File Size = 141 *
*Baskets : 1 : Basket Size= 32000 bytes Compression= 10.07 *
*............................................................................*
NTupleSvc INFO NTuples saved successfully
ApplicationMgr INFO Application Manager Finalized successfully
ApplicationMgr INFO Application Manager Terminated successfully
\ No newline at end of file
###############################################################################
# (c) Copyright 2021-2022 CERN for the benefit of the LHCb Collaboration #
# (c) Copyright 2021-2023 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". #
......@@ -68,18 +68,19 @@ def main(options: Options):
#Get selection line decision and HlT2 TCK.
# These decisions are stored in "LHCb::HltDecReports" object, which the ThOr functors take as input (like PVs in Example7), load it onto TES using "get_decreports".
# The function "get_decreports" takes as input:
# - sel_type: Type of selection "Hlt2" or "Spruce"
# - selection_type: Type of selection "Hlt2" or "Spruce"
# - line_names: list of line decision in this instance HLT2 line. Should return True for all since we are using the output of this line.
#
# The `Hlt1` decisions can be stored in similar way to `Hlt2` and `Spruce`
# (see example `option_trigger_decisions` in `DaVinciExamples` folder).
# For details, can also refer to the [talk](https://indico.cern.ch/event/1164051/#5-accessing-hlt1-decisions-usi)
# (The talk mentions that to persist Hlt1 decisions, one needs to add few options to the Moore script).
sel_type = "Hlt2" #User defined and will be used as prefix for TBranch in the root file
selection_type = "Hlt2" #User defined and will be used as prefix for TBranch in the root file
turbo_line = "Hlt2BsToJpsiPhi_JPsi2MuMu_PhiToKK_Line"
turbo_line2 = "Hlt2BsToJpsiPhi_JPsi2ee_PhiToKK_Line"
line_names = [f'{turbo_line}Decision', f'{turbo_line2}']
selinfo = SelectionInfo(sel_type=sel_type, line_names=line_names)
selinfo = SelectionInfo(
selection_type=selection_type, trigger_lines=line_names)
print(selinfo)
#Define variables dictionary "field name" -> Collections of functor
......
###############################################################################
# (c) Copyright 2021-2022 CERN for the benefit of the LHCb Collaboration #
# (c) Copyright 2021-2023 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". #
......@@ -45,13 +45,13 @@ def main(options: Options):
turbo_line = "Hlt2BsToJpsiPhi_JPsi2MuMu_PhiToKK_Line"
input_data = get_particles(f"/Event/HLT2/{turbo_line}/Particles")
#Define an algorithm that builds a map i.e. one-to-one relation b/w Reco Particle -> Truth MC Particle.
mctruth = configured_MCTruthAndBkgCatAlg(inputs=input_data)
#print(mctruth.MCAssocTable)
mctruth_alg = configured_MCTruthAndBkgCatAlg(inputs=input_data)
#print(mctruth_alg.MCAssocTable)
#Pass it to collections
kin = Kinematics()
mckin = MCKinematics(mctruth=mctruth)
mchierarchy = MCHierarchy(mctruth=mctruth)
mckin = MCKinematics(mctruth_alg=mctruth_alg)
mchierarchy = MCHierarchy(mctruth_alg=mctruth_alg)
#print(mckin)
#print(mchierarchy)
......@@ -75,7 +75,7 @@ def main(options: Options):
# - The 1st argument is the functor that returns the relevant information
# - The 2nd argument is relation table i.e. a one-to-one map b/w Reco Particle -> Truth MC Particle.
# Lets create a helper lambda function for that
MCTRUTH = lambda func: F.MAP_INPUT(func, mctruth.MCAssocTable)
MCTRUTH = lambda func: F.MAP_INPUT(func, mctruth_alg.MCAssocTable)
extra_info = {
# Important note: specify an invalid value for integer functors if there exists no truth info.
# The invalid value for floating point functors is set to nan.
......@@ -84,9 +84,9 @@ def main(options: Options):
}
extra_info = FC(extra_info)
#The algorithm mctruth also outputs a map b/w particle and bkg category which can be obtained using the functor
#The algorithm mctruth_alg also outputs a map b/w particle and bkg category which can be obtained using the functor
# For more info on background category see: https://twiki.cern.ch/twiki/bin/view/LHCb/TupleToolMCBackgroundInfo
bkg_cat = FC({"BKGCAT": F.BKGCAT(Relations=mctruth.BkgCatTable)})
bkg_cat = FC({"BKGCAT": F.BKGCAT(Relations=mctruth_alg.BkgCatTable)})
#Define variables dictionary "field name" -> Collections of functor
variables = {"ALL": kin + mckin + mchierarchy + bkg_cat, "Kp": extra_info}
......
###############################################################################
# (c) Copyright 2022 CERN for the benefit of the LHCb Collaboration #
# (c) Copyright 2022-2023 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". #
......@@ -14,7 +14,7 @@ from GaudiConf.LbExec import Options as DefaultOptions, InputProcessTypes
from pydantic import root_validator
from PyConf.reading import (upfront_decoder, reconstruction, get_tes_root,
get_odin, get_hlt_reports, get_mc_track_info)
from PyConf.application import default_raw_event, make_odin
from PyConf.application import default_raw_event, default_raw_banks, make_odin
class Options(DefaultOptions):
......@@ -74,6 +74,7 @@ class Options(DefaultOptions):
This function configures the following PyConf functions, where their keyword
arguments are globally bound to the user-specified values:
- default_raw_event
- default_raw_banks
- upfont_decoder
- reconstruction
- get_tes_root
......@@ -83,6 +84,7 @@ class Options(DefaultOptions):
This way users do not have to manually configure these functions themselves.
"""
default_raw_event.global_bind(raw_event_format=self.input_raw_format)
default_raw_banks.global_bind(stream=self.stream)
upfront_decoder.global_bind(
input_process=self.input_process, stream=self.stream)
reconstruction.global_bind(input_process=self.input_process)
......
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