Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Iss742: Add condition for SVT sync status #750

Merged
merged 9 commits into from
Feb 5, 2021
Merged

Iss742: Add condition for SVT sync status #750

merged 9 commits into from
Feb 5, 2021

Conversation

JeremyMcCormick
Copy link
Member

The SVT sync status condition is represented by the class SvtSyncStatus with the method isGood() returning true if the status is good and false if not.

Data is contained in the table svt_sync_statuses in the primary JLAB conditions database and was loaded from the information provided by @normangraf (see comments on the github issue).

There is a test that performs a spot check on a few of the records, which can be run as follows:

mvn test -Dtest=SvtSyncStatusesTest

This successfully checks that the first and last conditions records are correct (good and bad, respectively).

@JeremyMcCormick JeremyMcCormick added this to the V4.5 milestone Nov 17, 2020
@JeremyMcCormick JeremyMcCormick linked an issue Nov 25, 2020 that may be closed by this pull request
@normangraf
Copy link
Contributor

RawTrackerHitFitterDriver.java fails the style checker and does not compile. Please fix.

@@ -183,9 +194,17 @@ public void process(EventHeader event) {
fit.setT0(fit.getT0() - timingConstants.getOffsetTime());
}
if (subtractTriggerTime) {
double tt = (((event.getTimeStamp() - 4 * timingConstants.getOffsetPhase()) % 24) - 12);
if (debug)
double tt = (((event.getTimeStamp() - 4 * timingConstants.getOffsetPhase()) % 24) - 14);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like it changes the tt offset by 2 from what was done previously. I would expect at least some comment why this new behavior is superior than what was done before.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was discussed in multiple meetings. This shifts the average offset to be roughly zero, rather than the -2 it used to be. The intention was always to have a average time of roughly zero, and not -2.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to see a comment as to why 12 was chosen in the first place, and why it wasn't immediately fixed when it was seen that the behavior of the code was not what was actually intended.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I brought up it being at -2, it was argued it didn't matter because it changes the times the same amount and we only use relative hit times, not the absolute times, in our selection. I would say the same argument applies to this scenario, and zero is better because then defining a cut on the absolute time becomes a more simple cut.

@normangraf
Copy link
Contributor

All of the 2015 & 2016 integration tests fail. This should not happen, as this issue was intended to resolve problems specific to the 2019 data.

@cbravo135
Copy link
Collaborator

@normangraf this is an inaccurate representation of the intention of this issue.

@cbravo135
Copy link
Collaborator

The intention was to improve the calibration of the hit time corrections.

@JeremyMcCormick
Copy link
Member Author

JeremyMcCormick commented Jan 12, 2021 via email

@cbravo135
Copy link
Collaborator

@normangraf
Copy link
Contributor

Failed tests:
EngRun2015FeeReconTest.testIt:67->comparePlots:106 expected:<1> but was:<103>
EngRun2015MollerReconTest.testIt:62->comparePlots:101 expected:<417> but was:<389>
EngRun2015V0ReconTest.testIt:66->comparePlots:105 expected:<1949> but was:<1957>
PhysRun2016FeeReconTest.testIt:62->comparePlots:89 expected:<125> but was:<128>
PhysRun2016MollerReconTest.testIt:66->comparePlots:93 expected:<2221> but was:<2182>
PhysRun2016V0ReconTest.testIt:66->comparePlots:93 expected:<4890> but was:<4743>

@JeremyMcCormick
Copy link
Member Author

JeremyMcCormick commented Jan 12, 2021 via email

@normangraf
Copy link
Contributor

That's correct. Just adding the SVT conditions should have no effect.

@cbravo135
Copy link
Collaborator

If you look in jenkins, you can see that if I change the 14 back to 12, it passes everything.

@cbravo135
Copy link
Collaborator

cbravo135 commented Jan 12, 2021

This is the same code, just with the 14 changed to a 12: https://srs.slac.stanford.edu/hudson/job/hps-java-dev/61/

Copy link
Contributor

@normangraf normangraf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert the offset to 12, after which we can approve this pull request and merge with master. If needed, we can open a new issue to deal with the question of whether the offset should be 12 or 14.

@cbravo135
Copy link
Collaborator

We already did discuss changing this to 14 and the analysis group agreed the intention of this number is to put the average hit time at zero. The offset should be 14, and always should have been 14.

@cbravo135
Copy link
Collaborator

cbravo135 commented Jan 13, 2021

Mathematically, it makes sense for it to be 14 since the trigger fw and code is in essence "rounding up" the time to the next trigger clock cycle, so it will be off by half of a 4 ns cycle (2 ns) plus the time to the center (from the later edge) of the svt trigger window which is 24 ns wide, so 2 ns plus 12 ns is 14 ns.

@cbravo135
Copy link
Collaborator

12 is a bug, and I don't want to change my code to have a bug over not having one.

@cbravo135
Copy link
Collaborator

Seems like it is the tests that should change, not the 14.

@mholtrop
Copy link
Collaborator

I agree, the test should change. However, we cannot merge this until that is done. Can the test change be part of the pull request, or is that separate?

@cbravo135
Copy link
Collaborator

The tests can change as part of this PR. I just don't know how to do it myself, so someone that understands how the test framework works would need to do it.

@cbravo135
Copy link
Collaborator

cbravo135 commented Jan 25, 2021

So, after reading the code for the Recon tests that are failing, we just need to update some of the reference files in: http://www.lcsim.org/test/hps-java/referencePlots/
Not sure who has perms to do this, but I have no idea how to upload anything there.
It does seem that there is no need to change any code to get the tests to pass, so we can safely merge this PR.

@cbravo135
Copy link
Collaborator

The tests are now changed and legacy drivers were added for 2015/2016 recon.

@normangraf normangraf dismissed their stale review January 29, 2021 22:44

Tests were modified.

@cbravo135 cbravo135 reopened this Feb 4, 2021
@cbravo135 cbravo135 reopened this Feb 4, 2021
@cbravo135 cbravo135 closed this Feb 4, 2021
@cbravo135 cbravo135 reopened this Feb 4, 2021
@JeffersonLab JeffersonLab deleted a comment from cbravo135 Feb 4, 2021
@JeffersonLab JeffersonLab deleted a comment from cbravo135 Feb 4, 2021
@cbravo135 cbravo135 merged commit bfb2496 into master Feb 5, 2021
@JeremyMcCormick JeremyMcCormick modified the milestones: V4.5, v5.0 Feb 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add condition for SVT sync status
4 participants