Commit 6c7fd1b8 authored by amathad's avatar amathad
Browse files

Merge branch 'master' of ssh://gitlab.cern.ch:7999/lhcb/DaVinci into AM_tutorials

parents 1462eda0 91944409
......@@ -20,14 +20,15 @@ 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
from DaVinci.reco_objects_from_file import upfront_reconstruction
from DaVinci.common_particles_from_file 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"
options.process = 'Spruce'
jpsis = make_std_loose_jpsi2mumu()
......
......@@ -20,18 +20,18 @@ __date__ = "2021-11-23"
import Functors as F
from FunTuple import FunctorCollection
from FunTuple import FunTuple_Particles as Funtuple
from PyConf.application import make_data_with_FetchDataFromFile
from DaVinci.reco_objects import make_pvs_for
from PyConf.components import force_location
from DaVinci.reco_objects import make_pvs_v2
from DaVinci.algorithms import add_filter
from DaVinci import options
from DecayTreeFitter import DTFAlg
from DaVinci import options
#
# Definition of strucing line
#
bd2dsk_line = "SpruceB2OC_BdToDsmK_DsmToHHH_FEST_Line"
bd2dsk_data = make_data_with_FetchDataFromFile(
f"/Event/Spruce/{bd2dsk_line}/Particles")
bd2dsk_data = force_location(f"/Event/Spruce/{bd2dsk_line}/Particles")
_basic = 'basic'
_composite = 'composite'
......@@ -160,7 +160,7 @@ def alg_config():
#
# DecayTreeFitter Algorithm
#
v2_pvs = make_pvs_for(process=options.process, data_type=options.data_type)
v2_pvs = make_pvs_v2()
#
# DecayTreeFitter Algorithm
......
......@@ -9,7 +9,7 @@
# or submit itself to any jurisdiction. #
###############################################################################
annsvc_config: 'root://eoslhcb.cern.ch//eos/lhcb/wg/dpa/wp3/tests/spruce_all_lines_realtime.tck.json'
annsvc_config: 'root://eoslhcb.cern.ch//eos/lhcb/wg/dpa/wp3/tests/spruce_all_lines_realtime_newPacking.tck.json'
evt_max: 10
histo_file: 'DV-example-tupling-DTF-his-filtered.root'
ntuple_file: 'DV-example-tupling-DTF-ntp-filtered.root'
......
......@@ -23,9 +23,9 @@ __author__ = "P. Koppenburg"
__date__ = "2021-11-23"
import Functors as F
from DaVinci.standard_particles import make_detached_mumu
from DaVinci.reco_objects import upfront_reconstruction_from_file as upfront_reconstruction
from DaVinci.reco_objects import make_pvs
from DaVinci.standard_particles_from_file import make_detached_mumu
from DaVinci.reco_objects_from_file import upfront_reconstruction
from DaVinci.reco_objects_from_file import make_pvs
from FunTuple import FunctorCollection
from FunTuple import FunTuple_Particles as Funtuple
from DecayTreeFitter import DTFAlg, DTF_functors
......
......@@ -21,8 +21,8 @@ __author__ = "Davide Fazzini, Abhijit Mathad"
__date__ = "2021-06-18"
import Functors as F
from DaVinci.standard_particles import make_detached_mumu, make_KsDD
from DaVinci.reco_objects import upfront_reconstruction_from_file as upfront_reconstruction
from DaVinci.standard_particles_from_file import make_detached_mumu, make_KsDD
from DaVinci.reco_objects_from_file import upfront_reconstruction
from FunTuple import FunctorCollection
from FunTuple import FunTuple_Particles as Funtuple
from FunTuple.functorcollections import Kinematics
......
......@@ -21,8 +21,8 @@ __author__ = "Maurizio Martinelli, Abhijit Mathad"
__date__ = "2021-05-03"
import Functors as F
from DaVinci.standard_particles import make_detached_mumu
from DaVinci.reco_objects import upfront_reconstruction_from_file as upfront_reconstruction
from DaVinci.standard_particles_from_file import make_detached_mumu
from DaVinci.reco_objects_from_file import upfront_reconstruction
from FunTuple import FunctorCollection
from FunTuple import FunTuple_Particles as Funtuple
......
......@@ -19,8 +19,8 @@ __author__ = "Maurizio Martinelli, Abhijit Mathad"
__date__ = "2021-03-16"
from DaVinci import options, run_davinci
from DaVinci.standard_particles import make_detached_mumu, make_KsDD
from DaVinci.reco_objects import upfront_reconstruction_from_file as upfront_reconstruction
from DaVinci.standard_particles_from_file import make_detached_mumu, make_KsDD
from DaVinci.reco_objects_from_file import upfront_reconstruction
import Functors as F
from FunTuple import FunctorCollection
from FunTuple import FunTuple_Particles as Funtuple
......
......@@ -53,12 +53,16 @@ def main():
config = {
"location":
"/Event/Spruce/SpruceB2OC_BdToDsmPi_DsmToHHH_Line/Particles",
"filters": ["HLT_PASS('SpruceB2OC_BdToDsmPi_DsmToHHH_LineDecision')"],
"/Event/Spruce/SpruceB2OC_BdToDsmPi_DsmToKpKmPim_Line/Particles",
"filters":
["HLT_PASS('SpruceB2OC_BdToDsmPi_DsmToKpKmPim_LineDecision')"],
"preamble": ['TRACK_MAX_PT = MAXTREE(ISBASIC & HASTRACK, PT, -1)'],
"tuple": "DecayTree",
"fields": fields,
"variables": variables,
"tuple":
"DecayTree",
"fields":
fields,
"variables":
variables,
}
tools = []
......
......@@ -21,16 +21,21 @@
"""
import Functors as F
from PyConf.application import make_data_with_FetchDataFromFile
from PyConf.components import force_location
from PyConf.Algorithms import ParticleTaggerAlg, ParticleContainerMerger
from FunTuple import FunctorCollection, FunTuple_Particles as Funtuple
from DaVinci.algorithms import add_filter
from DaVinci.standard_particles import make_long_pions_from_spruce
from DaVinci.reco_objects import reconstruction
from DaVinci import options
options.process = 'Spruce'
bd2dsk_line = "SpruceB2OC_BdToDsmK_DsmToHHH_FEST_Line"
bd2dsk_data = make_data_with_FetchDataFromFile(
f"/Event/Spruce/{bd2dsk_line}/Particles")
pions = make_long_pions_from_spruce()
bd2dsk_data = force_location(f"/Event/Spruce/{bd2dsk_line}/Particles")
with reconstruction.bind(process=options.process):
pions = make_long_pions_from_spruce()
tagging_container = ParticleContainerMerger(
InputContainers=[pions]).OutputContainer
......@@ -77,8 +82,7 @@ tuple_B0DsK = Funtuple(
filter_B0DsK = add_filter("HDRFilter_B0DsK",
f"HLT_PASS('{bd2dsk_line}Decision')")
from DaVinci import options
options.annsvc_config = 'root://eoslhcb.cern.ch//eos/lhcb/wg/dpa/wp3/tests/spruce_all_lines_realtime.tck.json'
options.annsvc_config = 'root://eoslhcb.cern.ch//eos/lhcb/wg/dpa/wp3/tests/spruce_all_lines_realtime_newPacking.tck.json'
options.histo_file = 'DV-example-tagger-his.root'
options.ntuple_file = 'DV-example-tagger-ntp.root'
......
......@@ -12,7 +12,7 @@
Read an HLT2 file and create an ntuple using pre-defined Functor collections.
"""
from PyConf.application import make_data_with_FetchDataFromFile
from PyConf.components import force_location
from FunTuple import FunctorCollection, functorcollections
from FunTuple import FunTuple_Particles as Funtuple
from DaVinci.algorithms import add_filter
......@@ -20,8 +20,7 @@ from DaVinci import options
from DaVinci.truth_matching import configured_MCTruthAndBkgCatAlg
from DaVinci.algorithms import get_odin, get_decreports
d02kpi_data = make_data_with_FetchDataFromFile(
"/Event/HLT2/Hlt2CharmD0ToKmPipLine/Particles")
d02kpi_data = force_location("/Event/HLT2/Hlt2CharmD0ToKmPipLine/Particles")
#get configured "MCTruthAndBkgCatAlg" algorithm for HLT2 output
mctruth = configured_MCTruthAndBkgCatAlg(inputs=d02kpi_data)
......
......@@ -9,7 +9,7 @@
# or submit itself to any jurisdiction. #
###############################################################################
annsvc_config: 'root://eoslhcb.cern.ch//eos/lhcb/wg/dpa/wp3/NovemberFEST/hlt2_D0_Kpi_10evts.tck.json'
annsvc_config: 'root://eoslhcb.cern.ch//eos/lhcb/wg/dpa/wp3/NovemberFEST/hlt2_D0_Kpi_10evts_newPacking.tck.json'
evt_max: -1
histo_file: 'tuple_D0_Kpi_10evts_collections.root'
input_raw_format: 0.3
......
......@@ -14,13 +14,15 @@ Read an HLT2 file and create an ntuple with the new DaVinci configuration.
import Functors as F
from FunTuple import FunctorCollection
from FunTuple import FunTuple_Particles as Funtuple
from PyConf.application import make_data_with_FetchDataFromFile
from DaVinci.reco_objects import make_pvs_for
from PyConf.components import force_location
from DaVinci.reco_objects import make_pvs_v2, reconstruction
from DaVinci.algorithms import add_filter
from DaVinci import options
from DaVinci.truth_matching import configured_MCTruthAndBkgCatAlg
from DaVinci.algorithms import get_odin, get_decreports
options.process = 'Hlt2'
fields = {
"D0": "[D0 -> K- pi+]CC",
"Kminus": "[D0 -> ^K- pi+]CC",
......@@ -28,7 +30,9 @@ fields = {
}
# Creating v2 reconstructed vertices to be used in the following functor
v2_pvs = make_pvs_for(process="Hlt2", data_type="Upgrade")
with reconstruction.bind(process=options.process):
v2_pvs = make_pvs_v2()
d0_variables = FunctorCollection({
"ID": F.PARTICLE_ID,
"KEY": F.OBJECT_KEY,
......@@ -63,7 +67,7 @@ variables = {
def main():
d02kpi_data = make_data_with_FetchDataFromFile(
d02kpi_data = force_location(
"/Event/HLT2/Hlt2CharmD0ToKmPipLine/Particles")
my_filter = add_filter("HDRFilter_D0Kpi",
......
......@@ -9,7 +9,7 @@
# or submit itself to any jurisdiction. #
###############################################################################
annsvc_config: 'root://eoslhcb.cern.ch//eos/lhcb/wg/dpa/wp3/NovemberFEST/hlt2_D0_Kpi_10evts.tck.json'
annsvc_config: 'root://eoslhcb.cern.ch//eos/lhcb/wg/dpa/wp3/NovemberFEST/hlt2_D0_Kpi_10evts_newPacking.tck.json'
evt_max: -1
histo_file: 'tuple_D0_Kpi_10evts_fromHlt2.root'
lumi: false
......
......@@ -14,11 +14,13 @@ Read an HLT2 file and create an ntuple with the new DaVinci runned with gaudirun
import Functors as F
from FunTuple import FunctorCollection
from FunTuple import FunTuple_Particles as Funtuple
from PyConf.application import make_data_with_FetchDataFromFile
#from PyConf.application import make_data_with_FetchDataFromFile
from PyConf.components import force_location
from DaVinci.Configuration import run_davinci_app
from DaVinci.reco_objects import make_pvs_for
from DaVinci.reco_objects import make_pvs_v2, reconstruction
from DaVinci.algorithms import add_filter
from DaVinci import options
options.process = 'Hlt2'
fields = {
"D0": "[D0 -> K- pi+]CC",
......@@ -27,7 +29,9 @@ fields = {
}
# Creating v2 reconstructed vertices to be used in the following functor
v2_pvs = make_pvs_for(process='Hlt2', data_type="Upgrade")
with reconstruction.bind(process=options.process):
v2_pvs = make_pvs_v2()
d0_variables = FunctorCollection({
"PT": F.PT,
"BPVDIRA": F.BPVDIRA(v2_pvs),
......@@ -47,7 +51,7 @@ variables = {
def main():
d02kpi_data = make_data_with_FetchDataFromFile(
d02kpi_data = force_location(
"/Event/HLT2/Hlt2CharmD0ToKmPipLine/Particles")
my_filter = add_filter("HDRFilter_D0Kpi",
......@@ -63,12 +67,13 @@ def main():
options.ntuple_file = "tuple_D0_Kpi_10evts_gaudirun.root"
options.annsvc_config = "root://eoslhcb.cern.ch//eos/lhcb/wg/dpa/wp3/NovemberFEST/hlt2_D0_Kpi_10evts.tck.json"
options.annsvc_config = "root://eoslhcb.cern.ch//eos/lhcb/wg/dpa/wp3/NovemberFEST/hlt2_D0_Kpi_10evts_newPacking.tck.json"
options.process = 'Hlt2'
options.input_raw_format = 0.3
options.user_algorithms = "$DAVINCIEXAMPLESROOT/python/DaVinciExamples/tupling/option_davinci_tupling_from_hlt2_gaudirun:main"
options.write_fsr = False
fileDB_key = "FEST_November_2021_dst"
options.enable_unpack = True
fileDB_key = "FEST_November_2021_dst_newPacking"
fileDB_path = "$DAVINCIROOT/options/DaVinciDB-Example.yaml"
run_davinci_app(fileDB_key, fileDB_path)
......@@ -14,13 +14,14 @@ 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 PyConf.components import force_location
from DaVinci.algorithms import add_filter
from DaVinci import options
bd2dsk_line = make_data_with_FetchDataFromFile(
bd2dsk_line = force_location(
"/Event/Spruce/SpruceB2OC_BdToDsmK_DsmToHHH_FEST_Line/Particles")
bd2dspi_line = make_data_with_FetchDataFromFile(
"/Event/Spruce/SpruceB2OC_BdToDsmPi_DsmToHHH_Line/Particles")
bd2dspi_line = force_location(
"/Event/Spruce/SpruceB2OC_BdToDsmPi_DsmToKpKmPim_Line/Particles")
fields_dsk = {
'B0': "[B0 -> D_s- K+]CC",
......@@ -86,7 +87,6 @@ evt_filter = "HLT_PASS('Hlt2Topo2BodyLineDecision')"
def main():
from DaVinci import options
options.evt_pre_filters = {"Hlt2TopoLineFilter": evt_filter}
options.ntuple_file = "DV_example_sprucing_ntp.root"
options.histo_file = "DV_example_sprucing_his.root"
......@@ -96,7 +96,7 @@ def main():
"HLT_PASS('SpruceB2OC_BdToDsmK_DsmToHHH_FEST_LineDecision')")
filter_B0Dspi = add_filter(
"HDRFilter_B0Dspi",
"HLT_PASS('SpruceB2OC_BdToDsmPi_DsmToHHH_LineDecision')")
"HLT_PASS('SpruceB2OC_BdToDsmPi_DsmToKpKmPim_LineDecision')")
tools = []
algs = {
......
......@@ -9,7 +9,7 @@
# or submit itself to any jurisdiction. #
###############################################################################
annsvc_config: 'root://eoslhcb.cern.ch//eos/lhcb/wg/dpa/wp3/tests/spruce_all_lines_realtime.tck.json'
annsvc_config: 'root://eoslhcb.cern.ch//eos/lhcb/wg/dpa/wp3/tests/spruce_all_lines_realtime_newPacking.tck.json'
evt_max: -1
histo_file: 'sprucing_histos.root'
input_raw_format: 0.3
......
......@@ -14,7 +14,7 @@ from FunTuple import FunTuple_Particles as Funtuple
from FunTuple.functorcollections import Kinematics
from DaVinci.truth_matching import configured_MCTruthAndBkgCatAlg
from DaVinci.algorithms import add_filter
from PyConf.application import make_data_with_FetchDataFromFile
from PyConf.components import force_location
#FunTuple: define branches.
fields = {
......@@ -34,8 +34,7 @@ variables = {
def main():
B_data = make_data_with_FetchDataFromFile(
"/Event/Spruce/Spruce_Test_line/Particles")
B_data = force_location("/Event/Spruce/Spruce_Test_line/Particles")
my_filter = add_filter("HDRFilter_B",
"HLT_PASS('Spruce_Test_lineDecision')")
......
......@@ -9,7 +9,7 @@
# or submit itself to any jurisdiction. #
###############################################################################
annsvc_config: 'root://eoslhcb.cern.ch//eos/lhcb/wg/dpa/wp3/tests/spruce_MCtestfile.tck.json'
annsvc_config: 'root://eoslhcb.cern.ch//eos/lhcb/wg/dpa/wp3/tests/spruce_example_realtime_dstinput.tck.json'
evt_max: -1
histo_file: 'sprucing_mc_histos.root'
input_raw_format: 0.3
......
......@@ -27,6 +27,7 @@
-->
<extension class="GaudiTest.GaudiExeTest" kind="test">
<argument name="program"><text>davinci</text></argument>
<argument name="timeout"><integer>1000</integer></argument>
<argument name="args"><set>
<text>run-mc</text>
<text>--inputfiledb</text>
......@@ -37,31 +38,11 @@
<text>--user_algorithms</text>
<text>../../python/DaVinciExamples/tupling/option_davinci_configFuntuple:main</text>
</set></argument>
<argument name="validator"><text>
findReferenceBlock("""LAZY_AND: DaVinci #=110 Sum=4 Eff=|( 3.636364 +- 1.78482 )%|
NONLAZY_OR: FileSummaryRecords #=110 Sum=110 Eff=|( 100.0000 +- 0.00000 )%|
LAZY_AND: GenFSR #=110 Sum=110 Eff=|( 100.0000 +- 0.00000 )%|
RecordStream/FSROutputStreamDstWriter #=110 Sum=110 Eff=|( 100.0000 +- 0.00000 )%|
NONLAZY_OR: UserAnalysis #=110 Sum=4 Eff=|( 3.636364 +- 1.78482 )%|
LAZY_AND: B0Dspi #=110 Sum=4 Eff=|( 3.636364 +- 1.78482 )%|
LHCb__UnpackRawEvent/LHCb__UnpackRawEvent #=110 Sum=110 Eff=|( 100.0000 +- 0.00000 )%|
HltPackedDataDecoder/HltPackedDataDecoder #=110 Sum=110 Eff=|( 100.0000 +- 0.00000 )%|
UnpackMCParticle/UnpackMCParticle #=110 Sum=110 Eff=|( 100.0000 +- 0.00000 )%|
UnpackMCVertex/UnpackMCVertex #=110 Sum=110 Eff=|( 100.0000 +- 0.00000 )%|
UnpackTrack/UnpackTracks #=110 Sum=110 Eff=|( 100.0000 +- 0.00000 )%|
UnpackRecVertex/UnpackPVs #=110 Sum=110 Eff=|( 100.0000 +- 0.00000 )%|
UnpackProtoParticle/UnpackChargedProtos #=110 Sum=110 Eff=|( 100.0000 +- 0.00000 )%|
UnpackProtoParticle/UnpackNeutralProtos #=110 Sum=110 Eff=|( 100.0000 +- 0.00000 )%|
UnpackCaloHypo/UnpackCaloElectrons #=110 Sum=110 Eff=|( 100.0000 +- 0.00000 )%|
UnpackCaloHypo/UnpackCaloPhotons #=110 Sum=110 Eff=|( 100.0000 +- 0.00000 )%|
UnpackCaloHypo/UnpackCaloMergedPi0s #=110 Sum=110 Eff=|( 100.0000 +- 0.00000 )%|
UnpackCaloHypo/UnpackCaloSplitPhotons #=110 Sum=110 Eff=|( 100.0000 +- 0.00000 )%|
MuonPIDUnpacker/UnpackMuonPIDs #=110 Sum=110 Eff=|( 100.0000 +- 0.00000 )%|
RichPIDUnpacker/UnpackRichPIDs #=110 Sum=110 Eff=|( 100.0000 +- 0.00000 )%|
UnpackParticlesAndVertices/UnpackParticlesAndVertices #=110 Sum=110 Eff=|( 100.0000 +- 0.00000 )%|
LoKi__HDRFilter/Filter_B0Dspi #=110 Sum=4 Eff=|( 3.636364 +- 1.78482 )%|
FunTupleBase_Particles/Tuple_B0Dspi #=4 Sum=4 Eff=|( 100.0000 +- 0.00000 )%|
""", stdout, result, causes, signature_offset = 0, id = "Stream3")
<argument name="reference"><text>../refs/test_davinci_configFuntuple.ref</text></argument>
<argument name="error_reference"><text>../refs/empty.ref</text></argument>
<argument name="validator"><text>
from DaVinciTests.QMTest.DaVinciExclusions import preprocessor
validateWithReference(preproc = preprocessor)
countErrorLines({"FATAL":0, "ERROR":0})
</text></argument>
</text></argument>
</extension>
......@@ -23,6 +23,7 @@
-->
<extension class="GaudiTest.GaudiExeTest" kind="test">
<argument name="program"><text>davinci</text></argument>
<argument name="timeout"><integer>1000</integer></argument>
<argument name="args"><set>
<text>run-mc</text>
<text>--inputfiledb</text>
......
Supports Markdown
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