Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
test: 125 MHz DSC2 clock for RG-A Spring 2018 6.4 GeV
We suspect the DSC2 clock frequency for RG-A Spring 2018 6.4 GeV data
was 125 MHz, not 1 MHz. This PR allows one to run `RebuildScalers` with
the higher frequency clock, and more generalized clock rollover
corrections.

**do not merge**
  • Loading branch information
c-dilks committed Apr 7, 2026
commit 3552dc07e46ff2e840465fac6922c8066413230e
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ protected void calibrate(IndexedTable fcupTable,IndexedTable slmTable,double sec

if (this.clock > 0) {

String prefix = String.format("clocktest [%s]", this.getClass().getSimpleName());
System.out.println(String.format("%s: -----------", prefix));
System.out.println(String.format("%s: toString: %s", prefix, this.toString()));
System.out.println(String.format("%s: seconds=%f liveSeconds=%f", prefix, seconds, liveSeconds));
// String prefix = String.format("clocktest [%s]", this.getClass().getSimpleName());
// System.out.println(String.format("%s: -----------", prefix));
// System.out.println(String.format("%s: toString: %s", prefix, this.toString()));
// System.out.println(String.format("%s: seconds=%f liveSeconds=%f", prefix, seconds, liveSeconds));

final double fcup_slope = fcupTable.getDoubleValue("slope",0,0,0); // Hz/nA
final double fcup_offset = fcupTable.getDoubleValue("offset",0,0,0); // Hz
Expand All @@ -104,9 +104,9 @@ protected void calibrate(IndexedTable fcupTable,IndexedTable slmTable,double sec
this.beamChargeGated = qg * fcup_atten / fcup_slope;
}

System.out.println(String.format("%s: BANK fcup=%d fcupGated=%d", prefix, this.fcup, this.gatedFcup));
System.out.println(String.format("%s: CCDB fcup_offset=%f fcup_slope=%f fcup_atten=%f", prefix, fcup_offset, fcup_slope, fcup_atten));
System.out.println(String.format("%s: clockFreq=%f beamCharge=%f beamChargeGated=%f", prefix, this.clockFreq, this.beamCharge, this.beamChargeGated));
// System.out.println(String.format("%s: BANK fcup=%d fcupGated=%d", prefix, this.fcup, this.gatedFcup));
// System.out.println(String.format("%s: CCDB fcup_offset=%f fcup_slope=%f fcup_atten=%f", prefix, fcup_offset, fcup_slope, fcup_atten));
// System.out.println(String.format("%s: clockFreq=%f beamCharge=%f beamChargeGated=%f", prefix, this.clockFreq, this.beamCharge, this.beamChargeGated));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public Dsc2Scaler() {}
* @param seconds dwell time, provided in case the clock rolls over
*/
public Dsc2Scaler(Bank bank, IndexedTable fcupTable, IndexedTable slmTable, double seconds) {
this.clockFreq=1e6; // FIXME: this is what's actually used
this.clockFreq=125e6; // for RG-A spring 2018 6.4 GeV data
this.read(bank);
this.calibrate(fcupTable,slmTable,seconds);
}
Expand All @@ -50,7 +50,7 @@ public Dsc2Scaler(Bank bank, IndexedTable fcupTable, IndexedTable slmTable, doub
* @param dscTable /daq/config/scalers/dsc1 CCDB table
*/
public Dsc2Scaler(Bank bank, IndexedTable fcupTable, IndexedTable slmTable, IndexedTable dscTable) {
this.clockFreq = dscTable.getIntValue("frequency", 0,0,0);
this.clockFreq = 125e6; // for RG-A spring 2018 6.4 GeV data // dscTable.getIntValue("frequency", 0,0,0);
this.read(bank);
this.calibrate(fcupTable,slmTable);
}
Expand Down