Skip to content

Commit

Permalink
feat: cross check with qa-physics
Browse files Browse the repository at this point in the history
  • Loading branch information
c-dilks committed Sep 7, 2023
1 parent ac46b6c commit ae67f4d
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 9 deletions.
48 changes: 48 additions & 0 deletions config/beam-energy-qa.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# from qa-physics/monitorRead.groovy
beamEnergy:

# RGA
- runnum: [ 6616, 6783 ]
value: 10.1998
- runnum: [ 4763, 5001 ]
value: 10.6041
- runnum: [ 5032, 5262 ]
value: 10.6041
- runnum: [ 5300, 5666 ]
value: 10.6041

# RGB
- runnum: [ 6120, 6399 ]
value: 10.5986
- runnum: [ 6409, 6604 ]
value: 10.1998
- runnum: [ 11093, 11283 ]
value: 10.4096
- runnum: [ 11284, 11300 ]
value: 4.17179
- runnum: [ 11323, 11571 ]
value: 10.3894

# RGK
- runnum: [ 5674, 5870 ]
value: 7.546
- runnum: [ 5875, 6000 ]
value: 6.535

# RGF
- runnum: [ 12210, 12388 ]
value: 10.389
- runnum: [ 12389, 12443 ]
value: 2.186
- runnum: [ 12444, 12951 ]
value: 10.389

# RGM
- runnum: [ 15013, 15490 ]
value: 5.98636
- runnum: [ 15533, 15727 ]
value: 2.07052
- runnum: [ 15728, 15784 ]
value: 4.02962
- runnum: [ 15787, 15884 ]
value: 5.98636
1 change: 1 addition & 0 deletions config/beam-energy.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# from bin/slurm-mon12.sh
beamEnergy:
- runnum: [ 3861, 5673 ]
value: 10.6
Expand Down
19 changes: 10 additions & 9 deletions validate_beam_energy.groovy
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
import groovy.yaml.YamlSlurper
import org.rcdb.*

// arguments
if(args.length<1) {
System.err << "ERROR: specify yaml file\n"
System.exit(100)
}
beamEnConfigYaml = args[0]

// parse beam energy config file
def slurper = new YamlSlurper()
def beamEnConfig = slurper.parse(new File("config/beam-energy.yaml"))
def beamEnConfig = slurper.parse(new File(beamEnConfigYaml))

// connect to RCDB
def rcdbURL = System.getenv('RCDB_CONNECTION')
Expand All @@ -25,19 +32,13 @@ beamEnConfig['beamEnergy'].each{ runRange ->

// loop over runs in this range
(runRange.runnum.first()..runRange.runnum.last()).each{ runnum ->
print "$runnum: "
res = rcdbProvider.getCondition(runnum, 'beam_energy')
if(res==null) {
println " not in RCDB, skip"
// println " $runnum: not in RCDB, skip"
return
}
beamEnRCDB = res.toDouble() / 1e3 // [MeV] -> [GeV]
print " local=$beamEnLocal RCDB=$beamEnRCDB"
if(Math.abs(beamEnLocal - beamEnRCDB)>0.01)
println " --> DIFFERENT"
else
println ""
println " $runnum: yaml=$beamEnLocal RCDB=$beamEnRCDB --> DIFFERENT"
}
println "STOP PREMATURELY"
System.exit(0)
}

0 comments on commit ae67f4d

Please sign in to comment.