Skip to content

Commit d5ce7fc

Browse files
committed
fix: cleanup and add reproducers
1 parent f47e0b9 commit d5ce7fc

6 files changed

Lines changed: 336 additions & 38 deletions

File tree

common-tools/clas-detector/src/main/java/org/jlab/detector/scalers/DaqScaler.java

Lines changed: 2 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,6 @@ else if(Math.abs(this.clockFreq - ((1e6)+3)) < 0.1) {
104104
// print the clock
105105
System.err.println(String.format("%s: toString: %s", prefix, this.toString()));
106106

107-
// ==================================================================================
108-
// original code
109-
// ==================================================================================
110-
111107
final double fcup_slope = fcupTable.getDoubleValue("slope",0,0,0); // Hz/nA
112108
final double fcup_offset = fcupTable.getDoubleValue("offset",0,0,0); // Hz
113109
final double fcup_atten = fcupTable.getDoubleValue("atten",0,0,0); // attenuation
@@ -132,35 +128,8 @@ else if(Math.abs(this.clockFreq - ((1e6)+3)) < 0.1) {
132128
this.beamChargeGated = qg * fcup_atten / fcup_slope;
133129
}
134130

135-
// ==================================================================================
136-
137-
// print the beamCharge from the original code
138-
System.err.println(String.format("%s: clockFreq@%f beamCharge=%f beamChargeGated=%f", prefix, this.clockFreq, this.beamCharge, this.beamChargeGated));
139-
140-
// now redo the calculation as if the clock frequency were 100 kHz
141-
double clockFreq100 = 100000;
142-
double seconds100 = seconds * this.clockFreq / clockFreq100;
143-
double liveSeconds100 = liveSeconds * this.clockFreq / clockFreq100;
144-
double beamCharge100;
145-
double beamChargeGated100;
146-
147-
double q100 = (double)this.slm - slm_offset * seconds100;
148-
double qg100 = (double)this.gatedSlm - slm_offset * liveSeconds100;
149-
double beamChargeSLM100 = q100 * slm_atten / slm_slope;
150-
double beamChargeGatedSLM100 = qg100 * slm_atten / slm_slope;
151-
// double livetime100 = (double)this.gatedClock / this.clock;
152-
153-
if (fcup_atten<1e-8 || fcup_slope<1e-8) {
154-
beamCharge100 = beamChargeSLM100;
155-
beamChargeGated100 = beamChargeGatedSLM100;
156-
}
157-
else {
158-
q100 = (double)this.fcup - fcup_offset * seconds100;
159-
qg100 = (double)this.gatedFcup - fcup_offset * liveSeconds100;
160-
beamCharge100 = q100 * fcup_atten / fcup_slope;
161-
beamChargeGated100 = qg100 * fcup_atten / fcup_slope;
162-
}
163-
System.err.println(String.format("%s: clockFreq@%f beamCharge=%f beamChargeGated=%f", prefix, clockFreq100, beamCharge100, beamChargeGated100));
131+
// print the beam charge
132+
System.err.println(String.format("%s: clockFreq=%f beamCharge=%f beamChargeGated=%f", prefix, this.clockFreq, this.beamCharge, this.beamChargeGated));
164133
}
165134
}
166135

rg-c__summer22__10.5gev__NH3.yaml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
mime-types:
2+
- binary/data-hipo
3+
configuration:
4+
global:
5+
variation: rgc_summer2022
6+
dcrbJitter: "true"
7+
timestamp: 03/13/2024-06:40:00
8+
io-services:
9+
writer:
10+
schema_dir: dst
11+
services:
12+
MAGFIELDS:
13+
magfieldSolenoidMap: Symm_solenoid_r601_phi1_z1201_13June2018.dat
14+
magfieldTorusMap: Full_torus_r251_phi181_z251_25Jan2021.dat
15+
DCCR:
16+
rawBankGroup: "NOISE1"
17+
MLTD:
18+
run: "6302"
19+
DCHAI:
20+
outputBankPrefix: "HB"
21+
io-services:
22+
# reader:
23+
# class: org.jlab.io.clara.HipoToHipoReader
24+
# name: HipoToHipoReader
25+
# writer:
26+
# class: org.jlab.io.clara.HipoToHipoWriter
27+
# name: HipoToHipoWriter
28+
reader:
29+
class: org.jlab.io.clara.DecoderReader
30+
name: DecoderReader
31+
writer:
32+
class: org.jlab.io.clara.DecoderWriter
33+
name: DecoderWriter
34+
services:
35+
- class: org.jlab.clas.swimtools.MagFieldsEngine
36+
name: MAGFIELDS
37+
- class: org.jlab.rec.ft.cal.FTCALEngine
38+
name: FTCAL
39+
- class: org.jlab.rec.ft.hodo.FTHODOEngine
40+
name: FTHODO
41+
- class: org.jlab.rec.ft.trk.FTTRKEngine
42+
name: FTTRK
43+
- class: org.jlab.rec.ft.FTEBEngine
44+
name: FTEB
45+
- class: org.jlab.service.raster.RasterEngine
46+
name: RASTER
47+
# DC clustering: nominal algoritm, filled the cluster bank for ai and conventional tracking
48+
- class: org.jlab.service.dc.DCHBClustering
49+
name: DCCR
50+
# This is where the AI plugin would go. THe AI code reads the HB clusters.
51+
- class: org.jlab.service.mltn.MLTDEngine
52+
name: MLTD
53+
# DC using clustering on AI hits: NN assisted HB tracking
54+
- class: org.jlab.service.dc.DCHBPostClusterAI
55+
name: DCHAI
56+
- class: org.jlab.service.ftof.FTOFHBEngine
57+
name: FTOFHB
58+
- class: org.jlab.service.ec.ECEngine
59+
name: EC
60+
- class: org.jlab.rec.cvt.services.CVTEngine
61+
name: CVTFP
62+
- class: org.jlab.service.ctof.CTOFEngine
63+
name: CTOF
64+
- class: org.jlab.service.cnd.CNDCalibrationEngine
65+
name: CND
66+
- class: org.jlab.service.htcc.HTCCReconstructionService
67+
name: HTCC
68+
- class: org.jlab.service.ltcc.LTCCEngine
69+
name: LTCC
70+
- class: org.jlab.service.eb.EBHBEngine
71+
name: EBHB
72+
# DC regular TB tracking
73+
- class: org.jlab.service.dc.DCTBEngine
74+
name: DCTB
75+
- class: org.jlab.service.fmt.FMTEngine
76+
name: FMT
77+
- class: org.jlab.rec.cvt.services.CVTSecondPassEngine
78+
name: CVTSP
79+
- class: org.jlab.service.ftof.FTOFTBEngine
80+
name: FTOFTB
81+
- class: org.jlab.service.eb.EBTBEngine
82+
name: EBTB
83+
- class: org.jlab.rec.rich.RICHEBEngine
84+
name: RICH
85+
- class: org.jlab.service.rtpc.RTPCEngine
86+
name: RTPC
Lines changed: 213 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,213 @@
1+
{
2+
"ignored": {
3+
"reconYaml": [
4+
"io-services:",
5+
" reader:",
6+
" class: org.jlab.io.clara.HipoToHipoReader",
7+
" name: HipoToHipoReader",
8+
" writer:",
9+
" class: org.jlab.io.clara.HipoToHipoWriter",
10+
" name: HipoToHipoWriter",
11+
"services:",
12+
" - class: org.jlab.clas.swimtools.MagFieldsEngine",
13+
" name: MAGFIELDS",
14+
" - class: org.jlab.rec.ft.cal.FTCALEngine",
15+
" name: FTCAL",
16+
" - class: org.jlab.rec.ft.hodo.FTHODOEngine",
17+
" name: FTHODO",
18+
" - class: org.jlab.rec.ft.trk.FTTRKEngine",
19+
" name: FTTRK",
20+
" - class: org.jlab.rec.ft.FTEBEngine",
21+
" name: FTEB",
22+
" - class: org.jlab.service.raster.RasterEngine",
23+
" name: RASTER",
24+
"# DC clustering: nominal algoritm, filled the cluster bank for ai and conventional tracking",
25+
" - class: org.jlab.service.dc.DCHBClustering",
26+
" name: DCCR",
27+
"# This is where the AI plugin would go. THe AI code reads the HB clusters. ",
28+
" - class: org.jlab.service.mltn.MLTDEngine",
29+
" name: MLTD",
30+
"# DC using clustering on AI hits: NN assisted HB tracking",
31+
" - class: org.jlab.service.dc.DCHBPostClusterAI",
32+
" name: DCHAI",
33+
" - class: org.jlab.service.ftof.FTOFHBEngine",
34+
" name: FTOFHB",
35+
" - class: org.jlab.service.ec.ECEngine",
36+
" name: EC",
37+
" - class: org.jlab.rec.cvt.services.CVTEngine",
38+
" name: CVTFP",
39+
" - class: org.jlab.service.ctof.CTOFEngine",
40+
" name: CTOF",
41+
" - class: org.jlab.service.cnd.CNDCalibrationEngine",
42+
" name: CND",
43+
" - class: org.jlab.service.htcc.HTCCReconstructionService",
44+
" name: HTCC",
45+
" - class: org.jlab.service.ltcc.LTCCEngine",
46+
" name: LTCC",
47+
" - class: org.jlab.service.eb.EBHBEngine",
48+
" name: EBHB",
49+
"# DC regular TB tracking ",
50+
" - class: org.jlab.service.dc.DCTBEngine",
51+
" name: DCTB",
52+
" - class: org.jlab.service.fmt.FMTEngine",
53+
" name: FMT",
54+
" - class: org.jlab.rec.cvt.services.CVTSecondPassEngine",
55+
" name: CVTSP",
56+
" - class: org.jlab.service.ftof.FTOFTBEngine",
57+
" name: FTOFTB",
58+
" - class: org.jlab.service.eb.EBTBEngine",
59+
" name: EBTB",
60+
" - class: org.jlab.rec.rich.RICHEBEngine",
61+
" name: RICH",
62+
" - class: org.jlab.service.rtpc.RTPCEngine",
63+
" name: RTPC",
64+
"configuration:",
65+
" global:",
66+
" variation: rgc_summer2022",
67+
" dcrbJitter: \"true\"",
68+
" timestamp: 03/13/2024-06:40:00",
69+
" io-services:",
70+
" writer:",
71+
" schema_dir: \"/group/clas12/packages/clara/5.0.2_10.0.9/plugins/clas12/etc/bankdefs/hipo4/singles/dst/\"",
72+
" services:",
73+
" MAGFIELDS:",
74+
" magfieldSolenoidMap: Symm_solenoid_r601_phi1_z1201_13June2018.dat",
75+
" magfieldTorusMap: Full_torus_r251_phi181_z251_25Jan2021.dat",
76+
" DCCR:",
77+
" rawBankGroup: \"NOISE1\"",
78+
" MLTD:",
79+
" run: \"6302\"",
80+
" DCHAI:",
81+
" outputBankPrefix: \"HB\"",
82+
"mime-types:",
83+
" - binary/data-hipo"
84+
],
85+
"trainYaml": [
86+
"io-services:",
87+
" reader:",
88+
" class: org.jlab.jnp.grapes.io.HipoFrameReader",
89+
" name: HipoFrameReader",
90+
" writer:",
91+
" class: org.jlab.jnp.grapes.io.HipoFrameWriter",
92+
" name: HipoFrameWriter",
93+
"services:",
94+
"#################################################### JPSI/TCS",
95+
" - class: org.jlab.jnp.grapes.services.JpsiTcsWagon",
96+
" name: JPSITCS",
97+
"#################################################### gmn",
98+
" - class: org.jlab.jnp.grapes.services.GenericWagon",
99+
" name: gmn1",
100+
" - class: org.jlab.jnp.grapes.services.GenericWagon",
101+
" name: gmn2",
102+
"#################################################### eDeut",
103+
" - class: org.jlab.jnp.grapes.services.GenericWagon",
104+
" name: eDeutQ1",
105+
" - class: org.jlab.jnp.grapes.services.GenericWagon",
106+
" name: eDeutQ2",
107+
"#################################################### sidisdvcs",
108+
" - class: org.jlab.jnp.grapes.services.GenericWagon",
109+
" name: sidisdvcs",
110+
"#################################################### TWO ",
111+
" - class: org.jlab.jnp.grapes.services.GenericWagon",
112+
" name: TWO1",
113+
" - class: org.jlab.jnp.grapes.services.GenericWagon",
114+
" name: TWO2",
115+
"####################################################",
116+
"configuration:",
117+
" custom-names:",
118+
" 1: jpsi ",
119+
" 2: gmn",
120+
" 3: edeutcut",
121+
" 4: sidisdvcs",
122+
" 5: two ",
123+
" io-services:",
124+
" writer:",
125+
" compression: 2",
126+
" services:",
127+
"#################################################### JPSI/TCS",
128+
" JPSITCS:",
129+
" id: 1",
130+
"#################################################### nDVCS",
131+
" gmn1:",
132+
" id: 2",
133+
" forward: 11:Xn",
134+
" beamEnergy: 10.5473",
135+
" targetPDG: 2112",
136+
" electron: Q2>0.95 && W<2 && vz>-25 && vz<20",
137+
" gmn2:",
138+
" id: 2",
139+
" forward: 11:2212:Xn",
140+
" beamEnergy: 10.5473",
141+
" targetPDG: 2212",
142+
" electron: Q2>0.95 && W<2 && vz>-25 && vz<20",
143+
"#################################################### eDeut",
144+
" eDeutQ1:",
145+
" id: 3",
146+
" forward: 11:45:X+:X-:Xn",
147+
" beamEnergy: 10.5473",
148+
" targetPDG: 45",
149+
" electron: Q2>0.95 && W>1.95 && p>1 && vz>-25 && vz<20 ",
150+
" eDeutQ2:",
151+
" id: 3",
152+
" forward: 11:X+:X-:Xn",
153+
" central: 45:X+:X-:Xn",
154+
" beamEnergy: 10.5473",
155+
" targetPDG: 45",
156+
" electron: Q2>0.95 && W>1.95 && p>1 && vz>-25 && vz<20 ",
157+
"#################################################### sidisdvcs",
158+
" sidisdvcs:",
159+
" id: 4",
160+
" forward: 11:X+:X-:Xn",
161+
" beamEnergy: 10.5473",
162+
" targetPDG: 2112 ",
163+
" electron: Q2>0.95 && W>1.95 && p>1 && vz>-25 && vz<20",
164+
"#################################################### Two",
165+
" TWO1:",
166+
" id: 5",
167+
" filter: 321:321:X+:X-:Xn",
168+
" TWO2:",
169+
" id: 5",
170+
" filter: 2212:2212:X+:X-:Xn ",
171+
"",
172+
" mime-types:",
173+
" - binary/data-hipo-frame"
174+
]
175+
},
176+
"fileRegex": ".*clas[_A-Za-z]*_(\\d+)\\.evio\\.(\\d+)",
177+
"mergePattern": "clas_%.6d.evio.%.5d-%.5d.hipo",
178+
"trainDir": "/cache/clas12/rg-c/production/summer22/pass1/10.5gev/NH3",
179+
"clara": "/group/clas12/packages/clara/5.0.2_10.0.9",
180+
"mergeSize": 5,
181+
"phaseSize": -1,
182+
"noheldel": false,
183+
"recharge": false,
184+
"workDir": "/volatile/clas12/rg-c/production/summer22/pass1New/10.5gev/NH3",
185+
"coatjava": "/group/clas12/packages/clara/5.0.2_10.0.9/plugins/clas12",
186+
"denoise": 2.0,
187+
"runGroup": "rgc",
188+
"submit": false,
189+
"trainSize": 30,
190+
"hattawy": false,
191+
"tag": "pass1_su22e10_NH3_p1",
192+
"solenoid": null,
193+
"outDir": "/cache/clas12/rg-c/production/summer22/pass1/10.5gev/NH3",
194+
"node": "general",
195+
"helflip": false,
196+
"trainYaml": "/u/home/clas12-6/users/lixu/train_dst_20230113_105473MeV.yaml",
197+
"forties": false,
198+
"threads": 16,
199+
"logDir": "/farm_out/clas12-6",
200+
"reconSize": 2,
201+
"graalvm": false,
202+
"groovy": "/group/clas12/packages/groovy/4.0.3",
203+
"singlePattern": "clas_%.6d.evio.%.5d.hipo",
204+
"torus": null,
205+
"nopostproc": false,
206+
"project": "hallb-pro",
207+
"reconYaml": "/u/home/clas12-6/users/lixu/rgcPass1Summer22/rgcSummer22Pass1.yaml",
208+
"ccdbsqlite": null,
209+
"decDir": "/cache/clas12/rg-c/production/summer22/pass1/10.5gev/NH3/decoded",
210+
"model": "decmrgrecana",
211+
"schema": "dst",
212+
"physics": false
213+
}

scan.groovy

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
// a more general monitor, for things like <sinPhiH> or helicity
2-
// - this reads DST files or skim files
3-
// - can be run on slurm
4-
// - note: search for 'CUT' to find which cuts are applied
1+
// print `RUN::scaler`
52

63
import org.jlab.jnp.hipo4.io.HipoReader;
74
import org.jlab.jnp.hipo4.data.Event;

test-rgc.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
sep() { echo '=================================================================================='; }
4+
# ./build-coatjava.sh -T8 --clara
5+
6+
### decode an RG-C Summer 2022 NH3 file
7+
rm rgc.hipo -f
8+
coatjava/bin/decoder \
9+
-l FINE \
10+
-n 10000 \
11+
-o rgc.hipo \
12+
/cache/clas12/rg-c/data/clas_016330/clas_016330.evio.00808 2>&1 | tee clockbug.log
13+
grep --color '^clockbug.*' clockbug.log
14+
15+
### reconstruct; its `README.json` file is copied here to `rg-c__summer22__10.5gev__NH3__README.json`
16+
# rm -vfr tmp
17+
# coatjava/bin/run-clara \
18+
# -y rg-c__summer22__10.5gev__NH3.yaml \
19+
# -t 8 \
20+
# -n 500 \
21+
# -c ./clara \
22+
# -o ./tmp \
23+
# /cache/clas12/rg-c/data/clas_016330/clas_016330.evio.00808
24+
# # rgc.hipo
25+
# sep
26+
# grep \
27+
# --color \
28+
# '^clockbug.*' \
29+
# $(find tmp/log -type f -name '*dpe.log')
30+
# sep
31+
# coatjava/bin/run-groovy scan.groovy tmp/rec_clas_016330.evio.00808.hipo

0 commit comments

Comments
 (0)