Skip to content
Snippets Groups Projects
Commit 515d24f0 authored by Sebastien Ponce's avatar Sebastien Ponce
Browse files

Merge branch 'prefer-rawbank-view' into 'master'

use RawBank::View as input instead of RawEvent

Closes #543

See merge request !2166
parents c3e8752b 61cf41a7
No related branches found
No related tags found
1 merge request!2166use RawBank::View as input instead of RawEvent
Pipeline #6627738 passed
......@@ -18,7 +18,6 @@ from RecoConf.hlt1_tracking import make_FTRawBankDecoder_clusters
from RecoConf.hlt2_tracking import (make_hlt2_tracks_without_UT,
get_UpgradeGhostId_tool_no_UT)
from PyConf.Algorithms import VeloRetinaClusterTrackingSIMD
#from RecoConf.hlt1_tracking import make_VeloClusterTrackingSIMD, make_RetinaDecoder_raw_event
from RecoConf.hlt1_tracking import make_VeloClusterTrackingSIMD, make_RetinaClusters
from RecoConf.hlt1_muonid import make_muon_hits
......
......@@ -29,7 +29,6 @@ from RecoConf.hlt1_tracking import (
make_reco_pvs,
make_PatPV3DFuture_pvs,
make_RetinaClusters,
_rawevent_to_rawbank,
get_global_measurement_provider,
)
......@@ -72,10 +71,8 @@ def make_my_sequence():
my_mask = [sensor in [99]
for sensor in range(208)] # sensor 99 is chosen arbitrarily
bankType = "VPRetinaCluster"
vpClustering = VeloRetinaClusterTrackingSIMDFull(
RawBanks=_rawevent_to_rawbank(
default_raw_banks(bankType), bankType),
RawBanks=default_raw_banks("VPRetinaCluster"),
SensorMasks=tuple(my_mask),
MaxScatterSeeding=0.1,
MaxScatterForwarding=0.1,
......
......@@ -17,7 +17,6 @@ from RecoConf.hlt1_tracking import (
make_PatPV3DFuture_pvs,
make_RetinaClusters,
get_global_measurement_provider,
_rawevent_to_rawbank,
)
from PyConf.application import default_raw_banks
......@@ -71,8 +70,7 @@ def make_my_sequence():
]
vpClustering = VeloRetinaClusterTrackingSIMDFull(
RawBanks=_rawevent_to_rawbank(
default_raw_banks("VPRetinaCluster"), "VPRetinaCluster"),
RawBanks=default_raw_banks("VPRetinaCluster"),
SensorMasks=tuple(my_SensorMask),
MaxScatterSeeding=0.1,
MaxScatterForwarding=0.1,
......
......@@ -10,7 +10,7 @@
###############################################################################
import logging
from PyConf import configurable
from PyConf.application import default_raw_event, default_raw_banks, make_odin
from PyConf.application import default_raw_banks, make_odin
from PyConf.utilities import DISABLE_TOOL
from PyConf.packing import persistable_location
......@@ -40,7 +40,6 @@ from PyConf.Algorithms import (
PatPV3DFuture,
PrStorePrUTHitsEmptyProducer,
PrStoreUTHitEmptyProducer,
LHCb__UnpackRawEvent,
)
from PyConf.Tools import (
......@@ -60,34 +59,6 @@ log = logging.getLogger(__name__)
from RecoConf.core_algorithms import make_unique_id_generator
def _rawevent_to_rawbank(dh, tp):
if dh.type == "LHCb::RawEvent":
print("FIXME: fix input to return RawBanks instead of RawEvent")
def output_transform(Output):
return {"RawBankLocations": [Output]}
dh = LHCb__UnpackRawEvent(
RawEventLocation=dh,
output_transform=output_transform,
BankTypes=[tp]).Output
return dh
@configurable
def default_ft_decoding_version(value=4):
raise DeprecationWarning(
"Function default_ft_decoding_version has to be imported from the RecoConf.decoders module."
)
@configurable
def require_gec(make_raw=default_raw_banks, cut=-1, **kwargs):
raise DeprecationWarning(
"Function require_gec has to be imported from the RecoConf.event_filters module."
)
@configurable
def make_VeloClusterTrackingSIMD(algorithm=VeloClusterTrackingSIMD,
make_raw=default_raw_banks,
......@@ -117,7 +88,7 @@ def make_VeloClusterTrackingSIMD(algorithm=VeloClusterTrackingSIMD,
my_SensorMasks = [j in masked_sensors for j in range(208)
] # 208 = LHCb::Pr::Velo::VPInfos::NSensors
return algorithm(
RawBanks=_rawevent_to_rawbank(make_raw(bank_type), bank_type),
RawBanks=make_raw(bank_type),
SensorMasks=tuple(my_SensorMasks),
MaxScatterSeeding=MaxScatterSeeding,
MaxScatterForwarding=MaxScatterForwarding,
......@@ -142,9 +113,6 @@ def make_VeloClusterTrackingSIMD_hits(
def make_VPClus_location_and_offsets():
"""Makes velo clusters with VPClus
Args:
make_raw (DataHandle): RawEventLocation for VeloClusterTrackingSIMD, defaults to `default_raw_event <PyConf.application.default_raw_event>`.
Returns:
A dict mapping VPClus' ClusterLocation and ClusterOffsets DataHandles to ``'Location'`` and ``'Offsets'`` respectively.
"""
......@@ -161,11 +129,20 @@ def make_VPClus_hits():
@configurable
def make_velo_full_clusters(make_raw=default_raw_event,
def make_velo_full_clusters(make_raw=default_raw_banks,
make_full_cluster=VPClusFull,
detector=["VP"]):
return make_full_cluster(
RawEventLocation=make_raw(detector)).ClusterLocation
detector=None):
expected_detector = {
'VPClusFull': 'VP',
'VPRetinaFullClusterDecoder': 'VPRetinaCluster',
'VPRetinaFullClustering': 'VP'
}.get(make_full_cluster.type.getType(), None)
if expected_detector:
assert not detector or detector == expected_detector, f"explicitly specified detector will not work: {detector} vs {expected_detector} for {make_full_cluster.type.getType()}"
if not detector: detector = expected_detector
assert detector, "do not know which rawbank type {make_full_cluster.type.getType()} needs -- and it is not explicitly specified"
return make_full_cluster(RawBanks=make_raw(detector)).ClusterLocation
@configurable
......@@ -173,30 +150,13 @@ def make_SPmixed_raw_banks(detector=None, make_raw=default_raw_banks):
"""Mix SP.
Args:
make_raw (DataHandle): RawEventLocation for VPRetinaSPmixer, defaults to `default_raw_event <PyConf.application.default_raw_event>`.
Returns:
"""
# Can detector ever be something else
assert not detector or detector == "VP" or detector == ['VP'], detector
return VPRetinaSPmixer(RawBanks=make_raw("VP")).RawEventLocationMixed
@configurable
def make_RetinaCluster_raw_event(detector=None, make_raw=default_raw_banks):
"""Makes velo clusters with VPRetinaClusterCreator.
Args:
make_raw (DataHandle): RawEventLocation for VPRetinaClusterCreator, defaults to `default_raw_event <PyConf.application.default_raw_event>`.
make_raw (DataHandle): RawBanks for VPRetinaSPmixer, defaults to `default_raw_banks <PyConf.application.default_raw_banks>`.
Returns:
"""
assert not detector or detector == [
"VPRetinaCluster"
] or detector == "VPRetinaCluster", detector
clustering = VPRetinaClusterCreator(
RawBanks=_rawevent_to_rawbank(make_raw("VP"), "VP"))
return clustering.RetinaRawBanks # this is a RawBank::View
# Can detector ever be something else?
assert not detector or detector == "VP", detector
return VPRetinaSPmixer(RawBanks=make_raw("VP")).MixedRawBanks
@configurable
......@@ -204,16 +164,14 @@ def make_RetinaCluster_raw_bank(detector=None, make_raw=default_raw_banks):
"""Makes velo clusters with VPRetinaClusterCreator.
Args:
make_raw (DataHandle): RawEventLocation for VPRetinaClusterCreator, defaults to `default_raw_event <PyConf.application.default_raw_event>`.
make_raw (DataHandle): RawEventLocation for VPRetinaClusterCreator, defaults to `default_raw_vent <PyConf.application.default_raw_banks>`.
Returns:
"""
assert not detector or detector == [
"VPRetinaCluster"
] or detector == "VPRetinaCluster", detector
clustering = VPRetinaClusterCreator(
RawBanks=_rawevent_to_rawbank(make_raw("VP"), "VP"))
return clustering.RetinaRawBanks # this is a RawBank::View
return VPRetinaClusterCreator(RawBanks=make_raw("VP")).RetinaRawBanks
@configurable
......@@ -227,8 +185,8 @@ def make_RetinaClusters(detector=None, make_raw=default_raw_banks):
vector<LHCb::VPLightCluster>
"""
assert not detector or detector == 'VPRetinaCluster', detector
decoding = VPRetinaClusterDecoder(RawBanks=make_raw('VPRetinaCluster'))
return decoding.ClusterLocation
return VPRetinaClusterDecoder(
RawBanks=make_raw('VPRetinaCluster')).ClusterLocation
@configurable
......@@ -443,7 +401,7 @@ def make_PrStoreUTHit_hits(make_raw=default_raw_banks,
"""Decodes UT hits from raw data.
Args:
make_raw (DataHandle): RawEventLocation for VeloClusterTrackingSIMD, defaults to `default_raw_event <PyConf.application.default_raw_event>`.
make_raw (DataHandle): RawEventLocation for VeloClusterTrackingSIMD, defaults to `default_raw_banks <PyConf.application.default_raw_banks>`.
Returns:
DataHandle: PrStoreUTHit's UTHitsLocation.
......@@ -472,7 +430,7 @@ def make_PrStorePrUTHits_hits(make_raw=default_raw_banks,
"""Decodes UT hits from raw data, fills an SOA container.
Args:
make_raw (DataHandle): RawEventLocation for VeloClusterTrackingSIMD, defaults to `default_raw_event <PyConf.application.default_raw_event>`.
make_raw (DataHandle): RawEventLocation for VeloClusterTrackingSIMD, defaults to `default_raw_banks <PyConf.application.default_raw_banks>`.
Returns:
DataHandle: PrStorePrUTHits' UTHitsLocation.
......@@ -535,7 +493,7 @@ def make_FTRawBankDecoder_clusters(make_raw=default_raw_banks):
"""Decodes the FT raw bank into FTLiteClusters. DecodingVersion set by `default_ft_decoding_version`.
Args:
make_raw (DataHandle): RawEventLocation for VeloClusterTrackingSIMD, defaults to `default_raw_event <PyConf.application.default_raw_event>`.
make_raw (DataHandle): RawEventLocation for VeloClusterTrackingSIMD, defaults to `default_raw_banks <PyConf.application.default_raw_banks>`.
Returns:
DataHandle: FTRawBankDecoder's OutputLocation.
......
......@@ -14,11 +14,10 @@ from .event_filters import require_gec
from .hlt1_tracking import (
make_reco_pvs, make_pvs, make_all_pvs, make_hlt1_tracks,
make_SPmixed_raw_banks, make_RetinaCluster_raw_bank,
make_RetinaCluster_raw_event, make_VeloClusterTrackingSIMD,
make_VeloClusterTrackingSIMD_hits, make_VeloKalman_fitted_tracks,
make_PatPV3DFuture_pvs, all_hlt1_forward_track_types,
make_TrackEventFitter_fitted_tracks, make_hlt1_fitted_tracks,
make_velo_full_clusters, make_RetinaClusters,
make_VeloClusterTrackingSIMD, make_VeloClusterTrackingSIMD_hits,
make_VeloKalman_fitted_tracks, make_PatPV3DFuture_pvs,
all_hlt1_forward_track_types, make_TrackEventFitter_fitted_tracks,
make_hlt1_fitted_tracks, make_velo_full_clusters, make_RetinaClusters,
get_global_measurement_provider)
from RecoConf.hlt1_muonmatch import make_tracks_with_muonmatch_ipcut
......@@ -345,10 +344,9 @@ def standalone_hlt2_full_track_reco_retinacluster(light_reco=False,
Reconstruction: Data and control flow of Hlt2 track reconstruction.
"""
with make_RetinaCluster_raw_event.bind(make_raw=make_SPmixed_raw_banks), \
make_RetinaCluster_raw_bank.bind(make_raw=make_SPmixed_raw_banks), \
make_velo_full_clusters.bind(make_raw=make_SPmixed_raw_banks, make_full_cluster=VPRetinaFullClustering), \
make_RetinaClusters.bind(make_raw=make_RetinaCluster_raw_event,detector='VPRetinaCluster'),\
with make_RetinaCluster_raw_bank.bind(make_raw=make_SPmixed_raw_banks), \
make_velo_full_clusters.bind(make_full_cluster=VPRetinaFullClustering,make_raw=make_SPmixed_raw_banks), \
make_RetinaClusters.bind(make_raw=make_RetinaCluster_raw_bank),\
get_UpgradeGhostId_tool.bind(velo_hits=make_RetinaClusters),\
get_global_measurement_provider.bind(velo_hits=make_RetinaClusters),\
make_VeloClusterTrackingSIMD.bind(make_raw=make_RetinaCluster_raw_bank, algorithm=VeloRetinaClusterTrackingSIMD):
......
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