acts-project / traccc

Demonstrator tracking chain on accelerators
Mozilla Public License 2.0
29 stars 48 forks source link

Ambiguity Resolution Errors on ODD ttbar Simulation (2024.05.04.) #564

Closed krasznaa closed 1 month ago

krasznaa commented 6 months ago

Now that I finally started using the ttbar samples that I produced as described in #561, I came across an interesting type of error message from the track ambiguity resolution code. :thinking:

[bash][Legolas]:traccc > ./out/build/sycl/bin/traccc_seq_example --detector-file=geometries/odd/odd-detray_geometry_detray.json --grid-file=geometries/odd/odd-detray_surface_grids_detray.json --use-detray-detector --digitization-file=geometries/odd/odd-digi-geometric-config.json --input-directory=odd/geant4_ttbar_mu20/ --input-events=10

Running Full Tracking Chain on the Host

>>> Detector Options <<<
  Detector file       : geometries/odd/odd-detray_geometry_detray.json
  Material file       : 
  Surface rid file    : geometries/odd/odd-detray_surface_grids_detray.json
  Use detray::detector: yes
  Digitization file   : geometries/odd/odd-digi-geometric-config.json
>>> Input Data Options <<<
  Input data format             : csv
  Input directory               : odd/geant4_ttbar_mu20/
  Number of input events        : 10
  Number of input events to skip: 0
>>> Clusterization Options <<<
  Target cells per partition: 1024
>>> Track Seeding Options <<<
  None
>>> Track Finding Options <<<
  Track candidates range   : 3:100
  Minimum step length for the next surface: 0.5 [mm] 
  Maximum step counts for the next surface: 100
  Maximum Chi2             : 30
  Maximum branches per step: 4294967295
  Maximum number of skipped steps per candidates: 3
>>> Track Propagation Options <<<
  Constraint step size  : 3.40282e+38 [mm]
  Overstep tolerance    : -100 [um]
  Minimum mask tolerance: 1e-05 [mm]
  Maximum mask tolerance: 1 [mm]
  Search window         : 0 x 0
  Runge-Kutta tolerance : 0.0001
>>> Track Ambiguity Resolution Options <<<
  Run ambiguity resolution : yes
>>> Performance Measurement Options <<<
  Run performance checks: no

WARNING: No material in detector
WARNING: No entries in volume finder
Detector check: OK
WARNING: No material in detector
WARNING: No entries in volume finder
Detector check: OK
WARNING: @traccc::io::csv::read_cells: 2932 duplicate cells found in /data/ssd-1tb/projects/traccc/traccc/data/odd/geant4_ttbar_mu20/event000000000-cells.csv
WARNING: @traccc::io::csv::read_cells: 2209 duplicate cells found in /data/ssd-1tb/projects/traccc/traccc/data/odd/geant4_ttbar_mu20/event000000001-cells.csv
ERROR: @greedy_ambiguity_resolution_algorithm: Measurement 15195 is shared between 2 tracks, superior to _config.maximum_shared_hits(1). It is shared between tracks: 1176 1176
ERROR: @greedy_ambiguity_resolution_algorithm:     Track(1176)'s measurements: 3291 3475 4518 7396 8617 9632 9625 10484 15195 15195 15269 15268
ERROR: @greedy_ambiguity_resolution_algorithm:     Track(1176)'s measurements: 3291 3475 4518 7396 8617 9632 9625 10484 15195 15195 15269 15268
WARNING: @traccc::io::csv::read_cells: 1989 duplicate cells found in /data/ssd-1tb/projects/traccc/traccc/data/odd/geant4_ttbar_mu20/event000000002-cells.csv
WARNING: @traccc::io::csv::read_cells: 2291 duplicate cells found in /data/ssd-1tb/projects/traccc/traccc/data/odd/geant4_ttbar_mu20/event000000003-cells.csv
WARNING: @traccc::io::csv::read_cells: 2087 duplicate cells found in /data/ssd-1tb/projects/traccc/traccc/data/odd/geant4_ttbar_mu20/event000000004-cells.csv
WARNING: @traccc::io::csv::read_cells: 2229 duplicate cells found in /data/ssd-1tb/projects/traccc/traccc/data/odd/geant4_ttbar_mu20/event000000005-cells.csv
WARNING: @traccc::io::csv::read_cells: 3753 duplicate cells found in /data/ssd-1tb/projects/traccc/traccc/data/odd/geant4_ttbar_mu20/event000000006-cells.csv
WARNING: @traccc::io::csv::read_cells: 2352 duplicate cells found in /data/ssd-1tb/projects/traccc/traccc/data/odd/geant4_ttbar_mu20/event000000007-cells.csv
ERROR: @greedy_ambiguity_resolution_algorithm: Measurement 15837 is shared between 2 tracks, superior to _config.maximum_shared_hits(1). It is shared between tracks: 720 720
ERROR: @greedy_ambiguity_resolution_algorithm:     Track(720)'s measurements: 2878 4167 5155 15837 15837
ERROR: @greedy_ambiguity_resolution_algorithm:     Track(720)'s measurements: 2878 4167 5155 15837 15837
WARNING: @traccc::io::csv::read_cells: 2923 duplicate cells found in /data/ssd-1tb/projects/traccc/traccc/data/odd/geant4_ttbar_mu20/event000000008-cells.csv
WARNING: @traccc::io::csv::read_cells: 1213 duplicate cells found in /data/ssd-1tb/projects/traccc/traccc/data/odd/geant4_ttbar_mu20/event000000009-cells.csv
==> Statistics ... 
- read     514662 cells from 76402 modules
- created  142992 measurements. 
- created  142992 space points. 
- created  13886 seeds
- found    15758 tracks
- fitted   15758 tracks
- resolved 3742 tracks
==> Elapsed times...
                    Read cells  839 ms
                Clusterization  20 ms
          Spacepoint formation  1 ms
                       Seeding  79 ms
       Track params estimation  2 ms
                 Track finding  833 ms
                 Track fitting  434 ms
    Track ambiguity resolution  183 ms
                     Wall time  2395 ms
[bash][Legolas]:traccc >

@SylvainJoube, what is the exact meaning of the maximum_shared_hits parameter? Is "hit" a "cell", or a "measurement" in this context? Though in either case, having a maximum allowed value of 1 seems a bit harsh. Our track reconstruction is certainly allowed to reconstruct tracks with more shared measurements than that at the moment. :thinking:

But while this setting seems more of a tuning issue, the error output suggests some actual bug in the code. Since in both errors the output refers to the same track. :confused:

Not the most urgent thing to fix, but you should have a look during this coming week if possible.

Pinging @beomki-yeo as well for info. :wink:

SylvainJoube commented 5 months ago

I’m very sorry for my very late response.

First, let me reply to:

What is the exact meaning of the maximum_shared_hits parameter? Is "hit" a "cell", or a "measurement" in this context? Though in either case, having a maximum allowed value of 1 seems a bit harsh

The maximum_shared_hits is the maximum allowed common measurements between two tracks. The value 1 means "no shared measurement allowed", every track needs to be fully independent. The greedy ambiguity resolution algorithm only deals with (unique) measurement ids.

In ACTS, the Maximum amount of shared hits per track. is defined as follows: std::uint32_t maximumSharedHits = 1; in the file Examples/Algorithms/AmbiguityResolution/include/ActsExamples/AmbiguityResolution/GreedyAmbiguityResolutionAlgorithm.hpp. So the ACTS version allows no shared measurement either. And I’m 99,9% sure that the name hit is referring to measurements.

For all the following examples, we have:

===== Performance metrics for fitting =====
        Valid: 1786 (34%)
    Duplicates: 2170 (41%)
        Fakes: 1340 (25%)

For example, with the toy detector used by the seeding_example, with no common measurements, we have:

===== Performance metrics for ambiguity resolution (check v2) =====
        Valid: 1766 (99%)
    Duplicates: 0 (0%)
        Fakes: 14 (1%)

And with maximum_shared_hits = 2 (so maximum one single shared measurement between tracks), we have:

===== Performance metrics for ambiguity resolution (check v2) =====
        Valid: 1769 (98%)
    Duplicates: 0 (0%)
        Fakes: 45 (2%)

And with maximum_shared_hits = 3 (so maximum two shared measurements between tracks), we have:

===== Performance metrics for ambiguity resolution (check v2) =====
        Valid: 1769 (93%)
    Duplicates: 9 (0%)
        Fakes: 128 (7%)
SylvainJoube commented 5 months ago

I will investigate the error messages and be back as soon as possible.

SylvainJoube commented 5 months ago

PR Remove duplicate measurements for each track #590 should solve this issue :fox_face: I did not anticipate that a track could be made of the same measurement_id more than once!