Commit 6a182a3a authored by Patrick Koppenburg's avatar Patrick Koppenburg 🍃
Browse files

Merge branch 'remove-old-davinci-configurable' into 'master'

Remove old davinci configurable and related tests

Closes lhcb-dpa/project#137

See merge request !568
parents 3a130276 9ef2dfdd
Pipeline #2980097 passed with stage
in 35 seconds
###############################################################################
# (c) Copyright 2000-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. #
###############################################################################
"""
@file DVTestInitialise.py
Test for DaVinci initialisation
@author P. Koppenburg
@date 2009-01-07
"""
from Gaudi.Configuration import MessageSvc
from Configurables import DaVinci
DaVinci().MainOptions = ""
DaVinci().UserAlgorithms = []
DaVinci().EvtMax = 0 # No running
DaVinci().SkipEvents = 0
DaVinci().PrintFreq = 1
DaVinci().DataType = 'Upgrade'
DaVinci().Lumi = True
########################################################################
MessageSvc().Format = "% F%60W%S%7W%R%T %0W%M"
<?xml version="1.0" ?><!DOCTYPE extension PUBLIC '-//QM/2.3/Extension//EN' 'http://www.codesourcery.com/qm/dtds/2.3/-//qm/2.3/extension//en.dtd'>
<!--
(c) Copyright 2000-2018 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.
-->
<extension class="GaudiTest.GaudiExeTest" kind="test">
<argument name="program"><text>gaudirun.py</text></argument>
<argument name="args"><set>
<text>../options/DVTestInitialise.py</text>
</set></argument>
<argument name="validator"><text>
findReferenceBlock("""
TimingAuditor.TIMER INFO EVENT LOOP | 0.000 | 0.000 | 0.000 0.0 0.00 | 0 | 0.000 |
TimingAuditor.TIMER INFO DaVinciEventSeq | 0.000 | 0.000 | 0.000 0.0 0.00 | 0 | 0.000 |
TimingAuditor.TIMER INFO DaVinciInitAlg | 0.000 | 0.000 | 0.000 0.0 0.00 | 0 | 0.000 |
TimingAuditor.TIMER INFO FilteredEventSeq | 0.000 | 0.000 | 0.000 0.0 0.00 | 0 | 0.000 |
TimingAuditor.TIMER INFO DaVinciEventInitSeq | 0.000 | 0.000 | 0.000 0.0 0.00 | 0 | 0.000 |
TimingAuditor.TIMER INFO PhysInitSeq | 0.000 | 0.000 | 0.000 0.0 0.00 | 0 | 0.000 |
TimingAuditor.TIMER INFO AnalysisInitSeq | 0.000 | 0.000 | 0.000 0.0 0.00 | 0 | 0.000 |
TimingAuditor.TIMER INFO DaVinciAnalysisSeq | 0.000 | 0.000 | 0.000 0.0 0.00 | 0 | 0.000 |
TimingAuditor.TIMER INFO DaVinciUserSequence | 0.000 | 0.000 | 0.000 0.0 0.00 | 0 | 0.000 |
TimingAuditor.TIMER INFO MonitoringSequence | 0.000 | 0.000 | 0.000 0.0 0.00 | 0 | 0.000 |
TimingAuditor.TIMER INFO LumiSeq | 0.000 | 0.000 | 0.000 0.0 0.00 | 0 | 0.000 |
TimingAuditor.TIMER INFO EventAccount | 0.000 | 0.000 | 0.000 0.0 0.00 | 0 | 0.000 |
TimingAuditor.TIMER INFO IntegratorSeq | 0.000 | 0.000 | 0.000 0.0 0.00 | 0 | 0.000 |
TimingAuditor.TIMER INFO IntegrateBeamCrossing | 0.000 | 0.000 | 0.000 0.0 0.00 | 0 | 0.000 |
TimingAuditor.TIMER INFO ----------------------------------------------------------------------------------------------------------------------
""", stdout, result, causes, signature_offset = 0, id='rest')
countErrorLines({"FATAL":0})
</text></argument>
</extension>
<?xml version="1.0" ?>
<!--
(c) Copyright 2000-2018 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="explicit_suite.ExplicitSuite" kind="suite">
<argument name="test_ids"><set>
<text>davincisys.davincisys</text>
</set></argument>
</extension>
###############################################################################
# (c) Copyright 2000-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. #
###############################################################################
"""
@file DVTestInitialise.py
Test for DaVinci initialisation
@author P. Koppenburg
@date 2009-01-07
"""
from Gaudi.Configuration import *
from Configurables import DaVinci
DaVinci().MainOptions = ""
DaVinci().UserAlgorithms = []
DaVinci().EvtMax = 0 # No running
DaVinci().SkipEvents = 0
DaVinci().PrintFreq = 1
DaVinci().DataType = 'Upgrade'
DaVinci().Simulation = False
DaVinci().Lumi = True
########################################################################
MessageSvc().Format = "% F%60W%S%7W%R%T %0W%M"
......@@ -15,10 +15,7 @@ Test of a DST produced by HLT2 (Moore).
__author__ = "Patrick Koppenburg"
__date__ = "2021-03-22"
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_d2kk
......@@ -27,19 +24,20 @@ options.evt_max = -1
options.print_freq = 1
options.msg_svc_format = "% F%60W%S%7W%R%T %0W%M"
d0s = make_std_loose_d2kk()
pdt = PrintDecayTree(name="PrintD0s", Input=d0s)
def get_algs_d2kk():
d0s = make_std_loose_d2kk()
pdt = PrintDecayTree(name="PrintD0s", Input=d0s)
# the "upfront_reconstruction" is what unpacks reconstruction objects, particles and primary vertices
# from file and creates protoparticles.
algs = upfront_reconstruction() + [d0s, pdt]
# the "upfront_reconstruction" is what unpacks reconstruction objects, particles and primary vertices
# from file and creates protoparticles.
algs = upfront_reconstruction() + [d0s, pdt]
return algs
node = CompositeNode(
"PrintD0Node", children=algs, combine_logic=NodeLogic.NONLAZY_AND)
# File from Moore test
options.set_input_and_conds_from_testfiledb("Moore-Output-DST")
def main():
tools = []
algs = {"PrintD0Node": get_algs_d2kk()}
config = configure_input(options)
config.update(configure(options, node))
return algs, tools
###############################################################################
# (c) Copyright 2000-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. #
###############################################################################
#
# Options for a DaVinci job creating DSTs
#
# It looks for a J/psi and then saves the events in DSTs
# according to the number of PVs.
#
# @author Patrick Koppenburg
# @date 2009-02-03
#
##############################################################################
from Gaudi.Configuration import *
from Configurables import DaVinci
##############################################################################
from Configurables import FilterDesktop, DeterministicPrescaler
#
# get DoD muons
#
from PhysSelPython.Wrappers import Selection, DataOnDemand, SelectionSequence
#from Configurables import SelDSTWriter
from DSTWriters.Configuration import SelDSTWriter
from DSTWriters.microdstelements import CloneParticleMCInfo
MyLooseJpsi = DataOnDemand(Location='Phys/StdLooseJpsi2MuMu/Particles')
#
# Loop over three overlapping mass zones
#
MassRanges = [[3000, 3087], [3088, 3100], [3100, 4000]]
selections = []
for i in MassRanges:
lm = i[0]
hm = i[1]
ln = str(lm)
hn = str(hm)
name = ln + "_" + hn
# define the prescale to have a constant (assumed flat) level of background
prescale = DeterministicPrescaler(
"Prescale_" + name,
SeedName="Prescale_" + name,
AcceptFraction=100. / (hm - lm))
filter = FilterDesktop(
"Jpsi_" + name,
Code="(MM>" + ln + ") & (MM<" + hn + ") & (MIPCHI2DV(PRIMARY) > 2)")
SelJpsi = Selection(
'SelJpsi_' + name, Algorithm=filter, RequiredSelections=[MyLooseJpsi])
SeqJpsi = SelectionSequence(
'SeqJpsi_' + name,
TopSelection=SelJpsi,
EventPreSelector=[prescale],
# PostSelectionAlgs=[printer]
)
selections += [SeqJpsi]
dstWriter = SelDSTWriter(
"JpsiDSTWriter_" + name, SelectionSequences=selections)
dstWriter.MicroDSTElements['default'] += [CloneParticleMCInfo()]
seq = dstWriter.sequence()
DaVinci().UserAlgorithms = [seq]
##############################################################################
from Configurables import CondDB
DaVinci().EvtMax = 1000
DaVinci().PrintFreq = 100
# DaVinci().SkipEvents = 0
DaVinci().DataType = "Upgrade"
DaVinci().Simulation = True
DaVinci().InputType = 'LDST'
DaVinci().Lumi = False
CondDB().Upgrade = True
DaVinci().CondDBtag = "sim-20171127-vc-md100"
DaVinci().DDDBtag = "dddb-20171126"
########################################################################
MessageSvc().Format = "% F%60W%S%7W%R%T %0W%M"
##############################################################################
#-- GAUDI jobOptions generated on Mon Jan 17 17:13:58 2011
#-- Contains event types :
#-- 13144006 - 1 files - 10000 events - 4.13 GBytes
# MC 2010 Beam3500GeV-VeloClosed-MagDown-Nu3
# bs->Jpsi, Phi
from PRConfig import TestFileDB
TestFileDB.test_file_db["Upgrade_Bd2KstarMuMu"].run()
###############################################################################
# (c) Copyright 2000-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. #
###############################################################################
from Gaudi.Configuration import *
ApplicationMgr().ExtSvc + ["AuditorSvc"]
AuditorSvc().Auditors += ["FPEAuditor"]
#from Configurables import FPEAuditor
#FPEAuditor().TrapOn = [ "DivByZero", "Overflow", "Underflow" ]
#FPEAuditor().ActivateAt = ["Execute"]
###############################################################################
# (c) Copyright 2000-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. #
###############################################################################
########################################################################
from Gaudi.Configuration import *
from Configurables import GaudiSequencer
from Configurables import DaVinci, PhysConf
from Configurables import CondDB
########################################################################
DaVinci().EvtMax = 100 # Number of events
DaVinci().PrintFreq = 10 # Events to skip
DaVinci().DataType = "Upgrade" # Must be given
DaVinci().Simulation = True
DaVinci().InputType = 'LDST'
DaVinci().Lumi = False
CondDB().Upgrade = True
DaVinci().CondDBtag = "sim-20171127-vc-md100"
DaVinci().DDDBtag = "dddb-20171126"
DaVinci().HistogramFile = "dst-annpid.root"
########################################################################
from Configurables import ANNGlobalPID__ChargedProtoANNPIDMoni
DaVinci().UserAlgorithms += [
ANNGlobalPID__ChargedProtoANNPIDMoni("ANNPIDMoni")
]
########################################################################
from PRConfig import TestFileDB
TestFileDB.test_file_db["Upgrade_Bd2KstarMuMu"].run()
......@@ -8,9 +8,8 @@
# granted to it by virtue of its status as an Intergovernmental Organization #
# or submit itself to any jurisdiction. #
###############################################################################
from Configurables import DaVinci
DaVinci().TupleFile = 'DV-Ntuple.root'
DaVinci().HistogramFile = 'DV-Histos.root'
DaVinci().DataType = 'Upgrade'
DaVinci().Lumi = False
DaVinci().Simulation = True
{
'ntuple_file': 'DV-Ntuple.root',
'histo_file': 'DV-Histos.root',
'lumi': False
}
......@@ -8,5 +8,6 @@
# granted to it by virtue of its status as an Intergovernmental Organization #
# or submit itself to any jurisdiction. #
###############################################################################
from Configurables import DaVinci
DaVinci().InputType = 'DST'
ntuple_file: 'DV-Ntuple.root'
histo_file: 'DV-Histos.root'
lumi: False
###############################################################################
# (c) Copyright 2000-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. #
###############################################################################
from Configurables import DaVinci
DaVinci().InputType = 'MDST'
###############################################################################
# (c) Copyright 2000-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. #
###############################################################################
from Configurables import LHCbApp, CondDB
LHCbApp().DDDBtag = "dddb-20171126"
LHCbApp().CondDBtag = "sim-20171127-vc-md100"
CondDB().Upgrade = True
......@@ -8,24 +8,10 @@
# granted to it by virtue of its status as an Intergovernmental Organization #
# or submit itself to any jurisdiction. #
###############################################################################
from Configurables import GaudiSequencer
from Configurables import LHCbApp, CondDB
from Configurables import DaVinci
from PyConf.Algorithms import GenFSRMerge, GenFSRLog
from PRConfig import TestFileDB
seqGenFSR = GaudiSequencer("GenFSRSeq")
seqGenFSR.Members += ["GenFSRMerge"]
seqGenFSR.Members += ["GenFSRLog"]
DaVinci().DataType = "Upgrade"
DaVinci().Simulation = True
DaVinci().InputType = "LDST"
DaVinci().Lumi = False
DaVinci().UserAlgorithms = [seqGenFSR]
CondDB().Upgrade = True
LHCbApp().DDDBtag = "dddb-20171126"
LHCbApp().CondDBtag = "sim-20171127-vc-md100"
TestFileDB.test_file_db["genFSR_upgrade_ldst"].run(configurable=DaVinci())
def main():
tools = []
algs = {"FSRNode": [GenFSRMerge(), GenFSRLog()]}
return algs, tools
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# (c) Copyright 2000-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. #
###############################################################################
# =============================================================================
## @file gpython_algs
# simmple test for two problems
# - contrintuitive IAlgorithm::isInitialize [But ok...]
# - ALG-fuctors, created from python prompt/loop
# [it is ok when they are created via Hybrid framework]
# @author Vanya BELYAEV
# @date 2016-01-29
# =============================================================================
##
## Configurables:
##
from __future__ import print_function
from Configurables import DaVinci
dv = DaVinci(DataType="Upgrade", Simulation=True, InputType='LDST', Lumi=False)
##
## put some algorithms into "user" list
##
from PhysConf.Selections import AutomaticData
Kaons = AutomaticData('Phys/StdAllLooseKaons/Particles')
from PhysSelPython.Wrappers import SelectionSequence
seq = SelectionSequence('KAONS', Kaons)
dv.UserAlgorithms += [seq.sequence()]
## get some input data
from PRConfig import TestFileDB
TestFileDB.test_file_db["Upgrade_Bd2KstarMuMu"].run(configurable=DaVinci())
##
## GaudiPython
##
def isExecuted(alg):
if hasattr(alg._ialg, 'isExecuted'):
return alg._ialg.isExecuted()
else:
from cppyy.gbl import Gaudi, AlgExecState
return (alg._ialg.execState(
Gaudi.Hive.currentContext()).state() == AlgExecState.Done)
from GaudiPython.Bindings import AppMgr
gaudi = AppMgr()
alg = gaudi.algorithm('KAONS')
mainseq = 'DaVinciEventSeq'
from LoKiHlt.algorithms import ALG_EXECUTED, ALG_PASSED, ALG_ENABLED
## start event loop
for i in range(10):
gaudi.run(1)
alg = gaudi.algorithm('KAONS')
print(' [%d] KAONS initialized? %s [counterintuitive]' %
(i, alg._ialg.isInitialized()))
print(' [%d] KAONS executed? %s ' % (i, isExecuted(alg)))
print(
' without fix in $LOKICORE/src/AlgFunctors.cpp following lines produce segmentation violation'
)
fun1 = ALG_EXECUTED(mainseq)
fun2 = ALG_PASSED(mainseq)
fun3 = ALG_ENABLED(mainseq)
print(' [%d] main sequence executed? %s ' % (i, fun1()))
print(' [%d] main sequence passed? %s ' % (i, fun2()))
print(' [%d] main sequence enabled? %s ' % (i, fun3()))
exit()
# =============================================================================
# The END
# =============================================================================
......@@ -11,21 +11,20 @@
-->
<!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="program"> <text>davinci</text></argument>
<argument name="args"><set>
<text>-o</text>
<text>configuration_dst.py</text>
<text>--export</text>
<text>configuration_dst.opts</text>
<text>run-mc</text>
<text>--inputfiledb</text>
<text>Upgrade_Bd2KstarMuMu</text>
<text>-</text>
<text>--joboptfile</text>
<text>../options/Upgrade/DaVinci-Options.py</text>
<text>../options/Upgrade/Input-DST.py</text>
<text>../options/Upgrade/Upgrade-DB-tags.py</text>
</set></argument>
<argument name="use_temp_dir"><enumeral>true</enumeral></argument>
<argument name="validator"><text>
countErrorLines({"FATAL": 0, "ERROR": 0, "WARNING": 0}, stdout=stdout)
countErrorLines({"FATAL": 0, "ERROR": 0}, stdout=stdout)
</text></argument>
</extension>
<?xml version="1.0" ?>
<!--
(c) Copyright 2000-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="args"><set>
<text>-o</text>
<text>configuration_mdst.py</text>
<text>../options/Upgrade/DaVinci-Options.py</text>
<text>../options/Upgrade/Input-MDST.py</text>
<text>../options/Upgrade/Upgrade-DB-tags.py</text>
</set></argument>
<argument name="use_temp_dir"><enumeral>true</enumeral></argument>
<argument name="validator"><text>
countErrorLines({"FATAL": 0, "ERROR": 0, "WARNING": 0}, stdout=stdout)
</text></argument>
</extension>
<?xml version="1.0" ?>
<!--
(c) Copyright 2000-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>python</text></argument>
<argument name="args"><set>
<text>../options/gpython_algs.py</text>
</set></argument>
</extension>