diff --git a/common-tools/clas-detector/src/main/java/org/jlab/detector/scalers/DaqScaler.java b/common-tools/clas-detector/src/main/java/org/jlab/detector/scalers/DaqScaler.java index 8ae107969c..a144b11142 100644 --- a/common-tools/clas-detector/src/main/java/org/jlab/detector/scalers/DaqScaler.java +++ b/common-tools/clas-detector/src/main/java/org/jlab/detector/scalers/DaqScaler.java @@ -74,6 +74,18 @@ public void add(DaqScaler other) { protected void calibrate(IndexedTable fcupTable,IndexedTable slmTable,double seconds,double liveSeconds) { if (this.clock > 0) { + + String prefix = String.format("clockbug [%s]", this.getClass().getSimpleName()); + if(Math.abs(this.clockFreq - ((1e6)+1)) < 0.1) + System.err.println(String.format("%s: used hard-coded clockFreq from Dsc2Scaler(bank,table,table,seconds)", prefix)); + else if(Math.abs(this.clockFreq - ((1e6)+2)) < 0.1) + System.err.println(String.format("%s: used hard-coded clockFreq from StruckScaler()", prefix)); + else if(Math.abs(this.clockFreq - ((1e6)+3)) < 0.1) + System.err.println(String.format("%s: used hard-coded clockFreq from StruckScaler(table,table,table)", prefix)); + else + System.err.println(String.format("%s: clockFreq OK (value=%f)", prefix, this.clockFreq)); + System.err.println(String.format("%s: %s", prefix, this.toString())); + 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 @@ -97,6 +109,7 @@ protected void calibrate(IndexedTable fcupTable,IndexedTable slmTable,double sec this.beamCharge = q * fcup_atten / fcup_slope; this.beamChargeGated = qg * fcup_atten / fcup_slope; } + System.err.println(String.format("%s: beamCharge=%f beamChargeGated=%f", prefix, this.beamCharge, this.beamChargeGated)); } } diff --git a/common-tools/clas-detector/src/main/java/org/jlab/detector/scalers/Dsc2Scaler.java b/common-tools/clas-detector/src/main/java/org/jlab/detector/scalers/Dsc2Scaler.java index 5f48d43421..5e4aa3a3d2 100644 --- a/common-tools/clas-detector/src/main/java/org/jlab/detector/scalers/Dsc2Scaler.java +++ b/common-tools/clas-detector/src/main/java/org/jlab/detector/scalers/Dsc2Scaler.java @@ -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)+1; this.read(bank); this.calibrate(fcupTable,slmTable,seconds); } @@ -110,4 +110,4 @@ public final void read(Bank bank) { } } -} \ No newline at end of file +} diff --git a/common-tools/clas-detector/src/main/java/org/jlab/detector/scalers/StruckScaler.java b/common-tools/clas-detector/src/main/java/org/jlab/detector/scalers/StruckScaler.java index 14237ebe62..f940271c61 100644 --- a/common-tools/clas-detector/src/main/java/org/jlab/detector/scalers/StruckScaler.java +++ b/common-tools/clas-detector/src/main/java/org/jlab/detector/scalers/StruckScaler.java @@ -164,7 +164,7 @@ public final Interval getStableInterval(Bank bank, IndexedTable helTable) { } public StruckScaler() { - this.clockFreq = 1e6; + this.clockFreq = (1e6)+2; } /** @@ -178,7 +178,7 @@ public StruckScaler() { public StruckScaler(Bank bank,IndexedTable fcupTable, IndexedTable slmTable, IndexedTable helTable) { // the STRUCK's clock is 1 MHz - this.clockFreq = 1e6; + this.clockFreq = (1e6)+3; // Here we're going to assume the stable period is the same Struck // period throughout a single readout. Almost always correct ... @@ -239,4 +239,4 @@ else if (Input.equals(Input.CLOCK, chan)) { this.calibrate(fcupTable,slmTable); } -} \ No newline at end of file +}