Skip to content
Merged
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
2 changes: 2 additions & 0 deletions etc/bankdefs/hipo4/rich.json
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,8 @@
{"name":"time", "type":"F", "info":"Hit time" },
{"name":"rawtime", "type":"F", "info":"Hit rawtime" },
{"name":"duration", "type":"S", "info":"Hit duration" },
{"name":"mchi2", "type":"F", "info":"Track-cluster matching chi2 (if any)"},
{"name":"msize", "type":"S", "info":"Cluster size"},
{"name":"status", "type":"S", "info":"Hit status" },
{"name":"used", "type":"B", "info":"eligible for PID in time (1=yes, 0=no) angle (10=yes, 0=no) hypo (100=by other) or cluster (2)"},
{"name":"emilay", "type":"B", "info":"aerogel layer of photon emission"},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public DataBank buildCalibBank(DataEvent event) {
DataBank part = event.getBank("REC::Particle");
DataBank rich = event.getBank("RICH::Particle");
DataBank hits = event.getBank("RICH::Hit");
DataBank clus = event.getBank("RICH::Cluster");
DataBank phos = event.getBank("RICH::Photon");

List<Integer> goodPhotons = new ArrayList<>();
Expand All @@ -45,9 +46,12 @@ public DataBank buildCalibBank(DataEvent event) {
}

Map<Integer,Integer> part2Rich = new HashMap<>();
Map<Integer,Integer> clus2Rich = new HashMap<>();
for(int i=0; i<rich.rows(); i++) {
int pindex = rich.getByte("pindex", i);
int hindex = rich.getShort("hindex", i);
part2Rich.put(pindex, i);
clus2Rich.put(hindex, i);
}

List<Integer> goodClusters = new ArrayList<>();
Expand Down Expand Up @@ -99,6 +103,7 @@ public DataBank buildCalibBank(DataEvent event) {
row++;
}
for(int i : goodClusters) {
int cluster = hits.getShort("cluster", i);
calib.setShort("hindex", row, (short) i);
calib.setByte( "sector", row, (byte) hits.getShort("sector", i));
calib.setShort("pmt", row, hits.getShort("pmt", i));
Expand All @@ -111,6 +116,14 @@ public DataBank buildCalibBank(DataEvent event) {
calib.setFloat("time", row, hits.getFloat("time", i));
calib.setFloat("rawtime", row, hits.getFloat("rawtime", i));
calib.setShort("duration", row, hits.getShort("duration", i));
if(clus2Rich.containsKey(cluster-1)) {
int rindex = clus2Rich.get(cluster-1);
calib.setByte("pindex", row, rich.getByte("pindex", rindex));
calib.setFloat("mchi2", row, rich.getFloat("mchi2", rindex));
calib.setShort("msize", row, clus.getShort("size", cluster-1));
}
else
calib.setByte("pindex", row, (byte) -1);
row++;
}
return calib;
Expand Down