Skip to content
Merged
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 @@ -108,6 +108,12 @@ public static void main(String[] args) {
if (ccdb_dsc.getIntValue("frequency", 0,0,0) < 2e5) {
ds = DaqScalers.create(rawScalerBank, ccdb_fcup, ccdb_slm, ccdb_hel, ccdb_dsc);
}
else if (seq != null) {
// Use rollover-corrected clock if available and clock's freq > 200 kHz
long ut = seq.get(event).dsc2.getClock();
long gt = seq.get(event).dsc2.getGatedClock();
ds = DaqScalers.create(rawScalerBank, ccdb_fcup, ccdb_slm, ccdb_hel, ccdb_dsc, ut, gt);
}
else {
// Inputs for calculation run duration in seconds, since for
// some run periods the DSC2 clock rolls over during a run.
Expand All @@ -116,11 +122,6 @@ public static void main(String[] args) {
ds = DaqScalers.create(rawScalerBank, ccdb_fcup, ccdb_slm, ccdb_hel, rst, uet);
}

if (seq != null) {
ds.dsc2.setClock(seq.get(event).dsc2.getClock());
ds.dsc2.setGatedClock(seq.get(event).dsc2.getClock());
}

runScalerBank = ds.createRunBank(writer.getSchemaFactory());
helScalerBank = ds.createHelicityBank(writer.getSchemaFactory());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,27 @@ public static DaqScalers create(Bank rawScalerBank,IndexedTable fcupTable,Indexe
return DaqScalers.create(rawScalerBank,fcupTable,slmTable,helTable,dsc2.getGatedClockSeconds());
}

/**
* Same as create(Bank,IndexedTable,IndexedTable,IndexedTable), except
* relies on clock, gatedClock values. Used with clock rollover correction
*
* @param rawScalerBank HIPO RAW::scaler bank
* @param fcupTable /runcontrol/fcup from CCDB
* @param slmTable /runcontrol/slm from CCDB
* @param helTable /runcontrol/helicity from CCDB
* @param dscTable /daq/config/scalers/dsc1 from CCDB
* @param clock (rollover-corrected) DSC2 clock's count
* @param gatedClock (rollover-corrected) DSC2 gated clock's count
* @return
*/
public static DaqScalers create(Bank rawScalerBank,IndexedTable fcupTable,IndexedTable slmTable,IndexedTable helTable,IndexedTable dscTable,long clock,long gatedClock) {
DaqScalers ds = DaqScalers.create(rawScalerBank,fcupTable,slmTable,helTable,dscTable);
ds.dsc2.setClock(clock);
ds.dsc2.setGatedClock(gatedClock);
ds.dsc2.calibrate(fcupTable, slmTable);
return ds;
}

/**
*
* @param conman
Expand Down