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
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ public void add(DaqScaler other) {
protected void calibrate(IndexedTable fcupTable,IndexedTable slmTable,double seconds,double liveSeconds) {

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));

final double fcup_slope = fcupTable.getDoubleValue("slope",0,0,0); // Hz/nA
final double fcup_offset = fcupTable.getDoubleValue("offset",0,0,0); // Hz
final double fcup_atten = fcupTable.getDoubleValue("atten",0,0,0); // attenuation
Expand All @@ -97,6 +103,10 @@ protected void calibrate(IndexedTable fcupTable,IndexedTable slmTable,double sec
this.beamCharge = q * fcup_atten / fcup_slope;
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));
}
}

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;
this.clockFreq=1e6; // FIXME: this is what's actually used
this.read(bank);
this.calibrate(fcupTable,slmTable,seconds);
}
Expand Down Expand Up @@ -110,4 +110,4 @@ public final void read(Bank bank) {
}
}

}
}
Loading