Skip to content

Commit

Permalink
fix typecast error for QADB.groovy sectorDefect
Browse files Browse the repository at this point in the history
add script to sum charge for specified run range and QA criteria
  • Loading branch information
c-dilks committed Mar 2, 2021
1 parent fa90188 commit b7dc8d6
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/clasqa/QADB.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ class QADB {
private boolean chargeCounted
private def chargeCountedFiles
private int defect
private int sectorDefect
private def sectorDefect
private String comment
private boolean found
private int nbits
Expand Down
41 changes: 41 additions & 0 deletions util/chargeSumRuns.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// calculate total analyzed charge for a run period,
// with specified QA cuts enabled
// note: if syncCheck.groovy errors are present in the run range,
// the final charge value might be a bit wrong...

import org.jlab.io.hipo.HipoDataSource
import clasqa.QADB


// arguments: run range, from runLB to runUB
def runLB,runUB
if(args.length==2) {
runLB = args[0].toInteger()
runUB = args[1].toInteger()
}
else { System.err << "ARGUMENTS: [runLB] [runUB]\n"; return; }
println "run range: $runLB to $runUB"
QADB qa = new QADB(runLB,runUB)


// loop over runs and files
int runnum
int evnum
qa.getQaTree().each{ runnumStr, runTree ->
runnum = runnumStr.toInteger()
println runnum
runTree.each{ filenumStr, fileTree ->
evnum = fileTree['evnumMin']

// QA cut /////////////////
//if(qa.query(runnum,evnum)) qa.accumulateCharge() // no qa cut
//if(qa.golden(runnum,evnum)) qa.accumulateCharge()
if(qa.OkForAsymmetry(runnum,evnum)) qa.accumulateCharge()
///////////////////////////

}
}

// print charge
println "\ntotal accumulated charge: " +
qa.getAccumulatedCharge()/1e6 + " mC"

0 comments on commit b7dc8d6

Please sign in to comment.