Skip to content
Draft
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
33 changes: 33 additions & 0 deletions bin/run_cvt_viewer.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/usr/bin/env bash

set -euo pipefail

INPUT_FILE="$1"

if [ -z "$INPUT_FILE" ] ; then
echo "Usage: ./run_bank_browser.sh <input.hipo>"
echo "Example: ./run_bank_browser.sh data.hipo "
exit 1
fi

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_DIR="$(cd "$SCRIPT_DIR/../.." && pwd)"
PROJECT_DIR="$REPO_DIR/reconstruction/cvt"
POM_FILE="$PROJECT_DIR/pom.xml"

if [ ! -f "$POM_FILE" ]; then
echo "ERROR: No pom.xml found at $POM_FILE"
exit 2
fi

INPUT_ABS="$(cd "$(dirname "$INPUT_FILE")" && pwd)/$(basename "$INPUT_FILE")"

if [ ! -f "$INPUT_ABS" ]; then
echo "ERROR: Input file not found: $INPUT_FILE"
exit 3
fi

mvn -f "$POM_FILE" -q exec:java \
-Dexec.mainClass="org.jlab.rec.cvt.ml.qcddat.Browser" \
-Dexec.args="$INPUT_ABS"

104 changes: 104 additions & 0 deletions etc/bankdefs/hipo4/cvtnn.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
[
{
"name": "CVTRec::MLHit",
"group": 20500,
"item" : 51,
"info": "reconstructed hits (1st pass tracking)",
"entries": [
{"name":"id", "type":"S", "info":"id of the hit"},
{"name":"sidx", "type":"S", "info":"row in the MLSeed bank"},
{"name":"tidx", "type":"S", "info":"row in the MLTrack bank"},
{"name":"rectid", "type":"S", "info":"reconstructed track id associated with the hit"},
{"name":"recsid", "type":"S", "info":"reconstructed seed id associated with the hit"},
{"name":"mctid", "type":"S", "info":"MC track id associated with the hit"},
{"name":"sector", "type":"B", "info":"sector"},
{"name":"layer", "type":"B", "info":"layer (1...6)=SVT; (7...12)=BMT"},
{"name":"type", "type":"B", "info":"detector type: 0=SVT; 1=BMT-Z; 2=BMT-C"},
{"name":"strip", "type":"S", "info":"strip number"},
{"name":"order", "type":"B", "info":"order 0=MC hit-on-track; 1=noise hit"},
{"name":"cid", "type":"S", "info":"associated cluster id"},
{"name":"cweight", "type":"F", "info":"1/1+|difference to associated cluster centroid|"},
{"name":"sweight", "type":"F", "info":"1/1+|normalized difference to associated cluster seed|"},
{"name":"x1", "type":"F", "info":"geometric strip first end-point x-coordinate"},
{"name":"y1", "type":"F", "info":"geometric strip first end-point y-coordinate"},
{"name":"z1", "type":"F", "info":"geometric strip first end-point z-coordinate"},
{"name":"x2", "type":"F", "info":"geometric strip second end-point x-coordinate"},
{"name":"y2", "type":"F", "info":"geometric strip second end-point y-coordinate"},
{"name":"z2", "type":"F", "info":"geometric strip second end-point z-coordinate"}
]
},
{
"name": "CVT::MLHit",
"group": 20500,
"item" : 52,
"info": "reconstructed hits (2nd pass tracking)",
"entries": [
{"name":"id", "type":"S", "info":"id of the hit"},
{"name":"sidx", "type":"S", "info":"row in the MLSeed bank"},
{"name":"tidx", "type":"S", "info":"row in the MLTrack bank"},
{"name":"rectid", "type":"S", "info":"reconstructed track id associated with the hit"},
{"name":"recsid", "type":"S", "info":"reconstructed seed id associated with the hit"},
{"name":"mctid", "type":"S", "info":"MC track id associated with the hit"},
{"name":"sector", "type":"B", "info":"sector"},
{"name":"layer", "type":"B", "info":"layer (1...6)=SVT; (7...12)=BMT"},
{"name":"type", "type":"B", "info":"detector type: 0=SVT; 1=BMT-Z; 2=BMT-C"},
{"name":"strip", "type":"S", "info":"strip number"},
{"name":"order", "type":"B", "info":"order 0=MC hit-on-track; 1=noise hit"},
{"name":"cid", "type":"S", "info":"associated cluster id"},
{"name":"cweight", "type":"F", "info":"1/1+|normalized difference to associated cluster centroid|"},
{"name":"sweight", "type":"F", "info":"1/1+|normalized difference to associated cluster seed|"},
{"name":"x1", "type":"F", "info":"geometric strip first end-point x-coordinate"},
{"name":"y1", "type":"F", "info":"geometric strip first end-point y-coordinate"},
{"name":"z1", "type":"F", "info":"geometric strip first end-point z-coordinate"},
{"name":"x2", "type":"F", "info":"geometric strip second end-point x-coordinate"},
{"name":"y2", "type":"F", "info":"geometric strip second end-point y-coordinate"},
{"name":"z2", "type":"F", "info":"geometric strip second end-point z-coordinate"}
]
},
{
"name": "CVTRec::MLSeed",
"group": 20500,
"item" : 61,
"info": "reconstructed seeds (1st pass tracking)",
"entries": [
{"name":"id", "type":"S", "info":"id of the seed"},
{"name":"purity", "type":"F", "info":"seed purity: Nb of reconstructed true hits in seed / total hits on seed"},
{"name":"efficiency", "type":"F", "info":"seed purity: Nb of reconstructed true hits in seed / MC hits in gemerated track"}
]
},
{
"name": "CVTRec::MLTrack",
"group": 20500,
"item" : 62,
"info": "reconstructed seeds (1st pass tracking)",
"entries": [
{"name":"id", "type":"S", "info":"id of the seed"},
{"name":"purity", "type":"F", "info":"seed purity: Nb of reconstructed true hits in track / total hits on track"},
{"name":"efficiency", "type":"F", "info":"seed purity: Nb of reconstructed true hits in track / MC hits in gemerated track"}
]
},
{
"name": "CVT::MLSeed",
"group": 20500,
"item" : 63,
"info": "reconstructed seeds (2nd pass tracking)",
"entries": [
{"name":"id", "type":"S", "info":"id of the track"},
{"name":"purity", "type":"F", "info":"seed purity: Nb of reconstructed true hits in seed / total hits on seed"},
{"name":"efficiency", "type":"F", "info":"seed purity: Nb of reconstructed true hits in seed / MC hits in gemerated track"}
]
},
{
"name": "CVT::MLTrack",
"group": 20500,
"item" : 64,
"info": "reconstructed seeds (2nd pass tracking)",
"entries": [
{"name":"id", "type":"S", "info":"id of the track"},
{"name":"purity", "type":"F", "info":"seed purity: Nb of reconstructed true hits in track / total hits on track"},
{"name":"efficiency", "type":"F", "info":"seed purity: Nb of reconstructed true hits in track / MC hits in gemerated track"}
]
}


]
27 changes: 27 additions & 0 deletions etc/bankdefs/hipo4/cvtqcddat.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[
{
"name": "CVT::QCDDATHit",
"group": 20500,
"item" : 71,
"info": "reconstructed hits",
"entries": [
{"name":"id", "type":"S", "info":"id of the hit"},
{"name":"mctid", "type":"S", "info":"MC track id associated with the hit"},
{"name":"sector", "type":"B", "info":"sector"},
{"name":"layer", "type":"B", "info":"layer (1...6)=SVT; (7...12)=BMT"},
{"name":"strip", "type":"S", "info":"strip number"},
{"name":"energy", "type":"F", "info":"energy"},
{"name":"time", "type":"F", "info":"time"},
{"name":"mctrue", "type":"B", "info":"order 0=MC hit-on-track; 1=noise hit"},
{"name":"x1", "type":"F", "info":"geometric strip origin x-coordinate"},
{"name":"y1", "type":"F", "info":"geometric strip origin y-coordinate"},
{"name":"z1", "type":"F", "info":"geometric strip origin z-coordinate"},
{"name":"x2", "type":"F", "info":"geometric strip mid-point x-coordinate"},
{"name":"y2", "type":"F", "info":"geometric strip mid-point y-coordinate"},
{"name":"z2", "type":"F", "info":"geometric strip mid-point z-coordinate"},
{"name":"x3", "type":"F", "info":"geometric strip end-point x-coordinate"},
{"name":"y3", "type":"F", "info":"geometric strip end-point y-coordinate"},
{"name":"z3", "type":"F", "info":"geometric strip end-point z-coordinate"}
]
}
]
27 changes: 27 additions & 0 deletions etc/services/mc-mlcvt.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
io-services:
reader:
class: org.jlab.io.clara.HipoToHipoReader
name: HipoToHipoReader
writer:
class: org.jlab.io.clara.HipoToHipoWriter
name: HipoToHipoWriter
services:
- class: org.jlab.clas.swimtools.MagFieldsEngine
name: MAGFIELDS
- class: org.jlab.rec.cvt.ml.SampleMaker
name: CVTFP
configuration:
global:
variation: rga_fall2018_bg
# dcMinistagger: "NOTONREFWIRE"
# dcFeedthroughs: "OFF"
# io-services:
# writer:
# schema_dir: "absolute-path-to-schema-folder"
services:
MAGFIELDS:
magfieldSolenoidMap: Symm_solenoid_r601_phi1_z1201_13June2018.dat
magfieldTorusMap: Symm_torus_r2501_phi16_z251_24Apr2018.dat

mime-types:
- binary/data-hipo
27 changes: 27 additions & 0 deletions etc/services/mc-mlcvtfilter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
io-services:
reader:
class: org.jlab.io.clara.HipoToHipoReader
name: HipoToHipoReader
writer:
class: org.jlab.io.clara.HipoToHipoWriter
name: HipoToHipoWriter
services:
- class: org.jlab.clas.swimtools.MagFieldsEngine
name: MAGFIELDS
- class: org.jlab.rec.cvt.ml.CVTFilter
name: CVTFP
configuration:
global:
variation: rga_fall2018_bg
# dcMinistagger: "NOTONREFWIRE"
# dcFeedthroughs: "OFF"
# io-services:
# writer:
# schema_dir: "absolute-path-to-schema-folder"
services:
MAGFIELDS:
magfieldSolenoidMap: Symm_solenoid_r601_phi1_z1201_13June2018.dat
magfieldTorusMap: Symm_torus_r2501_phi16_z251_24Apr2018.dat

mime-types:
- binary/data-hipo
27 changes: 27 additions & 0 deletions etc/services/mc-qcddat.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
io-services:
reader:
class: org.jlab.io.clara.HipoToHipoReader
name: HipoToHipoReader
writer:
class: org.jlab.io.clara.HipoToHipoWriter
name: HipoToHipoWriter
services:
- class: org.jlab.clas.swimtools.MagFieldsEngine
name: MAGFIELDS
- class: org.jlab.rec.cvt.ml.qcddat.SampleMaker
name: CVTFP
configuration:
global:
variation: rga_fall2018_bg
# dcMinistagger: "NOTONREFWIRE"
# dcFeedthroughs: "OFF"
# io-services:
# writer:
# schema_dir: "absolute-path-to-schema-folder"
services:
MAGFIELDS:
magfieldSolenoidMap: Symm_solenoid_r601_phi1_z1201_13June2018.dat
magfieldTorusMap: Symm_torus_r2501_phi16_z251_24Apr2018.dat

mime-types:
- binary/data-hipo
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class Constants {
public static double CAANGLE4=19.;
public static double CAANGLE5=3.5;
public boolean seedingDebugMode =false;

public boolean QDCDATSample=true;


// private constructor for a singleton
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,11 @@ public void fetch_BMTHits(DataEvent event, Swim swim, IndexedTable status,
int strip = bankDGTZ.getShort("component", i);
double ADCtoEdep = bankDGTZ.getInt("ADC", i);
double time = bankDGTZ.getFloat("time", i);
int order = bankDGTZ.trueOrder(i);
int order = bankDGTZ.getByte("order", i);;
if(Constants.getInstance().timeCuts
&& !Constants.getInstance().QDCDATSample) {
order = bankDGTZ.trueOrder(i);
}
//if (order == 1) {
// continue;
//}
Expand All @@ -133,11 +137,13 @@ public void fetch_BMTHits(DataEvent event, Swim swim, IndexedTable status,
// create the strip object for the BMT
Strip BmtStrip = new Strip(strip, ADCtoEdep, time);
BmtStrip.setStatus(status.getIntValue("status", sector, layer, strip));
if(Constants.getInstance().timeCuts) {
if(Constants.getInstance().timeCuts
&& !Constants.getInstance().QDCDATSample) {
if(time!=0 && (time<tmin || time>tmax))
BmtStrip.setStatus(2);// calculate the strip parameters for the BMT hit
}
if(Constants.getInstance().bmtHVCuts) {
if(Constants.getInstance().bmtHVCuts
&& !Constants.getInstance().QDCDATSample) {
if(bmtStripVoltage!=null && bmtStripVoltage.hasEntry(sector,layer,0) &&
bmtStripVoltageThresh!=null && bmtStripVoltageThresh.hasEntry(sector,layer,0)) {
double hv = bmtStripVoltage.getDoubleValue("HV", sector,layer,0);
Expand Down Expand Up @@ -299,7 +305,8 @@ public void fetch_SVTHits(DataEvent event, int omitLayer, int omitHemisphere,
if(tdcs.containsKey(key)) {
time = tdcs.get(key);
//time tag
if(Constants.getInstance().useSVTTimingCuts) {
if(Constants.getInstance().useSVTTimingCuts &&
!Constants.getInstance().QDCDATSample) {
if(this.passTimingCuts(ADC, time)==false)
continue;
}
Expand Down
Loading
Loading