Skip to content

Adding hough reweighting for MM

Matous Vozak requested to merge mvozak/athena:mu-hough-reweighting into main

This MR contains implementation of the downweighting of noisy channels for the MM. It was suggested by @kluit and the main point was to hopefully reduce CPU time spend in the hough alg without dropping the performance. I have used noisy dataset recommended by @pscholer. Even though this cosmic dataset, I used nominal collision configuration as the changes are implemented for the HoughLayer tool. In principle could be done for cosmics as well if needed. I ran the following configuration:

INFILE=/eos/atlas/atlastier0/rucio/data23_cos/express_express/00459450/data23_cos.00459450.express_express.merge.RAW/data23_cos.00459450.express_express.merge.RAW._lb2793._SFO-ALL._0001.1

Reco_tf.py --CA 'all:True' 'RDOtoRDOTrigger:False' \
           --AMI x747 \
           --preExec 'all:flags.Common.doExpressProcessing=True;flags.DQ.Steering.HLT.doJet=True;flags.Tile.doTimingHistogramsForGain=1;flags.PerfMon.ProfiledAlgs = ["MuonLayerHoughAlg"];' \
           --postInclude MuonDetailedStudiesConfig.MuonDetailedStudiesCfg \
           --perfmon='fullmonmt' \
           --inputBSFile ${INFILE} \
           --imf False \
           --outputAODFile myAOD.poolroot \
           --postExec 'with open("new_config.pkl", "wb") as f: cfg.store(f)' \
           --maxEvents 1000

When running over 1k events on the main nightly 2023-09-18T2101

RAWtoALL 10:16:46 PerfMonMTSvc                                                      INFO Step           Count     CPU Time [ms]  Vmem [kB]      Malloc [kB]                Component

RAWtoALL 10:16:46 PerfMonMTSvc                                                      INFO Execute        999       375085.04      0              0                          MuonLayerHoughAlg

Compared to the case with the implemented changes:

RAWtoALL 10:12:39 PerfMonMTSvc                                                      INFO Execute        999       284803.20      0              0                          MuonLayerHoughAlg

As can be seen the CPU time seems to improve. For the performance validation, I ran the SA track performance alg, where both cases find the same amount of tracks:

Summarizing results for track collection MuonSpectrometerTracks  1000 events:
     number of tracks                                    969   average per event 0.969

On request by @pscholer I have ran 5k events on both data and MC to compare. Below I show some summary of the SA trkPerformance alg output. For data I used the following args:


Reco_tf.py --AMIConfig f1369 \
           --inputBSFile /eos/atlas/atlastier0/rucio/data23_13p6TeV/physics_Main/00456409/data23_13p6TeV.00456409.physics_Main.merge.DRAW_ZMUMU.f1369_m2193/data23_13p6TeV.00456409.physics_Main.merge.DRAW_ZMUMU.f1369_m2193._0001.1 \
           --postInclude MuonDetailedStudiesConfig.MuonDetailedStudiesCfg \
           --outputESDFile myESD.pool.root \
           --postExec 'with open("new_config.pkl", "wb") as f: cfg.store(f)' \
           --maxEvents 5000

#Main branch output of trkPerformance_MuonSpectrometerTracks.txt
Summarizing results for track collection MuonSpectrometerTracks  3519 events: 
  number of tracks                                   9715   average per event 2.761

#Test branch output of trkPerformance_MuonSpectrometerTracks.txt
Summarizing results for track collection MuonSpectrometerTracks  3519 events: 
  number of tracks                                   9655   average per event 2.744

So for data I see slightly less number of tracks on the test branch by 0.6% compared to main. In case of the MC run:

Digi_tf.py --inputHITSFile /eos/user/m/mvozak/data/muon_reco_studies/data/HITS/group.det-muon.33831010.EXT0._001132.HITS.pool.root \
           --outputRDOFile OUT_RDO_local.root \
           --maxEvents 5000

Reco_tf.py --CA 'all:True' 'RDOtoRDOTrigger:False' \
           --inputRDOFile OUT_RDO_local.root \
           --geometryVersion='default:ATLAS-R3S-2021-03-01-00' \
           --conditionsTag='default:OFLCOND-MC21-SDR-RUN3-09'  \
           --postInclude MuonDetailedStudiesConfig.MuonDetailedStudiesCfg \
           --outputESDFile myESD.pool.root \
           --postExec 'with open("new_config.pkl", "wb") as f: cfg.store(f)' \
           --maxEvents 5000

#Main branch output of trkPerformance_MuonSpectrometerTracks.txt
Summarizing results for track collection MuonSpectrometerTracks  5000 events: 
  number of tracks                                   9764   average per event 1.953
  number of truth tracks                             9735   average per event 1.947
  number of good tracks                              9592   average per event 1.918
  number of missed multi station tracks               100   average per event 0.02
  number of missed one station tracks                  43   average per event 0.0086
  number of fake tracks                               172   average per event 0.0344
  number of high pt fake tracks                       112   average per event 0.0224
  number of low pt fake tracks                         23   average per event 0.0046
  number of SL fake tracks                             37   average per event 0.0074
  number of matched fake tracks                       130   average per event 0.026
  number of tracks with lost momentum                 156   average per truth track 0.01602
  number of tracks missing precision layer            529   average per truth track 0.05434
  number of tracks missing trigger layer              262   average per truth track 0.02691
  number of tracks missing chamber                    604   average per truth track 0.06204
  number of tracks wrong precision layer                4   average per truth track 0.0004109
  number of tracks wrong trigger layer                  0   average per truth track 0
  number of tracks wrong chamber                       12   average per truth track 0.001233
  efficiency: 0.9853  fake rate 0.0344  high pt 0.0224  low pt 0.0046  missed track rate (per truth track) 0.01027

#Test branch output of trkPerformance_MuonSpectrometerTracks.txt
Summarizing results for track collection MuonSpectrometerTracks  5000 events: 
  number of tracks                                   9768   average per event 1.954
  number of truth tracks                             9735   average per event 1.947
  number of good tracks                              9591   average per event 1.918
  number of missed multi station tracks               100   average per event 0.02
  number of missed one station tracks                  44   average per event 0.0088
  number of fake tracks                               177   average per event 0.0354
  number of high pt fake tracks                       116   average per event 0.0232
  number of low pt fake tracks                         23   average per event 0.0046
  number of SL fake tracks                             38   average per event 0.0076
  number of matched fake tracks                       132   average per event 0.0264
  number of tracks with lost momentum                 157   average per truth track 0.01613
  number of tracks missing precision layer            529   average per truth track 0.05434
  number of tracks missing trigger layer              262   average per truth track 0.02691
  number of tracks missing chamber                    602   average per truth track 0.06184
  number of tracks wrong precision layer                4   average per truth track 0.0004109
  number of tracks wrong trigger layer                  0   average per truth track 0
  number of tracks wrong chamber                       13   average per truth track 0.001335
  efficiency: 0.9852  fake rate 0.0354  high pt 0.0232  low pt 0.0046  missed track rate (per truth track) 0.01027

Looks like with the test branch there is a few more fake tracks. Still want to look at the distribution of hits etc.

Happy to also run any other further checks if necessary.

Cheers Mat

Edited by Matous Vozak

Merge request reports