Skip to content
Snippets Groups Projects
Commit a67ab30f authored by Rosen Matev's avatar Rosen Matev :sunny:
Browse files

Remove the tistos test

parent 9255dd4a
No related branches found
No related tags found
No related merge requests found
from Configurables import Moore
from Configurables import RecombineRawEvent
RecombineRawEvent()
Moore().ForceSingleL0Configuration = False
evtmax=3000
Moore().EvtMax = evtmax
Moore().OutputLevel =3
Moore().UseTCK = False
Moore().ThresholdSettings="Physics_pp_Draft2016"
Moore().DataType = "2012"
Moore().Split = ''
Moore().Simulation = True
Moore().CheckOdin = False
Moore().EnableDataOnDemand = True
Moore().WriterRequires = []
Moore().RemoveInputHltRawBanks=True
Moore().DDDBtag = "dddb-20130929-1"
Moore().CondDBtag = "sim-20131023-vc-md100"
from GaudiConf import IOHelper
IOHelper().inputFiles( [ "PFN:root://castorlhcb.cern.ch//castor/cern.ch/user/s/sbenson/TempTestFiles/00026133_00000013_1.allstreams.dst" ] )
from Configurables import Hlt__Service
Hlt__Service().Pedantic = False
from Configurables import DataOnDemandSvc
from Configurables import DstConf, CaloDstUnPackConf
CaloDstUnPackConf().Enable=True
DstConf().EnableUnpack= ["Reconstruction","Stripping"]
from Configurables import L0MuonAlg
L0MuonAlg("L0Muon").L0DUConfigProviderType="L0DUConfigProvider"
from Configurables import L0Conf
L0Conf().EnableL0DecodingOnDemand = True
L0Conf().FastL0DUDecoding = True
L0Conf().DecodeL0DU = True
L0Conf().TCK = '0x0045'
#from Configurables import Hlt2Conf
#Hlt2Conf().Hlt1TrackOption = "Rerun"
import GaudiPython
from Gaudi.Configuration import ApplicationMgr
from Configurables import LoKiSvc
appMgr = ApplicationMgr()
#
from Configurables import EventNodeKiller
enk = EventNodeKiller('KillTrigRawEvent')
enk.Nodes = [ "Hlt","Hlt1","Hlt2" ]
appMgr.TopAlg.insert( 0, enk.getFullName() )
#
appMgr.ExtSvc += ['DataOnDemandSvc'] #breaks for real data
appMgr.ExtSvc += ['ToolSvc', 'DataOnDemandSvc', LoKiSvc()]
#appMgr.TopAlg += [ seq ]
gaudi = GaudiPython.AppMgr(outputlevel=4)
gaudi.initialize()
gaudi.algorithm('Hlt').Enable = False
gaudi.algorithm('KillTrigRawEvent').Enable = False
triggerTisTosTool = gaudi.toolsvc().create('TriggerTisTos', interface='ITriggerTisTos')
triggerTisTosTool1 = gaudi.toolsvc().create('Hlt1TriggerTisTos', interface='ITriggerTisTos')
triggerTisTosTool2 = gaudi.toolsvc().create('Hlt2TriggerTisTos', interface='ITriggerTisTos')
tes = gaudi.evtsvc()
hlt1names = [
"Hlt1TrackAllL0Decision"
]
hlt2names = [
"Hlt2IncPhiDecision"
]
offlineLoc ="/Event/AllStreams/Phys/BetaSBs2PhiPhiLine/Particles"
count_hlt1_Dec={}
count_hlt1_TOS={}
for trigger in hlt1names:
count_hlt1_Dec.update( { trigger : 0 } )
count_hlt1_TOS.update( { trigger : 0 } )
count_hlt2_Dec={}
count_hlt2_TOS={}
for trigger in hlt2names:
count_hlt2_Dec.update( { trigger : 0 } )
count_hlt2_TOS.update( { trigger : 0 } )
i=0
n=0
#while True:
while n<evtmax:
n+=1
gaudi.run(1)
#
gaudi.executeEvent()
gaudi.algorithm("KillTrigRawEvent").execute()
gaudi.algorithm("Hlt").execute()
if i==0:
tes.dump()
split = True
if not tes["Hlt1/SelReports"]:
split = False
if not tes['/Event/DAQ/RawEvent']:
print "End of file"
break
cands = tes[offlineLoc]
if not cands:
continue
for cand in cands:
i+=1
triggerTisTosTool.setOfflineInput(cands[0])
triggerTisTosTool1.setOfflineInput(cands[0])
triggerTisTosTool2.setOfflineInput(cands[0])
#
for trigger in hlt1names:
if split == True:
triggerTisTosTool1.setTriggerInput(trigger)
classified = triggerTisTosTool1.tisTosTobTrigger()
if classified.decision() == True:
count_hlt1_Dec[trigger]+=1
if classified.tos() == True:
count_hlt1_TOS[trigger]+=1
else:
triggerTisTosTool.setTriggerInput(trigger)
classified = triggerTisTosTool.tisTosTobTrigger()
if classified.decision() == True:
count_hlt1_Dec[trigger]+=1
if classified.tos() == True:
count_hlt1_TOS[trigger]+=1
#
for trigger in hlt2names:
if split == True:
triggerTisTosTool2.setTriggerInput(trigger)
classified = triggerTisTosTool2.tisTosTobTrigger()
if classified.decision() == True:
count_hlt2_Dec[trigger]+=1
if classified.tos() == True:
count_hlt2_TOS[trigger]+=1
else:
triggerTisTosTool.setTriggerInput(trigger)
classified = triggerTisTosTool.tisTosTobTrigger()
if classified.decision() == True:
count_hlt2_Dec[trigger]+=1
if classified.tos() == True:
count_hlt2_TOS[trigger]+=1
# print efficiencies
print "Hlt1 efficiencies"
print "Trigger"+" "+"Eff. (Decision)"+" "+"Eff. (TOS)"
for trigger in hlt1names:
print trigger+" "+str( round(float(count_hlt1_Dec[trigger]) / float(i),2) )+" "+str( round(float(count_hlt1_TOS[trigger]) / float(i),2) )
print "Hlt2 efficiencies"
print "Trigger"+" "+"Eff. (Decision)"+" "+"Eff. (TOS)"
for trigger in hlt2names:
print trigger+" "+str( round(float(count_hlt2_Dec[trigger]) / float(i),2) )+" "+str( round(float(count_hlt2_TOS[trigger]) / float(i),2) )
<?xml version="1.0" ?><!DOCTYPE extension PUBLIC '-//QM/2.3/Extension//EN' 'http://www.codesourcery.com/qm/dtds/2.3/-//qm/2.3/extension//en.dtd'>
<!--
#######################################################
# SUMMARY OF THIS TEST
# ...................
# Author: sbenson
# Purpose: Check the TOS and decision efficiency on MC
# Prerequisites: None
# Common failure modes, severities and cures:
# . SEVERE: Segfault or raised exception, stderr, nonzero return code
# . MAJOR: additional FATAL/ERROR messages always a major problem. no ERROR messages should ever be printed when running this test.
# . MINOR: additional WARNING messages, it is unclear how severe these may be, you will need to hunt down the cause and either fix the problem or suppress the warning.
# . EXPECTED: At the moment this test has a habit of timing out or being killed by some abort signal in finalize, but the output always looks fine.
#######################################################
-->
<extension class="GaudiTest.GaudiExeTest" kind="test">
<argument name="program"><text>python</text></argument>
<argument name="timeout"><integer>3600</integer></argument>
<argument name="args"><set>
<text>../options/tistostest.py</text>
</set></argument>
<argument name="validator"><text>
block = """
Hlt1 efficiencies
Trigger Eff. (Decision) Eff. (TOS)
Hlt1TrackAllL0Decision 0.33 0.31
Hlt2 efficiencies
Trigger Eff. (Decision) Eff. (TOS)
Hlt2IncPhiDecision 0.28 0.28
"""
findReferenceBlock(block, signature_offset = 3)
</text></argument>
</extension>
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