From eb9d59e70f6ee5183786af7503b3c44372ab5dee Mon Sep 17 00:00:00 2001 From: Sascha Stahl Date: Fri, 24 May 2019 09:21:02 +0200 Subject: [PATCH 1/3] Add simple MC checking sequence --- .../python/Hlt1Conf/reconstruction.py | 2 +- .../python/Hlt2Conf/data_from_file.py | 19 +++- Hlt/RecoConf/CMakeLists.txt | 18 ++++ Hlt/RecoConf/options/only_reco.py | 94 ++++++++++++++++ Hlt/RecoConf/python/RecoConf/__init.py__ | 0 Hlt/RecoConf/python/RecoConf/mcchecking.py | 102 ++++++++++++++++++ Hlt/RecoConf/python/RecoConf/mccuts.py | 101 +++++++++++++++++ PyConf/python/PyConf/core.py | 5 +- 8 files changed, 335 insertions(+), 6 deletions(-) create mode 100644 Hlt/RecoConf/CMakeLists.txt create mode 100644 Hlt/RecoConf/options/only_reco.py create mode 100644 Hlt/RecoConf/python/RecoConf/__init.py__ create mode 100644 Hlt/RecoConf/python/RecoConf/mcchecking.py create mode 100644 Hlt/RecoConf/python/RecoConf/mccuts.py diff --git a/Hlt/Hlt1Conf/python/Hlt1Conf/reconstruction.py b/Hlt/Hlt1Conf/python/Hlt1Conf/reconstruction.py index 3ff4f9b477a..4773aa4129f 100644 --- a/Hlt/Hlt1Conf/python/Hlt1Conf/reconstruction.py +++ b/Hlt/Hlt1Conf/python/Hlt1Conf/reconstruction.py @@ -143,7 +143,7 @@ def make_keyed_velo_tracks(make_velo_tracks=make_velo_tracks): @configurable def make_pvs(make_velo_tracks=make_velo_tracks, needConvertedTracks = False): tracks = make_velo_tracks(convertToSelection = needConvertedTracks) - return PVFinding(InputTracks = tracks, name = "WURST").OutputVerticesName + return PVFinding(InputTracks = tracks, name = "PVFinding").OutputVerticesName @configurable def make_V1_pvs(make_keyed_velo_tracks=make_keyed_velo_tracks, make_pvs=make_pvs): diff --git a/Hlt/Hlt2Conf/python/Hlt2Conf/data_from_file.py b/Hlt/Hlt2Conf/python/Hlt2Conf/data_from_file.py index b3ba367893b..ef59ebcc4c7 100644 --- a/Hlt/Hlt2Conf/python/Hlt2Conf/data_from_file.py +++ b/Hlt/Hlt2Conf/python/Hlt2Conf/data_from_file.py @@ -46,8 +46,11 @@ from Configurables import ( UnpackCaloHypo, UnpackProtoParticle, UnpackRecVertex, - UnpackTrackFunctional + UnpackTrackFunctional, + UnpackMCParticle, + UnpackMCVertex ) + from RawEventFormat import Raw_location_db from PyConf.core import Algorithm, force_location @@ -67,12 +70,18 @@ def packed_data_from_file(): 'PackedTracks': '/Event/pRec/Track/Best', 'PackedMuonTracks': '/Event/pRec/Track/Muon', 'PackedNeutralProtos': '/Event/pRec/ProtoP/Neutrals', - 'PackedChargedProtos': '/Event/pRec/ProtoP/Charged' + 'PackedChargedProtos': '/Event/pRec/ProtoP/Charged', + 'PackedMCParticles' : '/Event/pSim/MCParticles', + 'PackedMCVertices' : '/Event/pSim/MCVertices' } def unpacked_locations(): - return {k: v.replace('pRec', 'Rec') for k, v in packed_data_from_file().items()} + locations = {k: v.replace('pRec', 'Rec') for k, v in packed_data_from_file().items()} + # If the structure is not like this, pointers point to to the wrong place... + locations.update({'PackedMCParticles': "/Event/MC/Particles" }) + locations.update({'PackedMCVertices': "/Event/MC/Vertices" }) + return locations @configurable @@ -136,7 +145,9 @@ def unpackers(): ('Tracks', unpacker('PackedTracks', UnpackTrackFunctional, 'UnpackBestTracks')), ('MuonTracks', unpacker('PackedMuonTracks', UnpackTrackFunctional, 'UnpackMuonTracks')), ('NeutralProtos', unpacker('PackedNeutralProtos', UnpackProtoParticle, 'UnpackNeutralProtos')), - ('ChargedProtos', unpacker('PackedChargedProtos', UnpackProtoParticle, 'UnpackChargedProtos')) + ('ChargedProtos', unpacker('PackedChargedProtos', UnpackProtoParticle, 'UnpackChargedProtos')), + ('MCParticles', unpacker('PackedMCParticles', UnpackMCParticle, 'UnpackMCParticles')), + ('MCVertices', unpacker('PackedMCVertices', UnpackMCVertex, 'UnpackMCVertices')) ]) # Make sure we have consistent names, and that we're unpacking everything diff --git a/Hlt/RecoConf/CMakeLists.txt b/Hlt/RecoConf/CMakeLists.txt new file mode 100644 index 00000000000..a72357c289e --- /dev/null +++ b/Hlt/RecoConf/CMakeLists.txt @@ -0,0 +1,18 @@ +############################################################################### +# (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. # +############################################################################### +find_package(pytools) + +gaudi_install_python_modules() +gaudi_install_scripts() + +gaudi_add_test(pytests + COMMAND python -m pytest -v --doctest-modules + ${CMAKE_CURRENT_SOURCE_DIR}/python) diff --git a/Hlt/RecoConf/options/only_reco.py b/Hlt/RecoConf/options/only_reco.py new file mode 100644 index 00000000000..1ea31fb6fef --- /dev/null +++ b/Hlt/RecoConf/options/only_reco.py @@ -0,0 +1,94 @@ +############################################################################### +# (c) Copyright 2019 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 __future__ import absolute_import, division, print_function +import math + +from PyConf.smart import ( + configurable, +) +from Hlt1Conf.lines import ( + require_all, + require_any, + TrackV1FilterWithPVs, + TrackCombinerWithPVs, +) + +from Hlt1Conf.reconstruction import ( + gec, + RawData, + FilterEmptyPVs, + FTDecoding, + make_forward_tracks, + make_param_forward_fitted_tracks, + make_pvs, + EmptyFilter +) + +from Hlt2Conf.data_from_file import ( + unpackers +) + +from RecoConf.mcchecking import ( + make_velo_full_clusters, + make_links_veloclusters_mcparticles, + make_links_lhcbids_mcparticles, + make_links_tracks_mcparticles, + make_efficiency_checks +) + + +from PyConf.core import ( + Algorithm, + EverythingHandler, +) + +def patch_hybrid_tool(): + """Remove Hybrid modules that require a DVAlgorithm. + + Some modules import functors that depend on the DVAlgorithm context being + available. The LoKi::Hybrid::Tool tool loads these modules by default, but + we don't want nor need them, so remove them from the default list. + """ + # List of modules we will delete from the default list + dv_modules = [ + "LoKiPhys.decorators", + "LoKiArrayFunctors.decorators" + ] + + from Configurables import LoKi__Hybrid__Tool + factory = LoKi__Hybrid__Tool("HybridFactory") + for m in dv_modules: + del factory.Modules[factory.Modules.index(m)] + # Add the Track functors as we'll need most of these + # It can be important to include this in the Modules, otherwise the functor + # context patching might not be applied in time (e.g. if a Track functor is + # imported and instantiated in the preamble) + factory.Modules.append('LoKiTrack.decorators') + + + +ftdec_v = 4 +with FTDecoding.bind(DecodingVersion = ftdec_v): + + gec = gec(FTDecodingVersion=ftdec_v) + + NoPVFilter = FilterEmptyPVs() + + env = EverythingHandler(threadPoolSize = 1, nEventSlots = 1, evtMax = 100, debug=True, HistoFile = "test.root") + env.registerLine('Reconstruction', algs = [gec, make_pvs(), make_forward_tracks(), + make_velo_full_clusters(), make_links_lhcbids_mcparticles(), + make_links_tracks_mcparticles(), + make_efficiency_checks()]) + env.setupInputFromTestFileDB('MiniBrunel_2018_MinBias_FTv4_DIGI') + env.configureAllTheFlows() + #env.plotDataFlow() + + patch_hybrid_tool() diff --git a/Hlt/RecoConf/python/RecoConf/__init.py__ b/Hlt/RecoConf/python/RecoConf/__init.py__ new file mode 100644 index 00000000000..e69de29bb2d diff --git a/Hlt/RecoConf/python/RecoConf/mcchecking.py b/Hlt/RecoConf/python/RecoConf/mcchecking.py new file mode 100644 index 00000000000..db7207a37ca --- /dev/null +++ b/Hlt/RecoConf/python/RecoConf/mcchecking.py @@ -0,0 +1,102 @@ +############################################################################### +# (c) Copyright 2019 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 __future__ import absolute_import, division, print_function +from PyConf.smart import ( + configurable +) + +from PyConf.core import ( + make_algorithm, + Algorithm, + force_location, + Tool +) + +from Configurables import ( + VPClusFull, + VPFullCluster2MCParticleLinker, + PrLHCbID2MCParticle, + PrTrackAssociator, + PrTrackChecker +) + +from Hlt1Conf.reconstruction import( + RawData, + make_UT_clusters, + make_ft_clusters, + make_forward_tracks, + V2TrackConvV1 +) + +from Hlt2Conf.data_from_file import ( + unpackers, + make_data_from_file +) + +from RecoConf.mccuts import getMCCuts + +VeloFullClustering = make_algorithm(VPClusFull) +VeloFullCluster2MCParticleLinker = make_algorithm(VPFullCluster2MCParticleLinker) +PrLHCbID2MCParticle_comp = make_algorithm(PrLHCbID2MCParticle) +TrackAssociator = make_algorithm(PrTrackAssociator) +TrackChecker = make_algorithm(PrTrackChecker) + +@configurable +def make_velo_full_clusters(): + return VeloFullClustering(RawEventLocation=RawData().RawEvent).ClusterLocation + + +@configurable +def make_links_veloclusters_mcparticles(): + return VeloFullCluster2MCParticleLinker(ClusterLocation=make_velo_full_clusters(), + MCParticlesLocation=unpackers()["MCParticles"], + VPDigit2MCParticleLinksLocation=make_data_from_file("/Event/Link/Raw/VP/Digits")).OutputLocation + +@configurable +def make_links_lhcbids_mcparticles(): + return PrLHCbID2MCParticle_comp(MCParticlesLocation = unpackers()["MCParticles"], + VPFullClustersLocation = make_velo_full_clusters(), + VPFullClustersLinkLocation = make_links_veloclusters_mcparticles(), + UTHitsLocation = make_UT_clusters(), + UTHitsLinkLocation = make_data_from_file('/Event/Link/Raw/UT/Clusters'), + FTLiteClustersLocation = make_ft_clusters(), + FTLiteClustersLinkLocation = make_data_from_file('/Event/Link/Raw/FT/LiteClusters')).TargetName + +@configurable +def make_converted_to_track_v1(InputTracks=make_forward_tracks): + return V2TrackConvV1(InputTracksName=InputTracks()).OutputTracksName + +@configurable +def make_links_tracks_mcparticles(InputTracks = make_converted_to_track_v1, + LinkerLocationID = make_links_lhcbids_mcparticles): + return TrackAssociator(SingleContainer=InputTracks(), + LinkerLocationID = LinkerLocationID(), + MCParticleLocation = unpackers()["MCParticles"]).OutputLocation + +@configurable +def make_efficiency_checks(InputTracks=make_converted_to_track_v1, + Links = make_links_tracks_mcparticles, + TrackType = "Forward"): + props = dict(Title=TrackType, + HitTypesToCheck=8, + WriteHistos=1, + MyCuts=getMCCuts(TrackType)) + from Configurables import LoKi__Hybrid__MCTool + myFactory = Tool(LoKi__Hybrid__MCTool, Modules = [ "LoKiMC.decorators" ]) + + return TrackChecker(Tracks = InputTracks(), + Links = Links(), + MCParticleInput = unpackers()["MCParticles"], + MCVerticesInput = unpackers()["MCVertices"], + LinkTableLocation = make_links_lhcbids_mcparticles(), + MCPropertyInput = make_data_from_file("/Event/MC/TrackInfo"), + LoKiFactory = myFactory, + **props) diff --git a/Hlt/RecoConf/python/RecoConf/mccuts.py b/Hlt/RecoConf/python/RecoConf/mccuts.py new file mode 100644 index 00000000000..76aea57e7b7 --- /dev/null +++ b/Hlt/RecoConf/python/RecoConf/mccuts.py @@ -0,0 +1,101 @@ +############################################################################### +# (c) Copyright 2019 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 GaudiKernel.SystemOfUnits import mm, GeV +MCCuts = { + "Velo" : { "01_velo" : "isVelo", + "02_long" : "isLong", + "03_long>5GeV" : "isLong & over5", + "04_long_strange" : "isLong & strange", + "05_long_strange>5GeV" : "isLong & strange & over5", + "06_long_fromB" : "isLong & fromB", + "07_long_fromB>5GeV" : "isLong & fromB & over5", + "08_long_electrons" : "isLong & isElectron", + "09_long_fromB_electrons" : "isLong & isElectron & fromB", + "10_long_fromB_electrons_P>5GeV" : "isLong & isElectron & over5 & fromB" }, + "Forward" : { "01_long" : "isLong", + "02_long>5GeV" : "isLong & over5", + "03_long_strange" : "isLong & strange", + "04_long_strange>5GeV" : "isLong & strange & over5", + "05_long_fromB" : "isLong & fromB", + "06_long_fromB>5GeV" : "isLong & fromB & over5", + "07_long_electrons" : "isLong & isElectron", + "08_long_fromB_electrons" : "isLong & isElectron & fromB", + "09_long_fromB_electrons_P>5GeV" : "isLong & isElectron & over5 & fromB" }, + "Up" : { "01_velo" : "isVelo", + "02_velo+UT" : "isVelo & isUT", + "03_velo+UT>5GeV" : "isVelo & isUT & over5", + "04_velo+notLong" : "isNotLong & isVelo ", + "05_velo+UT+notLong" : "isNotLong & isVelo & isUT", + "06_velo+UT+notLong>5GeV" : "isNotLong & isVelo & isUT & over5", + "07_long" : "isLong", + "08_long>5GeV" : "isLong & over5 ", + "09_long_fromB" : "isLong & fromB", + "10_long_fromB>5GeV" : "isLong & fromB & over5", + "11_long_electrons" : "isLong & isElectron", + "12_long_fromB_electrons" : "isLong & isElectron & fromB", + "13_long_fromB_electrons_P>5GeV" : "isLong & isElectron & over5 & fromB" }, + "T" : { "01_hasT" : "isSeed ", + "02_long" : "isLong", + "03_long>5GeV" : "isLong & over5", + "04_long_fromB" : "isLong & fromB", + "05_long_fromB>5GeV" : "isLong & fromB & over5", + "06_UT+T_strange" : "strange & isDown", + "07_UT+T_strange>5GeV" : "strange & isDown & over5", + "08_noVelo+UT+T_strange" : "strange & isDown & isNotVelo", + "09_noVelo+UT+T_strange>5GeV" : "strange & isDown & over5 & isNotVelo", + "10_UT+T_SfromDB" : "strange & isDown & ( fromB | fromD )", + "11_UT+T_SfromDB>5GeV" : "strange & isDown & over5 & ( fromB | fromD )", + "12_noVelo+UT+T_SfromDB>5GeV" : "strange & isDown & isNotVelo & over5 & ( fromB | fromD )" }, + "Down" : { "01_UT+T" : "isDown ", + "02_UT+T>5GeV" : "isDown & over5", + "03_UT+T_strange" : " strange & isDown", + "04_UT+T_strange>5GeV" : " strange & isDown & over5", + "05_noVelo+UT+T_strange" : " strange & isDown & isNotVelo", + "06_noVelo+UT+T_strange>5GeV" : " strange & isDown & over5 & isNotVelo", + "07_UT+T_fromB" : "isDown & fromB", + "08_UT+T_fromB>5GeV" : "isDown & fromB & over5", + "09_noVelo+UT+T_fromB" : "isDown & fromB & isNotVelo", + "10_noVelo+UT+T_fromB>5GeV" : "isDown & fromB & over5 & isNotVelo", + "11_UT+T_SfromDB" : " strange & isDown & ( fromB | fromD )", + "12_UT+T_SfromDB>5GeV" : " strange & isDown & over5 & ( fromB | fromD )", + "13_noVelo+UT+T_SfromDB" : " strange & isDown & isNotVelo & ( fromB | fromD )", + "14_noVelo+UT+T_SfromDB>5GeV" : " strange & isDown & isNotVelo & over5 & ( fromB | fromD ) " }, + "UTForward" : { "01_long" : "isLong", + "02_long>5GeV" : "isLong & over5" }, + "UTDown" : { "01_has seed" : "isSeed", + "02_has seed +noVelo, T+UT" : "isSeed & isNotVelo & isDown", + "03_down+strange" : "strange & isDown", + "04_down+strange+>5GeV" : "strange & isDown & over5", + "05_pi<-Ks<-B" : "fromKsFromB", + "06_pi<-Ks<-B+> 5 GeV" : "fromKsFromB & over5" }, +} +TriggerMCCuts = { + "Velo" : { "11_long_fromB_P>3GeV_Pt>0.5GeV" : "isLong & fromB & trigger", + "12_UT_long_fromB_P>3GeV_Pt>0.5GeV" : "isLong & fromB & trigger & isUT" }, + "Forward" : { "10_long_fromB_P>3GeV_Pt>0.5GeV" : "isLong & fromB & trigger", + "11_UT_long_fromB_P>3GeV_Pt>0.5GeV" : "isLong & fromB & trigger & isUT" }, + "Up" :{ "14_long_fromB_P>3GeV_Pt>0.5GeV" : "isLong & fromB & trigger", + "15_UT_long_fromB_P>3GeV_Pt>0.5GeV" : "isLong & fromB & trigger & isUT" }, + "New" : { "long_fromB_P>3GeV_Pt>0.5GeV" : "isLong & fromB & trigger", + "UT_long_fromB_P>3GeV_Pt>0.5GeV" : "isLong & fromB & trigger & isUT" }, + "UTForward" : { "03_long_fromB_P>3GeV_Pt>0.5GeV" : "isLong & fromB & trigger", + "04_UT_long_fromB_P>3GeV_Pt>0.5GeV" : "isLong & fromB & trigger & isUT" }, + "UTDown" : { "07_long_fromB_P>3GeV_Pt>0.5GeV" : "isLong & fromB & trigger", + "08_UT_long_fromB_P>3GeV_Pt>0.5GeV" : "isLong & fromB & trigger & isUT" }, + "UTNew" : { "long_fromB_P>3GeV_Pt>0.5GeV" : "isLong & fromB & trigger", + "UT_long_fromB_P>3GeV_Pt>0.5GeV" : "isLong & fromB & trigger & isUT" }, +} +def getMCCuts(key, triggerNumbers = False): + cuts = MCCuts[key] if key in MCCuts else {} + if triggerNumbers and key in TriggerMCCuts: + cuts.update(TriggerMCCuts[key]) + return cuts + diff --git a/PyConf/python/PyConf/core.py b/PyConf/python/PyConf/core.py index 2382b3f5d96..d113b8e48e3 100644 --- a/PyConf/python/PyConf/core.py +++ b/PyConf/python/PyConf/core.py @@ -127,7 +127,7 @@ class CompositeNode(object): class EverythingHandler(object): - def __init__(self, threadPoolSize=1, nEventSlots=0, evtMax=-1, debug=True): + def __init__(self, threadPoolSize=1, nEventSlots=0, evtMax=-1, debug=True, HistoFile = None): self._nodes = [] self._algs = [] self._tools = [] #public tools @@ -152,6 +152,9 @@ class EverythingHandler(object): _setupComponent('MessageSvc', Format='% F%35W%S %7W%R%T %0W%M') _setupComponent('HistogramPersistencySvc', OutputLevel=5) self._eventClockSvc = _setupComponent('EventClockSvc', InitialTime=1433509200000000000) + if HistoFile != None: + self._histogramPersistencySvc = _setupComponent('HistogramPersistencySvc', OutputFile=HistoFile) + self._appMgr.HistogramPersistency = "ROOT" if debug: self._scheduler.OutputLevel = DEBUG self._hiveDataBroker.OutputLevel = DEBUG -- GitLab From 244a3a19133a9e915e02ea8c596bf77dd07bac72 Mon Sep 17 00:00:00 2001 From: Rosen Matev Date: Fri, 14 Jun 2019 17:55:35 +0200 Subject: [PATCH 2/3] Add qmtest for mc checking sequence --- Hlt/RecoConf/CMakeLists.txt | 1 + .../options/{only_reco.py => reco_example.py} | 0 Hlt/RecoConf/python/RecoConf/__init__.py | 0 .../tests/qmtest/test_reco_example.qmt | 32 +++++++++++++++++++ 4 files changed, 33 insertions(+) rename Hlt/RecoConf/options/{only_reco.py => reco_example.py} (100%) create mode 100644 Hlt/RecoConf/python/RecoConf/__init__.py create mode 100644 Hlt/RecoConf/tests/qmtest/test_reco_example.qmt diff --git a/Hlt/RecoConf/CMakeLists.txt b/Hlt/RecoConf/CMakeLists.txt index a72357c289e..969c7433c7a 100644 --- a/Hlt/RecoConf/CMakeLists.txt +++ b/Hlt/RecoConf/CMakeLists.txt @@ -16,3 +16,4 @@ gaudi_install_scripts() gaudi_add_test(pytests COMMAND python -m pytest -v --doctest-modules ${CMAKE_CURRENT_SOURCE_DIR}/python) +gaudi_add_test(QMTest QMTEST) diff --git a/Hlt/RecoConf/options/only_reco.py b/Hlt/RecoConf/options/reco_example.py similarity index 100% rename from Hlt/RecoConf/options/only_reco.py rename to Hlt/RecoConf/options/reco_example.py diff --git a/Hlt/RecoConf/python/RecoConf/__init__.py b/Hlt/RecoConf/python/RecoConf/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/Hlt/RecoConf/tests/qmtest/test_reco_example.qmt b/Hlt/RecoConf/tests/qmtest/test_reco_example.qmt new file mode 100644 index 00000000000..3d10ce5f8c0 --- /dev/null +++ b/Hlt/RecoConf/tests/qmtest/test_reco_example.qmt @@ -0,0 +1,32 @@ + + + + +gaudirun.py + + $RECOCONFROOT/options/reco_example.py + --output=reco_example.opts.py + --all-opt + + +from Configurables import HiveDataBrokerSvc +HiveDataBrokerSvc().OutputLevel = 5 + +true + + +countErrorLines({"FATAL": 0, "ERROR": 0, "WARNING": 0}) + + + -- GitLab From c16570ab73b30c926537daa7e24f06340192032a Mon Sep 17 00:00:00 2001 From: Sascha Stahl Date: Wed, 19 Jun 2019 09:54:36 +0200 Subject: [PATCH 3/3] Remove use of make_algorithm in mcchecking.py and use from PyConf.Algorithms import instead. --- Hlt/RecoConf/python/RecoConf/mcchecking.py | 68 ++++++++++------------ 1 file changed, 30 insertions(+), 38 deletions(-) diff --git a/Hlt/RecoConf/python/RecoConf/mcchecking.py b/Hlt/RecoConf/python/RecoConf/mcchecking.py index db7207a37ca..68c36cc75d7 100644 --- a/Hlt/RecoConf/python/RecoConf/mcchecking.py +++ b/Hlt/RecoConf/python/RecoConf/mcchecking.py @@ -14,26 +14,24 @@ from PyConf.smart import ( ) from PyConf.core import ( - make_algorithm, Algorithm, force_location, Tool ) -from Configurables import ( - VPClusFull, - VPFullCluster2MCParticleLinker, - PrLHCbID2MCParticle, - PrTrackAssociator, - PrTrackChecker -) + +from PyConf.Algorithms import (VPClusFull, + VPFullCluster2MCParticleLinker, + PrLHCbID2MCParticle, + PrTrackAssociator, + PrTrackChecker) from Hlt1Conf.reconstruction import( RawData, make_UT_clusters, make_ft_clusters, make_forward_tracks, - V2TrackConvV1 + fromV2TrackV1Track ) from Hlt2Conf.data_from_file import ( @@ -43,43 +41,37 @@ from Hlt2Conf.data_from_file import ( from RecoConf.mccuts import getMCCuts -VeloFullClustering = make_algorithm(VPClusFull) -VeloFullCluster2MCParticleLinker = make_algorithm(VPFullCluster2MCParticleLinker) -PrLHCbID2MCParticle_comp = make_algorithm(PrLHCbID2MCParticle) -TrackAssociator = make_algorithm(PrTrackAssociator) -TrackChecker = make_algorithm(PrTrackChecker) - @configurable def make_velo_full_clusters(): - return VeloFullClustering(RawEventLocation=RawData().RawEvent).ClusterLocation + return VPClusFull(RawEventLocation=RawData().RawEvent).ClusterLocation @configurable def make_links_veloclusters_mcparticles(): - return VeloFullCluster2MCParticleLinker(ClusterLocation=make_velo_full_clusters(), - MCParticlesLocation=unpackers()["MCParticles"], - VPDigit2MCParticleLinksLocation=make_data_from_file("/Event/Link/Raw/VP/Digits")).OutputLocation + return VPFullCluster2MCParticleLinker(ClusterLocation=make_velo_full_clusters(), + MCParticlesLocation=unpackers()["MCParticles"], + VPDigit2MCParticleLinksLocation=make_data_from_file("/Event/Link/Raw/VP/Digits")).OutputLocation @configurable def make_links_lhcbids_mcparticles(): - return PrLHCbID2MCParticle_comp(MCParticlesLocation = unpackers()["MCParticles"], - VPFullClustersLocation = make_velo_full_clusters(), - VPFullClustersLinkLocation = make_links_veloclusters_mcparticles(), - UTHitsLocation = make_UT_clusters(), - UTHitsLinkLocation = make_data_from_file('/Event/Link/Raw/UT/Clusters'), - FTLiteClustersLocation = make_ft_clusters(), - FTLiteClustersLinkLocation = make_data_from_file('/Event/Link/Raw/FT/LiteClusters')).TargetName + return PrLHCbID2MCParticle(MCParticlesLocation = unpackers()["MCParticles"], + VPFullClustersLocation = make_velo_full_clusters(), + VPFullClustersLinkLocation = make_links_veloclusters_mcparticles(), + UTHitsLocation = make_UT_clusters(), + UTHitsLinkLocation = make_data_from_file('/Event/Link/Raw/UT/Clusters'), + FTLiteClustersLocation = make_FT_clusters(), + FTLiteClustersLinkLocation = make_data_from_file('/Event/Link/Raw/FT/LiteClusters')).TargetName @configurable def make_converted_to_track_v1(InputTracks=make_forward_tracks): - return V2TrackConvV1(InputTracksName=InputTracks()).OutputTracksName + return fromV2TrackV1Track(InputTracksName=InputTracks()).OutputTracksName @configurable def make_links_tracks_mcparticles(InputTracks = make_converted_to_track_v1, LinkerLocationID = make_links_lhcbids_mcparticles): - return TrackAssociator(SingleContainer=InputTracks(), - LinkerLocationID = LinkerLocationID(), - MCParticleLocation = unpackers()["MCParticles"]).OutputLocation + return PrTrackAssociator(SingleContainer=InputTracks(), + LinkerLocationID = LinkerLocationID(), + MCParticleLocation = unpackers()["MCParticles"]).OutputLocation @configurable def make_efficiency_checks(InputTracks=make_converted_to_track_v1, @@ -92,11 +84,11 @@ def make_efficiency_checks(InputTracks=make_converted_to_track_v1, from Configurables import LoKi__Hybrid__MCTool myFactory = Tool(LoKi__Hybrid__MCTool, Modules = [ "LoKiMC.decorators" ]) - return TrackChecker(Tracks = InputTracks(), - Links = Links(), - MCParticleInput = unpackers()["MCParticles"], - MCVerticesInput = unpackers()["MCVertices"], - LinkTableLocation = make_links_lhcbids_mcparticles(), - MCPropertyInput = make_data_from_file("/Event/MC/TrackInfo"), - LoKiFactory = myFactory, - **props) + return PrTrackChecker(Tracks = InputTracks(), + Links = Links(), + MCParticleInput = unpackers()["MCParticles"], + MCVerticesInput = unpackers()["MCVertices"], + LinkTableLocation = make_links_lhcbids_mcparticles(), + MCPropertyInput = make_data_from_file("/Event/MC/TrackInfo"), + LoKiFactory = myFactory, + **props) -- GitLab