Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
16 changes: 15 additions & 1 deletion etc/bankdefs/hipo4/alert.json
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@
"name": "time",
"type": "D",
"info": "calibrated time (ns)"
}, {
}, {
"name": "adc",
"type": "I",
"info": "calibrated ADC"
Expand Down Expand Up @@ -440,5 +440,19 @@
{"name": "x", "type": "F", "info": "x info (mm)"},
{"name": "y", "type": "F", "info": "y info (mm)"}
]
},
{
"name": "AHDC::docaclusters",
"group": 23000,
"item": 126,
"info": "Doca-refined cluster space points",
"entries": [
{"name": "x", "type": "F", "info": "refined x (mm)"},
{"name": "y", "type": "F", "info": "refined y (mm)"},
{"name": "z", "type": "F", "info": "refined z (mm)"},
{"name": "weight", "type": "F", "info": "refined point weight"},
{"name": "pattern", "type": "I", "info": "hit pattern: 11,12,21,22"},
{"name": "idx", "type": "I", "info": "index of original AHDC::clusters row"}
]
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@
import org.jlab.rec.ahdc.AI.InterCluster;
import org.jlab.rec.ahdc.AI.TrackPrediction;
import org.jlab.rec.ahdc.Cluster.Cluster;
import org.jlab.rec.ahdc.Cluster.DocaCluster;
import org.jlab.rec.ahdc.Hit.Hit;
import org.jlab.rec.ahdc.PreCluster.PreCluster;
import org.jlab.rec.ahdc.Track.Track;

import java.util.ArrayList;
import java.util.List;

public class RecoBankWriter {

Expand Down Expand Up @@ -198,4 +200,22 @@ public DataBank fillInterClusterBank(DataEvent event, ArrayList<InterCluster> in

return bank;
}

public DataBank fillAHDCDocaClustersBank(DataEvent event, ArrayList<DocaCluster> docaclusters) {

if (docaclusters == null || docaclusters.size() == 0) return null;

DataBank bank = event.createBank("AHDC::docaclusters", docaclusters.size());

for (int i = 0; i < docaclusters.size(); i++) {
bank.setFloat("x", i, (float) docaclusters.get(i).get_X());
bank.setFloat("y", i, (float) docaclusters.get(i).get_Y());
bank.setFloat("z", i, (float) docaclusters.get(i).get_Z());
bank.setFloat("weight", i, (float) docaclusters.get(i).get_Weight());
bank.setInt("pattern", i, (int) docaclusters.get(i).get_Pattern());
bank.setInt("idx", i, (int) docaclusters.get(i).get_ClusterIndex());
}

return bank;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
package org.jlab.rec.ahdc.Cluster;

/**
* DocaCluster is a "refined" cluster space point built from
* the DOCA information of hits in the two PreClusters that
* compose a standard Cluster.
*
* One original Cluster can produce one or several DocaCluster
* objects, each with its own (x, y, z, weight).
*/
public class DocaCluster {

// Refined space point
private double _X;
private double _Y;
private double _Z;

// Weight for helix fit (relative weight of this point)
private double _Weight = 1.0;

// Pattern of hit multiplicity: 11, 12, 21, 22, or 0 for "others"
private int _Pattern = 0;

// Index of the original Cluster in the AHDC_Clusters list
private int _ClusterIndex = -1;

public DocaCluster(double x, double y, double z,
double weight, int pattern, int clusterIndex) {
this._X = x;
this._Y = y;
this._Z = z;
this._Weight = weight;
this._Pattern = pattern;
this._ClusterIndex = clusterIndex;
}

public double get_X() { return _X; }
public double get_Y() { return _Y; }
public double get_Z() { return _Z; }
public double get_Weight() { return _Weight; }

public int get_Pattern() { return _Pattern; }
public int get_ClusterIndex() { return _ClusterIndex; }

public void set_X(double x) { this._X = x; }
public void set_Y(double y) { this._Y = y; }
public void set_Z(double z) { this._Z = z; }
public void set_Weight(double weight) { this._Weight = weight; }
public void set_Pattern(int pattern) { this._Pattern = pattern; }
public void set_ClusterIndex(int idx) { this._ClusterIndex = idx; }

@Override
public String toString() {
return String.format(
"DocaCluster{X=%.3f, Y=%.3f, Z=%.3f, w=%.3f, pattern=%d, idx=%d}",
_X, _Y, _Z, _Weight, _Pattern, _ClusterIndex
);
}
}
Loading
Loading