You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

114 lines
3.3 KiB

  1. # flake8: noqa
  2. """
  3. This set of options is used for reconstruction development purposes,
  4. and assumes that the input contains MCHits (i.e. is of `Exended`
  5. DST/digi type).
  6. author: Furkan Cetin
  7. date: 10/2023
  8. """
  9. from Moore import options, run_reconstruction
  10. from Moore.config import Reconstruction
  11. from PyConf.Algorithms import (
  12. PrMatchNN,
  13. fromPrMatchTracksV1Tracks,
  14. )
  15. from PyConf.Tools import TrackMasterExtrapolator
  16. from RecoConf.hlt1_tracking import make_all_pvs
  17. from RecoConf.event_filters import require_gec
  18. from RecoConf.mc_checking import (
  19. check_track_resolution,
  20. check_tracking_efficiency,
  21. get_mc_categories,
  22. get_hit_type_mask,
  23. make_links_lhcbids_mcparticles_tracking_system,
  24. make_links_tracks_mcparticles,
  25. get_track_checkers,
  26. get_fitted_tracks_checkers,
  27. )
  28. from RecoConf.core_algorithms import make_unique_id_generator
  29. from RecoConf.hlt2_tracking import (
  30. make_hlt2_tracks,
  31. get_default_out_track_types_for_light_reco,
  32. get_global_ut_hits_tool,
  33. )
  34. from RecoConf.hlt1_tracking import (
  35. make_VeloClusterTrackingSIMD_hits,
  36. make_PrStorePrUTHits_hits,
  37. make_PrStoreSciFiHits_hits,
  38. get_global_materiallocator,
  39. )
  40. import glob
  41. decay = "testJpsi"
  42. options.evt_max = -1
  43. options.ntuple_file = f"/work/cetin/LHCb/reco_tuner/data_matching/sample4_data/match_effs_{decay}_EFilter.root"
  44. options.input_type = "ROOT"
  45. if decay == "B":
  46. options.input_files = glob.glob("/auto/data/guenther/Bd_Kstee/*.xdigi")
  47. elif decay == "BJpsi":
  48. options.input_files = glob.glob("/auto/data/guenther/Bd_JpsiKst_ee/*.xdigi")
  49. elif decay == "D":
  50. options.input_files = glob.glob("/auto/data/guenther/Dst_D0ee/*.xdigi")
  51. elif decay == "testJpsi":
  52. options.input_files = [
  53. "/auto/data/guenther/Bd_JpsiKst_ee/00143565_00000009_1.xdigi",
  54. "/auto/data/guenther/Bd_JpsiKst_ee/00143565_00000059_1.xdigi",
  55. "/auto/data/guenther/Bd_JpsiKst_ee/00143565_00000020_1.xdigi",
  56. ]
  57. elif decay == "test":
  58. options.input_files = ["/auto/data/guenther/Bd_Kstee/00151673_00000002_1.xdigi"]
  59. options.dddb_tag = "dddb-20210617"
  60. options.conddb_tag = "sim-20210617-vc-md100"
  61. options.simulation = True
  62. options.output_level = 3
  63. def run_tracking_debug():
  64. tracks = make_hlt2_tracks(light_reco=True, fast_reco=False, use_pr_kf=True)
  65. matching_params = dict(
  66. MinMatchNN=0.5, # NN response cut value
  67. )
  68. match_long = PrMatchNN(
  69. VeloInput=tracks["Velo"]["Pr"],
  70. SeedInput=tracks["Seed"]["Pr"],
  71. AddUTHitsToolName=get_global_ut_hits_tool(),
  72. **matching_params,
  73. ).MatchOutput
  74. match_tracks = {}
  75. match_tracks["Pr"] = match_long
  76. match_tracks["v1"] = fromPrMatchTracksV1Tracks(
  77. InputTracksLocation=match_tracks["Pr"],
  78. VeloTracksLocation=tracks["Velo"]["v1"],
  79. SeedTracksLocation=tracks["Seed"]["v1"],
  80. ).OutputTracksLocation
  81. types_and_locations_for_checkers = {
  82. "Forward": tracks["Forward"],
  83. "Seed": tracks["Seed"],
  84. "Match": match_tracks,
  85. }
  86. best_tracks = {
  87. "BestLong": tracks["BestLong"],
  88. }
  89. data = [match_long]
  90. data += get_track_checkers(types_and_locations_for_checkers)
  91. # data += get_fitted_tracks_checkers(best_tracks, fitted_track_types=["BestLong"])
  92. return Reconstruction("hlt2_matching_reco", data, [require_gec()])
  93. run_reconstruction(options, run_tracking_debug)