Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
32f76ba
Refactor and move KF tracking package from dc to common-tools and upd…
tongtongcao Jan 9, 2023
c95ea47
small update for KFitter::calcFinalChisq()
tongtongcao Jan 17, 2023
a1f0dc4
adjust code format and add author for source files
tongtongcao Feb 3, 2023
0eeb540
further adjust code format
tongtongcao Feb 3, 2023
613ca23
futher code format adjustments
tongtongcao Feb 7, 2023
4fdf52c
first version of forward tracking with uRWell
tongtongcao Feb 13, 2023
6fc9d12
add pseudo segments for missed track candidates
tongtongcao Feb 14, 2023
f044691
add AI services for forward tracking with uRWell
tongtongcao Feb 15, 2023
c9c0af7
change uRWELL resolution setup
tongtongcao Feb 24, 2023
a83e4e3
reset uRWell resolution
tongtongcao Feb 27, 2023
e8c9b2e
fix issue for the FastMath package
tongtongcao Mar 1, 2023
d65561f
fix issue in the FastMath package
tongtongcao Mar 1, 2023
3cfc641
cache some sine and cosine calculations in DC reconstruction and forw…
tongtongcao Mar 6, 2023
0d3bec1
Merge branch 'issueFastMathPackage' into upgradeTrackingWithuRWELL
tongtongcao Mar 6, 2023
b7883c8
use math library to assign values for constant parameters
tongtongcao Mar 8, 2023
aa508e0
Merge branch 'issueFastMathPackage' into upgradeTrackingWithuRWELL
tongtongcao Mar 8, 2023
52c6d81
switch to new CCDB
tongtongcao Mar 8, 2023
b57b71c
re-design pattern recognition for FD tracking
tongtongcao Mar 27, 2023
17f0c63
reset covaraince matrix for initial state
tongtongcao Mar 30, 2023
e937fc6
tiny change
tongtongcao Mar 30, 2023
20ba059
tiny change
tongtongcao Mar 30, 2023
d39473d
change conditions for stopping forward tracking iteration
tongtongcao Apr 3, 2023
ab49f65
Merge branch 'upgradeTrackingWithuRWELL' into redesignPatternRecognition
tongtongcao Apr 3, 2023
9edbc8a
update overlap of tracks with uRWell crosses
tongtongcao Apr 5, 2023
886382e
Version 2 of DC-uRWell tracking
tongtongcao May 26, 2023
d96c634
fix conflicts when merging with branch development
tongtongcao May 26, 2023
582118a
fix issue that some information for states in trajectory is missed
tongtongcao Jul 19, 2023
6682a41
Merge branch 'development' into upgradeTrackingWithuRWELL
tongtongcao Jul 19, 2023
4692bd0
tiny change
tongtongcao Jul 19, 2023
b707d09
update pom file
tongtongcao Jul 19, 2023
0484aa5
change uRWell resolution setup in TB tracking
tongtongcao Aug 8, 2023
39dd887
fix an issue for writting KF fit doca
tongtongcao Aug 18, 2023
6d45e37
Merge branch 'development' into upgradeTrackingWithuRWELL
tongtongcao Aug 31, 2023
670e0d1
blow up initial covariance matrix starting from the second iteration
tongtongcao Sep 15, 2023
acb9924
Merge branch 'development' into upgradeTrackingWithuRWELL
tongtongcao Sep 18, 2023
9fea9d9
change limit for inverse calculation of covariance matrix
tongtongcao Oct 12, 2023
b9b7bfb
reset limit since CI test failed
tongtongcao Oct 12, 2023
a2c71d8
Merge branch 'development' into upgradeTrackingWithuRWELL
tongtongcao Oct 12, 2023
5053091
modify reconstruction/dc/pom.xml for version of tracking package
tongtongcao Oct 12, 2023
a0d8fb6
Issue for CI test was fixed. Reset limit to proper value.
tongtongcao Oct 12, 2023
55fd5dd
apply DAF into DC-only tracking
tongtongcao Oct 19, 2023
ee56b5e
redefine NDF and remove codes for fail tracking judge
tongtongcao Nov 7, 2023
723bced
update projected doca for double hits
tongtongcao Nov 29, 2023
352c964
fix conflict for definition of LR ambiguity between DC hits and measu…
tongtongcao Dec 1, 2023
0624c53
Merge branch 'upgradeTrackingWithuRWELL' into applyDAF
tongtongcao Dec 1, 2023
f64c764
apply DAF into DC-uRWell tracking
tongtongcao Dec 1, 2023
a45a392
update calcFinalChisq() in org.jlab.clas.tracking.kalmanfilter.zRefer…
tongtongcao Dec 1, 2023
c1e1363
fix merge conflicts
tongtongcao Dec 1, 2023
25f77c3
modify fitResidual in TB hit banks
tongtongcao Dec 5, 2023
c7b9f33
Merge branch 'upgradeTrackingWithuRWELL' into applyDAF
tongtongcao Dec 5, 2023
4651800
update trajectory projected doca
tongtongcao Dec 5, 2023
d7d264e
Merge branch 'development' into upgradeTrackingWithuRWELL
tongtongcao Dec 7, 2023
6f3043d
Merge branch 'upgradeTrackingWithuRWELL' of https://github.com/Jeffer…
tongtongcao Dec 7, 2023
93044b1
add KF package for straight tracking
tongtongcao Dec 8, 2023
b841721
Merge branch 'upgradeTrackingWithuRWELL' into applyDAF
tongtongcao Dec 8, 2023
f9e18b6
update filter_DAF function
tongtongcao Dec 19, 2023
a2419f4
fix issue to judge if zero field in DCTBEngine
tongtongcao Dec 19, 2023
46ffd46
Merge branch 'development' into upgradeTrackingWithuRWELL
tongtongcao Dec 19, 2023
52eff35
update pom file for DC reconstruction for version of clas-tracking
tongtongcao Dec 19, 2023
68a47a0
Merge branch 'upgradeTrackingWithuRWELL' into applyDAF
tongtongcao Dec 19, 2023
a83a064
Merge branch 'applyDAF' into studyHitLR
tongtongcao Dec 19, 2023
28c6e86
add DAF weight into TB hit banks
tongtongcao Dec 20, 2023
4c4fe70
fix a bug in function matchHits()
tongtongcao Jan 3, 2024
f80df3f
Merge branch 'upgradeTrackingWithuRWELL' into applyDAF
tongtongcao Jan 3, 2024
86bd280
Merge branch 'applyDAF' into studyHitLR
tongtongcao Jan 3, 2024
9daeb40
add ndfDAF for NDF weighted by DAF
tongtongcao Jan 31, 2024
ee87d04
Merge branch 'studyHitLR' into applyDAF
tongtongcao Jan 31, 2024
0a0df89
store final weight for DAF in DC-uRWell tracking
tongtongcao Jan 31, 2024
55e6f37
Merge branch 'development' into upgradeTrackingWithuRWELL
tongtongcao Feb 9, 2024
469bf95
update pom file in DC package for version of clas-tracking
tongtongcao Feb 9, 2024
43e5216
Merge branch 'upgradeTrackingWithuRWELL' into applyDAF
tongtongcao Feb 9, 2024
6006a41
fix merge conflicts and update uRWell reader with 2 regions of uRWells
tongtongcao Feb 23, 2024
f789f16
Merge branch 'upgradeTrackingWithuRWELL' into applyDAF
tongtongcao Feb 23, 2024
d4921c8
set configuration for option of DAF application
tongtongcao Mar 6, 2024
5a47f52
set configuration for option of DAF parameters
tongtongcao Mar 7, 2024
71b3492
Merge branch 'development' into upgradeTrackingWithuRWELL
tongtongcao Mar 7, 2024
a742314
update dc pom file for tracking package version
tongtongcao Mar 7, 2024
42a9f6d
Merge branch 'applyDAF' into upgradeTrackingWithuRWELL
tongtongcao Mar 7, 2024
d1a2c29
loose limit for Vtx0_y in DC reconstruction test
tongtongcao Mar 7, 2024
4c32fae
Merge branch 'development' into applyDAF
tongtongcao Mar 13, 2024
1bcc0e6
update DC reconstruction pom file for version of tracking
tongtongcao Mar 13, 2024
9c35c38
fix merge conflict
tongtongcao Mar 13, 2024
540aa85
update configuration setup for options of DAF implementation and DAF …
tongtongcao Mar 20, 2024
2d9b8bb
update for configuration of DAF annealing factor
tongtongcao Mar 25, 2024
d27a668
Merge branch 'development' into upgradeTrackingWithuRWELL
tongtongcao Mar 26, 2024
84f7422
update DC reconstruction pom file for version of tracking
tongtongcao Mar 26, 2024
07cbf20
set lower limit for DAF weight to avoid overflow
tongtongcao Mar 27, 2024
d4d0909
fine updates
tongtongcao Mar 28, 2024
6f35a35
tiny change
tongtongcao Mar 28, 2024
5239f52
Update TB hit status, whose first bit indicates that a hit is belong …
tongtongcao Mar 29, 2024
78b1557
update for NDF
tongtongcao Apr 1, 2024
3f6f3d4
remove all updates for uRWell-DC tracking
tongtongcao Apr 8, 2024
488fae5
add comments for todo task
tongtongcao Apr 9, 2024
98240a8
Merge branch 'development' into upgradeFDTracking
c-dilks Apr 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
/**
*
* @author ziegler
* @author Tongtong Cao
*/

public abstract class AMeasVecs {
Expand All @@ -22,7 +23,8 @@ public abstract class AMeasVecs {

public void setMeasVecs(List<Surface> measSurfaces) {
measurements = new ArrayList<>();
Collections.sort(measSurfaces);
if(measSurfaces.get(0).type != Type.LINEDOCA) // Measurements from DC has been sorted
Collections.sort(measSurfaces);
for(int i = 0; i < measSurfaces.size(); i++) {
MeasVec mvec = new MeasVec();
mvec.k = i ;
Expand All @@ -33,9 +35,57 @@ public void setMeasVecs(List<Surface> measSurfaces) {
mvec.skip = mvec.surface.passive;
mvec.hemisphere = measSurfaces.get(i).hemisphere;
measurements.add(mvec);
if(measSurfaces.get(i).type == Type.LINEDOCA) { //Todo: assign a value to the Surface index and use that as the identifier
mvec.region = measSurfaces.get(i).region;
mvec.sector = measSurfaces.get(i).getSector();
mvec.superlayer = measSurfaces.get(i).getSuperLayer();
mvec.layer = measSurfaces.get(i).getLayer();
}
}
}

// For DC, there could be two hits at a measurement
public double[] dhDoca(int k, StateVec stateVec) {
double value[] = {Double.NaN, Double.NaN};

Surface surf = this.measurements.get(stateVec.k).surface;
Point3D point = new Point3D(stateVec.x, stateVec.y, stateVec.z);
double h = hDoca(point, surf.wireLine[0]);

double signMeas = 1;
double sign = 1;
if(surf.doca[1]!=-99 || !(Math.abs(surf.doca[0])<0.5 && surf.doca[1]==-99 ) ) { //use LR only for double hits or large enough doca for one hit
signMeas = Math.signum(surf.doca[0]);
sign = Math.signum(h);
} else {
signMeas = Math.signum(h);
sign = Math.signum(h);
}

value[0] = signMeas*Math.abs(surf.doca[0]) - sign*Math.abs(h);

//USE THE DOUBLE HIT
if(surf.doca[1]!=-99) {
h = hDoca(point, surf.wireLine[1]);

signMeas = Math.signum(surf.doca[1]);
sign = Math.signum(h);

value[1]= signMeas*Math.abs(surf.doca[1]) - sign*Math.abs(h);
}

return value;
}

// Return a signed doca for DC
public double hDoca(Point3D point, Line3D wireLine) {

Line3D WL = new Line3D();
WL.copy(wireLine);
WL.copy(WL.distance(point));

return WL.length()*Math.signum(WL.direction().x());
}

public double dh(int k, StateVec stateVec) {

Expand All @@ -53,7 +103,7 @@ public double dh(int k, StateVec stateVec) {
}
if( this.measurements.get(stateVec.k).surface.type == Type.PLANEWITHPOINT ||
this.measurements.get(stateVec.k).surface.type == Type.CYLINDERWITHPOINT) {
Point3D p = new Point3D(this.measurements.get(stateVec.k).surface.refPoint);
Point3D p = new Point3D(this.measurements.get(stateVec.k).surface.measPoint);
value = p.distance(stateVec.x, stateVec.y, stateVec.z);
}
if( this.measurements.get(stateVec.k).surface.type == Type.CYLINDERWITHARC) {
Expand Down Expand Up @@ -133,7 +183,7 @@ public double h(int k, StateVec stateVec) {
}
if( this.measurements.get(stateVec.k).surface.type == Type.PLANEWITHPOINT ||
this.measurements.get(stateVec.k).surface.type == Type.CYLINDERWITHPOINT) {
Point3D p = new Point3D(this.measurements.get(stateVec.k).surface.refPoint);
Point3D p = new Point3D(this.measurements.get(stateVec.k).surface.measPoint);
p.setZ(0);
value = p.distance(stateVec.x, stateVec.y, 0);
}
Expand Down Expand Up @@ -209,6 +259,10 @@ public class MeasVec implements Comparable<MeasVec> {
public boolean skip = false;
public double hemisphere = 1;

//For DC
public int region = -1;
public int sector = -1;
public int superlayer = -1;

@Override
public int compareTo(MeasVec arg) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@
import org.jlab.clas.tracking.kalmanfilter.helical.KFitter;
import org.jlab.clas.tracking.trackrep.Helix;
import org.jlab.geom.prim.Point3D;
import org.jlab.jnp.matrix.Matrix;
import org.jlab.jnp.matrix.Matrix5x5;

/**
*
* @author ziegler
* @author Tongtong Cao
*/

public abstract class AStateVecs {

Expand Down Expand Up @@ -245,6 +253,81 @@ public class StateVec {
public double energyLoss;
public double dx;
public double path;

/////////////////////// extra variables for forward tracking ///////////////////////
// tx = px/pz
public double ty; //=py/pz
public double Q; //q/p
public double B;
public double deltaPath;
public Matrix CM = new Matrix(); // Todo: unify covMat and CM
private double _PathLength;

/////////////////////// For DAF ///////////////////////
private double weightDAF_single = 1;
private double[] weightDAF_double = {0.5, 0.5};

public double getWeightDAF_singleHit(){
return weightDAF_single;
}
public void setWeightDAF_singleHit(double weight){
this.weightDAF_single = weight;
}

public double[] getWeightDAF_doubleHits(){
return weightDAF_double;
}
public void setWeightDAF_doubleHits(double[] weight){
this.weightDAF_double = weight;
}

// Todo: move variables finalDAFWeight, _PathLength, hw, and h from AStateVecs to AMeasVecs
private double finalDAFWeight = -999;
public double getFinalDAFWeight(){
return finalDAFWeight;
}
public void setFinalDAFWeight(double weight){
this.finalDAFWeight = weight;
}

boolean isDoubleHit = false;

public boolean getIsDoubleHit(){
return isDoubleHit;
}
public void setIsDoubleHit(boolean isDoubleHit){
this.isDoubleHit = isDoubleHit;
}

public double getPathLength() {
return _PathLength;
}

public void setPathLength(double _PathLength) {
this._PathLength = _PathLength;
}

// KF projector --> get Wire midPoint match
private double hw;

public double getProjector() {
return hw;
}

public void setProjector(double h) {
this.hw = h;
}
// KF projector --> get fit doca
private double h;

public double getProjectorDoca() {
return h;
}

public void setProjectorDoca(double h) {
this.h = h;
}
/////////////////////// extra variables for forward tracking ///////////////////////

public StateVec(int k) {
this.k = k;
Expand Down Expand Up @@ -294,8 +377,18 @@ public final void copy(StateVec s) {
this.energyLoss = s.energyLoss;
this.dx = s.dx;
this.path = s.path;
this.covMat = this.copyMatrix(s.covMat);
this.F = this.copyMatrix(s.F);
if(s.covMat != null)
this.covMat = this.copyMatrix(s.covMat);
if(s.F != null)
this.F = this.copyMatrix(s.F);
this.ty = s.ty;
this.Q = s.Q;
this.B = s.B;
this.deltaPath = s.deltaPath;
if(s.CM != null)
Matrix5x5.copy(s.CM, this.CM);
this.weightDAF_single = s.weightDAF_single;
this.weightDAF_double = s.weightDAF_double;
}

public void copyCovMat(double[][] c) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,15 @@
/**
*
* @author ziegler
* @author Tongtong Cao
*/
public class Surface implements Comparable<Surface> {

public Type type;
public Plane3D plane;
public Point3D refPoint;
public Point3D measPoint;
public Point3D measPoint_err;
// Todo: make a line to replace two end points
public Point3D lineEndPoint1;
public Point3D lineEndPoint2;
public Point3D finitePlaneCorner1;
Expand All @@ -40,10 +43,56 @@ public class Surface implements Comparable<Surface> {
public boolean passive = false;
public double hemisphere = 1;

public double[] unc = new double[2];
public double[] doca = new double[2];
public Line3D[] wireLine = new Line3D[2];
public int region;
public int superlayer;
public int nMeas = 1;


public void setNMeas(int n) {
nMeas = n;
}

public int getNMeas() {
return nMeas;
}

// For URWell
public Surface(int sector, double x, double y, double z, double x_err, double y_err) {
type = Type.PLANEWITHPOINT;
this.sector = sector;
Point3D point = new Point3D(x, y, z);
measPoint = point;
Point3D point_err = new Point3D(x_err, y_err, 0);
measPoint_err = point_err;
Material material_air = new Material("air", 0, 0, 0, 30400, 0, Units.CM);
Material material_argon = new Material("argon", 0, 0, 0, 14, 0, Units.CM);
materials.add(material_air);
materials.add(material_argon);
}

// For DC
public Surface(int region, double[] doca, double[] unc, double error, Line3D[] wireLine) {
type = Type.LINEDOCA;
this.region = region;
this.doca = doca;
this.unc = unc;
this.error = error;
this.wireLine = wireLine;
Point3D point = new Point3D(0, 0, wireLine[0].origin().z());
this.measPoint = point;
Material material_air = new Material("air", 0, 0, 0, 30400, 0, Units.CM);
Material material_argon = new Material("argon", 0, 0, 0, 14, 0, Units.CM);
materials.add(material_air);
materials.add(material_argon);
}

public Surface(Plane3D plane3d, Point3D refrPoint, Point3D c1, Point3D c2, double accuracy) {
type = Type.PLANEWITHPOINT;
plane = plane3d;
refPoint = refrPoint;
measPoint = refrPoint;
finitePlaneCorner1 = c1;
finitePlaneCorner2 = c2;
swimAccuracy = accuracy;
Expand Down Expand Up @@ -82,7 +131,7 @@ public Surface(Cylindrical3D cylinder3d, Strip strp, double accuracy) {
public Surface(Cylindrical3D cylinder3d, Point3D refrPoint, double accuracy) {
type = Type.CYLINDERWITHPOINT;
cylinder = cylinder3d;
refPoint = refrPoint;
measPoint = refrPoint;
swimAccuracy = accuracy;
}
public Surface(Cylindrical3D cylinder3d, Point3D endPoint1, Point3D endPoint2, double accuracy) {
Expand Down Expand Up @@ -184,6 +233,20 @@ public int getLayer() {
public void setLayer(int layer) {
this.layer = layer;
}

/**
* @return the superlayer
*/
public int getSuperLayer() {
return superlayer;
}

/**
* @param superlayer the superlayer to set
*/
public void setSuperLayer(int superlayer) {
this.superlayer = superlayer;
}

/**
* @return the sector
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
/**
*
* @author ziegler
* @author Tongtong Cao
*/
public enum Type {
UDF(-1), PLANEWITHPOINT(0), PLANEWITHLINE(1), PLANEWITHSTRIP(2),
CYLINDERWITHPOINT(3), CYLINDERWITHLINE(4), CYLINDERWITHARC(5),
CYLINDERWITHSTRIP(6), LINE(7);
CYLINDERWITHSTRIP(6), LINE(7), LINEDOCA(8);
private final int value;

Type(int value) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package org.jlab.clas.tracking.kalmanfilter.zReference;

import java.util.logging.Logger;

/**
* Constants used in forward tracking
*
* author: Tongtong
*/
public class Constants {

// private constructor for a singleton
private Constants() {
}


public static Logger LOGGER = Logger.getLogger(Constants.class.getName());

// CONSTATNS for TRANSFORMATION
public static final double ITERSTOPXHB = 1.2e-2;
public static final double ITERSTOPYHB = 1.4e-1;
public static final double ITERSTOPTXHB = 2.5e-4;
public static final double ITERSTOPTYHB = 1.0e-3;
public static final double ITERSTOPQHB = 1.6e-3;

public static final double ITERSTOPXTB = 5.5e-5;
public static final double ITERSTOPYTB = 8.0e-4;
public static final double ITERSTOPTXTB = 2.1e-6;
public static final double ITERSTOPTYTB = 3.5e-6;
public static final double ITERSTOPQTB = 1.1e-5;

}
Loading