Skip to content
Snippets Groups Projects
Commit d52c3de4 authored by Davide Fazzini's avatar Davide Fazzini Committed by Patrick Koppenburg
Browse files

Avoid race conditions between tests

parent 1917e900
No related branches found
No related tags found
2 merge requests!1103Draft: Add AnalysisHelpers to DaVinci Stack,!672Avoid race conditions between tests
Showing
with 35 additions and 170 deletions
......@@ -36,6 +36,9 @@ bd2dsk_data = make_data_with_FetchDataFromFile(
_basic = 'basic'
_composite = 'composite'
options.ntuple_file = "DV_example_allFunctors_ntp.root"
options.histo_file = "DV_example_allFunctors_his.root"
def all_variables(pvs, DTFR, ptype):
"""
......
###############################################################################
# (c) Copyright 2020-2021 CERN for the benefit of the LHCb Collaboration #
# (c) Copyright 2020-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". #
......
......@@ -46,6 +46,10 @@ variables = {
def main():
from DaVinci.algorithms import configured_FunTuple
from DaVinci import options
options.ntuple_file = "DV_example_configFuntuple_ntp.root"
options.histo_file = "DV_example_configFuntuple_his.root"
config = {
"location":
......
......@@ -11,11 +11,9 @@
annsvc_config: 'root://eoslhcb.cern.ch//eos/lhcb/wg/dpa/wp3/NovemberFEST/hlt2_D0_Kpi_10evts.tck.json'
evt_max: -1
histo_file: 'tuple_D0_Kpi_10evts.root'
input_raw_format: 0.3
histo_file: 'tuple_D0_Kpi_10evts_fromHlt2.root'
lumi: false
ntuple_file: 'tuple_D0_Kpi_10evts.root'
ntuple_file: 'tuple_D0_Kpi_10evts_fromHlt2.root'
print_freq: 1
skip_events: 0
process: 'Hlt2'
stream: 'default'
\ No newline at end of file
......@@ -87,9 +87,9 @@ evt_filter = "HLT_PASS('Hlt2Topo2BodyLineDecision')"
def main():
from DaVinci import options
options.evt_max = -1
options.evt_pre_filters = {"Hlt2TopoLineFilter": evt_filter}
options.output_level = 3
options.ntuple_file = "DV_example_sprucing_ntp.root"
options.histo_file = "DV_example_sprucing_his.root"
filter_B0DsK = add_filter(
"HDRFilter_B0DsK",
......
......@@ -46,7 +46,7 @@ B_vars_stored = ['B0_SUBCOMB12_MM', 'B0_ALV', 'B0_BPVCORRM', 'B0_BPVDIRA', 'B0_B
B_vars_stored = sorted(B_vars_stored)
#open the TFile and TTree
ntuple = './sprucing_tuple.root'
ntuple = './DV_example_allFunctors_ntp.root'
if not os.path.isfile(ntuple): raise Exception(f"File: {ntuple} does not exist!")
f = TFile.Open(ntuple)
t_B = f.Get('B0DsK_Tuple/DecayTree')
......
......@@ -127,7 +127,7 @@ B_vars_stored =['D0_BKGCAT',
B_vars_stored = sorted(B_vars_stored)
#open the TFile and TTree
ntuple = './tuple_D0_Kpi_10evts.root'
ntuple = './tuple_D0_Kpi_10evts_fromHlt2.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')
......
......@@ -6,8 +6,8 @@ ApplicationMgr SUCCESS
ApplicationMgr INFO Application Manager Configured successfully
DetectorPersistencySvc INFO Added successfully Conversion service:XmlCnvSvc
DetectorDataSvc SUCCESS Detector description database: git:/lhcb.xml
NTupleSvc INFO Added stream file:tuple_D0_Kpi_10evts.root as FILE1
RootHistSvc INFO Writing ROOT histograms to: tuple_D0_Kpi_10evts.root
NTupleSvc INFO Added stream file:tuple_D0_Kpi_10evts_fromHlt2.root as FILE1
RootHistSvc INFO Writing ROOT histograms to: tuple_D0_Kpi_10evts_fromHlt2.root
HistogramPersistencySvc INFO Added successfully Conversion service:RootHistSvc
FSROutputStreamDstWriter INFO Data source: EventDataSvc output: SVC='Gaudi::RootCnvSvc'
EventClockSvc.FakeEventTime INFO Event times generated from 0 with steps of 0
......@@ -21,9 +21,9 @@ EventPersistencySvc INFO Added successfully Conversion servic
EventSelector SUCCESS Reading Event record 1. Record number within stream 1: 1
MCTruthAndBkgCatAlg#1.DaVinciSma... WARNING BackgroundCategory:: Common mother is stable. StatusCode=FAILURE
MCTruthAndBkgCatAlg#1.Background... WARNING BackgroundCategory:: Common mother is stable. StatusCode=FAILURE
RFileCnv INFO opening Root file "tuple_D0_Kpi_10evts.root" for writing
RFileCnv INFO opening Root file "tuple_D0_Kpi_10evts_fromHlt2.root" for writing
Tuple WARNING FunTupleBase<Gaudi::NamedRange_<std::vector<LHCb::Particle const*,std::allocator<LHCb::Particle const*> >,__gnu_cxx::__normal_iterator<LHCb::Particle const* const*,std::vector<LHCb::Particle const*,std::allocator<LHCb::Particle const*> > > > >:: Tuple 'DecayTree' 'unsigned long' has different sizes on 32/64 bit systems. Casting 'EVENTNUMBER' to 'unsigned long long'
RCWNTupleCnv INFO Booked TTree with ID: DecayTree "DecayTree" in directory tuple_D0_Kpi_10evts.root:/Tuple
RCWNTupleCnv INFO Booked TTree with ID: DecayTree "DecayTree" in directory tuple_D0_Kpi_10evts_fromHlt2.root:/Tuple
Tuple WARNING FunTupleBase<Gaudi::NamedRange_<std::vector<LHCb::Particle const*,std::allocator<LHCb::Particle const*> >,__gnu_cxx::__normal_iterator<LHCb::Particle const* const*,std::vector<LHCb::Particle const*,std::allocator<LHCb::Particle const*> > > > >:: Tuple 'DecayTree' 'unsigned long' has different sizes on 32/64 bit systems. Casting 'EVENTNUMBER' to 'unsigned long long'
Tuple WARNING FunTupleBase<Gaudi::NamedRange_<std::vector<LHCb::Particle const*,std::allocator<LHCb::Particle const*> >,__gnu_cxx::__normal_iterator<LHCb::Particle const* const*,std::vector<LHCb::Particle const*,std::allocator<LHCb::Particle const*> > > > >:: Tuple 'DecayTree' 'unsigned long' has different sizes on 32/64 bit systems. Casting 'EVENTNUMBER' to 'unsigned long long'
EventSelector SUCCESS Reading Event record 2. Record number within stream 1: 2
......@@ -73,7 +73,7 @@ ToolSvc INFO Removing all tools created by ToolSv
MCTruthAndBkgCatAlg#1.Background... SUCCESS #WARNINGS = 1 Message = 'Common mother is stable.'
MCTruthAndBkgCatAlg#1.DaVinciSma... SUCCESS #WARNINGS = 1 Message = 'Common mother is stable.'
RFileCnv INFO dumping contents of /NTUPLES/FILE1
TFile: name=tuple_D0_Kpi_10evts.root, title=Gaudi Trees, option=CREATE
TFile: name=tuple_D0_Kpi_10evts_fromHlt2.root, title=Gaudi Trees, option=CREATE
NTupleSvc INFO NTuples saved successfully
ApplicationMgr INFO Application Manager Finalized successfully
ApplicationMgr INFO Application Manager Terminated successfully
......
......@@ -11,86 +11,16 @@
"""
Read the output of an Sprucing job with the new DaVinci configuration.
"""
#from FunTuple import FunctorCollection
#from FunTuple import FunTuple_Particles as Funtuple
#from FunTuple.functorcollections import Kinematics
#from PyConf.application import make_data_with_FetchDataFromFile
from DaVinci.algorithms import add_filter
"""
bd2dsk_line = make_data_with_FetchDataFromFile(
"/Event/Spruce/SpruceB2OC_BdToDsmK_DsmToHHH_FEST_Line/Particles")
bd2dspi_line = make_data_with_FetchDataFromFile(
"/Event/Spruce/SpruceB2OC_BdToDsmPi_DsmToHHH_Line/Particles")
fields_dsk = {
'B0': "[B0 -> D_s- K+]CC",
'Ds': "[B0 -> ^D_s- K+]CC",
'Kp': "[B0 -> D_s- ^K+]CC"
}
fields_dspi = {
'B0': "[B0 -> D_s- pi+]CC",
'Ds': "[B0 -> ^D_s- pi+]CC",
'pip': "[B0 -> D_s- ^pi+]CC",
}
variables = FunctorCollection({
'LOKI_MAXPT': 'TRACK_MAX_PT',
'LOKI_Muonp_PT': 'CHILD(PT, 1)',
'LOKI_Muonm_PT': 'CHILD(PT, 2)',
})
variables_extra = FunctorCollection({
'LOKI_NTRCKS_ABV_THRSHLD':
'NINTREE(ISBASIC & (PT > 15*MeV))'
})
variables += variables_extra
#FunTuple: get functor collection from the imported functor library Kinematics
variables_all = Kinematics()
#FunTuple: associate functor collections to field (branch) name
variables_dsk = {
'ALL': variables_all, #adds variables to all fields
'B0': variables,
'Ds': variables_extra,
'Kp': variables_extra
}
variables_dspi = {
'ALL': variables_all, #adds variables to all fields
'B0': variables,
'Ds': variables_extra,
'pip': variables_extra,
}
loki_preamble = ['TRACK_MAX_PT = MAXTREE(ISBASIC & HASTRACK, PT, -1)']
tuple_B0DsK = Funtuple(
name="B0DsK_Tuple",
tuple_name="DecayTree",
fields=fields_dsk,
variables=variables_dsk,
loki_preamble=loki_preamble,
inputs=bd2dsk_line)
tuple_B0Dspi = Funtuple(
name="B0Dspi_Tuple",
tuple_name="DecayTree",
fields=fields_dspi,
variables=variables_dspi,
loki_preamble=loki_preamble,
inputs=bd2dspi_line)
"""
def main():
from DaVinci import options
options.evt_max = -1
options.evt_pre_filters = {
"Hlt2TopoLineFilter": "HLT_PASS('Hlt2Topo2BodyLineDecision')"
}
options.output_level = 3
options.ntuple_file = "ntuple_filter.root"
options.histo_file = "histo_filter.root"
filter_B0DsK = add_filter(
"HDRFilter_B0DsK",
......@@ -100,9 +30,6 @@ def main():
"HLT_PASS('SpruceB2OC_BdToDsmPi_DsmToHHH_LineDecision')")
tools = []
algs = {
"B0DsK": [filter_B0DsK], # tuple_B0DsK],
"B0Dspi": [filter_B0Dspi] #, tuple_B0Dspi]
}
algs = {"B0DsK": [filter_B0DsK], "B0Dspi": [filter_B0Dspi]}
return algs, tools
###############################################################################
# (c) Copyright 2020-2021 CERN for the benefit of the LHCb Collaboration #
# (c) Copyright 2020-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". #
......@@ -11,6 +11,4 @@
evt_max: 1000
skip_events: 0
ntuple_file: 'DVNtuple.root'
histo_file: 'DVHistos.root'
enable_unpack: False
\ No newline at end of file
......@@ -57,7 +57,6 @@ def main():
from DaVinci import options
options.enable_unpack = True
options.unpack_stream = "/Event"
options.input_raw_format = 0.3
options.lumi = False
options.histo_file = "DV_histo_xgen.root"
......
......@@ -22,11 +22,12 @@ from DaVinci import options
bd2dsk_line = "SpruceB2OC_BdToDsmK_DsmToHHH_FEST_Line"
bd2dsk_data = make_data_with_FetchDataFromFile(
f"/Event/Spruce/{bd2dsk_line}/Particles")
fields_dsk = {
'B0': "[B0 -> D_s- K+]CC",
}
options.ntuple_file = "test_recVertices.root"
def alg_config():
v2_pvs = make_pvs_for(process=options.process, data_type=options.data_type)
......
###############################################################################
# (c) Copyright 2020-2021 CERN for the benefit of the LHCb Collaboration #
# (c) Copyright 2020-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". #
......@@ -11,11 +11,6 @@
annsvc_config: 'root://eoslhcb.cern.ch//eos/lhcb/wg/dpa/wp3/tests/spruce_all_lines_realtime.tck.json'
evt_max: -1
histo_file: 'sprucing_histos.root'
input_raw_format: 0.3
lumi: false
ntuple_file: 'sprucing_tuple.root'
print_freq: 1
skip_events: 0
process: 'Spruce'
stream: 'default'
process: Spruce
stream: default
\ No newline at end of file
###############################################################################
# (c) Copyright 2020-2021 CERN for the benefit of the LHCb Collaboration #
# (c) Copyright 2020-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". #
......@@ -26,6 +26,9 @@ def main():
algs = [VoidConsumer(OutputLevel=ERROR)]
from DaVinci import options
options.ntuple_file = "DVtest_useralgs_ntp.root"
options.histo_file = "DVtest_useralgs_his.root"
options.evt_max = 10
options.enable_unpack = False
......
......@@ -6,16 +6,12 @@ ApplicationMgr SUCCESS
ApplicationMgr INFO Application Manager Configured successfully
DetectorPersistencySvc INFO Added successfully Conversion service:XmlCnvSvc
DetectorDataSvc SUCCESS Detector description database: git:/lhcb.xml
NTupleSvc INFO Added stream file:DVNtuple.root as FILE1
RootHistSvc INFO Writing ROOT histograms to: DVHistos.root
HistogramPersistencySvc INFO Added successfully Conversion service:RootHistSvc
FSROutputStreamDstWriter INFO Data source: EventDataSvc output: SVC='Gaudi::RootCnvSvc'
EventClockSvc.FakeEventTime INFO Event times generated from 0 with steps of 0
ApplicationMgr INFO Application Manager Initialized successfully
DeFTDetector INFO Current FT geometry version = 63
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/MC/Upgrade/LDST/00076720/0000/00076720_00000002_1.ldst' SVC='Gaudi::RootEvtSelector' OPT='READ' IgnoreChecksum='YES'
EventSelector SUCCESS Reading Event record 1. Record number within stream 1: 1
ApplicationMgr INFO Application Manager Stopped successfully
FSROutputStreamDstWriter INFO Set up File Summary Record
......
......@@ -6,16 +6,12 @@ ApplicationMgr SUCCESS
ApplicationMgr INFO Application Manager Configured successfully
DetectorPersistencySvc INFO Added successfully Conversion service:XmlCnvSvc
DetectorDataSvc SUCCESS Detector description database: git:/lhcb.xml
NTupleSvc INFO Added stream file:DVNtuple.root as FILE1
RootHistSvc INFO Writing ROOT histograms to: DVHistos.root
HistogramPersistencySvc INFO Added successfully Conversion service:RootHistSvc
FSROutputStreamDstWriter INFO Data source: EventDataSvc output: SVC='Gaudi::RootCnvSvc'
EventClockSvc.FakeEventTime INFO Event times generated from 0 with steps of 0
ApplicationMgr INFO Application Manager Initialized successfully
DeFTDetector INFO Current FT geometry version = 63
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/MC/Upgrade/LDST/00076720/0000/00076720_00000002_1.ldst' SVC='Gaudi::RootEvtSelector' OPT='READ' IgnoreChecksum='YES'
EventSelector SUCCESS Reading Event record 1. Record number within stream 1: 1
ApplicationMgr INFO Application Manager Stopped successfully
FSROutputStreamDstWriter INFO Set up File Summary Record
......
INFO No MainOptions specified. DaVinci will import no options file!
INFO User algorithm option_davinci_user_algs.main imported successfully!
/***** User DVAppOptions/DVAppOptions **************************************************************
|-annsvc_config = '' (default: '')
|-auditors = [] (default: [])
|-buffer_events = 20000 (default: 20000)
|-callgrind_profile = False (default: False)
|-conddb_tag = 'sim-20171127-vc-md100' (default: '')
|-control_flow_file = '' (default: '')
|-data_flow_file = '' (default: '')
|-data_type = 'Upgrade' (default: '')
|-dddb_tag = 'dddb-20171126' (default: '')
|-detectors = ['VP', 'UT', 'FT', 'Rich1Pmt', 'Rich2Pmt', 'Ecal', 'Hcal', 'Muon', 'Magnet', 'Tr']
| (default: ['VP', 'UT', 'FT', 'Rich1Pmt', 'Rich2Pmt', 'Ecal', 'Hcal', 'Muon', 'Magnet', 'Tr'])
|-dqflags_tag = '' (default: '')
|-enable_unpack = False (default: True)
|-event_store = 'HiveWhiteBoard' (default: 'HiveWhiteBoard')
|-evt_max = 10 (default: -1)
|-evt_pre_filters = {} (default: {})
|-first_evt = 0 (default: 0)
|-histo_file = 'DVHistos.root' (default: '')
|-ignore_dq_flags = False (default: False)
|-input_files = ['root://eoslhcb.cern.ch//eos/lhcb/MC/Upgrade/LDST/00076720/0000/00076720_00000002_1.ldst', 'root://eoslhcb.cern.ch//eos/lhcb/MC/Upgrade/LDST/00076720/0000/00076720_00000004_1.ldst', 'root://eoslhcb.cern.ch//eos/lhcb/MC/Upgrade/LDST/00076720/0000/00076720_00000043_1.ldst', 'root://eoslhcb.cern.ch//eos/lhcb/MC/Upgrade/LDST/00076720/0000/00076720_00000068_1.ldst']
| (default: [])
|-input_raw_format = 0.3 (default: 0.3)
|-input_type = 'ROOT' (default: 'DST')
|-lines_maker = None
|-lumi = False (default: False)
|-main_options = '' (default: '')
|-memory_pool_size = 10485760 (default: 10485760)
|-merge_genfsr = False (default: False)
|-monitoring_file = '' (default: '')
|-msg_svc_format = '% F%35W%S %7W%R%T %0W%M' (default: '% F%35W%S %7W%R%T %0W%M')
|-msg_svc_time_format = '%Y-%m-%d %H:%M:%S UTC' (default: '%Y-%m-%d %H:%M:%S UTC')
|-n_event_slots = 1 (default: -1)
|-n_threads = 1 (default: 1)
|-ntuple_file = 'DVNtuple.root' (default: '')
|-output_file = '' (default: '')
|-output_level = 3 (default: 3)
|-output_type = '' (default: '')
|-override_data_options = False (default: False)
|-phoenix_filename = '' (default: '')
|-print_freq = 1000 (default: 1000)
|-process = 'Spruce' (default: 'Spruce')
|-python_logging_level = 30 (default: 30)
|-root_compression_level = 'LZMA:6' (default: 'LZMA:6')
|-scheduler_legacy_mode = True (default: True)
|-simulation = True (default: False)
|-skip_events = 0 (default: 0)
|-stream = 'default' (default: 'default')
|-tck = 0 (default: 0)
|-use_iosvc = False (default: False)
|-user_algorithms = '../options/option_davinci_user_algs:main' (default: '')
|-write_fsr = True (default: True)
\----- (End of User DVAppOptions/DVAppOptions) -----------------------------------------------------
ApplicationMgr SUCCESS
====================================================================================================================================
====================================================================================================================================
ApplicationMgr INFO Application Manager Configured successfully
DetectorPersistencySvc INFO Added successfully Conversion service:XmlCnvSvc
DetectorDataSvc SUCCESS Detector description database: git:/lhcb.xml
NTupleSvc INFO Added stream file:DVNtuple.root as FILE1
RootHistSvc INFO Writing ROOT histograms to: DVHistos.root
NTupleSvc INFO Added stream file:DVtest_useralgs_ntp.root as FILE1
RootHistSvc INFO Writing ROOT histograms to: DVtest_useralgs_his.root
HistogramPersistencySvc INFO Added successfully Conversion service:RootHistSvc
FSROutputStreamDstWriter INFO Data source: EventDataSvc output: SVC='Gaudi::RootCnvSvc'
EventClockSvc.FakeEventTime INFO Event times generated from 0 with steps of 0
......@@ -68,7 +15,6 @@ ApplicationMgr INFO Application Manager Initialized succ
DeFTDetector INFO Current FT geometry version = 63
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/MC/Upgrade/LDST/00076720/0000/00076720_00000002_1.ldst' SVC='Gaudi::RootEvtSelector' OPT='READ' IgnoreChecksum='YES'
EventSelector SUCCESS Reading Event record 1. Record number within stream 1: 1
ApplicationMgr INFO Application Manager Stopped successfully
FSROutputStreamDstWriter INFO Set up File Summary Record
......
###############################################################################
# (c) Copyright 2021 CERN for the benefit of the LHCb Collaboration #
# (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". #
......@@ -26,5 +26,4 @@ options.lumi = False
options.ntuple_file = 'DaVinci_tuple.root'
options.print_freq = 1
options.simulation = True
options.unpack_stream = ''
options.user_algorithms = 'DaVinciExamples/python/DaVinciExamples/tupling/example-tupling-basic-run-mc:main'
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