Skip to content

Commit cd5d037

Browse files
committed
feat: before and after rollover corrections
1 parent 50391b1 commit cd5d037

2 files changed

Lines changed: 13 additions & 8 deletions

File tree

bin/qtl-xcharge

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,10 @@ case $mtd in
7474
$TIMELINESRC/qa-physics/charge_analysis/analyze_charge.py $inputFile $outputDir $suffix
7575
;;
7676
clock)
77-
$TIMELINESRC/libexec/run-groovy-timeline.sh $TIMELINESRC/qa-physics/charge_analysis/analyze_clock.groovy $inputFile $outputDir $suffix
78-
root -b -q $TIMELINESRC/qa-physics/charge_analysis/plot_clock.C'("'$outputDir'", "'$suffix'")'
77+
$TIMELINESRC/libexec/run-groovy-timeline.sh $TIMELINESRC/qa-physics/charge_analysis/analyze_clock.groovy $inputFile $outputDir rollover_corr_disabled_$suffix 0
78+
$TIMELINESRC/libexec/run-groovy-timeline.sh $TIMELINESRC/qa-physics/charge_analysis/analyze_clock.groovy $inputFile $outputDir rollover_corr_enabled_$suffix 1
79+
root -b -q $TIMELINESRC/qa-physics/charge_analysis/plot_clock.C'("'$outputDir'", "'rollover_corr_disabled_$suffix'")'
80+
root -b -q $TIMELINESRC/qa-physics/charge_analysis/plot_clock.C'("'$outputDir'", "'rollover_corr_enabled_$suffix'")'
7981
;;
8082
*)
8183
echo "ERROR: unknown method '$mtd'" >&2

qa-physics/charge_analysis/analyze_clock.groovy

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,16 @@ import org.jlab.jnp.hipo4.data.SchemaFactory;
88
import java.util.List;
99
import java.util.ArrayList;
1010

11-
if(args.length<3) {
11+
if(args.length<4) {
1212
System.err.println """
13-
USAGE: groovy ${this.class.getSimpleName()}.groovy [HIPO file] [output directory] [suffix]
13+
USAGE: groovy ${this.class.getSimpleName()}.groovy [HIPO file] [output directory] [suffix] [0/1=rollover_off/rollover_on]
1414
"""
1515
System.exit(101)
1616
}
17-
def in_file = args[0]
18-
def out_dir = args[1]
19-
def suffix = args[2]
17+
def in_file = args[0]
18+
def out_dir = args[1]
19+
def suffix = args[2]
20+
def rollover = args[3] == '1'
2021

2122
List<String> filenames = new ArrayList<>();
2223
filenames.add(in_file);
@@ -25,7 +26,9 @@ ConstantsManager consts = new ConstantsManager();
2526
consts.init("/runcontrol/fcup","/runcontrol/slm","/runcontrol/helicity","/daq/config/scalers/dsc1","/runcontrol/hwp");
2627
DaqScalersSequence seq = DaqScalersSequence.rebuildSequence(1, consts, filenames);
2728

28-
// seq.fixClockRollover();
29+
if(rollover) {
30+
seq.fixClockRollover();
31+
}
2932

3033
def out_file_name = "${out_dir}/clock_${suffix}.dat";
3134
def out_file = new File(out_file_name);

0 commit comments

Comments
 (0)