New T2D function for ALERT AHDC#1178
New T2D function for ALERT AHDC#1178mpaolone wants to merge 2 commits intoJeffersonLab:developmentfrom
Conversation
… call: time_to_distance_wire
| double p2 = (time2distance[2] + time2distance[3]*time); | ||
| double p3 = (time2distance[4] + time2distance[5]*time); | ||
|
|
||
| double t1 = 1.0/(1.0 + Math.exp(-(time - time2distance[6])/time2distance[7])); |
There was a problem hiding this comment.
If time2distance[7] or time2distance[9] are zero in CCDB, you get NaN from the division. A guard would be great.
There was a problem hiding this comment.
Ok, I can add an excption.
There was a problem hiding this comment.
Ok we can assume that the CCDB table are correct no need for 0 or NaN
|
|
||
| //////////////////////////////////////////////////////////////////////////////////////////////////////////////// | ||
| // AHDC time to distance per wire | ||
| // See implimentation and functional form in reconstruction/alert/src/main/java/org/jlab/rec/ahdc/Hit/HitReader.java |
There was a problem hiding this comment.
Typo "See implimentation" → "implementation".
There is no null-check on ahdc_time2distanceWire.
There was a problem hiding this comment.
Besides the typo, the ahdc_time2distanceWire is handled identically to every other calibration table that is loaded in the file (no direct null-check). Maybe there is a null check upstream in manager.getConstants.
There was a problem hiding this comment.
I was referring to if (ahdc_adcGains != null) { and if (ahdc_timeOverThreshold != null) {. But yes, most of the tables don't do that.
There was a problem hiding this comment.
I'd leave those kind of checks to a hidden contract between the CCDB table and the software, e.g., just don't put data in the CCDB table that the software doesn't know how to (easily) deal with.
| if (CSTLOADED) return; | ||
|
|
||
| IndexedTable ahdc_timeOffsets = manager.getConstants(runno, "/calibration/alert/ahdc/time_offsets"); | ||
| IndexedTable ahdc_time2distance = manager.getConstants(runno, "/calibration/alert/ahdc/time_to_distance"); |
There was a problem hiding this comment.
AHDC_TIME_TO_DISTANCE is still fetched and populated, but HitReader no longer uses it. Is it still useful?
There was a problem hiding this comment.
Not at all. I can remove.
Added new T2D functional form and new wire-by-wire T2D database table call: time_to_distance_wire
Removed old call to database and calculation of doca in HitReader.java. Added call to new table and a new function called T2Dfunction. This is then called in line 151 to calculate doca. In the constants loader, the new table is defined AHDC_TIME_TO_DISTANCE_WIRE... and in the AHDCEngine, the table name is added to the list of ccdb table names.