Skip to content
Snippets Groups Projects
Commit e4c447f0 authored by Tamara Vazquez Schroeder's avatar Tamara Vazquez Schroeder
Browse files

problem with zero division solved

parent a5055477
6 merge requests!58791DataQualityConfigurations: Modify L1Calo config for web display,!46784MuonCondInterface: Enable thread-safety checking.,!46776Updated LArMonitoring config file for WD to match new files produced using MT,!45405updated ART test cron job,!42417Draft: DIRE and VINCIA Base Fragments for Pythia 8.3,!38003Create CSV output from RatesAnalysis
......@@ -47,8 +47,18 @@ def toCSV(fileName, HLTTriggers):
else:
group_name="UNDEFINED"
if trig.name.startswith("HLT"):
rates_csv_writer.writerow([trig.name,trig.rateDenominator,group_name,trig.rate,trig.rateErr,trig.prescale,'ID',trig.activeRaw,trig.passRaw,trig.activeWeighted,float(trig.activeWeighted)/float(trig.rateDenominator),float(trig.passRaw)/float(trig.activeRaw),float(trig.passWeighted)/float(trig.activeWeighted),trig.passWeighted])
if float(trig.rateDenominator)==0:
print("float(trig.rateDenominator) is ZERO! This shouldn't happen")
if float(trig.activeRaw)==0:
passFrac_beforePS=0
else:
passFrac_beforePS=float(trig.passRaw)/float(trig.activeRaw)
if float(trig.activeWeighted)==0:
passFrac_afterPS=0
else:
passFrac_afterPS=float(trig.passWeighted)/float(trig.activeWeighted)
rates_csv_writer.writerow([trig.name,trig.rateDenominator,group_name,trig.rate,trig.rateErr,trig.prescale,'ID',trig.activeRaw,trig.passRaw,trig.activeWeighted,float(trig.activeWeighted)/float(trig.rateDenominator),passFrac_beforePS,passFrac_afterPS,trig.passWeighted])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment