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

beam energy access violates DRY #60

Open
c-dilks opened this issue Jul 26, 2023 · 0 comments · May be fixed by #61
Open

beam energy access violates DRY #60

c-dilks opened this issue Jul 26, 2023 · 0 comments · May be fixed by #61
Assignees

Comments

@c-dilks
Copy link
Member

c-dilks commented Jul 26, 2023

There are at least 2 hard-coded run -> beam energy maps:

beam_energy=`python -c "beamlist = [
(3861,5673,10.6), (5674, 5870, 7.546), (5871, 6000, 6.535), (6608, 6783, 10.199),
(11620, 11657, 2.182), (11658, 12283, 10.389), (12389, 12444, 2.182), (12445, 12951, 10.389),
(15013,15490, 5.98636), (15533,15727, 2.07052), (15728,15784, 4.02962), (15787,15884, 5.98636),
(16010, 16079, 2.22), (16084, 1e9, 10.54) ]

and

// beam energy
// - hard-coded; could instead get from RCDB, but sometimes it is incorrect
def EBEAM = 10.6041 // RGA default
if(RG=="RGA") {
if(runnum>=6616 && runnum<=6783) EBEAM = 10.1998 // spring 19
else EBEAM = 10.6041
}
else if(RG=="RGB") {
if(runnum>=6120 && runnum<=6399) EBEAM = 10.5986 // spring
else if(runnum>=6409 && runnum<=6604) EBEAM = 10.1998 // spring
else if(runnum>=11093 && runnum<=11283) EBEAM = 10.4096 // fall
else if(runnum>=11284 && runnum<=11300) EBEAM = 4.17179 // fall BAND_FT
else if(runnum>=11323 && runnum<=11571) EBEAM = 10.3894 // winter (RCDB may still be incorrect)
else System.err << "ERROR: unknown beam energy\n"
}
else if(RG=="RGK") {
if(runnum>=5674 && runnum<=5870) EBEAM = 7.546
else if(runnum>=5875 && runnum<=6000) EBEAM = 6.535
else System.err << "ERROR: unknown beam energy\n"
}
else if(RG=="RGF") {
if (runnum>=12210 && runnum<=12388) EBEAM = 10.389 // RCDB may still be incorrect
else if(runnum>=12389 && runnum<=12443) EBEAM = 2.186 // RCDB may still be incorrect
else if(runnum>=12444 && runnum<=12951) EBEAM = 10.389 // RCDB may still be incorrect
else System.err << "ERROR: unknown beam energy\n"
}
else if(RG=="RGM") {
if (runnum>=15013 && runnum<=15490) EBEAM = 5.98636
else if(runnum>=15533 && runnum<=15727) EBEAM = 2.07052
else if(runnum>=15728 && runnum<=15784) EBEAM = 4.02962
else if(runnum>=15787 && runnum<=15884) EBEAM = 5.98636
else System.err << "ERROR: unknown beam energy\n"
}

Suggestion:

  • use RCDB (and cross check it with these settings)
  • use a local config file
  • run number retrieval should not be done in the wrapper script, but rather in the groovy or java code
@c-dilks c-dilks linked a pull request Jul 26, 2023 that will close this issue
@c-dilks c-dilks linked a pull request Aug 9, 2023 that will close this issue
@c-dilks c-dilks moved this from Todo to In Progress in CLAS12 Timelines Aug 9, 2023
@c-dilks c-dilks self-assigned this Aug 9, 2023
@c-dilks c-dilks added this to the SWIF Integration milestone Sep 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

Successfully merging a pull request may close this issue.

1 participant