Skip to content

Commit 043e582

Browse files
tongtongcaobaltzell
andcommitted
fix: transform DC covariance matrix for TB tracks at vertex from local to global (#1059)
* transformation for covaraince matrix of DC TB tracks from local to global * modify banks TimeBasedTrkg::TBCovMat and TimeBasedTrkg::AICovMat to store CM in the lab frame in replacement of CM in the tilted sector frame * adapt eb to 6-dimensional covariance matrix * dsts assume symmetric covariance matrix --------- Co-authored-by: Nathan Baltzell <baltzell@jlab.org>
1 parent 5bcda51 commit 043e582

12 files changed

Lines changed: 274 additions & 131 deletions

File tree

common-tools/clas-reco/src/main/java/org/jlab/clas/detector/DetectorData.java

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -521,12 +521,9 @@ public static DataBank getCovMatrixBank(List<DetectorParticle> particles, DataEv
521521
}
522522
bank.setShort("index", row, (short) p.getTrackIndex());
523523
bank.setShort("pindex", row, (short) i);
524-
for (int ii = 0; ii < 5; ii++) {
525-
for (int jj = 0; jj < 5; jj++) {
524+
for (int ii = 0; ii < 6; ii++) {
525+
for (int jj = ii; jj < 6; jj++) {
526526
String varName = String.format("C%d%d", ii + 1, jj + 1);
527-
if (bank.getDescriptor().hasEntry(varName) != true) {
528-
continue;
529-
}
530527
bank.setFloat(varName, row, p.getCovMatrix(ii, jj));
531528
}
532529
}
@@ -595,13 +592,13 @@ public static List<DetectorTrack> readDetectorTracks(DataEvent event, String ban
595592
}
596593
}
597594
if (covBank != null) {
598-
final int dimCovMat = 5;
595+
final int dimCovMat = 6;
599596
for (int ii = 0; ii < covBank.rows(); ii++) {
600597
if (covBank.getInt("id", ii) != trkId) {
601598
continue;
602599
}
603600
for (int jj = 1; jj <= dimCovMat; jj++) {
604-
for (int kk = 1; kk <= dimCovMat; kk++) {
601+
for (int kk = jj; kk <= dimCovMat; kk++) {
605602
float ele = covBank.getFloat(String.format("C%d%d", jj, kk), ii);
606603
track.setCovMatrix(jj - 1, kk - 1, ele);
607604
}

common-tools/clas-reco/src/main/java/org/jlab/clas/detector/DetectorTrack.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ public int size() {
134134
private Vector3 trackP = new Vector3();
135135
private Vector3 trackVertex = new Vector3();
136136

137-
private float[][] covMatrix = new float[5][5];
137+
private float[][] covMatrix = new float[6][6];
138138
private List<Line3D> trackCrosses = new ArrayList<>();
139139

140140
private Trajectory trajectory=new Trajectory();

common-tools/clas-tracking/src/main/java/org/jlab/clas/tracking/utilities/MatrixOps.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public double[][] MatrixTranspose(Object obj1) {
128128

129129
for(int i = 0; i < r; i++) {
130130
for (int j = 0; j < c; j++) {
131-
result[i][j] = arr1[j][i];
131+
result[j][i] = arr1[i][j];
132132
}
133133
}
134134
arr1 = null;

common-tools/coat-libs/.flattened-pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
<modelVersion>4.0.0</modelVersion>
55
<groupId>org.jlab.coat</groupId>
66
<artifactId>coat-libs</artifactId>
7-
<version>13.5.2-SNAPSHOT</version>
7+
<version>13.6.0-SNAPSHOT</version>
88
</project>

etc/bankdefs/hipo4/dc.json

Lines changed: 38 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -569,36 +569,47 @@
569569
"name": "TimeBasedTrkg::TBCovMat",
570570
"group": 20600,
571571
"item" : 37,
572-
"info": "reconstructed track covariance matrix",
572+
"info": "reconstructed track covariance matrix in lab frame",
573573
"entries": [
574574
{"name":"id", "type":"S", "info":"id of the track"},
575-
{"name":"C11", "type":"F", "info":"C11 covariance matrix element at last superlayer used in the fit"},
576-
{"name":"C12", "type":"F", "info":"C12 covariance matrix element at last superlayer used in the fit"},
577-
{"name":"C13", "type":"F", "info":"C13 covariance matrix element at last superlayer used in the fit"},
578-
{"name":"C14", "type":"F", "info":"C14 covariance matrix element at last superlayer used in the fit"},
579-
{"name":"C15", "type":"F", "info":"C15 covariance matrix element at last superlayer used in the fit"},
580-
{"name":"C21", "type":"F", "info":"C21 covariance matrix element at last superlayer used in the fit"},
581-
{"name":"C22", "type":"F", "info":"C22 covariance matrix element at last superlayer used in the fit"},
582-
{"name":"C23", "type":"F", "info":"C23 covariance matrix element at last superlayer used in the fit"},
583-
{"name":"C24", "type":"F", "info":"C24 covariance matrix element at last superlayer used in the fit"},
584-
{"name":"C25", "type":"F", "info":"C25 covariance matrix element at last superlayer used in the fit"},
585-
{"name":"C31", "type":"F", "info":"C31 covariance matrix element at last superlayer used in the fit"},
586-
{"name":"C32", "type":"F", "info":"C32 covariance matrix element at last superlayer used in the fit"},
587-
{"name":"C33", "type":"F", "info":"C33 covariance matrix element at last superlayer used in the fit"},
588-
{"name":"C34", "type":"F", "info":"C34 covariance matrix element at last superlayer used in the fit"},
589-
{"name":"C35", "type":"F", "info":"C35 covariance matrix element at last superlayer used in the fit"},
590-
{"name":"C41", "type":"F", "info":"C41 covariance matrix element at last superlayer used in the fit"},
591-
{"name":"C42", "type":"F", "info":"C42 covariance matrix element at last superlayer used in the fit"},
592-
{"name":"C43", "type":"F", "info":"C43 covariance matrix element at last superlayer used in the fit"},
593-
{"name":"C44", "type":"F", "info":"C44 covariance matrix element at last superlayer used in the fit"},
594-
{"name":"C45", "type":"F", "info":"C45 covariance matrix element at last superlayer used in the fit"},
595-
{"name":"C51", "type":"F", "info":"C51 covariance matrix element at last superlayer used in the fit"},
596-
{"name":"C52", "type":"F", "info":"C52 covariance matrix element at last superlayer used in the fit"},
597-
{"name":"C53", "type":"F", "info":"C53 covariance matrix element at last superlayer used in the fit"},
598-
{"name":"C54", "type":"F", "info":"C54 covariance matrix element at last superlayer used in the fit"},
599-
{"name":"C55", "type":"F", "info":"C55 covariance matrix element at last superlayer used in the fit"}
575+
{"name":"C11", "type":"F", "info":"var(x) at vertex in lab frame"},
576+
{"name":"C12", "type":"F", "info":"cov(x, y) at vertex in lab frame"},
577+
{"name":"C13", "type":"F", "info":"cov(x, z) at vertex in lab frame"},
578+
{"name":"C14", "type":"F", "info":"cov(x, p_theta) at vertex in lab frame"},
579+
{"name":"C15", "type":"F", "info":"cov(x, p_phi) at vertex in lab frame"},
580+
{"name":"C16", "type":"F", "info":"cov(x, p) at vertex in lab frame"},
581+
{"name":"C21", "type":"F", "info":"cov(y, x) at vertex in lab frame"},
582+
{"name":"C22", "type":"F", "info":"var(y) at vertex in lab frame"},
583+
{"name":"C23", "type":"F", "info":"cov(y, z) at vertex in lab frame"},
584+
{"name":"C24", "type":"F", "info":"cov(y, p_theta) at vertex in lab frame"},
585+
{"name":"C25", "type":"F", "info":"cov(y, p_phi) at vertex in lab frame"},
586+
{"name":"C26", "type":"F", "info":"cov(y, p) at vertex in lab frame"},
587+
{"name":"C31", "type":"F", "info":"cov(z, x) at vertex in lab frame"},
588+
{"name":"C32", "type":"F", "info":"cov(z, y) at vertex in lab frame"},
589+
{"name":"C33", "type":"F", "info":"var(z) at vertex in lab frame"},
590+
{"name":"C34", "type":"F", "info":"cov(z, p_theta) at vertex in lab frame"},
591+
{"name":"C35", "type":"F", "info":"cov(z, p_phi) at vertex in lab frame"},
592+
{"name":"C36", "type":"F", "info":"cov(z, p) at vertex in lab frame"},
593+
{"name":"C41", "type":"F", "info":"cov(p_theta, x) at vertex in lab frame"},
594+
{"name":"C42", "type":"F", "info":"cov(p_theta, y) at vertex in lab frame"},
595+
{"name":"C43", "type":"F", "info":"cov(p_theta, z) at vertex in lab frame"},
596+
{"name":"C44", "type":"F", "info":"var(p_theta) at vertex in lab frame"},
597+
{"name":"C45", "type":"F", "info":"cov(p_theta, p_phi) at vertex in lab frame"},
598+
{"name":"C46", "type":"F", "info":"cov(p_theta, p) at vertex in lab frame"},
599+
{"name":"C51", "type":"F", "info":"cov(p_phi, x) at vertex in lab frame"},
600+
{"name":"C52", "type":"F", "info":"cov(p_phi, y) at vertex in lab frame"},
601+
{"name":"C53", "type":"F", "info":"cov(p_phi, z) at vertex in lab frame"},
602+
{"name":"C54", "type":"F", "info":"cov(p_phi, p_theta) at vertex in lab frame"},
603+
{"name":"C55", "type":"F", "info":"var(p_phi) at vertex in lab frame"},
604+
{"name":"C56", "type":"F", "info":"cov(p_phi, p) at vertex in lab frame"},
605+
{"name":"C61", "type":"F", "info":"cov(p, x) at vertex in lab frame"},
606+
{"name":"C62", "type":"F", "info":"cov(p, y) at vertex in lab frame"},
607+
{"name":"C63", "type":"F", "info":"cov(p, z) at vertex in lab frame"},
608+
{"name":"C64", "type":"F", "info":"cov(p, p_theta) at vertex in lab frame"},
609+
{"name":"C65", "type":"F", "info":"cov(p, p_phi) at vertex in lab frame"},
610+
{"name":"C66", "type":"F", "info":"var(p) at vertex in lab frame"}
600611
]
601-
},
612+
},
602613
{
603614
"name": "TimeBasedTrkg::Trajectory",
604615
"group": 20600,

etc/bankdefs/hipo4/dcnn.json

Lines changed: 38 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -420,36 +420,47 @@
420420
"name": "TimeBasedTrkg::AICovMat",
421421
"group": 20600,
422422
"item" : 77,
423-
"info": "reconstructed track covariance matrix",
423+
"info": "reconstructed track covariance matrix in lab frame",
424424
"entries": [
425425
{"name":"id", "type":"S", "info":"id of the track"},
426-
{"name":"C11", "type":"F", "info":"C11 covariance matrix element at last superlayer used in the fit"},
427-
{"name":"C12", "type":"F", "info":"C12 covariance matrix element at last superlayer used in the fit"},
428-
{"name":"C13", "type":"F", "info":"C13 covariance matrix element at last superlayer used in the fit"},
429-
{"name":"C14", "type":"F", "info":"C14 covariance matrix element at last superlayer used in the fit"},
430-
{"name":"C15", "type":"F", "info":"C15 covariance matrix element at last superlayer used in the fit"},
431-
{"name":"C21", "type":"F", "info":"C21 covariance matrix element at last superlayer used in the fit"},
432-
{"name":"C22", "type":"F", "info":"C22 covariance matrix element at last superlayer used in the fit"},
433-
{"name":"C23", "type":"F", "info":"C23 covariance matrix element at last superlayer used in the fit"},
434-
{"name":"C24", "type":"F", "info":"C24 covariance matrix element at last superlayer used in the fit"},
435-
{"name":"C25", "type":"F", "info":"C25 covariance matrix element at last superlayer used in the fit"},
436-
{"name":"C31", "type":"F", "info":"C31 covariance matrix element at last superlayer used in the fit"},
437-
{"name":"C32", "type":"F", "info":"C32 covariance matrix element at last superlayer used in the fit"},
438-
{"name":"C33", "type":"F", "info":"C33 covariance matrix element at last superlayer used in the fit"},
439-
{"name":"C34", "type":"F", "info":"C34 covariance matrix element at last superlayer used in the fit"},
440-
{"name":"C35", "type":"F", "info":"C35 covariance matrix element at last superlayer used in the fit"},
441-
{"name":"C41", "type":"F", "info":"C41 covariance matrix element at last superlayer used in the fit"},
442-
{"name":"C42", "type":"F", "info":"C42 covariance matrix element at last superlayer used in the fit"},
443-
{"name":"C43", "type":"F", "info":"C43 covariance matrix element at last superlayer used in the fit"},
444-
{"name":"C44", "type":"F", "info":"C44 covariance matrix element at last superlayer used in the fit"},
445-
{"name":"C45", "type":"F", "info":"C45 covariance matrix element at last superlayer used in the fit"},
446-
{"name":"C51", "type":"F", "info":"C51 covariance matrix element at last superlayer used in the fit"},
447-
{"name":"C52", "type":"F", "info":"C52 covariance matrix element at last superlayer used in the fit"},
448-
{"name":"C53", "type":"F", "info":"C53 covariance matrix element at last superlayer used in the fit"},
449-
{"name":"C54", "type":"F", "info":"C54 covariance matrix element at last superlayer used in the fit"},
450-
{"name":"C55", "type":"F", "info":"C55 covariance matrix element at last superlayer used in the fit"}
426+
{"name":"C11", "type":"F", "info":"var(x) at vertex in lab frame"},
427+
{"name":"C12", "type":"F", "info":"cov(x, y) at vertex in lab frame"},
428+
{"name":"C13", "type":"F", "info":"cov(x, z) at vertex in lab frame"},
429+
{"name":"C14", "type":"F", "info":"cov(x, p_theta) at vertex in lab frame"},
430+
{"name":"C15", "type":"F", "info":"cov(x, p_phi) at vertex in lab frame"},
431+
{"name":"C16", "type":"F", "info":"cov(x, p) at vertex in lab frame"},
432+
{"name":"C21", "type":"F", "info":"cov(y, x) at vertex in lab frame"},
433+
{"name":"C22", "type":"F", "info":"var(y) at vertex in lab frame"},
434+
{"name":"C23", "type":"F", "info":"cov(y, z) at vertex in lab frame"},
435+
{"name":"C24", "type":"F", "info":"cov(y, p_theta) at vertex in lab frame"},
436+
{"name":"C25", "type":"F", "info":"cov(y, p_phi) at vertex in lab frame"},
437+
{"name":"C26", "type":"F", "info":"cov(y, p) at vertex in lab frame"},
438+
{"name":"C31", "type":"F", "info":"cov(z, x) at vertex in lab frame"},
439+
{"name":"C32", "type":"F", "info":"cov(z, y) at vertex in lab frame"},
440+
{"name":"C33", "type":"F", "info":"var(z) at vertex in lab frame"},
441+
{"name":"C34", "type":"F", "info":"cov(z, p_theta) at vertex in lab frame"},
442+
{"name":"C35", "type":"F", "info":"cov(z, p_phi) at vertex in lab frame"},
443+
{"name":"C36", "type":"F", "info":"cov(z, p) at vertex in lab frame"},
444+
{"name":"C41", "type":"F", "info":"cov(p_theta, x) at vertex in lab frame"},
445+
{"name":"C42", "type":"F", "info":"cov(p_theta, y) at vertex in lab frame"},
446+
{"name":"C43", "type":"F", "info":"cov(p_theta, z) at vertex in lab frame"},
447+
{"name":"C44", "type":"F", "info":"var(p_theta) at vertex in lab frame"},
448+
{"name":"C45", "type":"F", "info":"cov(p_theta, p_phi) at vertex in lab frame"},
449+
{"name":"C46", "type":"F", "info":"cov(p_theta, p) at vertex in lab frame"},
450+
{"name":"C51", "type":"F", "info":"cov(p_phi, x) at vertex in lab frame"},
451+
{"name":"C52", "type":"F", "info":"cov(p_phi, y) at vertex in lab frame"},
452+
{"name":"C53", "type":"F", "info":"cov(p_phi, z) at vertex in lab frame"},
453+
{"name":"C54", "type":"F", "info":"cov(p_phi, p_theta) at vertex in lab frame"},
454+
{"name":"C55", "type":"F", "info":"var(p_phi) at vertex in lab frame"},
455+
{"name":"C56", "type":"F", "info":"cov(p_phi, p) at vertex in lab frame"},
456+
{"name":"C61", "type":"F", "info":"cov(p, x) at vertex in lab frame"},
457+
{"name":"C62", "type":"F", "info":"cov(p, y) at vertex in lab frame"},
458+
{"name":"C63", "type":"F", "info":"cov(p, z) at vertex in lab frame"},
459+
{"name":"C64", "type":"F", "info":"cov(p, p_theta) at vertex in lab frame"},
460+
{"name":"C65", "type":"F", "info":"cov(p, p_phi) at vertex in lab frame"},
461+
{"name":"C66", "type":"F", "info":"var(p) at vertex in lab frame"}
451462
]
452-
},
463+
},
453464
{
454465
"name": "TimeBasedTrkg::AITrajectory",
455466
"group": 20600,

etc/bankdefs/hipo4/event-ai.json

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -545,21 +545,27 @@
545545
"entries": [
546546
{"name":"index", "type":"S", "info":"index of the track in Tracks bank"},
547547
{"name":"pindex", "type":"S", "info":"row number in the particle bank hit is associated with"},
548-
{"name":"C11", "type":"F", "info":"C11 covariance matrix element at last superlayer used in the fit"},
549-
{"name":"C12", "type":"F", "info":"C12 covariance matrix element at last superlayer used in the fit"},
550-
{"name":"C13", "type":"F", "info":"C13 covariance matrix element at last superlayer used in the fit"},
551-
{"name":"C14", "type":"F", "info":"C14 covariance matrix element at last superlayer used in the fit"},
552-
{"name":"C15", "type":"F", "info":"C15 covariance matrix element at last superlayer used in the fit"},
553-
{"name":"C22", "type":"F", "info":"C22 covariance matrix element at last superlayer used in the fit"},
554-
{"name":"C23", "type":"F", "info":"C23 covariance matrix element at last superlayer used in the fit"},
555-
{"name":"C24", "type":"F", "info":"C24 covariance matrix element at last superlayer used in the fit"},
556-
{"name":"C25", "type":"F", "info":"C25 covariance matrix element at last superlayer used in the fit"},
557-
{"name":"C33", "type":"F", "info":"C33 covariance matrix element at last superlayer used in the fit"},
558-
{"name":"C34", "type":"F", "info":"C34 covariance matrix element at last superlayer used in the fit"},
559-
{"name":"C35", "type":"F", "info":"C35 covariance matrix element at last superlayer used in the fit"},
560-
{"name":"C44", "type":"F", "info":"C44 covariance matrix element at last superlayer used in the fit"},
561-
{"name":"C45", "type":"F", "info":"C45 covariance matrix element at last superlayer used in the fit"},
562-
{"name":"C55", "type":"F", "info":"C55 covariance matrix element at last superlayer used in the fit"}
548+
{"name":"C11", "type":"F", "info":"var(x) (cm^2)"},
549+
{"name":"C12", "type":"F", "info":"cov(x,y)"},
550+
{"name":"C13", "type":"F", "info":"cov(x,z)"},
551+
{"name":"C14", "type":"F", "info":"cov(x,theta)"},
552+
{"name":"C15", "type":"F", "info":"cov(x,phi)"},
553+
{"name":"C16", "type":"F", "info":"cov(x,p)"},
554+
{"name":"C22", "type":"F", "info":"var(y) (cm^2)"},
555+
{"name":"C23", "type":"F", "info":"cov(y,z)"},
556+
{"name":"C24", "type":"F", "info":"cov(y,theta)"},
557+
{"name":"C25", "type":"F", "info":"cov(y,phi)"},
558+
{"name":"C26", "type":"F", "info":"cov(y,p)"},
559+
{"name":"C33", "type":"F", "info":"var(z) (cm^2)"},
560+
{"name":"C34", "type":"F", "info":"cov(z,theta)"},
561+
{"name":"C35", "type":"F", "info":"cov(z,phi)"},
562+
{"name":"C36", "type":"F", "info":"cov(z,p)"},
563+
{"name":"C44", "type":"F", "info":"var(theta) (rad^2)"},
564+
{"name":"C45", "type":"F", "info":"cov(theta,phi)"},
565+
{"name":"C46", "type":"F", "info":"cov(theta,p)"},
566+
{"name":"C55", "type":"F", "info":"var(phi) (rad^2)"},
567+
{"name":"C56", "type":"F", "info":"cov(phi,p)"},
568+
{"name":"C66", "type":"F", "info":"var(p) (GeV^2)"}
563569
]
564570
},
565571
{

0 commit comments

Comments
 (0)