Skip to content
Snippets Groups Projects

Draft: Update SciFi Hit Error in Kalman Filter

Open Ya Zhao requested to merge update_KF_FT_hit_err into master
4 unresolved threads

Update SciFi Hit Error in Kalman Filter. In the new model (see tables below), hit error is a function of (pseudoSize, layer, momentum). The draft note discussing hit resolution and models can be found in https://www.overleaf.com/read/gmnqfjrrhfwh#044c90 . The last step that is not yet done is to scale the hit error to optimize the yields of particles using KS2pipi.

LayerID pseudoSize=4, x: momentum[MeV]
0 23154789.379444800 / ( (x + 3228.567709951)*(x + 3228.567709951) ) + 0.092237549
1 20680896.657339606 / ( (x + 3591.815330855)*(x + 3591.815330855) ) + 0.095023980
2 15596036.426450219 / ( (x + 3151.058261365)*(x + 3151.058261365) ) + 0.102177476
3 13418024.048170315 / ( (x + 2722.136254393)*(x + 2722.136254393) ) + 0.086063198
4 2868747.742438843 / ( (x + 1096.843522791)*(x + 1096.843522791) ) + 0.085193987
5 4137639.787156299 / ( (x + 2325.165019022)*(x + 2325.165019022) ) + 0.095592633
6 1959740.767703929 / ( (x + 904.497892442)*(x + 904.497892442) ) + 0.101976882
7 3392491.967029064 / ( (x + 2084.762805573)*(x + 2084.762805573) ) + 0.082226020
8 5152946.229277493 / ( (x + 5278.899947562)*(x + 5278.899947562) ) + 0.092301151
9 3213061.215173298 / ( (x + 2707.901153302)*(x + 2707.901153302) ) + 0.116760051
10 3772903.457997424 / ( (x + 3597.170859661)*(x + 3597.170859661) ) + 0.112550243
11 1960780.593258482 / ( (x + 1325.066583623)*(x + 1325.066583623) ) + 0.105152955
LayerID pseudoSize=5, x: momentum[MeV]
0 10862533.257766284 / ( (x + 2068.414053334)*(x + 2068.414053334) ) + 0.310275197
1 10351052.130930372 / ( (x + 2669.909098654)*(x + 2669.909098654) ) + 0.312346217
2 9625838.999464801 / ( (x + 2861.413620979)*(x + 2861.413620979) ) + 0.318818946
3 7256105.303798619 / ( (x + 2365.226207088)*(x + 2365.226207088) ) + 0.306103732
4 463340.981901859 / ( (x + -1338.465472533)*(x + -1338.465472533) ) + 0.305699223
5 684974.893330344 / ( (x + -450.623923066)*(x + -450.623923066) ) + 0.322762240
6 449453.201123709 / ( (x + -929.967845135)*(x + -929.967845135) ) + 0.325342528
7 20545.947720544 / ( (x + -3302.023069448)*(x + -3302.023069448) ) + 0.309772860
8 311400.387884595 / ( (x + -311.512026007)*(x + -311.512026007) ) + 0.320782412
9 1008928.606811547 / ( (x + 594.558549039)*(x + 594.558549039) ) + 0.335819708
10 535483.585470130 / ( (x + -420.307257708)*(x + -420.307257708) ) + 0.336026346
11 681849.685564990 / ( (x + -1933.335114649)*(x + -1933.335114649) ) + 0.334432489
LayerID pseudoSize=6, x: momentum[MeV]
0 8744438.127454557 / ( (x + 2171.709290445)*(x + 2171.709290445) ) + 0.392915795
1 8630282.620604541 / ( (x + 2778.357261528)*(x + 2778.357261528) ) + 0.392562231
2 8571078.950357920 / ( (x + 3225.003799690)*(x + 3225.003799690) ) + 0.396866582
3 5857229.174073162 / ( (x + 2410.540009518)*(x + 2410.540009518) ) + 0.388225913
4 771094.400566404 / ( (x + -109.134122281)*(x + -109.134122281) ) + 0.390519895
5 575422.182995292 / ( (x + -345.410480818)*(x + -345.410480818) ) + 0.403873681
6 553676.601798218 / ( (x + -180.840778227)*(x + -180.840778227) ) + 0.404635669
7 433281.405553064 / ( (x + -502.029947673)*(x + -502.029947673) ) + 0.390250734
8 1385390.998106212 / ( (x + 5277.235171386)*(x + 5277.235171386) ) + 0.402258100
9 1547987.764117316 / ( (x + 2222.494553865)*(x + 2222.494553865) ) + 0.411895297
10 1245786.900500593 / ( (x + 1879.393214241)*(x + 1879.393214241) ) + 0.411115007
11 831109.112978482 / ( (x + -972.617375190)*(x + -972.617375190) ) + 0.409304316
LayerID pseudoSize=7, x: momentum[MeV]
0 7033190.564052835 / ( (x + 2157.853438187)*(x + 2157.853438187) ) + 0.473505309
1 7224796.335991498 / ( (x + 2927.977247145)*(x + 2927.977247145) ) + 0.471073467
2 7892181.264411370 / ( (x + 3548.004236783)*(x + 3548.004236783) ) + 0.472423204
3 4679523.550175380 / ( (x + 2344.907576283)*(x + 2344.907576283) ) + 0.466247056
4 1807318.277830467 / ( (x + 2701.444857489)*(x + 2701.444857489) ) + 0.470227160
5 1518661.581785633 / ( (x + 2801.101193980)*(x + 2801.101193980) ) + 0.481867466
6 2102933.701136883 / ( (x + 4758.815252922)*(x + 4758.815252922) ) + 0.480977283
7 1937379.207928441 / ( (x + 4001.020855378)*(x + 4001.020855378) ) + 0.467848225
8 4032005.069611534 / ( (x + 12310.883579913)*(x + 12310.883579913) ) + 0.481137780
9 3242244.133625510 / ( (x + 5478.583125678)*(x + 5478.583125678) ) + 0.485487941
10 8031431.175710511 / ( (x + 11294.979366016)*(x + 11294.979366016) ) + 0.480068023
11 842164.512574237 / ( (x + -354.226282397)*(x + -354.226282397) ) + 0.484829942
LayerID pseudoSize=8, x: momentum[MeV]
0 4623094.990568376 / ( (x + 1449.812968037)*(x + 1449.812968037) ) + 0.553541148
1 5837006.951407019 / ( (x + 3065.257386389)*(x + 3065.257386389) ) + 0.550391725
2 6670069.220234816 / ( (x + 3816.275792892)*(x + 3816.275792892) ) + 0.550423509
3 4797680.978752845 / ( (x + 3100.948665751)*(x + 3100.948665751) ) + 0.542559832
4 5647932.335294667 / ( (x + 10691.965262934)*(x + 10691.965262934) ) + 0.549989802
5 13376579.285965819 / ( (x + 17855.734603185)*(x + 17855.734603185) ) + 0.555825706
6 33271013.887585603 / ( (x + 30280.248608720)*(x + 30280.248608720) ) + 0.549150846
7 4296720.445854717 / ( (x + 9511.799336392)*(x + 9511.799336392) ) + 0.545853750
8 63906850160.236946106 / ( (x + 869037.020869628)*(x + 869037.020869628) ) + 0.485405653
9 5369732.715899627 / ( (x + 10485.743135610)*(x + 10485.743135610) ) + 0.561966787
10 40816541.707359821 / ( (x + 32900.933985713)*(x + 32900.933985713) ) + 0.550193066
11 2896820.957309694 / ( (x + 3778.807517829)*(x + 3778.807517829) ) + 0.555143155
LayerID pseudoSize=0, x: momentum[MeV]
0 6087552.612283930 / ( (x + 2745.312299624)*(x + 2745.312299624) ) + 0.256845343
1 6411031.858935189 / ( (x + 3922.657189789)*(x + 3922.657189789) ) + 0.261618954
2 6484063.655053214 / ( (x + 3895.999151155)*(x + 3895.999151155) ) + 0.260920807
3 4343681.840399578 / ( (x + 3254.608850145)*(x + 3254.608850145) ) + 0.256307503
4 1123536.088399351 / ( (x + 1069.744612037)*(x + 1069.744612037) ) + 0.256471253
5 1955966.066095850 / ( (x + 2482.489593856)*(x + 2482.489593856) ) + 0.263483736
6 2006995.518003298 / ( (x + 2357.620182799)*(x + 2357.620182799) ) + 0.264714583
7 1653317.462377106 / ( (x + 839.232020867)*(x + 839.232020867) ) + 0.256811440
8 821970.755634446 / ( (x + 966.614788690)*(x + 966.614788690) ) + 0.268134208
9 43681249.443321966 / ( (x + 15148.727801742)*(x + 15148.727801742) ) + 0.256109753
10 1478601.310518233 / ( (x + 1486.356516981)*(x + 1486.356516981) ) + 0.275348180
11 1302516.837420181 / ( (x + 402.675734246)*(x + 402.675734246) ) + 0.275644455
Edited by Ya Zhao

Merge request reports

Merge request pipeline #8171376 passed

Merge request pipeline passed for 6ec5dca9

Ready to merge by members who can write to the target branch.
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
477 // https://gitlab.cern.ch/lhcb/Rec/-/blob/master/Pr/PrAlgorithms/src/PrStoreSciFiHits.cpp#L41
478 double init_ft_error = node.measurement_error;
479 if ( abs( init_ft_error - 0.05 / 2 ) < 0.0001 )
480 node.measurement_error = FTErrorProvider_pseudoSize0( layer, last_measurement.p() );
481 if ( abs( init_ft_error - 0.17 / 2 ) < 0.0001 )
482 node.measurement_error = FTErrorProvider_pseudoSize4( layer, last_measurement.p() );
483 if ( abs( init_ft_error - 0.20 / 2 ) < 0.0001 )
484 node.measurement_error = FTErrorProvider_pseudoSize5( layer, last_measurement.p() );
485 if ( abs( init_ft_error - 0.23 / 2 ) < 0.0001 )
486 node.measurement_error = FTErrorProvider_pseudoSize6( layer, last_measurement.p() );
487 if ( abs( init_ft_error - 0.26 / 2 ) < 0.0001 )
488 node.measurement_error = FTErrorProvider_pseudoSize7( layer, last_measurement.p() );
489 if ( abs( init_ft_error - 0.29 / 2 ) < 0.0001 )
490 node.measurement_error = FTErrorProvider_pseudoSize8( layer, last_measurement.p() );
491 }
492 }
  • Comment on lines +478 to +492

    This does not (yet?) use the interface as discussed in #110, as pointed out already in this comment. It would be good to not add this level of detailed knowledge to KF.h but factor this out and hide it behind the interface proposed in #110.

    And it would remove the hardwired assumptions currently implied here.

  • Author Developer

    Thanks for the comments! These lines of code are ugly and should be changed to a better way. Currently I'm not working on implementing the codes, because I had a discussion with Laurent and he suggested that we should do further study on the hit error model itself to make sure the model is correct. So this MR is just draft for now, and after we have a convincing hit error model we can start to implement codes according to #110 :).

  • Please register or sign in to reply
  • 37 case 7:
    38 fterr = 3392491.967029064 / ( ( p + 2084.762805573 ) * ( p + 2084.762805573 ) ) + 0.082226020;
    39 break;
    40 case 8:
    41 fterr = 5152946.229277493 / ( ( p + 5278.899947562 ) * ( p + 5278.899947562 ) ) + 0.092301151;
    42 break;
    43 case 9:
    44 fterr = 3213061.215173298 / ( ( p + 2707.901153302 ) * ( p + 2707.901153302 ) ) + 0.116760051;
    45 break;
    46 case 10:
    47 fterr = 3772903.457997424 / ( ( p + 3597.170859661 ) * ( p + 3597.170859661 ) ) + 0.112550243;
    48 break;
    49 case 11:
    50 fterr = 1960780.593258482 / ( ( p + 1325.066583623 ) * ( p + 1325.066583623 ) ) + 0.105152955;
    51 break;
    52 }
    • Comment on lines +15 to +52

      Please write this not as a lot of repetitive code which uses different constants, but split the constants from the code:

      Suggested change
      15 switch ( layer ) {
      16 case 0:
      17 fterr = 23154789.379444800 / ( ( p + 3228.567709951 ) * ( p + 3228.567709951 ) ) + 0.092237549;
      18 break;
      19 case 1:
      20 fterr = 20680896.657339606 / ( ( p + 3591.815330855 ) * ( p + 3591.815330855 ) ) + 0.095023980;
      21 break;
      22 case 2:
      23 fterr = 15596036.426450219 / ( ( p + 3151.058261365 ) * ( p + 3151.058261365 ) ) + 0.102177476;
      24 break;
      25 case 3:
      26 fterr = 13418024.048170315 / ( ( p + 2722.136254393 ) * ( p + 2722.136254393 ) ) + 0.086063198;
      27 break;
      28 case 4:
      29 fterr = 2868747.742438843 / ( ( p + 1096.843522791 ) * ( p + 1096.843522791 ) ) + 0.085193987;
      30 break;
      31 case 5:
      32 fterr = 4137639.787156299 / ( ( p + 2325.165019022 ) * ( p + 2325.165019022 ) ) + 0.095592633;
      33 break;
      34 case 6:
      35 fterr = 1959740.767703929 / ( ( p + 904.497892442 ) * ( p + 904.497892442 ) ) + 0.101976882;
      36 break;
      37 case 7:
      38 fterr = 3392491.967029064 / ( ( p + 2084.762805573 ) * ( p + 2084.762805573 ) ) + 0.082226020;
      39 break;
      40 case 8:
      41 fterr = 5152946.229277493 / ( ( p + 5278.899947562 ) * ( p + 5278.899947562 ) ) + 0.092301151;
      42 break;
      43 case 9:
      44 fterr = 3213061.215173298 / ( ( p + 2707.901153302 ) * ( p + 2707.901153302 ) ) + 0.116760051;
      45 break;
      46 case 10:
      47 fterr = 3772903.457997424 / ( ( p + 3597.170859661 ) * ( p + 3597.170859661 ) ) + 0.112550243;
      48 break;
      49 case 11:
      50 fterr = 1960780.593258482 / ( ( p + 1325.066583623 ) * ( p + 1325.066583623 ) ) + 0.105152955;
      51 break;
      52 }
      15 auto const C0 = std::array{ 23154789.379444800, 20680896.657339606,
      16 15596036.426450219, 13418024.048170315,
      17 2868747.742438843, 4137639.787156299,
      18 1959740.767703929, 3392491.967029064,
      19 5152946.229277493, 3213061.215173298,
      20 3772903.457997424, 1960780.593258482 };
      21 auto const C1 = std::array{ 3228.567709951 , 3591.815330855,
      22 3151.058261365, 2722.136254393,
      23 1096.843522791, 2325.165019022
      24 904.497892442, 2084.762805573,
      25 5278.899947562, 2707.901153302,
      26 3597.170859661, 1325.066583623 };
      27 auto const C2 = std::array{ 0.092237549, 0.095023980,
      28 0.102177476, 0.086063198,
      29 0.085193987, 0.095592633,
      30 0.101976882, 0.082226020,
      31 0.092301151, 0.116760051,
      32 0.112550243, 0.105152955 };
      33 assert( layer < 12 );
      34 fterr = C0[layer] / ( ( p + C1[layer] ) * ( p + C1[layer] ) ) + C2[layer]

      That makes it a lot more readable, and also leads to another question: why are the numbers that enter here so different? Does one really expect eg. factors of three differences in constants between layers?

    • Author Developer

      Thanks for this! The difference between layers is just what I'm currently studying. The plots about comparison between layers can be found in Figure 9 from the draft note: https://www.overleaf.com/read/gmnqfjrrhfwh#044c90 . The values of C2 seems close between layers, but C0 and C1 not. This may be related with how to determine the hit errors of low momentum regions, which would influence the shapes of the curves, and thus influence C0 and C1.

    • It probably makes most sense to look at the hit errors at one particular mat, and then later at another specific mat, as these are the most detailed elements we treat in the alignment. It could be that you see a combination of alignment effects when looking at bigger objects, and see trends that are not actually the intrinsic detector resolution.

    • Please register or sign in to reply
    Please register or sign in to reply
    Loading