Skip to content

Commit 62335a7

Browse files
raffaelladevitabaltzell
authored andcommitted
restored TDC jitter correction for timestamp=0
1 parent 9d7b2bc commit 62335a7

File tree

7 files changed

+8
-8
lines changed

7 files changed

+8
-8
lines changed

reconstruction/band/src/main/java/org/jlab/rec/band/banks/HitReader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ private static double getTriggerPhase( DataEvent ev) {
154154
if(ev.hasBank("RUN::config")) {
155155
DataBank bank = ev.getBank("RUN::config");
156156
long timeStamp = bank.getLong("timestamp", 0);
157-
if( CalibrationConstantsLoader.JITTER_CYCLES > 0 && timeStamp > 0 ) {
157+
if( CalibrationConstantsLoader.JITTER_CYCLES > 0 && timeStamp >= 0 ) {
158158
tPh = CalibrationConstantsLoader.JITTER_PERIOD *
159159
( ( timeStamp + CalibrationConstantsLoader.JITTER_PHASE ) %
160160
CalibrationConstantsLoader.JITTER_CYCLES);

reconstruction/cnd/src/main/java/org/jlab/rec/cnd/banks/HitReader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public static ArrayList<HalfHit> getCndHalfHits(DataEvent event, CalibrationCon
2222
if(event.hasBank("RUN::config")) {
2323
DataBank bank = event.getBank("RUN::config");
2424
long timeStamp = bank.getLong("timestamp", 0);
25-
if(ccdb.JITTER_CYCLES>0 && timeStamp>0)
25+
if(ccdb.JITTER_CYCLES>0 && timeStamp>=0)
2626
triggerPhase=ccdb.JITTER_PERIOD*((timeStamp+ccdb.JITTER_PHASE)%ccdb.JITTER_CYCLES);
2727
}
2828

reconstruction/dc/src/main/java/org/jlab/rec/dc/banks/HitReader.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public List<FittedHit> get_TBHits() {
112112

113113
private int getTIJitter() {
114114
int jitter = 0;
115-
if (tiTimeStamp>0 && timejitter!=null) {
115+
if (tiTimeStamp>=0 && timejitter!=null) {
116116
double period = timejitter.getDoubleValue("period", 0, 0, 0);
117117
int phase = timejitter.getIntValue("phase", 0, 0, 0);
118118
int cycles = timejitter.getIntValue("cycles", 0, 0, 0);
@@ -124,7 +124,7 @@ private int getTIJitter() {
124124

125125
private void getDCRBJitters(boolean swapBits) {
126126

127-
if(tiTimeStamp>0 && event.hasBank(bankNames.getTimeStampBank())) {
127+
if(tiTimeStamp>=0 && event.hasBank(bankNames.getTimeStampBank())) {
128128

129129
dcrbjitters = new IndexedTable(2, "jitter:I");
130130

reconstruction/eb/src/main/java/org/jlab/rec/eb/EBRadioFrequency.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public void processEvent(DataEvent event) {
9595
int phase = ccdb.getInteger(EBCCDBEnum.RF_JITTER_PHASE);
9696
int cycles = ccdb.getInteger(EBCCDBEnum.RF_JITTER_CYCLES);
9797
long timeStamp = bank.getLong("timestamp", 0);
98-
if(cycles>0 && timeStamp>0) triggerPhase=period*((timeStamp+phase)%cycles);
98+
if(cycles>0 && timeStamp>=0) triggerPhase=period*((timeStamp+phase)%cycles);
9999

100100
}
101101
// if RF::tdc exists (data), calculate rfTime from scratch

reconstruction/ec/src/main/java/org/jlab/service/ec/ECCommon.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ public static List<ECStrip> readStripsHipo(DataEvent event, int run, ConstantsM
327327
if(CYCLES>0&&event.hasBank("RUN::config")==true){
328328
DataBank bank = event.getBank("RUN::config");
329329
long timestamp = bank.getLong("timestamp", 0);
330-
triggerPhase = timestamp>0 ? (int) (PERIOD*((timestamp+PHASE)%CYCLES)) : 0;
330+
triggerPhase = timestamp>=0 ? (int) (PERIOD*((timestamp+PHASE)%CYCLES)) : 0;
331331
}
332332

333333
if(event.hasBank("ECAL::tdc")==true){

reconstruction/tof/src/main/java/org/jlab/rec/tof/banks/ctof/HitReader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ private double getTriggerPhase(long timestamp, IndexedTable table) {
524524
int phase = table.getIntValue("phase", 0,0,0);
525525
int cycles = table.getIntValue("cycles", 0,0,0);
526526
double triggerphase=0;
527-
if(cycles>0 && timestamp>0) triggerphase=period*((timestamp+phase)%cycles);
527+
if(cycles>0 && timestamp>=0) triggerphase=period*((timestamp+phase)%cycles);
528528
// System.out.println(period + " " + phase + " " + cycles + " " + timestamp + " " + triggerphase);
529529
return triggerphase;
530530
}

reconstruction/tof/src/main/java/org/jlab/rec/tof/banks/ftof/HitReader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ private double getTriggerPhase(long timestamp, IndexedTable table) {
540540
int phase = table.getIntValue("phase", 0,0,0);
541541
int cycles = table.getIntValue("cycles", 0,0,0);
542542
double triggerphase=0;
543-
if(cycles>0 && timestamp>0) triggerphase=period*((timestamp+phase)%cycles);
543+
if(cycles>0 && timestamp>=0) triggerphase=period*((timestamp+phase)%cycles);
544544
// System.out.println(period + " " + phase + " " + cycles + " " + timestamp + " " + triggerphase);
545545
return triggerphase;
546546
}

0 commit comments

Comments
 (0)