acts icon indicating copy to clipboard operation
acts copied to clipboard

feat: Enable more fine-grained digitization configuration

Open benjaminhuth opened this issue 3 years ago • 4 comments

This extends the JSON-format for digitization configuration to allow more fine grained constraints.

The underlying problem is, that modules in one layer may have a different configuration, but this cannot be reflected by the geometry hierarchy.

Overview

This changes the JSON plugin in a way, that it allows a list for the "value" entry (single entries are still allowed). The configuration gets an additional field "constraint" that allows setting some constraints on the modules (for now only restriction in the radial-position of the surface with respect to the coordinate-origin). This can look like this:

{
    "volume": 23,
    "layer": 2,
    "value": [
      {
        "constraint": {
          "r-range": [300.0,320.0]
        },
        "geometric": {  }
      },
      {
        "constraint": {
          "r-range": [500.0,520.0]
        },
        "geometric": {  }
      }
   ]
}

In the C++ code this is reflected by an additional object in the DigiComponentsConfig, the DigiConstraint:

struct DigiConstraint {
  std::optional<std::pair<double, double>> rRange;

  bool operator()(const Acts::Surface &s,
                  const Acts::GeometryContext &g) const {
    const auto r = std::hypot(s.center(g)[0], s.center(g)[1]);
    if (rRange && (r < rRange->first || r > rRange->second)) {
      return false;
    }

    return true;
  }
};

This is then propagated through the DigitizationAlgorithm and then checked.

Problems

  • The getBoundIndices() function does not work yet, I'm not sure what it does, but it seems difficult to reflect the constraints here...
  • Performance of nested std::vectors bad, maybe switch to boost::small_vector or something like that?
  • Constraints hard-coded

benjaminhuth avatar May 25 '22 19:05 benjaminhuth

Codecov Report

Merging #1272 (e1981c5) into main (4ceddf3) will decrease coverage by 0.01%. The diff coverage is n/a.

@@            Coverage Diff             @@
##             main    #1272      +/-   ##
==========================================
- Coverage   47.49%   47.48%   -0.02%     
==========================================
  Files         376      376              
  Lines       19811    19816       +5     
  Branches     9305     9308       +3     
==========================================
  Hits         9410     9410              
- Misses       4011     4016       +5     
  Partials     6390     6390              
Impacted Files Coverage Δ
Core/include/Acts/Seeding/BinnedSPGroup.ipp 0.00% <0.00%> (ø)
Core/include/Acts/Seeding/SeedFinderUtils.ipp 0.00% <0.00%> (ø)
Core/include/Acts/Seeding/SeedfinderConfig.hpp 0.00% <0.00%> (ø)

:mega: Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

codecov[bot] avatar May 25 '22 19:05 codecov[bot]

what I didn't/don't understand is what's the difference between your approach

...
{
    "volume": 23,
    "layer": 2,
    "value": [
      {
        "constraint": {
          "r-range": [300.0,320.0]
        },
        "geometric": {...}
      },
      {
        "constraint": {
          "r-range": [500.0,520.0]
        },
        "geometric": {...}
      }
   ]
}
...

and something like

...
{
    "volume": 23,
    "layer": 2,
    "module": 103,
    "value": {...}
},
{
    "volume": 23,
    "layer": 2,
    "module": 104,
    "value": {...}
}
...

andiwand avatar Jun 01 '22 05:06 andiwand

what I didn't/don't understand is what's the difference between your approach

...
{
    "volume": 23,
    "layer": 2,
    "value": [
      {
        "constraint": {
          "r-range": [300.0,320.0]
        },
        "geometric": {...}
      },
      {
        "constraint": {
          "r-range": [500.0,520.0]
        },
        "geometric": {...}
      }
   ]
}
...

and something like

...
{
    "volume": 23,
    "layer": 2,
    "module": 103,
    "value": {...}
},
{
    "volume": 23,
    "layer": 2,
    "module": 104,
    "value": {...}
}
...

@andiwand Hmm technical not really a difference, but you would need several thousand entries in the json file then... You could generate that itself by a script of course, but this way it is still human-readable, which is also an advantage I think...

benjaminhuth avatar Jun 01 '22 08:06 benjaminhuth

This issue/PR has been automatically marked as stale because it has not had recent activity. The stale label will be removed if any interaction occurs.

stale[bot] avatar Jul 10 '22 02:07 stale[bot]