Skip to content

279 Build contiguous bar numbers from geometry - #280

Open
jdkio wants to merge 1 commit into
mainfrom
jdkio/279_geometry_bar_map
Open

279 Build contiguous bar numbers from geometry#280
jdkio wants to merge 1 commit into
mainfrom
jdkio/279_geometry_bar_map

Conversation

@jdkio

@jdkio jdkio commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Fixes issue #279 by creating a map.

More info about the bug

Geometry copy number only gives bar number within a module. So the code tries to calculate a global bar number. The bug was because it was using coordinate position for this calculation.

We create a map instead.

Comparison before and after

# Before (note there are no view 1 bar 32)
Truth_Info->Scan("TrueHitPlane:TrueHitBar:TrueHitView", "TrueHitBar==32", "colsize=18", 100);
**************************************************************************************
*    Row   * Instance *       TrueHitPlane *         TrueHitBar *        TrueHitView *
**************************************************************************************
*        0 *      541 *                 57 *                 32 *                  0 *
*        0 *     1373 *                 81 *                 32 *                  0 *
*        0 *     1669 *                 78 *                 32 *                  0 *
*        0 *     1887 *                 81 *                 32 *                  0 *
*        3 *       27 *                  3 *                 32 *                  0 *
*        4 *        6 *                 30 *                 32 *                  0 *

# After
Truth_Info->Scan("TrueHitPlane:TrueHitBar:TrueHitView", "TrueHitBar==32", "colsize=18", 100);
**************************************************************************************
*    Row   * Instance *       TrueHitPlane *         TrueHitBar *        TrueHitView *
**************************************************************************************
*        0 *      541 *                 57 *                 32 *                  0 *
*        0 *      550 *                  8 *                 32 *                  1 *
*        0 *      868 *                 17 *                 32 *                  1 *
*        0 *      907 *                 64 *                 32 *                  1 *
*        0 *     1101 *                 80 *                 32 *                  1 *
*        0 *     1224 *                 58 *                 32 *                  1 *
*        0 *     1245 *                 80 *                 32 *                  1 *
*        0 *     1373 *                 81 *                 32 *                  0 *

# Before (there are no view 0 bar 128)
Truth_Info->Scan("TrueHitPlane:TrueHitBar:TrueHitView", "TrueHitBar==128", "colsize=18", 100);
**************************************************************************************
*    Row   * Instance *       TrueHitPlane *         TrueHitBar *        TrueHitView *
**************************************************************************************
*        0 *       39 *                 38 *                128 *                  1 *
*        0 *      292 *                 49 *                128 *                  1 *
*        0 *      294 *                 55 *                128 *                  1 *
*        0 *      421 *                  2 *                128 *                  1 *
*        0 *      592 *                 61 *                128 *                  1 *
*        0 *      960 *                 62 *                128 *                  1 *
*        0 *     1163 *                 68 *                128 *                  1 *
*        0 *     1179 *                 50 *                128 *                  1 *
*        0 *     1293 *                 68 *                128 *                  1 *

# After
Truth_Info->Scan("TrueHitPlane:TrueHitBar:TrueHitView", "TrueHitBar==128", "colsize=18", 100);
**************************************************************************************
*    Row   * Instance *       TrueHitPlane *         TrueHitBar *        TrueHitView *
**************************************************************************************
*        0 *       27 *                 41 *                128 *                  1 *
*        0 *      359 *                  0 *                128 *                  1 *
*        0 *      567 *                  4 *                128 *                  1 *
*        0 *      641 *                 61 *                128 *                  1 *
*        0 *      672 *                 58 *                128 *                  1 *
*        0 *      681 *                 59 *                128 *                  1 *
*        0 *     1114 *                 51 *                128 *                  0 *
*        0 *     1192 *                 17 *                128 *                  1 *

# Before
Truth_Info->Scan("TrueHitPlane:TrueHitBar:TrueHitView", "TrueHitBar==192", "colsize=18", 100);
**************************************************************************************
*    Row   * Instance *       TrueHitPlane *         TrueHitBar *        TrueHitView *
**************************************************************************************
*        0 *      737 *                 63 *                192 *                  0 *
*        0 *     1123 *                 72 *                192 *                  0 *
*        0 *     1699 *                 72 *                192 *                  0 *
*        0 *     1724 *                 69 *                192 *                  0 *
*        0 *     1726 *                 70 *                192 *                  1 *

# After (we expect bar number to go to 64*3-1=191)
root [2] Truth_Info->Scan("TrueHitPlane:TrueHitBar:TrueHitView", "TrueHitBar==192", "colsize=18", 100);
**************************************************************************************
*    Row   * Instance *       TrueHitPlane *         TrueHitBar *        TrueHitView *
**************************************************************************************
**************************************************************************************

@jdkio

jdkio commented Jul 27, 2026

Copy link
Copy Markdown
Contributor Author

Example file with this fix:
/exp/dune/data/users/kleykamp/dune-tms/279_geometry_bar_map.root

@jdkio

jdkio commented Jul 27, 2026

Copy link
Copy Markdown
Contributor Author

Left before, right after. Note that a slideshow shows that the bars shift by 1 to the right of the gap. So I think we're good.
image
image

@jdkio jdkio changed the title Build contiguous bar numbers from geometry 279 Build contiguous bar numbers from geometry Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant