Skip to content

Commit d6557f8

Browse files
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 24091a2 commit d6557f8

11 files changed

Lines changed: 272 additions & 129 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;

etc/bankdefs/hipo4/dc.json

Lines changed: 38 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -529,36 +529,47 @@
529529
"name": "TimeBasedTrkg::TBCovMat",
530530
"group": 20600,
531531
"item" : 37,
532-
"info": "reconstructed track covariance matrix",
532+
"info": "reconstructed track covariance matrix in lab frame",
533533
"entries": [
534534
{"name":"id", "type":"S", "info":"id of the track"},
535-
{"name":"C11", "type":"F", "info":"C11 covariance matrix element at last superlayer used in the fit"},
536-
{"name":"C12", "type":"F", "info":"C12 covariance matrix element at last superlayer used in the fit"},
537-
{"name":"C13", "type":"F", "info":"C13 covariance matrix element at last superlayer used in the fit"},
538-
{"name":"C14", "type":"F", "info":"C14 covariance matrix element at last superlayer used in the fit"},
539-
{"name":"C15", "type":"F", "info":"C15 covariance matrix element at last superlayer used in the fit"},
540-
{"name":"C21", "type":"F", "info":"C21 covariance matrix element at last superlayer used in the fit"},
541-
{"name":"C22", "type":"F", "info":"C22 covariance matrix element at last superlayer used in the fit"},
542-
{"name":"C23", "type":"F", "info":"C23 covariance matrix element at last superlayer used in the fit"},
543-
{"name":"C24", "type":"F", "info":"C24 covariance matrix element at last superlayer used in the fit"},
544-
{"name":"C25", "type":"F", "info":"C25 covariance matrix element at last superlayer used in the fit"},
545-
{"name":"C31", "type":"F", "info":"C31 covariance matrix element at last superlayer used in the fit"},
546-
{"name":"C32", "type":"F", "info":"C32 covariance matrix element at last superlayer used in the fit"},
547-
{"name":"C33", "type":"F", "info":"C33 covariance matrix element at last superlayer used in the fit"},
548-
{"name":"C34", "type":"F", "info":"C34 covariance matrix element at last superlayer used in the fit"},
549-
{"name":"C35", "type":"F", "info":"C35 covariance matrix element at last superlayer used in the fit"},
550-
{"name":"C41", "type":"F", "info":"C41 covariance matrix element at last superlayer used in the fit"},
551-
{"name":"C42", "type":"F", "info":"C42 covariance matrix element at last superlayer used in the fit"},
552-
{"name":"C43", "type":"F", "info":"C43 covariance matrix element at last superlayer used in the fit"},
553-
{"name":"C44", "type":"F", "info":"C44 covariance matrix element at last superlayer used in the fit"},
554-
{"name":"C45", "type":"F", "info":"C45 covariance matrix element at last superlayer used in the fit"},
555-
{"name":"C51", "type":"F", "info":"C51 covariance matrix element at last superlayer used in the fit"},
556-
{"name":"C52", "type":"F", "info":"C52 covariance matrix element at last superlayer used in the fit"},
557-
{"name":"C53", "type":"F", "info":"C53 covariance matrix element at last superlayer used in the fit"},
558-
{"name":"C54", "type":"F", "info":"C54 covariance matrix element at last superlayer used in the fit"},
559-
{"name":"C55", "type":"F", "info":"C55 covariance matrix element at last superlayer used in the fit"}
535+
{"name":"C11", "type":"F", "info":"var(x) at vertex in lab frame"},
536+
{"name":"C12", "type":"F", "info":"cov(x, y) at vertex in lab frame"},
537+
{"name":"C13", "type":"F", "info":"cov(x, z) at vertex in lab frame"},
538+
{"name":"C14", "type":"F", "info":"cov(x, p_theta) at vertex in lab frame"},
539+
{"name":"C15", "type":"F", "info":"cov(x, p_phi) at vertex in lab frame"},
540+
{"name":"C16", "type":"F", "info":"cov(x, p) at vertex in lab frame"},
541+
{"name":"C21", "type":"F", "info":"cov(y, x) at vertex in lab frame"},
542+
{"name":"C22", "type":"F", "info":"var(y) at vertex in lab frame"},
543+
{"name":"C23", "type":"F", "info":"cov(y, z) at vertex in lab frame"},
544+
{"name":"C24", "type":"F", "info":"cov(y, p_theta) at vertex in lab frame"},
545+
{"name":"C25", "type":"F", "info":"cov(y, p_phi) at vertex in lab frame"},
546+
{"name":"C26", "type":"F", "info":"cov(y, p) at vertex in lab frame"},
547+
{"name":"C31", "type":"F", "info":"cov(z, x) at vertex in lab frame"},
548+
{"name":"C32", "type":"F", "info":"cov(z, y) at vertex in lab frame"},
549+
{"name":"C33", "type":"F", "info":"var(z) at vertex in lab frame"},
550+
{"name":"C34", "type":"F", "info":"cov(z, p_theta) at vertex in lab frame"},
551+
{"name":"C35", "type":"F", "info":"cov(z, p_phi) at vertex in lab frame"},
552+
{"name":"C36", "type":"F", "info":"cov(z, p) at vertex in lab frame"},
553+
{"name":"C41", "type":"F", "info":"cov(p_theta, x) at vertex in lab frame"},
554+
{"name":"C42", "type":"F", "info":"cov(p_theta, y) at vertex in lab frame"},
555+
{"name":"C43", "type":"F", "info":"cov(p_theta, z) at vertex in lab frame"},
556+
{"name":"C44", "type":"F", "info":"var(p_theta) at vertex in lab frame"},
557+
{"name":"C45", "type":"F", "info":"cov(p_theta, p_phi) at vertex in lab frame"},
558+
{"name":"C46", "type":"F", "info":"cov(p_theta, p) at vertex in lab frame"},
559+
{"name":"C51", "type":"F", "info":"cov(p_phi, x) at vertex in lab frame"},
560+
{"name":"C52", "type":"F", "info":"cov(p_phi, y) at vertex in lab frame"},
561+
{"name":"C53", "type":"F", "info":"cov(p_phi, z) at vertex in lab frame"},
562+
{"name":"C54", "type":"F", "info":"cov(p_phi, p_theta) at vertex in lab frame"},
563+
{"name":"C55", "type":"F", "info":"var(p_phi) at vertex in lab frame"},
564+
{"name":"C56", "type":"F", "info":"cov(p_phi, p) at vertex in lab frame"},
565+
{"name":"C61", "type":"F", "info":"cov(p, x) at vertex in lab frame"},
566+
{"name":"C62", "type":"F", "info":"cov(p, y) at vertex in lab frame"},
567+
{"name":"C63", "type":"F", "info":"cov(p, z) at vertex in lab frame"},
568+
{"name":"C64", "type":"F", "info":"cov(p, p_theta) at vertex in lab frame"},
569+
{"name":"C65", "type":"F", "info":"cov(p, p_phi) at vertex in lab frame"},
570+
{"name":"C66", "type":"F", "info":"var(p) at vertex in lab frame"}
560571
]
561-
},
572+
},
562573
{
563574
"name": "TimeBasedTrkg::Trajectory",
564575
"group": 20600,

etc/bankdefs/hipo4/dcnn.json

Lines changed: 38 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -390,36 +390,47 @@
390390
"name": "TimeBasedTrkg::AICovMat",
391391
"group": 20600,
392392
"item" : 77,
393-
"info": "reconstructed track covariance matrix",
393+
"info": "reconstructed track covariance matrix in lab frame",
394394
"entries": [
395395
{"name":"id", "type":"S", "info":"id of the track"},
396-
{"name":"C11", "type":"F", "info":"C11 covariance matrix element at last superlayer used in the fit"},
397-
{"name":"C12", "type":"F", "info":"C12 covariance matrix element at last superlayer used in the fit"},
398-
{"name":"C13", "type":"F", "info":"C13 covariance matrix element at last superlayer used in the fit"},
399-
{"name":"C14", "type":"F", "info":"C14 covariance matrix element at last superlayer used in the fit"},
400-
{"name":"C15", "type":"F", "info":"C15 covariance matrix element at last superlayer used in the fit"},
401-
{"name":"C21", "type":"F", "info":"C21 covariance matrix element at last superlayer used in the fit"},
402-
{"name":"C22", "type":"F", "info":"C22 covariance matrix element at last superlayer used in the fit"},
403-
{"name":"C23", "type":"F", "info":"C23 covariance matrix element at last superlayer used in the fit"},
404-
{"name":"C24", "type":"F", "info":"C24 covariance matrix element at last superlayer used in the fit"},
405-
{"name":"C25", "type":"F", "info":"C25 covariance matrix element at last superlayer used in the fit"},
406-
{"name":"C31", "type":"F", "info":"C31 covariance matrix element at last superlayer used in the fit"},
407-
{"name":"C32", "type":"F", "info":"C32 covariance matrix element at last superlayer used in the fit"},
408-
{"name":"C33", "type":"F", "info":"C33 covariance matrix element at last superlayer used in the fit"},
409-
{"name":"C34", "type":"F", "info":"C34 covariance matrix element at last superlayer used in the fit"},
410-
{"name":"C35", "type":"F", "info":"C35 covariance matrix element at last superlayer used in the fit"},
411-
{"name":"C41", "type":"F", "info":"C41 covariance matrix element at last superlayer used in the fit"},
412-
{"name":"C42", "type":"F", "info":"C42 covariance matrix element at last superlayer used in the fit"},
413-
{"name":"C43", "type":"F", "info":"C43 covariance matrix element at last superlayer used in the fit"},
414-
{"name":"C44", "type":"F", "info":"C44 covariance matrix element at last superlayer used in the fit"},
415-
{"name":"C45", "type":"F", "info":"C45 covariance matrix element at last superlayer used in the fit"},
416-
{"name":"C51", "type":"F", "info":"C51 covariance matrix element at last superlayer used in the fit"},
417-
{"name":"C52", "type":"F", "info":"C52 covariance matrix element at last superlayer used in the fit"},
418-
{"name":"C53", "type":"F", "info":"C53 covariance matrix element at last superlayer used in the fit"},
419-
{"name":"C54", "type":"F", "info":"C54 covariance matrix element at last superlayer used in the fit"},
420-
{"name":"C55", "type":"F", "info":"C55 covariance matrix element at last superlayer used in the fit"}
396+
{"name":"C11", "type":"F", "info":"var(x) at vertex in lab frame"},
397+
{"name":"C12", "type":"F", "info":"cov(x, y) at vertex in lab frame"},
398+
{"name":"C13", "type":"F", "info":"cov(x, z) at vertex in lab frame"},
399+
{"name":"C14", "type":"F", "info":"cov(x, p_theta) at vertex in lab frame"},
400+
{"name":"C15", "type":"F", "info":"cov(x, p_phi) at vertex in lab frame"},
401+
{"name":"C16", "type":"F", "info":"cov(x, p) at vertex in lab frame"},
402+
{"name":"C21", "type":"F", "info":"cov(y, x) at vertex in lab frame"},
403+
{"name":"C22", "type":"F", "info":"var(y) at vertex in lab frame"},
404+
{"name":"C23", "type":"F", "info":"cov(y, z) at vertex in lab frame"},
405+
{"name":"C24", "type":"F", "info":"cov(y, p_theta) at vertex in lab frame"},
406+
{"name":"C25", "type":"F", "info":"cov(y, p_phi) at vertex in lab frame"},
407+
{"name":"C26", "type":"F", "info":"cov(y, p) at vertex in lab frame"},
408+
{"name":"C31", "type":"F", "info":"cov(z, x) at vertex in lab frame"},
409+
{"name":"C32", "type":"F", "info":"cov(z, y) at vertex in lab frame"},
410+
{"name":"C33", "type":"F", "info":"var(z) at vertex in lab frame"},
411+
{"name":"C34", "type":"F", "info":"cov(z, p_theta) at vertex in lab frame"},
412+
{"name":"C35", "type":"F", "info":"cov(z, p_phi) at vertex in lab frame"},
413+
{"name":"C36", "type":"F", "info":"cov(z, p) at vertex in lab frame"},
414+
{"name":"C41", "type":"F", "info":"cov(p_theta, x) at vertex in lab frame"},
415+
{"name":"C42", "type":"F", "info":"cov(p_theta, y) at vertex in lab frame"},
416+
{"name":"C43", "type":"F", "info":"cov(p_theta, z) at vertex in lab frame"},
417+
{"name":"C44", "type":"F", "info":"var(p_theta) at vertex in lab frame"},
418+
{"name":"C45", "type":"F", "info":"cov(p_theta, p_phi) at vertex in lab frame"},
419+
{"name":"C46", "type":"F", "info":"cov(p_theta, p) at vertex in lab frame"},
420+
{"name":"C51", "type":"F", "info":"cov(p_phi, x) at vertex in lab frame"},
421+
{"name":"C52", "type":"F", "info":"cov(p_phi, y) at vertex in lab frame"},
422+
{"name":"C53", "type":"F", "info":"cov(p_phi, z) at vertex in lab frame"},
423+
{"name":"C54", "type":"F", "info":"cov(p_phi, p_theta) at vertex in lab frame"},
424+
{"name":"C55", "type":"F", "info":"var(p_phi) at vertex in lab frame"},
425+
{"name":"C56", "type":"F", "info":"cov(p_phi, p) at vertex in lab frame"},
426+
{"name":"C61", "type":"F", "info":"cov(p, x) at vertex in lab frame"},
427+
{"name":"C62", "type":"F", "info":"cov(p, y) at vertex in lab frame"},
428+
{"name":"C63", "type":"F", "info":"cov(p, z) at vertex in lab frame"},
429+
{"name":"C64", "type":"F", "info":"cov(p, p_theta) at vertex in lab frame"},
430+
{"name":"C65", "type":"F", "info":"cov(p, p_phi) at vertex in lab frame"},
431+
{"name":"C66", "type":"F", "info":"var(p) at vertex in lab frame"}
421432
]
422-
},
433+
},
423434
{
424435
"name": "TimeBasedTrkg::AITrajectory",
425436
"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)