Skip to content
Snippets Groups Projects
Commit 7af2eb7a authored by Christopher Rob Jones's avatar Christopher Rob Jones
Browse files

Merge branch 'bokutsen_AllenOptionFile_VertexCompare' into '2024-patches'

PV resolution monitor is added to RecoMon

See merge request !3312
parents 2ed3a781 2cbdd560
No related branches found
No related tags found
3 merge requests!4232Run5: rebase, restructure run5 code, add back examples,!3700Synchronize master branch with 2024-patches,!3312PV resolution monitor is added to RecoMon
Pipeline #7811698 passed
......@@ -8,7 +8,8 @@
# granted to it by virtue of its status as an Intergovernmental Organization #
# or submit itself to any jurisdiction. #
###############################################################################
from Moore import options, run_reconstruction
from Moore import options
from Moore.config import run_allen_reconstruction
from RecoConf.standalone import standalone_hlt2_global_reco
from RecoConf.hlt2_global_reco import (
reconstruction,
......@@ -16,4 +17,4 @@ from RecoConf.hlt2_global_reco import (
)
with reconstruction.bind(make_reconstruction=make_fastest_reconstruction):
run_reconstruction(options, standalone_hlt2_global_reco)
run_allen_reconstruction(options, standalone_hlt2_global_reco)
......@@ -8,9 +8,10 @@
# granted to it by virtue of its status as an Intergovernmental Organization #
# or submit itself to any jurisdiction. #
###############################################################################
from Moore import options, run_reconstruction
from Moore import options
from Moore.config import run_allen_reconstruction
from RecoConf.standalone import standalone_hlt2_global_reco
from RecoConf.hlt2_global_reco import reconstruction, make_light_reco_pr_kf
with reconstruction.bind(make_reconstruction=make_light_reco_pr_kf):
run_reconstruction(options, standalone_hlt2_global_reco)
run_allen_reconstruction(options, standalone_hlt2_global_reco)
......@@ -8,7 +8,8 @@
# granted to it by virtue of its status as an Intergovernmental Organization #
# or submit itself to any jurisdiction. #
###############################################################################
from Moore import options, run_reconstruction
from Moore import options
from Moore.config import run_allen_reconstruction
from RecoConf.standalone import standalone_hlt2_global_reco, reco_prefilters
from RecoConf.hlt2_global_reco import (
reconstruction,
......@@ -17,4 +18,4 @@ from RecoConf.hlt2_global_reco import (
with reconstruction.bind(make_reconstruction=make_light_reco_pr_kf_without_UT),\
reco_prefilters.bind(skipUT=True):
run_reconstruction(options, standalone_hlt2_global_reco)
run_allen_reconstruction(options, standalone_hlt2_global_reco)
......@@ -9,9 +9,11 @@
# or submit itself to any jurisdiction. #
###############################################################################
import os
from Moore import options, run_reconstruction
from Moore import options
from Moore.config import run_allen_reconstruction
from RecoConf.standalone import standalone_hlt2_light_reco_without_UT
from RecoConf.mc_checking import check_track_resolution
from PyConf.Algorithms import VertexCompare
isQMTTest = 'QMTTEST_NAME' in os.environ
myName = (os.environ["QMTTEST_NAME"]
......@@ -23,5 +25,6 @@ options.ntuple_file = (options.getProp("ntuple_file")
with standalone_hlt2_light_reco_without_UT.bind(
do_mc_checking=True, do_data_monitoring=True, monitor_all_tracks=True), \
check_track_resolution.bind(per_hit_resolutions=True, split_per_type=True):
run_reconstruction(options, standalone_hlt2_light_reco_without_UT)
check_track_resolution.bind(per_hit_resolutions=True, split_per_type=True),\
VertexCompare.bind(produceNtuple=False,produceHistogram=True,monitoring=True):
run_allen_reconstruction(options, standalone_hlt2_light_reco_without_UT)
......@@ -12,12 +12,14 @@
## part II
#####
from Moore import options, run_reconstruction
from Moore import options
from Moore.config import run_allen_reconstruction
from RecoConf.decoders import default_VeloCluster_source
from RecoConf.standalone import standalone_hlt2_light_reco_without_UT
from RecoConf.hlt2_tracking import (
make_PrKalmanFilter_noUT_tracks, make_PrKalmanFilter_Seed_tracks,
make_PrKalmanFilter_Velo_tracks, make_TrackBestTrackCreator_tracks)
from PyConf.Algorithms import VertexCompare
options.histo_file = "histos_hlt2_light_reco_pr_kf_without_UT_on_data_with_monitoring.root"
......@@ -32,5 +34,6 @@ make_TrackBestTrackCreator_tracks.bind(max_chi2ndof=4.2),\
make_PrKalmanFilter_Velo_tracks.bind(max_chi2ndof=4.2),\
make_PrKalmanFilter_noUT_tracks.bind(max_chi2ndof=4.2),\
make_PrKalmanFilter_Seed_tracks.bind(max_chi2ndof=4.2),\
default_VeloCluster_source.bind(bank_type="VPRetinaCluster"):
run_reconstruction(options, standalone_hlt2_light_reco_without_UT)
default_VeloCluster_source.bind(bank_type="VPRetinaCluster"),\
VertexCompare.bind(produceNtuple=False,produceHistogram=True,monitoring=True):
run_allen_reconstruction(options, standalone_hlt2_light_reco_without_UT)
......@@ -8,7 +8,8 @@
# granted to it by virtue of its status as an Intergovernmental Organization #
# or submit itself to any jurisdiction. #
###############################################################################
from Moore import options, run_reconstruction
from Moore import options
from Moore.config import run_allen_reconstruction
from RecoConf.standalone import standalone_hlt2_global_reco, reco_prefilters
from RecoConf.mc_checking import check_track_resolution, mc_check_tracking
from Hlt2Conf.settings.hlt2_binds import config_pp_2024_with_monitoring
......@@ -27,4 +28,4 @@ with config_pp_2024_with_monitoring(), reco_prefilters.bind(gec=False), \
standalone_hlt2_global_reco.bind(do_mc_checking=True, do_data_monitoring=True), \
check_track_resolution.bind(per_hit_resolutions=True, split_per_type=True), \
mc_check_tracking.bind(skip_UT=True):
run_reconstruction(options, standalone_hlt2_global_reco)
run_allen_reconstruction(options, standalone_hlt2_global_reco)
......@@ -10,7 +10,8 @@
###############################################################################
from RecoConf.standalone import standalone_hlt2_global_reco, reco_prefilters
from Hlt2Conf.settings.hlt2_binds import config_pp_2024
from Moore import options, run_reconstruction
from Moore import options
from Moore.config import run_allen_reconstruction
with config_pp_2024(), reco_prefilters.bind(gec=False):
run_reconstruction(options, standalone_hlt2_global_reco)
run_allen_reconstruction(options, standalone_hlt2_global_reco)
......@@ -68,7 +68,7 @@ from .protoparticles import (make_charged_protoparticles,
make_neutral_protoparticles)
from .calo_data_monitoring import monitor_calo
from .track_data_monitoring import monitor_tracking, get_monitoring_track_types_for_light_reco
from .track_data_monitoring import monitor_tracking, monitor_vertex_resolution, get_monitoring_track_types_for_light_reco
from .muonPID_data_monitoring import monitor_muon_PID
from .mass_monitors import make_mass_monitors
......@@ -228,6 +228,8 @@ def standalone_hlt2_global_reco(
}))
]
data += make_mass_monitors()
data += monitor_vertex_resolution(
reco_handles["AllTrackHandles"]["Velo"])
data_producers_node = CompositeNode(
"data_with_gec",
......@@ -946,6 +948,7 @@ def standalone_hlt2_light_reco_without_UT(fast_reco=False,
"Long": best_tracks["BestLong"],
}
# Add RICH
if not skip_RICH:
rich_reco = add_hlt2_rich(
best_tracks=tracks4rich,
......@@ -1020,8 +1023,8 @@ def standalone_hlt2_light_reco_without_UT(fast_reco=False,
muonRecConfs, trackrels, shared_container=True)
muon_pids = make_merged_muon_pids(muon_conv)
data += [muon_pids]
monitors_outside_gec = []
if do_data_monitoring:
if not skip_Calo:
data += monitor_calo(calo, tracks_v3)
......@@ -1034,6 +1037,7 @@ def standalone_hlt2_light_reco_without_UT(fast_reco=False,
pvs=pvs["v1"],
use_pr_kf=use_pr_kf)
]
if not skip_Muon:
data += [monitor_muon_PID(muon_pids)]
if not (skip_Muon or skip_Calo or skip_RICH):
......@@ -1049,6 +1053,7 @@ def standalone_hlt2_light_reco_without_UT(fast_reco=False,
monitors_outside_gec += [hit_correlations]
data += make_mass_monitors()
data += monitor_vertex_resolution(hlt2_tracks["Velo"])
if do_mc_checking:
if not skip_Calo:
......@@ -1076,6 +1081,7 @@ def standalone_hlt2_light_reco_without_UT(fast_reco=False,
data,
combine_logic=NodeLogic.NONLAZY_OR,
force_order=True)
with_gec_node = CompositeNode(
"with_gec",
reco_prefilters(skipUT=True) + [data_producers_node],
......
......@@ -8,15 +8,20 @@
# granted to it by virtue of its status as an Intergovernmental Organization #
# or submit itself to any jurisdiction. #
###############################################################################
from PyConf.Algorithms import (TrackVertexMonitor, TrackFitMatchMonitor,
TrackMonitor, TrackPV2HalfMonitor,
DeterministicPrescaler, PrSciFiHitsMonitor,
FTTrackMonitor, TrackVPOverlapMonitor)
from PyConf.Algorithms import (
TrackVertexMonitor, TrackFitMatchMonitor, TrackMonitor,
TrackPV2HalfMonitor, DeterministicPrescaler, PrSciFiHitsMonitor,
FTTrackMonitor, TrackVPOverlapMonitor, VertexCompare,
GaudiAllenPVsToPrimaryVertexContainer, RandomTrackContainerSplitter,
RandomVeloTrackContainerSplitter)
from PyConf import configurable
from PyConf.application import make_odin
from PyConf.control_flow import CompositeNode, NodeLogic
from RecoConf.hlt2_tracking import make_PrStoreSciFiHits_hits
from AllenConf.velo_reconstruction import decode_velo, make_velo_tracks_ACsplit
from AllenConf.primary_vertex_reconstruction import make_pvs
from RecoConf.legacy_rec_hlt1_tracking import make_reco_pvs, make_PatPV3DFuture_pvs, make_TrackBeamLineVertexFinderSoA_pvs
from PyConf.packing import persistable_location
def get_default_monitoring_track_types_for_light_reco():
......@@ -56,6 +61,7 @@ def monitor_tracking(tracks,
pvs,
use_pr_kf=False,
prescale=1.0):
prescaler = DeterministicPrescaler(
name="TrackMonitoringPrescaler",
AcceptFraction=prescale,
......@@ -108,3 +114,89 @@ def monitor_tracking(tracks,
],
combine_logic=NodeLogic.LAZY_AND,
force_order=True)
@configurable
def monitor_vertex_resolution(tracks_for_pvs):
# ------------------- Allen PV reconstruction alghorhithm (TBLV) -------------------
# reconstruct Allen velo tracks
decoded_velo = decode_velo()
#Split of velo tracks to two random sets - RS1 and RS2
velo_tracks_RS1, velo_tracks_RS2 = make_velo_tracks_ACsplit(
decoded_velo, split_alg="random")
# reconstruct Allen PVs
pvs_RS1 = make_pvs(velo_tracks_RS1, pv_name="_RS1", velo_open=False)
# convert Allen PVs to PrimaryVertexContainer object
pv_container_RS1 = GaudiAllenPVsToPrimaryVertexContainer(
number_of_multivertex=pvs_RS1["dev_number_of_multi_final_vertices"],
reconstructed_multi_pvs=pvs_RS1["dev_multi_final_vertices"],
).OutputPVs
pvs_RS2 = make_pvs(velo_tracks_RS2, pv_name="_RS2", velo_open=False)
# convert Allen PVs to PrimaryVertexContainer object
pv_container_RS2 = GaudiAllenPVsToPrimaryVertexContainer(
number_of_multivertex=pvs_RS2["dev_number_of_multi_final_vertices"],
reconstructed_multi_pvs=pvs_RS2["dev_multi_final_vertices"],
).OutputPVs
vertex_compare_Allen = VertexCompare(
name="vertex_resolution_Allen",
inputVerticesName1=pv_container_RS1,
inputVerticesName2=pv_container_RS2)
# ------------------- Moore PV reconstruction alghorhithms (PatPV3D, TBLV)-------------------
random_splitter_forward = RandomVeloTrackContainerSplitter(
name="RandomVeloTrackContainerSplitter_Forward",
TracksInContainer=tracks_for_pvs["Pr"])
random_splitter_backward = RandomVeloTrackContainerSplitter(
name="RandomVeloTrackContainerSplitter_Backward",
TracksInContainer=tracks_for_pvs["Pr::backward"])
random_splitter = RandomTrackContainerSplitter(
name="RandomTrackContainerSplitter",
TracksInContainer=tracks_for_pvs["v1"])
RS1_velo = {
"v1": random_splitter.PassedContainer,
"Pr": random_splitter_forward.PassedContainer,
"Pr::backward": random_splitter_backward.PassedContainer
}
RS2_velo = {
"v1": random_splitter.RejectedContainer,
"Pr": random_splitter_forward.RejectedContainer,
"Pr::backward": random_splitter_backward.RejectedContainer
}
pvs1_TBLV = make_reco_pvs(
RS1_velo,
persistable_location('PVs'),
make_pvs_from_velo_tracks=make_TrackBeamLineVertexFinderSoA_pvs)
pvs2_TBLV = make_reco_pvs(
RS2_velo,
persistable_location('PVs'),
make_pvs_from_velo_tracks=make_TrackBeamLineVertexFinderSoA_pvs)
vertex_compare_Moore_TBLV = VertexCompare(
name="vertex_resolution_Moore_TBLV",
inputVerticesName1=pvs1_TBLV["v3"],
inputVerticesName2=pvs2_TBLV["v3"])
pvs1_PatPV3D = make_reco_pvs(
RS1_velo, None, make_pvs_from_velo_tracks=make_PatPV3DFuture_pvs)
pvs2_PatPV3D = make_reco_pvs(
RS2_velo, None, make_pvs_from_velo_tracks=make_PatPV3DFuture_pvs)
vertex_compare_Moore_PatPV3D = VertexCompare(
name="vertex_resolution_Moore_PatPV3D",
inputVerticesName1=pvs1_PatPV3D["v3"],
inputVerticesName2=pvs2_PatPV3D["v3"])
return [
vertex_compare_Allen, vertex_compare_Moore_TBLV,
vertex_compare_Moore_PatPV3D
]
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