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.

121 lines
3.5 KiB

7 months ago
7 months ago
  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 = "BJpsi"
  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.ntuple_file = (
  45. f"/work/cetin/LHCb/reco_tuner/efficiencies/electrons/match_effs_{decay}_EDef.root"
  46. )
  47. options.input_type = "ROOT"
  48. if decay == "B":
  49. options.input_files = glob.glob("/auto/data/guenther/Bd_Kstee/*.xdigi")
  50. elif decay == "BJpsi":
  51. options.input_files = glob.glob("/auto/data/guenther/Bd_JpsiKst_ee/*.xdigi")
  52. elif decay == "D":
  53. options.input_files = glob.glob("/auto/data/guenther/Dst_D0ee/*.xdigi")
  54. elif decay == "testJpsi":
  55. options.input_files = [
  56. "/auto/data/guenther/Bd_JpsiKst_ee/00143565_00000009_1.xdigi",
  57. "/auto/data/guenther/Bd_JpsiKst_ee/00143565_00000059_1.xdigi",
  58. "/auto/data/guenther/Bd_JpsiKst_ee/00143565_00000020_1.xdigi",
  59. ]
  60. elif decay == "test":
  61. options.input_files = ["/auto/data/guenther/Bd_Kstee/00151673_00000002_1.xdigi"]
  62. options.dddb_tag = "dddb-20210617"
  63. options.conddb_tag = "sim-20210617-vc-md100"
  64. options.simulation = True
  65. options.output_level = 3
  66. def run_tracking_debug():
  67. tracks = make_hlt2_tracks(light_reco=True, fast_reco=False, use_pr_kf=True)
  68. matching_params = dict(
  69. MinMatchNN=0.25,
  70. MaxdDist=0.1,
  71. MinZMag=5100,
  72. MaxZMag=5700,
  73. )
  74. match_long = PrMatchNN(
  75. VeloInput=tracks["Velo"]["Pr"],
  76. SeedInput=tracks["Seed"]["Pr"],
  77. AddUTHitsToolName=get_global_ut_hits_tool(),
  78. **matching_params,
  79. ).MatchOutput
  80. match_tracks = {}
  81. match_tracks["Pr"] = match_long
  82. match_tracks["v1"] = fromPrMatchTracksV1Tracks(
  83. InputTracksLocation=match_tracks["Pr"],
  84. VeloTracksLocation=tracks["Velo"]["v1"],
  85. SeedTracksLocation=tracks["Seed"]["v1"],
  86. ).OutputTracksLocation
  87. types_and_locations_for_checkers = {
  88. "Forward": tracks["Forward"],
  89. "Seed": tracks["Seed"],
  90. "Match": match_tracks,
  91. }
  92. # best_tracks = {
  93. # "BestLong": tracks["BestLong"],
  94. # }
  95. data = []
  96. data += get_track_checkers(types_and_locations_for_checkers)
  97. # data += get_fitted_tracks_checkers(best_tracks, fitted_track_types=["BestLong"])
  98. return Reconstruction("hlt2_matching_reco", data, [require_gec()])
  99. run_reconstruction(options, run_tracking_debug)