diff --git a/DaVinciExamples/python/DaVinciExamples/tupling/example-tupling-AllFunctors.py b/DaVinciExamples/python/DaVinciExamples/tupling/example-tupling-AllFunctors.py index d8d96eed61f1091c6c9c41c29dec5aea72eb4cda..5f5f6bfda439a3db141fa0f6218d9d5774e9ac19 100644 --- a/DaVinciExamples/python/DaVinciExamples/tupling/example-tupling-AllFunctors.py +++ b/DaVinciExamples/python/DaVinciExamples/tupling/example-tupling-AllFunctors.py @@ -91,7 +91,7 @@ def all_variables(pvs, DTFR, ptype): all_vars['MAXPT'] = F.MAX(F.PT) all_vars['CHILD'] = F.CHILD(1, F.PT) #all_vars['SUBCOMB'] = F.SUBCOMB - all_vars['MASSWITHHYPOTHESES'] = F.MASSWITHHYPOTHESES([939., 939.]) + all_vars['MASSWITHHYPOTHESES'] = F.MASSWITHHYPOTHESES((939., 939.)) all_vars['END_VX'] = F.END_VX all_vars['END_VY'] = F.END_VY all_vars['END_VZ'] = F.END_VZ diff --git a/DaVinciExamples/python/DaVinciExamples/tupling/example-tupling-advanced-run-mc.py b/DaVinciExamples/python/DaVinciExamples/tupling/example-tupling-advanced-run-mc.py index c64c62c3e353f626e47faa2ddbdda102e7156675..29315b9616becb5345d886edd14216ad74d3e989 100644 --- a/DaVinciExamples/python/DaVinciExamples/tupling/example-tupling-advanced-run-mc.py +++ b/DaVinciExamples/python/DaVinciExamples/tupling/example-tupling-advanced-run-mc.py @@ -44,7 +44,7 @@ variables_jpsi = FunctorCollection({ 'PX': F.PX, 'PY': F.PY, 'PZ': F.PZ, - 'PE': F.ENERGY, + 'ENERGY': F.ENERGY, 'FourMom_P': F.FOURMOMENTUM, 'MAXPT': 'TRACK_MAX_PT', }) @@ -54,10 +54,10 @@ variables_jpsi.update({ 'PT': F.PT }) #OR like dictionaries can do variables_jpsi['LOKI_PT'] = 'PT' #FunTuple: Remove from collection given the list of variable names -variables_jpsi.pop(['PT', 'PE']) +variables_jpsi.pop(['PT', 'ENERGY']) #FunTuple: Join two functor #If entries already exist user is warned about picking entries from the base instance. -variables_extra = FunctorCollection({'E': F.ENERGY, 'P': F.P}) +variables_extra = FunctorCollection({'ENERGY': F.ENERGY, 'P': F.P}) variables_jpsi += variables_extra #FunTuple: Can also subtract two FunctorCollection to get unique entries like below #variables_unique = variables_jpsi - variables_extra diff --git a/DaVinciExamples/python/DaVinciExamples/tupling/option_davinci_tupling_from_collections.py b/DaVinciExamples/python/DaVinciExamples/tupling/option_davinci_tupling_from_collections.py index 5f207371c266cf8215e6db5d4238cd914351c0ac..8ee5bcbe3f855033ffb414c1599bd8f1264ed76e 100644 --- a/DaVinciExamples/python/DaVinciExamples/tupling/option_davinci_tupling_from_collections.py +++ b/DaVinciExamples/python/DaVinciExamples/tupling/option_davinci_tupling_from_collections.py @@ -18,6 +18,7 @@ from FunTuple import FunTuple_Particles as Funtuple 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 d02kpi_data = make_data_with_FetchDataFromFile( "/Event/HLT2/Hlt2CharmD0ToKmPipLine/Particles") @@ -25,6 +26,12 @@ d02kpi_data = make_data_with_FetchDataFromFile( #get configured "MCTruthAndBkgCatAlg" algorithm for HLT2 output mctruth = configured_MCTruthAndBkgCatAlg(inputs=d02kpi_data) +#get location to odin +odin = get_odin(options) + +#get location to hlt2 dec report +dec = get_decreports("Hlt2", options) + # use functorcollections to add variables, please expand when there's new collections :) collections = [ functorcollections.Kinematics(), @@ -33,13 +40,23 @@ collections = [ functorcollections.MCVertexInfo(mctruth) ] -assert len(collections) == len( +hlt2_line_names = ['Hlt2CharmD0ToKmPipLineDecision'] +evt_collections = [ + functorcollections.EventInfo(odin), + functorcollections.SelectionInfo("Hlt2", dec, hlt2_line_names) +] + +assert len(collections) + len(evt_collections) == len( functorcollections. __all__), "Oh no! Did you forget to add a new collection to this test?" -variable_collection = FunctorCollection() +field_vars = FunctorCollection() for coll in collections: - variable_collection += coll + field_vars += coll + +evt_vars = FunctorCollection() +for coll in evt_collections: + evt_vars += coll fields = { "D0": "[D0 -> K- pi+]CC", @@ -47,10 +64,16 @@ fields = { "piplus": "[D0 -> K- ^pi+]CC", } +#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 +print(evt_vars.pop(['Hlt2'])) + variables = { - "D0": variable_collection, - "Kminus": variable_collection, - "piplus": variable_collection + "D0": field_vars, + "Kminus": field_vars, + "piplus": field_vars, + #special field name "EVENT" (like "ALL") + "EVENT": evt_vars, } my_tuple = Funtuple( @@ -62,11 +85,6 @@ my_tuple = Funtuple( def main(): - options.ntuple_file = "tuple_D0_Kpi_10evts.root" - options.annsvc_config = "root://eoslhcb.cern.ch//eos/lhcb/wg/dpa/wp3/NovemberFEST/hlt2_D0_Kpi_10evts.tck.json" - options.process = "Hlt2" - options.input_raw_format = 0.3 - my_filter = add_filter("HDRFilter_D0Kpi", "HLT_PASS('Hlt2CharmD0ToKmPipLineDecision')") diff --git a/DaVinciExamples/python/DaVinciExamples/tupling/option_davinci_tupling_from_collections.yaml b/DaVinciExamples/python/DaVinciExamples/tupling/option_davinci_tupling_from_collections.yaml new file mode 100644 index 0000000000000000000000000000000000000000..ebcafd5995f81d55568a19b66e489852309abfa3 --- /dev/null +++ b/DaVinciExamples/python/DaVinciExamples/tupling/option_davinci_tupling_from_collections.yaml @@ -0,0 +1,21 @@ +############################################################################### +# (c) Copyright 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". # +# # +# 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. # +############################################################################### + +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_collections.root' +input_raw_format: 0.3 +lumi: false +ntuple_file: 'tuple_D0_Kpi_10evts_collections.root' +print_freq: 1 +skip_events: 0 +process: 'Hlt2' +stream: 'default' \ No newline at end of file diff --git a/DaVinciExamples/python/DaVinciExamples/tupling/option_davinci_tupling_from_hlt2.py b/DaVinciExamples/python/DaVinciExamples/tupling/option_davinci_tupling_from_hlt2.py index cfb4085e74a8e1286dbab1185df5a5f090bab173..07f503483905d1c620b58b04cfc7252a9dcc0617 100644 --- a/DaVinciExamples/python/DaVinciExamples/tupling/option_davinci_tupling_from_hlt2.py +++ b/DaVinciExamples/python/DaVinciExamples/tupling/option_davinci_tupling_from_hlt2.py @@ -19,6 +19,7 @@ from DaVinci.reco_objects import make_pvs_for 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 fields = { "D0": "[D0 -> K- pi+]CC", @@ -62,11 +63,6 @@ variables = { def main(): - options.ntuple_file = "tuple_D0_Kpi_10evts.root" - options.annsvc_config = "root://eoslhcb.cern.ch//eos/lhcb/wg/dpa/wp3/NovemberFEST/hlt2_D0_Kpi_10evts.tck.json" - options.process = "Hlt2" - options.input_raw_format = 0.3 - d02kpi_data = make_data_with_FetchDataFromFile( "/Event/HLT2/Hlt2CharmD0ToKmPipLine/Particles") @@ -101,6 +97,33 @@ def main(): for field in variables.keys(): variables[field] += FunctorCollection(trueid_bkgcat_info) + #get ODIN and DecReports location + odin = get_odin(options) + hlt2_dec = get_decreports("Hlt2", options) + + #Since input is from this line should return 1 for decisions + hlt2_lines = ['Hlt2CharmD0ToKmPipLineDecision'] + + #define event level variables + evt_variables = FunctorCollection({ + "RUNNUMBER": + F.RUNNUMBER(odin), + "EVENTNUMBER": + F.EVENTNUMBER(odin), + "Hlt2_TCK": + F.TCK(hlt2_dec), + "Sel": + F.DECISIONS(Lines=hlt2_lines, DecReports=hlt2_dec), + }) + #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('Sel') + + #Add them to a special branch called "EVENT" + # (currently two special branches exist: "EVENT" and "ALL") + variables["EVENT"] = evt_variables + + #define FunTuple instance my_tuple = Funtuple( name="Tuple", tuple_name="DecayTree", diff --git a/DaVinciExamples/python/DaVinciExamples/tupling/option_davinci_tupling_from_hlt2.yaml b/DaVinciExamples/python/DaVinciExamples/tupling/option_davinci_tupling_from_hlt2.yaml new file mode 100644 index 0000000000000000000000000000000000000000..3f239fbaaa57093790ca1d77385635c27ada89ce --- /dev/null +++ b/DaVinciExamples/python/DaVinciExamples/tupling/option_davinci_tupling_from_hlt2.yaml @@ -0,0 +1,21 @@ +############################################################################### +# (c) Copyright 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". # +# # +# 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. # +############################################################################### + +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 +lumi: false +ntuple_file: 'tuple_D0_Kpi_10evts.root' +print_freq: 1 +skip_events: 0 +process: 'Hlt2' +stream: 'default' \ No newline at end of file diff --git a/DaVinciExamples/tests/qmtest/tupling.qms/test_davinci_tupling_advanced.qmt b/DaVinciExamples/tests/qmtest/tupling.qms/test_davinci_tupling_advanced.qmt index 2da87d7979e86351b01a7b4a65a2a4677464e59c..9a3a2662bf47dfd33500a1adb6d97de2115d4b2b 100755 --- a/DaVinciExamples/tests/qmtest/tupling.qms/test_davinci_tupling_advanced.qmt +++ b/DaVinciExamples/tests/qmtest/tupling.qms/test_davinci_tupling_advanced.qmt @@ -38,37 +38,37 @@ import sys, os, glob from ROOT import TFile Jpsi_vars_stored = ['Jpsi_MAXPT', - 'Jpsi_E', - 'Jpsi_FourMom_PE', - 'Jpsi_FourMom_PX', - 'Jpsi_FourMom_PY', - 'Jpsi_FourMom_PZ', - 'Jpsi_M', - 'Jpsi_P', - 'Jpsi_PT', - 'Jpsi_PX', - 'Jpsi_PY', - 'Jpsi_PZ', - 'MuPlus_E', - 'MuPlus_M', - 'MuPlus_P', - 'MuPlus_PT', - 'MuPlus_PX', - 'MuPlus_PY', - 'MuPlus_PZ'] + 'Jpsi_PX', + 'Jpsi_PY', + 'Jpsi_PZ', + 'Jpsi_FourMom_PE', + 'Jpsi_FourMom_PX', + 'Jpsi_FourMom_PY', + 'Jpsi_FourMom_PZ', + 'Jpsi_ENERGY', + 'Jpsi_P', + 'Jpsi_M', + 'Jpsi_PT', + 'MuPlus_ENERGY', + 'MuPlus_P', + 'MuPlus_M', + 'MuPlus_PT', + 'MuPlus_PX', + 'MuPlus_PY', + 'MuPlus_PZ'] Ks_vars_stored = ['KS_MAXPT', - 'KS_E', - 'KS_FourMom_PE', - 'KS_FourMom_PX', - 'KS_FourMom_PY', - 'KS_FourMom_PZ', - 'KS_M', - 'KS_P', - 'KS_PT', - 'KS_PX', - 'KS_PY', - 'KS_PZ'] + 'KS_PX', + 'KS_PY', + 'KS_PZ', + 'KS_FourMom_PE', + 'KS_FourMom_PX', + 'KS_FourMom_PY', + 'KS_FourMom_PZ', + 'KS_ENERGY', + 'KS_P', + 'KS_M', + 'KS_PT'] #sort the expected vars Jpsi_vars_stored = sorted(Jpsi_vars_stored) diff --git a/DaVinciExamples/tests/qmtest/tupling.qms/test_davinci_tupling_from_collections.qmt b/DaVinciExamples/tests/qmtest/tupling.qms/test_davinci_tupling_from_collections.qmt index e8bb6d5a2e24e9bcc0d95b0789278345fabd6bc0..bfa5603d323f5bdda2130636e8aa1384287d7c74 100644 --- a/DaVinciExamples/tests/qmtest/tupling.qms/test_davinci_tupling_from_collections.qmt +++ b/DaVinciExamples/tests/qmtest/tupling.qms/test_davinci_tupling_from_collections.qmt @@ -30,6 +30,8 @@ <text>--inputfiledb</text> <text>FEST_November_2021_dst</text> <text>$DAVINCIROOT/options/DaVinciDB-Example.yaml</text> + <text>--joboptfile</text> + <text>../../python/DaVinciExamples/tupling/option_davinci_tupling_from_collections.yaml</text> <text>--user_algorithms</text> <text>../../python/DaVinciExamples/tupling/option_davinci_tupling_from_collections:main</text> </set></argument> diff --git a/DaVinciExamples/tests/qmtest/tupling.qms/test_davinci_tupling_from_hlt2.qmt b/DaVinciExamples/tests/qmtest/tupling.qms/test_davinci_tupling_from_hlt2.qmt index b4c9551791010caf1f85dc5627caba750e981a63..8b90ef895c2ae26277ec164600169a034f997185 100644 --- a/DaVinciExamples/tests/qmtest/tupling.qms/test_davinci_tupling_from_hlt2.qmt +++ b/DaVinciExamples/tests/qmtest/tupling.qms/test_davinci_tupling_from_hlt2.qmt @@ -30,6 +30,8 @@ <text>--inputfiledb</text> <text>FEST_November_2021_dst</text> <text>$DAVINCIROOT/options/DaVinciDB-Example.yaml</text> + <text>--joboptfile</text> + <text>../../python/DaVinciExamples/tupling/option_davinci_tupling_from_hlt2.yaml</text> <text>--user_algorithms</text> <text>../../python/DaVinciExamples/tupling/option_davinci_tupling_from_hlt2:main</text> </set></argument> @@ -116,7 +118,10 @@ B_vars_stored =['D0_BKGCAT', 'D0_KEY', 'D0_TRUEKEY', 'Kminus_TRUEKEY', - 'piplus_TRUEKEY'] + 'piplus_TRUEKEY', + 'RUNNUMBER', + 'EVENTNUMBER', + 'Hlt2_TCK'] #sort the expected vars B_vars_stored = sorted(B_vars_stored) diff --git a/DaVinciExamples/tests/refs/test_davinci_tupling_from_hlt2.ref b/DaVinciExamples/tests/refs/test_davinci_tupling_from_hlt2.ref index 780d344abb89b50ba16c5720f61deed2ade1d7e5..49106268b0cb718ef6232debb083d1b03c5b8a1a 100644 --- a/DaVinciExamples/tests/refs/test_davinci_tupling_from_hlt2.ref +++ b/DaVinciExamples/tests/refs/test_davinci_tupling_from_hlt2.ref @@ -22,20 +22,37 @@ EventSelector SUCCESS Reading Event record 1. Record numbe 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 +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 +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 +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' +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' +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' +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*> > > > >:: The WARNING message is suppressed : 'Tuple 'DecayTree' 'unsigned long' has different sizes on 32/64 bit systems. Casting 'EVENTNUMBER' to 'unsigned long long'' +EventSelector SUCCESS Reading Event record 3. Record number within stream 1: 3 +EventSelector SUCCESS Reading Event record 4. Record number within stream 1: 4 +EventSelector SUCCESS Reading Event record 5. Record number within stream 1: 5 +EventSelector SUCCESS Reading Event record 6. Record number within stream 1: 6 +EventSelector SUCCESS Reading Event record 7. Record number within stream 1: 7 ApplicationMgr INFO Application Manager Stopped successfully FSROutputStreamDstWriter INFO Set up File Summary Record FSROutputStreamDstWriter INFO Events output: 1 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=76 {D0_ID,D0_KEY,D0_PT,D0_PX,D0_PY,D0_PZ,D0_ENERGY,D0_P,D0_FOURMOMENTUME,D0_FOURMOMEN} +Tuple SUCCESS ID=DecayTree Title="DecayTree" #items=79 {EVENTNUMBER,Hlt2_TCK,RUNNUMBER,D0_ID,D0_KEY,D0_PT,D0_PX,D0_PY,D0_PZ,D0_ENERGY,D0_} +Tuple SUCCESS #WARNINGS = 93 Message = 'Tuple 'DecayTree' 'unsigned long' has different sizes on 32/64 bit systems. Casting 'EVENTNUMBER' to 'unsigned long long'' LAZY_AND: DaVinci #=7 Sum=7 Eff=|( 100.0000 +- 0.00000 )%| NONLAZY_OR: FileSummaryRecords #=7 Sum=7 Eff=|( 100.0000 +- 0.00000 )%| LAZY_AND: GenFSR #=7 Sum=7 Eff=|( 100.0000 +- 0.00000 )%| RecordStream/FSROutputStreamDstWriter #=7 Sum=7 Eff=|( 100.0000 +- 0.00000 )%| NONLAZY_OR: UserAnalysis #=7 Sum=7 Eff=|( 100.0000 +- 0.00000 )%| LAZY_AND: UserAlgs #=7 Sum=7 Eff=|( 100.0000 +- 0.00000 )%| - LHCb__UnpackRawEvent/LHCb__UnpackRawEvent #=7 Sum=7 Eff=|( 100.0000 +- 0.00000 )%| + LHCb__UnpackRawEvent/LHCb__UnpackRawEvent#1 #=7 Sum=7 Eff=|( 100.0000 +- 0.00000 )%| HltPackedDataDecoder/HltPackedDataDecoder #=7 Sum=7 Eff=|( 100.0000 +- 0.00000 )%| UnpackMCParticle/UnpackMCParticle #=7 Sum=7 Eff=|( 100.0000 +- 0.00000 )%| UnpackMCVertex/UnpackMCVertex #=7 Sum=7 Eff=|( 100.0000 +- 0.00000 )%| diff --git a/Phys/DaVinci/python/DaVinci/algorithms.py b/Phys/DaVinci/python/DaVinci/algorithms.py index 74cc9531b181999e1f3406522e132c6339ec1884..f9ef11b92b2344ea1fd05d3b3a9a910f76fb7989 100644 --- a/Phys/DaVinci/python/DaVinci/algorithms.py +++ b/Phys/DaVinci/python/DaVinci/algorithms.py @@ -14,6 +14,7 @@ from GaudiKernel.ProcessJobOptions import importOptions from PyConf.Algorithms import (LoKi__HDRFilter as HDRFilter, LoKi__VoidFilter as VoidFilter) from DaVinci.optionChecker import DVImportError, log_click +from PyConf.application import default_raw_event, make_odin def setup_algorithms(options): @@ -350,3 +351,33 @@ def configured_FunTuple(config): dictAlgs[key].append(funTuple) return dictAlgs + + +def get_odin(dv_options): + """ + Function to get the LHCb::ODIN location + + Args: + dv_options: Configured DaVinci.options object + Returns: + odin_loc: Location of the LHCb::ODIN + """ + with default_raw_event.bind(raw_event_format=dv_options.input_raw_format): + odin_loc = make_odin() + + return odin_loc + + +def get_decreports(sel_stage, dv_options): + """ + Function to get the LHCb::DecReports for HLT1 or Hlt2 or Spruce + + Args: + sel_state (str): Selction stage can be "Hlt1" or "Hlt2" or "Spruce" (There does not seem to be a decoder for Hlt1 currently) + dv_options: Configured DaVinci.options object + Returns: + dec_loc: Location of the LHCb::DecReports for HLT1 or Hlt2 or Spruce + """ + dec_loc = get_hlt_reports( + dv_options, source=sel_stage).OutputHltDecReportsLocation + return dec_loc