Skip to content

Conversation

@efuchey
Copy link
Collaborator

@efuchey efuchey commented Jan 27, 2025

  • residuals in the AHDC::Hits list in the alert.json file;
  • filling the hits residuals in the RecoBankWriter;
  • added residual and residual_prefit in ahdc/Hit/Hit.java
  • added a identification flag to match ahdc/KalmanFilter/Hit.java to ahdc/Hit/Hit.java
  • affect the track parameters to the KFTrack right after the fit;
  • redo a forward indicators pass without correction for post-fit residual evaluation;
  • Added optional use of vertex input to constraint "beam hit":
  • Added flag "vertexdefined" in KalmanFilter and KFitter to use vertex;
  • added a different constructor for the list of backwards-indicators to include vertex info;
  • Setting sigma_Z_beam_Hit^2 to 100mm2 if "vertexdefined" is true;
  • Attempt to include hit "sign" / left-right disambiguation:
  • added "virtual wires" located at the distance-of-closest-approach of the actual wire, on each side of the wire;
  • added hit sign parameter in KalmanFilter/Hit class;
    added a new distance function to KalmanFilter/Hit class calculate the distance of a point to the correct virtual wire depending on the sign;
  • attempt to modify the "h" function to call new distance function

* adjusted number of filtering iterations from 10 to 5;
* adjusted step size dx for calculation of ddoca/dx from 10^8 to 10^5;
@efuchey efuchey marked this pull request as draft January 27, 2025 14:38
efuchey and others added 13 commits February 10, 2025 10:28
* residuals in the AHDC::Hits list in the alert.json file;
* filling the hits residuals in the RecoBankWriter;
* added residual and residual_prefit in ahdc/Hit/Hit.java
* added a identification flag to match ahdc/KalmanFilter/Hit.java to ahdc/Hit/Hit.java
* affecting the track parameters to the KFTrack right after the fit;
* redo a forward indicators pass without correction;
- removed all "cylindrical coordinates" vector and measurement functions;
- renamed all preexisting vector and measurement function with their original name.
- removed many commented printouts.
 * added "virtual wires" located at the distance-of-closest-approach of the actual wire, on each side of the wire;
 * added hit sign parameter in KalmanFilter/Hit class;
 * added a new distance function to KalmanFilter/Hit class calculate the distance of a point to the correct virtual wire depending on the sign;
 * attempt to modify the "h" function to call new distance function
@efuchey efuchey changed the title Optimized parameters for ALERT Kalman filter New features for ALERT Kalman filter+optimized parameters Feb 13, 2025
@efuchey efuchey marked this pull request as ready for review February 13, 2025 13:36
efuchey and others added 11 commits February 16, 2025 22:48
access ADC for AHDC/Hit/Hit and AHDC/KalmanFilter/Hit.
Added filtering of two hits on same superlayer/layer based on ADC
(largest ADC is kept) and use info to determine the hit sign.
…tion and preset fixed parameters in AHDCEngine.

Added a function in AHDC/KalmanFilter/Hit.java to calculate the measurement vector if we have a sign.
…with hit vector and measurement functions that handle hit left/right disambiguation.
…effersonLab-development

Included new addition to alert.json with atof hits + residuals for ahdc
 * if track on right side of wire, normal error;
 * if track on wrong side of wire, inflated error;
Ensured reordering of hits by increasing phi; added exception for
"rollover" around phi = pi;
efuchey added 15 commits March 13, 2025 15:27
…e by setting the measurement on the correct "virtual wire" with a larger error.
…of a wire by setting the measurement on the correct "virtual wire" with a larger error."

This reverts commit 9bf4715.
…t +deltaphi (-deltaphi)

since wire x, y position depend on -R*sin(phi), -R cos(phi)
respectively.
…ent matrix) function with goodsign as an input.
 - one simulation flag is declared in AHDCengine and defined as false;
 - it is now propagated into KalmanFilter.
mathieuouillon
mathieuouillon previously approved these changes Mar 27, 2025
Copy link
Collaborator

@mathieuouillon mathieuouillon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look good for me.

@baltzell baltzell merged commit e20330f into JeffersonLab:development Mar 27, 2025
34 checks passed
@github-project-automation github-project-automation bot moved this from Todo to Done in ALERT Software Roadmap Mar 27, 2025
N-Plx added a commit that referenced this pull request Apr 1, 2025
* DC v2: includes TFLight fix and new dc beta time walk with constants from /calibration/dc/v2 (#494)

* fix issue for path length in FD tracking

* fix issue for coordinate transformation from global to tilted sector coordinate

* add comments to explain transition of starting point for path length

* T2D with beta dependence.
Fixes in interpolation.

* Fix for instances where the t2d function turns over.

* Fix in last interpolation step.
More validation plots.

* Fix table filling

* B-field interpolation test interpolation in B instead of B^2.
More plots

* Added modularity for calibration use

* version bump

* switch to use new dc/v2 tables

* switch to use new dc/v2 for ref_pressure too

---------

Co-authored-by: tongtongcao <[email protected]>
Co-authored-by: ziegler <ziegler@enpziegler-mac>

* Update DC reconstruction at the denoisinng level (#499)

* cancel SNR and change limit of total DC hits from raw hits to hits after denoising

* remove unused codes

* reset limit for prob in DC clustering and cancel requirement that no skipped layer for cluster candidates from splitter (#500)

* pass 2 additional values

* fix data type

* feat: pre-commit hook to update banks README (#505)

* Change the option to select the track finding to a enum.
Now this option can be setup from the yaml file with the option Mode:
```
    ALERT:
      Mode: "AI_Track_Finding"
```
Add a cut on the number of hits to rely on the conventional track finding with there is more than 300 hits.

* Change the default options for DJL:
- Use a single thread for the inference.
- Remove waring about the graph executor optimization

* Modification of the track candidates generation

* Improve the function to get all the track candidates.

* Update AHDCEngine to initialize model conditionally and adjust prediction threshold

* New features for ALERT Kalman filter+optimized parameters (#445)

* Optimization of Kalman Filter:
* adjusted number of filtering iterations from 10 to 5;
* adjusted step size dx for calculation of ddoca/dx from 10^8 to 10^5;

* Added AHDC hits residuals (post-fit and pre-fit) in the output:
* residuals in the AHDC::Hits list in the alert.json file;
* filling the hits residuals in the RecoBankWriter;
* added residual and residual_prefit in ahdc/Hit/Hit.java
* added a identification flag to match ahdc/KalmanFilter/Hit.java to ahdc/Hit/Hit.java

* Successfully affected the calculated hit residual to the correct AHDC::Hit.

* Fixed and improved the calculation of the post-fit residuals:
* affecting the track parameters to the KFTrack right after the fit;
* redo a forward indicators pass without correction;

* * Cleaning the Kalman filter code:
- removed all "cylindrical coordinates" vector and measurement functions;
- renamed all preexisting vector and measurement function with their original name.
- removed many commented printouts.

* Attempt to include hit "sign" / left-right disambiguation:
 * added "virtual wires" located at the distance-of-closest-approach of the actual wire, on each side of the wire;
 * added hit sign parameter in KalmanFilter/Hit class;
 * added a new distance function to KalmanFilter/Hit class calculate the distance of a point to the correct virtual wire depending on the sign;
 * attempt to modify the "h" function to call new distance function

* Fix of a parameter modified by mistake.

* Added a second definition of BackwardIndicators in AHDC/KalmanFilter to
be able to initialize a vertex.

* Added a flag setDefinedVertex to AHDC/KalmanFilter and KFitter to define
"hit_beam" vertex.

* Reset Niter and ddoca step size parameters to 10, 1.e-8 respectively.

* Added reading of wire ADC from the AHDC HitReader, and functions to
access ADC for AHDC/Hit/Hit and AHDC/KalmanFilter/Hit.
Added filtering of two hits on same superlayer/layer based on ADC
(largest ADC is kept) and use info to determine the hit sign.

* Added an option to build the initial track with just the hits combination and preset fixed parameters in AHDCEngine.
Added a function in AHDC/KalmanFilter/Hit.java to calculate the measurement vector if we have a sign.

* Substituted call of default hit vector and hit measurement functions with hit vector and measurement functions that handle hit left/right disambiguation.

* Started to reintroduce the hit sign.

* Save state: back to status quo before revising sign.

* Added variable measurement error for hits with sign defined, with tracks on the wrong side.

* Implemented varaible measurement error for signed hits:
 * if track on right side of wire, normal error;
 * if track on wrong side of wire, inflated error;
Ensured reordering of hits by increasing phi; added exception for
"rollover" around phi = pi;

* fixed once and for all the convention for hit sign:
sign >0  if phi_expected state > phi_wire

* Tried to introduce a "pull" to the track on the correct sign of a wire by setting the measurement on the correct "virtual wire" with a larger error.

* Revert "Tried to introduce a "pull" to the track on the correct sign of a wire by setting the measurement on the correct "virtual wire" with a larger error."

This reverts commit 9bf4715.

* Fixed the convention for the "virtual wires": wire "minus" ("plus") at +deltaphi (-deltaphi)
since wire x, y position depend on -R*sin(phi), -R cos(phi)
respectively.

* Improved the functions to calculate hit vector: returns doca if sign is 0 or if sign is good.

* Added a hit distance function with goodsign as input, and H (measurement matrix) function with goodsign as an input.

* Added (commented) calls of functions with sign.

* Added a simple handle to disable reading of MC variables.

* Rerolled to fitting with no double hit.

* Harmonized simulation flag:
 - one simulation flag is declared in AHDCengine and defined as false;
 - it is now propagated into KalmanFilter.

* Added a check to read MC hits in AHDC_engine.

---------

Co-authored-by: Mathieu Ouillon <[email protected]>

* Petiroc timestamps2 (#512)

* Added petiroc board timestamps
* Adding CI stuff that is for gitlab

	modified:   common-tools/clas-detector/src/main/java/org/jlab/detector/decode/CLASDecoder4.java
	modified:   common-tools/clas-detector/src/main/java/org/jlab/detector/decode/CodaEventDecoder.java
	modified:   common-tools/clas-detector/src/main/java/org/jlab/detector/decode/DetectorDataDgtz.java
	modified:   etc/bankdefs/hipo4/data.json

---------

Co-authored-by: Whitney Armstrong <[email protected]>

* bump version

* version bump

* create a method to decode evio events in a single line to simplify usage in mon12 and ced

* new DCRB firmware  (#509)

* implemented decoding of new DCRB banks with ToT and order labeling of DC hit to use the first in time

* removed anused code

* printingg exception from DC banks decoding

---------

Co-authored-by: Nathan Baltzell <[email protected]>

* fix: remove `jdtls` files

* fix: ignore `jdtls` files

* Use pulse time and hide MVTFitter

* Change samplingTime

* Fix issue

* version bump

---------

Co-authored-by: raffaelladevita <[email protected]>
Co-authored-by: tongtongcao <[email protected]>
Co-authored-by: ziegler <ziegler@enpziegler-mac>
Co-authored-by: baltzell <[email protected]>
Co-authored-by: Christopher Dilks <[email protected]>
Co-authored-by: MathieuOuillon <[email protected]>
Co-authored-by: efuchey <[email protected]>
Co-authored-by: Mathieu Ouillon <[email protected]>
Co-authored-by: Whitney Armstrong <[email protected]>
Co-authored-by: Whitney Armstrong <[email protected]>
Co-authored-by: Felix Touchte Codjo <[email protected]>
Co-authored-by: Nathan Baltzell <[email protected]>
c-dilks pushed a commit that referenced this pull request Sep 15, 2025
* Optimization of Kalman Filter:
* adjusted number of filtering iterations from 10 to 5;
* adjusted step size dx for calculation of ddoca/dx from 10^8 to 10^5;

* Added AHDC hits residuals (post-fit and pre-fit) in the output:
* residuals in the AHDC::Hits list in the alert.json file;
* filling the hits residuals in the RecoBankWriter;
* added residual and residual_prefit in ahdc/Hit/Hit.java
* added a identification flag to match ahdc/KalmanFilter/Hit.java to ahdc/Hit/Hit.java

* Successfully affected the calculated hit residual to the correct AHDC::Hit.

* Fixed and improved the calculation of the post-fit residuals:
* affecting the track parameters to the KFTrack right after the fit;
* redo a forward indicators pass without correction;

* * Cleaning the Kalman filter code:
- removed all "cylindrical coordinates" vector and measurement functions;
- renamed all preexisting vector and measurement function with their original name.
- removed many commented printouts.

* Attempt to include hit "sign" / left-right disambiguation:
 * added "virtual wires" located at the distance-of-closest-approach of the actual wire, on each side of the wire;
 * added hit sign parameter in KalmanFilter/Hit class;
 * added a new distance function to KalmanFilter/Hit class calculate the distance of a point to the correct virtual wire depending on the sign;
 * attempt to modify the "h" function to call new distance function

* Fix of a parameter modified by mistake.

* Added a second definition of BackwardIndicators in AHDC/KalmanFilter to
be able to initialize a vertex.

* Added a flag setDefinedVertex to AHDC/KalmanFilter and KFitter to define
"hit_beam" vertex.

* Reset Niter and ddoca step size parameters to 10, 1.e-8 respectively.

* Added reading of wire ADC from the AHDC HitReader, and functions to
access ADC for AHDC/Hit/Hit and AHDC/KalmanFilter/Hit.
Added filtering of two hits on same superlayer/layer based on ADC
(largest ADC is kept) and use info to determine the hit sign.

* Added an option to build the initial track with just the hits combination and preset fixed parameters in AHDCEngine.
Added a function in AHDC/KalmanFilter/Hit.java to calculate the measurement vector if we have a sign.

* Substituted call of default hit vector and hit measurement functions with hit vector and measurement functions that handle hit left/right disambiguation.

* Started to reintroduce the hit sign.

* Save state: back to status quo before revising sign.

* Added variable measurement error for hits with sign defined, with tracks on the wrong side.

* Implemented varaible measurement error for signed hits:
 * if track on right side of wire, normal error;
 * if track on wrong side of wire, inflated error;
Ensured reordering of hits by increasing phi; added exception for
"rollover" around phi = pi;

* fixed once and for all the convention for hit sign:
sign >0  if phi_expected state > phi_wire

* Tried to introduce a "pull" to the track on the correct sign of a wire by setting the measurement on the correct "virtual wire" with a larger error.

* Revert "Tried to introduce a "pull" to the track on the correct sign of a wire by setting the measurement on the correct "virtual wire" with a larger error."

This reverts commit 9bf4715.

* Fixed the convention for the "virtual wires": wire "minus" ("plus") at +deltaphi (-deltaphi)
since wire x, y position depend on -R*sin(phi), -R cos(phi)
respectively.

* Improved the functions to calculate hit vector: returns doca if sign is 0 or if sign is good.

* Added a hit distance function with goodsign as input, and H (measurement matrix) function with goodsign as an input.

* Added (commented) calls of functions with sign.

* Added a simple handle to disable reading of MC variables.

* Rerolled to fitting with no double hit.

* Harmonized simulation flag:
 - one simulation flag is declared in AHDCengine and defined as false;
 - it is now propagated into KalmanFilter.

* Added a check to read MC hits in AHDC_engine.

---------

Co-authored-by: Mathieu Ouillon <[email protected]>
tongtongcao pushed a commit that referenced this pull request Sep 22, 2025
* Optimization of Kalman Filter:
* adjusted number of filtering iterations from 10 to 5;
* adjusted step size dx for calculation of ddoca/dx from 10^8 to 10^5;

* Added AHDC hits residuals (post-fit and pre-fit) in the output:
* residuals in the AHDC::Hits list in the alert.json file;
* filling the hits residuals in the RecoBankWriter;
* added residual and residual_prefit in ahdc/Hit/Hit.java
* added a identification flag to match ahdc/KalmanFilter/Hit.java to ahdc/Hit/Hit.java

* Successfully affected the calculated hit residual to the correct AHDC::Hit.

* Fixed and improved the calculation of the post-fit residuals:
* affecting the track parameters to the KFTrack right after the fit;
* redo a forward indicators pass without correction;

* * Cleaning the Kalman filter code:
- removed all "cylindrical coordinates" vector and measurement functions;
- renamed all preexisting vector and measurement function with their original name.
- removed many commented printouts.

* Attempt to include hit "sign" / left-right disambiguation:
 * added "virtual wires" located at the distance-of-closest-approach of the actual wire, on each side of the wire;
 * added hit sign parameter in KalmanFilter/Hit class;
 * added a new distance function to KalmanFilter/Hit class calculate the distance of a point to the correct virtual wire depending on the sign;
 * attempt to modify the "h" function to call new distance function

* Fix of a parameter modified by mistake.

* Added a second definition of BackwardIndicators in AHDC/KalmanFilter to
be able to initialize a vertex.

* Added a flag setDefinedVertex to AHDC/KalmanFilter and KFitter to define
"hit_beam" vertex.

* Reset Niter and ddoca step size parameters to 10, 1.e-8 respectively.

* Added reading of wire ADC from the AHDC HitReader, and functions to
access ADC for AHDC/Hit/Hit and AHDC/KalmanFilter/Hit.
Added filtering of two hits on same superlayer/layer based on ADC
(largest ADC is kept) and use info to determine the hit sign.

* Added an option to build the initial track with just the hits combination and preset fixed parameters in AHDCEngine.
Added a function in AHDC/KalmanFilter/Hit.java to calculate the measurement vector if we have a sign.

* Substituted call of default hit vector and hit measurement functions with hit vector and measurement functions that handle hit left/right disambiguation.

* Started to reintroduce the hit sign.

* Save state: back to status quo before revising sign.

* Added variable measurement error for hits with sign defined, with tracks on the wrong side.

* Implemented varaible measurement error for signed hits:
 * if track on right side of wire, normal error;
 * if track on wrong side of wire, inflated error;
Ensured reordering of hits by increasing phi; added exception for
"rollover" around phi = pi;

* fixed once and for all the convention for hit sign:
sign >0  if phi_expected state > phi_wire

* Tried to introduce a "pull" to the track on the correct sign of a wire by setting the measurement on the correct "virtual wire" with a larger error.

* Revert "Tried to introduce a "pull" to the track on the correct sign of a wire by setting the measurement on the correct "virtual wire" with a larger error."

This reverts commit 9bf4715.

* Fixed the convention for the "virtual wires": wire "minus" ("plus") at +deltaphi (-deltaphi)
since wire x, y position depend on -R*sin(phi), -R cos(phi)
respectively.

* Improved the functions to calculate hit vector: returns doca if sign is 0 or if sign is good.

* Added a hit distance function with goodsign as input, and H (measurement matrix) function with goodsign as an input.

* Added (commented) calls of functions with sign.

* Added a simple handle to disable reading of MC variables.

* Rerolled to fitting with no double hit.

* Harmonized simulation flag:
 - one simulation flag is declared in AHDCengine and defined as false;
 - it is now propagated into KalmanFilter.

* Added a check to read MC hits in AHDC_engine.

---------

Co-authored-by: Mathieu Ouillon <[email protected]>
tongtongcao pushed a commit that referenced this pull request Nov 18, 2025
* Optimization of Kalman Filter:
* adjusted number of filtering iterations from 10 to 5;
* adjusted step size dx for calculation of ddoca/dx from 10^8 to 10^5;

* Added AHDC hits residuals (post-fit and pre-fit) in the output:
* residuals in the AHDC::Hits list in the alert.json file;
* filling the hits residuals in the RecoBankWriter;
* added residual and residual_prefit in ahdc/Hit/Hit.java
* added a identification flag to match ahdc/KalmanFilter/Hit.java to ahdc/Hit/Hit.java

* Successfully affected the calculated hit residual to the correct AHDC::Hit.

* Fixed and improved the calculation of the post-fit residuals:
* affecting the track parameters to the KFTrack right after the fit;
* redo a forward indicators pass without correction;

* * Cleaning the Kalman filter code:
- removed all "cylindrical coordinates" vector and measurement functions;
- renamed all preexisting vector and measurement function with their original name.
- removed many commented printouts.

* Attempt to include hit "sign" / left-right disambiguation:
 * added "virtual wires" located at the distance-of-closest-approach of the actual wire, on each side of the wire;
 * added hit sign parameter in KalmanFilter/Hit class;
 * added a new distance function to KalmanFilter/Hit class calculate the distance of a point to the correct virtual wire depending on the sign;
 * attempt to modify the "h" function to call new distance function

* Fix of a parameter modified by mistake.

* Added a second definition of BackwardIndicators in AHDC/KalmanFilter to
be able to initialize a vertex.

* Added a flag setDefinedVertex to AHDC/KalmanFilter and KFitter to define
"hit_beam" vertex.

* Reset Niter and ddoca step size parameters to 10, 1.e-8 respectively.

* Added reading of wire ADC from the AHDC HitReader, and functions to
access ADC for AHDC/Hit/Hit and AHDC/KalmanFilter/Hit.
Added filtering of two hits on same superlayer/layer based on ADC
(largest ADC is kept) and use info to determine the hit sign.

* Added an option to build the initial track with just the hits combination and preset fixed parameters in AHDCEngine.
Added a function in AHDC/KalmanFilter/Hit.java to calculate the measurement vector if we have a sign.

* Substituted call of default hit vector and hit measurement functions with hit vector and measurement functions that handle hit left/right disambiguation.

* Started to reintroduce the hit sign.

* Save state: back to status quo before revising sign.

* Added variable measurement error for hits with sign defined, with tracks on the wrong side.

* Implemented varaible measurement error for signed hits:
 * if track on right side of wire, normal error;
 * if track on wrong side of wire, inflated error;
Ensured reordering of hits by increasing phi; added exception for
"rollover" around phi = pi;

* fixed once and for all the convention for hit sign:
sign >0  if phi_expected state > phi_wire

* Tried to introduce a "pull" to the track on the correct sign of a wire by setting the measurement on the correct "virtual wire" with a larger error.

* Revert "Tried to introduce a "pull" to the track on the correct sign of a wire by setting the measurement on the correct "virtual wire" with a larger error."

This reverts commit 9bf4715.

* Fixed the convention for the "virtual wires": wire "minus" ("plus") at +deltaphi (-deltaphi)
since wire x, y position depend on -R*sin(phi), -R cos(phi)
respectively.

* Improved the functions to calculate hit vector: returns doca if sign is 0 or if sign is good.

* Added a hit distance function with goodsign as input, and H (measurement matrix) function with goodsign as an input.

* Added (commented) calls of functions with sign.

* Added a simple handle to disable reading of MC variables.

* Rerolled to fitting with no double hit.

* Harmonized simulation flag:
 - one simulation flag is declared in AHDCengine and defined as false;
 - it is now propagated into KalmanFilter.

* Added a check to read MC hits in AHDC_engine.

---------

Co-authored-by: Mathieu Ouillon <[email protected]>
tongtongcao pushed a commit that referenced this pull request Nov 21, 2025
* Optimization of Kalman Filter:
* adjusted number of filtering iterations from 10 to 5;
* adjusted step size dx for calculation of ddoca/dx from 10^8 to 10^5;

* Added AHDC hits residuals (post-fit and pre-fit) in the output:
* residuals in the AHDC::Hits list in the alert.json file;
* filling the hits residuals in the RecoBankWriter;
* added residual and residual_prefit in ahdc/Hit/Hit.java
* added a identification flag to match ahdc/KalmanFilter/Hit.java to ahdc/Hit/Hit.java

* Successfully affected the calculated hit residual to the correct AHDC::Hit.

* Fixed and improved the calculation of the post-fit residuals:
* affecting the track parameters to the KFTrack right after the fit;
* redo a forward indicators pass without correction;

* * Cleaning the Kalman filter code:
- removed all "cylindrical coordinates" vector and measurement functions;
- renamed all preexisting vector and measurement function with their original name.
- removed many commented printouts.

* Attempt to include hit "sign" / left-right disambiguation:
 * added "virtual wires" located at the distance-of-closest-approach of the actual wire, on each side of the wire;
 * added hit sign parameter in KalmanFilter/Hit class;
 * added a new distance function to KalmanFilter/Hit class calculate the distance of a point to the correct virtual wire depending on the sign;
 * attempt to modify the "h" function to call new distance function

* Fix of a parameter modified by mistake.

* Added a second definition of BackwardIndicators in AHDC/KalmanFilter to
be able to initialize a vertex.

* Added a flag setDefinedVertex to AHDC/KalmanFilter and KFitter to define
"hit_beam" vertex.

* Reset Niter and ddoca step size parameters to 10, 1.e-8 respectively.

* Added reading of wire ADC from the AHDC HitReader, and functions to
access ADC for AHDC/Hit/Hit and AHDC/KalmanFilter/Hit.
Added filtering of two hits on same superlayer/layer based on ADC
(largest ADC is kept) and use info to determine the hit sign.

* Added an option to build the initial track with just the hits combination and preset fixed parameters in AHDCEngine.
Added a function in AHDC/KalmanFilter/Hit.java to calculate the measurement vector if we have a sign.

* Substituted call of default hit vector and hit measurement functions with hit vector and measurement functions that handle hit left/right disambiguation.

* Started to reintroduce the hit sign.

* Save state: back to status quo before revising sign.

* Added variable measurement error for hits with sign defined, with tracks on the wrong side.

* Implemented varaible measurement error for signed hits:
 * if track on right side of wire, normal error;
 * if track on wrong side of wire, inflated error;
Ensured reordering of hits by increasing phi; added exception for
"rollover" around phi = pi;

* fixed once and for all the convention for hit sign:
sign >0  if phi_expected state > phi_wire

* Tried to introduce a "pull" to the track on the correct sign of a wire by setting the measurement on the correct "virtual wire" with a larger error.

* Revert "Tried to introduce a "pull" to the track on the correct sign of a wire by setting the measurement on the correct "virtual wire" with a larger error."

This reverts commit 9bf4715.

* Fixed the convention for the "virtual wires": wire "minus" ("plus") at +deltaphi (-deltaphi)
since wire x, y position depend on -R*sin(phi), -R cos(phi)
respectively.

* Improved the functions to calculate hit vector: returns doca if sign is 0 or if sign is good.

* Added a hit distance function with goodsign as input, and H (measurement matrix) function with goodsign as an input.

* Added (commented) calls of functions with sign.

* Added a simple handle to disable reading of MC variables.

* Rerolled to fitting with no double hit.

* Harmonized simulation flag:
 - one simulation flag is declared in AHDCengine and defined as false;
 - it is now propagated into KalmanFilter.

* Added a check to read MC hits in AHDC_engine.

---------

Co-authored-by: Mathieu Ouillon <[email protected]>
tongtongcao pushed a commit that referenced this pull request Dec 5, 2025
* Optimization of Kalman Filter:
* adjusted number of filtering iterations from 10 to 5;
* adjusted step size dx for calculation of ddoca/dx from 10^8 to 10^5;

* Added AHDC hits residuals (post-fit and pre-fit) in the output:
* residuals in the AHDC::Hits list in the alert.json file;
* filling the hits residuals in the RecoBankWriter;
* added residual and residual_prefit in ahdc/Hit/Hit.java
* added a identification flag to match ahdc/KalmanFilter/Hit.java to ahdc/Hit/Hit.java

* Successfully affected the calculated hit residual to the correct AHDC::Hit.

* Fixed and improved the calculation of the post-fit residuals:
* affecting the track parameters to the KFTrack right after the fit;
* redo a forward indicators pass without correction;

* * Cleaning the Kalman filter code:
- removed all "cylindrical coordinates" vector and measurement functions;
- renamed all preexisting vector and measurement function with their original name.
- removed many commented printouts.

* Attempt to include hit "sign" / left-right disambiguation:
 * added "virtual wires" located at the distance-of-closest-approach of the actual wire, on each side of the wire;
 * added hit sign parameter in KalmanFilter/Hit class;
 * added a new distance function to KalmanFilter/Hit class calculate the distance of a point to the correct virtual wire depending on the sign;
 * attempt to modify the "h" function to call new distance function

* Fix of a parameter modified by mistake.

* Added a second definition of BackwardIndicators in AHDC/KalmanFilter to
be able to initialize a vertex.

* Added a flag setDefinedVertex to AHDC/KalmanFilter and KFitter to define
"hit_beam" vertex.

* Reset Niter and ddoca step size parameters to 10, 1.e-8 respectively.

* Added reading of wire ADC from the AHDC HitReader, and functions to
access ADC for AHDC/Hit/Hit and AHDC/KalmanFilter/Hit.
Added filtering of two hits on same superlayer/layer based on ADC
(largest ADC is kept) and use info to determine the hit sign.

* Added an option to build the initial track with just the hits combination and preset fixed parameters in AHDCEngine.
Added a function in AHDC/KalmanFilter/Hit.java to calculate the measurement vector if we have a sign.

* Substituted call of default hit vector and hit measurement functions with hit vector and measurement functions that handle hit left/right disambiguation.

* Started to reintroduce the hit sign.

* Save state: back to status quo before revising sign.

* Added variable measurement error for hits with sign defined, with tracks on the wrong side.

* Implemented varaible measurement error for signed hits:
 * if track on right side of wire, normal error;
 * if track on wrong side of wire, inflated error;
Ensured reordering of hits by increasing phi; added exception for
"rollover" around phi = pi;

* fixed once and for all the convention for hit sign:
sign >0  if phi_expected state > phi_wire

* Tried to introduce a "pull" to the track on the correct sign of a wire by setting the measurement on the correct "virtual wire" with a larger error.

* Revert "Tried to introduce a "pull" to the track on the correct sign of a wire by setting the measurement on the correct "virtual wire" with a larger error."

This reverts commit 9bf4715.

* Fixed the convention for the "virtual wires": wire "minus" ("plus") at +deltaphi (-deltaphi)
since wire x, y position depend on -R*sin(phi), -R cos(phi)
respectively.

* Improved the functions to calculate hit vector: returns doca if sign is 0 or if sign is good.

* Added a hit distance function with goodsign as input, and H (measurement matrix) function with goodsign as an input.

* Added (commented) calls of functions with sign.

* Added a simple handle to disable reading of MC variables.

* Rerolled to fitting with no double hit.

* Harmonized simulation flag:
 - one simulation flag is declared in AHDCengine and defined as false;
 - it is now propagated into KalmanFilter.

* Added a check to read MC hits in AHDC_engine.

---------

Co-authored-by: Mathieu Ouillon <[email protected]>
tongtongcao pushed a commit that referenced this pull request Dec 5, 2025
* Optimization of Kalman Filter:
* adjusted number of filtering iterations from 10 to 5;
* adjusted step size dx for calculation of ddoca/dx from 10^8 to 10^5;

* Added AHDC hits residuals (post-fit and pre-fit) in the output:
* residuals in the AHDC::Hits list in the alert.json file;
* filling the hits residuals in the RecoBankWriter;
* added residual and residual_prefit in ahdc/Hit/Hit.java
* added a identification flag to match ahdc/KalmanFilter/Hit.java to ahdc/Hit/Hit.java

* Successfully affected the calculated hit residual to the correct AHDC::Hit.

* Fixed and improved the calculation of the post-fit residuals:
* affecting the track parameters to the KFTrack right after the fit;
* redo a forward indicators pass without correction;

* * Cleaning the Kalman filter code:
- removed all "cylindrical coordinates" vector and measurement functions;
- renamed all preexisting vector and measurement function with their original name.
- removed many commented printouts.

* Attempt to include hit "sign" / left-right disambiguation:
 * added "virtual wires" located at the distance-of-closest-approach of the actual wire, on each side of the wire;
 * added hit sign parameter in KalmanFilter/Hit class;
 * added a new distance function to KalmanFilter/Hit class calculate the distance of a point to the correct virtual wire depending on the sign;
 * attempt to modify the "h" function to call new distance function

* Fix of a parameter modified by mistake.

* Added a second definition of BackwardIndicators in AHDC/KalmanFilter to
be able to initialize a vertex.

* Added a flag setDefinedVertex to AHDC/KalmanFilter and KFitter to define
"hit_beam" vertex.

* Reset Niter and ddoca step size parameters to 10, 1.e-8 respectively.

* Added reading of wire ADC from the AHDC HitReader, and functions to
access ADC for AHDC/Hit/Hit and AHDC/KalmanFilter/Hit.
Added filtering of two hits on same superlayer/layer based on ADC
(largest ADC is kept) and use info to determine the hit sign.

* Added an option to build the initial track with just the hits combination and preset fixed parameters in AHDCEngine.
Added a function in AHDC/KalmanFilter/Hit.java to calculate the measurement vector if we have a sign.

* Substituted call of default hit vector and hit measurement functions with hit vector and measurement functions that handle hit left/right disambiguation.

* Started to reintroduce the hit sign.

* Save state: back to status quo before revising sign.

* Added variable measurement error for hits with sign defined, with tracks on the wrong side.

* Implemented varaible measurement error for signed hits:
 * if track on right side of wire, normal error;
 * if track on wrong side of wire, inflated error;
Ensured reordering of hits by increasing phi; added exception for
"rollover" around phi = pi;

* fixed once and for all the convention for hit sign:
sign >0  if phi_expected state > phi_wire

* Tried to introduce a "pull" to the track on the correct sign of a wire by setting the measurement on the correct "virtual wire" with a larger error.

* Revert "Tried to introduce a "pull" to the track on the correct sign of a wire by setting the measurement on the correct "virtual wire" with a larger error."

This reverts commit 9bf4715.

* Fixed the convention for the "virtual wires": wire "minus" ("plus") at +deltaphi (-deltaphi)
since wire x, y position depend on -R*sin(phi), -R cos(phi)
respectively.

* Improved the functions to calculate hit vector: returns doca if sign is 0 or if sign is good.

* Added a hit distance function with goodsign as input, and H (measurement matrix) function with goodsign as an input.

* Added (commented) calls of functions with sign.

* Added a simple handle to disable reading of MC variables.

* Rerolled to fitting with no double hit.

* Harmonized simulation flag:
 - one simulation flag is declared in AHDCengine and defined as false;
 - it is now propagated into KalmanFilter.

* Added a check to read MC hits in AHDC_engine.

---------

Co-authored-by: Mathieu Ouillon <[email protected]>
@baltzell baltzell added the rg-l label Dec 23, 2025
tongtongcao pushed a commit that referenced this pull request Dec 31, 2025
* Optimization of Kalman Filter:
* adjusted number of filtering iterations from 10 to 5;
* adjusted step size dx for calculation of ddoca/dx from 10^8 to 10^5;

* Added AHDC hits residuals (post-fit and pre-fit) in the output:
* residuals in the AHDC::Hits list in the alert.json file;
* filling the hits residuals in the RecoBankWriter;
* added residual and residual_prefit in ahdc/Hit/Hit.java
* added a identification flag to match ahdc/KalmanFilter/Hit.java to ahdc/Hit/Hit.java

* Successfully affected the calculated hit residual to the correct AHDC::Hit.

* Fixed and improved the calculation of the post-fit residuals:
* affecting the track parameters to the KFTrack right after the fit;
* redo a forward indicators pass without correction;

* * Cleaning the Kalman filter code:
- removed all "cylindrical coordinates" vector and measurement functions;
- renamed all preexisting vector and measurement function with their original name.
- removed many commented printouts.

* Attempt to include hit "sign" / left-right disambiguation:
 * added "virtual wires" located at the distance-of-closest-approach of the actual wire, on each side of the wire;
 * added hit sign parameter in KalmanFilter/Hit class;
 * added a new distance function to KalmanFilter/Hit class calculate the distance of a point to the correct virtual wire depending on the sign;
 * attempt to modify the "h" function to call new distance function

* Fix of a parameter modified by mistake.

* Added a second definition of BackwardIndicators in AHDC/KalmanFilter to
be able to initialize a vertex.

* Added a flag setDefinedVertex to AHDC/KalmanFilter and KFitter to define
"hit_beam" vertex.

* Reset Niter and ddoca step size parameters to 10, 1.e-8 respectively.

* Added reading of wire ADC from the AHDC HitReader, and functions to
access ADC for AHDC/Hit/Hit and AHDC/KalmanFilter/Hit.
Added filtering of two hits on same superlayer/layer based on ADC
(largest ADC is kept) and use info to determine the hit sign.

* Added an option to build the initial track with just the hits combination and preset fixed parameters in AHDCEngine.
Added a function in AHDC/KalmanFilter/Hit.java to calculate the measurement vector if we have a sign.

* Substituted call of default hit vector and hit measurement functions with hit vector and measurement functions that handle hit left/right disambiguation.

* Started to reintroduce the hit sign.

* Save state: back to status quo before revising sign.

* Added variable measurement error for hits with sign defined, with tracks on the wrong side.

* Implemented varaible measurement error for signed hits:
 * if track on right side of wire, normal error;
 * if track on wrong side of wire, inflated error;
Ensured reordering of hits by increasing phi; added exception for
"rollover" around phi = pi;

* fixed once and for all the convention for hit sign:
sign >0  if phi_expected state > phi_wire

* Tried to introduce a "pull" to the track on the correct sign of a wire by setting the measurement on the correct "virtual wire" with a larger error.

* Revert "Tried to introduce a "pull" to the track on the correct sign of a wire by setting the measurement on the correct "virtual wire" with a larger error."

This reverts commit 9bf4715.

* Fixed the convention for the "virtual wires": wire "minus" ("plus") at +deltaphi (-deltaphi)
since wire x, y position depend on -R*sin(phi), -R cos(phi)
respectively.

* Improved the functions to calculate hit vector: returns doca if sign is 0 or if sign is good.

* Added a hit distance function with goodsign as input, and H (measurement matrix) function with goodsign as an input.

* Added (commented) calls of functions with sign.

* Added a simple handle to disable reading of MC variables.

* Rerolled to fitting with no double hit.

* Harmonized simulation flag:
 - one simulation flag is declared in AHDCengine and defined as false;
 - it is now propagated into KalmanFilter.

* Added a check to read MC hits in AHDC_engine.

---------

Co-authored-by: Mathieu Ouillon <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants