diff --git a/Control/AthenaCommon/python/Configurable.py b/Control/AthenaCommon/python/Configurable.py index 8c88102befa5620d9e10e8a6813e30f6f3dfa9f2..67af258f09c16f14876cc9aa481c3321e20ad545 100755 --- a/Control/AthenaCommon/python/Configurable.py +++ b/Control/AthenaCommon/python/Configurable.py @@ -514,8 +514,7 @@ class Configurable( object ): value = value.getFullName() elif type(value) is list and len(value) > 0 and hasattr(value[0], 'getFullName'): value = [ i.getFullName() for i in value ] - if not hasattr(proxy,'default') or value != proxy.default : - props[ name ] = value + props[ name ] = value except AttributeError: pass diff --git a/Control/AthenaConfiguration/python/ComponentAccumulator.py b/Control/AthenaConfiguration/python/ComponentAccumulator.py index 9e775bb3ab4d50ffd8ee332e5b1d8f8c03d7b58e..d7ee5e68f46e8517a037537164d47032f4f1b3b3 100644 --- a/Control/AthenaConfiguration/python/ComponentAccumulator.py +++ b/Control/AthenaConfiguration/python/ComponentAccumulator.py @@ -94,9 +94,11 @@ class ComponentAccumulator(object): seq = findSubSequence(seq, sequence ) if seq == None: raise ConfigurationError("Missing sequence %s to add new sequence to" % sequence ) + if findSubSequence( self._sequence, newseq.name() ): raise ConfigurationError("Sequence %s already present" % newseq.name() ) seq += newseq + return newseq def addEventAlgo(self, algo,sequence=None): if not isinstance(algo, ConfigurableAlgorithm): @@ -110,7 +112,7 @@ class ComponentAccumulator(object): self._msg.debug("Adding %s to sequence %s" % ( algo.getFullName(), seq.name()) ) seq += algo - pass + return algo def getEventAlgo(self,name): @@ -129,7 +131,7 @@ class ComponentAccumulator(object): raise TypeError("Attempt to add wrong type: %s as conditions algorithm" % type( algo ).__name__) pass self._deduplicate(algo,self._conditionsAlgs) #will raise on conflict - return + return algo def getCondAlgo(self,name): @@ -143,13 +145,13 @@ class ComponentAccumulator(object): raise TypeError("Attempt to add wrong type: %s as service" % type( newSvc ).__name__) pass self._deduplicate(newSvc,self._services) #will raise on conflict - return + return newSvc def addAlgTool(self,newTool): if not isinstance(newTool,ConfigurableAlgTool): raise TypeError("Attempt to add wrong type as AlgTool") self._privateTools.append(newTool) - return + return newTool def clearAlgTools(self): @@ -159,7 +161,8 @@ class ComponentAccumulator(object): def addPublicTool(self,newTool): if not isinstance(newTool,ConfigurableAlgTool): raise TypeError("Attempt to add wrong type: %s as AlgTool" % type( newTool ).__name__) - newTool.setParent("ToolSvc") + if newTool.getParent() != "ToolSvc": + newTool.setParent("ToolSvc") self._deduplicate(newTool,self._publicTools) return @@ -347,7 +350,7 @@ class ComponentAccumulator(object): del kwargs['sequence'] CurrentSequence.set( seq ) - self._msg.info("Excuting configuration function %s" % fct.__name__) + self._msg.info("Executing configuration function %s" % fct.__name__) retval=fct(configFlags,*args,**kwargs) CurrentSequence.set( currentSeq ) @@ -363,7 +366,11 @@ class ComponentAccumulator(object): def appendConfigurable(self,confElem): - name=confElem.getJobOptName() #FIXME: Don't overwrite duplicates! + name=confElem.getJobOptName() # to be FIXED + # if self._jocat.has_key(name): + # self._msg.info("Not adding duplicate configurable: %s" % name ) + # return + #Hack for public Alg tools, drop multiple mentions of ToolSvc nTS=0 for n in name.split("."): @@ -373,7 +380,7 @@ class ComponentAccumulator(object): break if nTS>2: name=".".join(name.split(".")[nTS-1:]) - for k, v in confElem.getValuedProperties().items(): + for k, v in confElem.getValuedProperties().items(): if isinstance(v,Configurable): self._jocat[name][k]=v.getFullName() elif isinstance(v,GaudiHandles.GaudiHandleArray): @@ -391,8 +398,17 @@ class ComponentAccumulator(object): from AthenaCommon.Utils.unixtools import find_datafile from collections import defaultdict import pickle - #first load basics from the bootstrap-pickle - bsfilename=find_datafile("bootstrap.pkl") + import glob + # first load basics from the bootstrap-pickle + # a better solution to be discussed + # prefer local file + localbs = glob.glob("bootstrap.pkl") + if len( localbs ) == 0: + # if local bootstrap is missing, use one from the release + bsfilename=find_datafile("bootstrap.pkl") + else: + bsfilename = localbs[0] + bsfile=open(bsfilename) self._jocat=pickle.load(bsfile) self._jocfg=pickle.load(bsfile) @@ -400,16 +416,15 @@ class ComponentAccumulator(object): bsfile.close() - #EventAlgorithms - for (seqName,algoList) in flatSequencers( self._sequence ).iteritems(): + for seqName, algoList in flatSequencers( self._sequence ).iteritems(): evtalgseq=[] for alg in algoList: - self.appendConfigurable(alg) - evtalgseq.append(alg.getFullName()) - - self._jocat[seqName]["Members"]=str(evtalgseq) - + self.appendConfigurable( alg ) + evtalgseq.append( alg.getFullName() ) + + for seqName, algoList in flatSequencers( self._sequence ).iteritems(): + self._jocat[seqName]["Members"]=str( [alg.getFullName() for alg in algoList] ) #Conditions Algorithms: condalgseq=[] @@ -428,12 +443,18 @@ class ComponentAccumulator(object): #Hack for now: self._jocfg["ApplicationMgr"]["CreateSvc"]=['ToolSvc/ToolSvc', 'AthDictLoaderSvc/AthDictLoaderSvc', 'AthenaSealSvc/AthenaSealSvc', 'CoreDumpSvc/CoreDumpSvc'] - + svcList=ast.literal_eval(self._jocfg["ApplicationMgr"]["ExtSvc"]) - for svc in self._services: - svcname=svc.getJobOptName() - if (svcname=="GeoModelSvc"): self._jocfg["ApplicationMgr"]["CreateSvc"]+=['GeoModelSvc',] + def __addif( name ): + for svc in self._services: + if name == svc.getJobOptName(): + self._jocfg["ApplicationMgr"]["CreateSvc"].append( svc.getFullName() ) + __addif('DetDescrCnvSvc') + __addif('GeoModelSvc') + __addif('TileInfoLoader') + + for svc in self._services: svcList.append(svc.getFullName()) #for k, v in svc.getValuedProperties().items(): # self._jocat[svcname][k]=str(v) @@ -442,11 +463,12 @@ class ComponentAccumulator(object): self._jocfg["ApplicationMgr"]["EvtMax"]=nEvents - for (k,v) in self._theAppProps.iteritems(): - self._jocfg["ApplicationMgr"][k]=v - from pprint import pprint + if k not in [ 'CreateSvc', 'ExtSvc']: + self._jocfg["ApplicationMgr"][k]=v + + #from pprint import pprint #pprint (self._jocat) pickle.dump( self._jocat, outfile ) @@ -467,7 +489,6 @@ if __name__ == "__main__": def __init__(self, name): super( ConfigurablePyAlgorithm, self ).__init__( name ) - def AlgsConf1(flags): acc = ComponentAccumulator() acc.addEventAlgo( Algo("Algo1") ) @@ -482,6 +503,7 @@ if __name__ == "__main__": acc = ComponentAccumulator() + # top level algs acc.addConfig( AlgsConf2,dummyCfgFlags ) # checks assert findAlgorithm(AlgSequence("AthAlgSeq"), "Algo1", 1), "Algorithm not added to a top sequence" @@ -502,30 +524,49 @@ if __name__ == "__main__": acc.addEventAlgo( NestedAlgo2 ) return acc + acc.addSequence( seqAND("Nest") ) + acc.addSequence( seqAND("subSequence1"), sequence="Nest" ) + acc.addSequence( parOR("subSequence2"), sequence="Nest" ) - acc.addSequence( seqAND("subSequence1") ) - acc.addSequence( parOR("subSequence2") ) - assert findSubSequence(AlgSequence("AthAlgSeq"), "subSequence1"), "Adding sub-sequence failed" - assert findSubSequence(AlgSequence("AthAlgSeq"), "subSequence2"), "Adding sub-sequence failed" + assert findSubSequence( AlgSequence("AthAlgSeq"), "subSequence1" ), "Adding sub-sequence failed" + assert findSubSequence( AlgSequence("AthAlgSeq"), "subSequence2" ), "Adding sub-sequence failed" acc.addSequence( seqAND("sub2Sequence1"), "subSequence1") + acc.addSequence( seqAND("sub3Sequence1"), "subSequence1") + acc.addSequence( seqAND("sub4Sequence1"), "subSequence1") assert findSubSequence(AlgSequence("AthAlgSeq"), "sub2Sequence1"), "Adding sub-sequence failed" - assert findSubSequence( findSubSequence(AlgSequence("AthAlgSeq"), "subSequence1"), "sub2Sequence1" ), "Adding sub-sequence doen in a wrong place" + assert findSubSequence( findSubSequence(AlgSequence("AthAlgSeq"), "subSequence1"), "sub2Sequence1" ), "Adding sub-sequence done in a wrong place" - acc.addConfig( AlgsConf4, dummyCfgFlags, sequence="subSequence1" ) - assert findAlgorithm(AlgSequence("AthAlgSeq"), "NestedAlgo1" ), "Algorithm added to nested seqeunce" + acc.addConfig( AlgsConf4, dummyCfgFlags, sequence="sub2Sequence1" ) + assert findAlgorithm(AlgSequence("AthAlgSeq"), "NestedAlgo1" ), "Algorithm added to nested sequence" assert findAlgorithm(AlgSequence("AthAlgSeq"), "NestedAlgo1", 1 ) == None, "Algorithm mistakenly in top sequence" - assert findAlgorithm( findSubSequence(AlgSequence("AthAlgSeq"), "subSequence1"), "NestedAlgo1", 1 ), "Algorithm not in right sequence" + assert findAlgorithm( findSubSequence(AlgSequence("AthAlgSeq"), "sub2Sequence1"), "NestedAlgo1", 1 ), "Algorithm not in right sequence" print( "Complex sequences construction also OK ") - - acc.printConfig(True) + + #acc.printConfig(True) acc.printConfig() # try recording acc.store(open("testFile.pkl", "w")) f = open("testFile.pkl") import pickle - u = pickle.load(f) + + # replicate HLT issue, it occured because the sequnces were recorded in the order of storing in the dict and thus the + # some of them (in this case hltSteps) did not have properties recorded + acc = ComponentAccumulator() + acc.addSequence( seqOR("hltTop") ) + acc.addConfig( AlgsConf2, dummyCfgFlags, sequence="hltTop" ) # some algo + acc.addSequence( seqAND("hltSteps"), sequence="hltTop" ) + acc.addSequence( parOR("hltStep_1"), sequence="hltSteps" ) + acc.addSequence( seqAND("L2CaloEgammaSeq"), "hltStep_1" ) + acc.addSequence( parOR("hltStep_2"), sequence="hltSteps" ) + acc.printConfig() + + acc.store(open("testFile2.pkl", "w")) + f = open("testFile2.pkl") + s = pickle.load(f) + f.close() + assert s['hltSteps']['Members'] != '[]', "Empty set of members in hltSteps, Sequences recording order metters" print( "\nAll OK" ) diff --git a/Control/AthenaConfiguration/share/ComponentAccumulatorTest.ref b/Control/AthenaConfiguration/share/ComponentAccumulatorTest.ref index 202219f7bd594b0a54bd35022309fb2284f28fd1..70f7395a805c4c92e52ef4f802ce75fec55ffadd 100644 --- a/Control/AthenaConfiguration/share/ComponentAccumulatorTest.ref +++ b/Control/AthenaConfiguration/share/ComponentAccumulatorTest.ref @@ -1,224 +1,29 @@ -ComponentAccumulator.py:addConfig INFO Excuting configuration function AlgsConf2 -ComponentAccumulator.py:addConfig INFO Excuting configuration function AlgsConf1 +ComponentAccumulator.py:addConfig INFO Executing configuration function AlgsConf2 +ComponentAccumulator.py:addConfig INFO Executing configuration function AlgsConf1 ComponentAccumulator.py:addEventAlgo DEBUG Adding Algo/Algo1 to sequence AthAlgSeq ComponentAccumulator.py:addEventAlgo DEBUG Adding Algo/Algo2 to sequence AthAlgSeq ComponentAccumulator.py:addEventAlgo DEBUG Adding Algo/Algo3 to sequence AthAlgSeq Simple Configuration construction OK -ComponentAccumulator.py:addConfig INFO Excuting configuration function AlgsConf4 -ComponentAccumulator.py:addConfig INFO Excuting configuration function AlgsConf3 -ComponentAccumulator.py:addEventAlgo DEBUG Adding Algo/NestedAlgo1 to sequence subSequence1 -ComponentAccumulator.py:addEventAlgo DEBUG Adding Algo/NestedAlgo2 to sequence subSequence1 +ComponentAccumulator.py:addConfig INFO Executing configuration function AlgsConf4 +ComponentAccumulator.py:addConfig INFO Executing configuration function AlgsConf3 +ComponentAccumulator.py:addEventAlgo DEBUG Adding Algo/NestedAlgo1 to sequence sub2Sequence1 +ComponentAccumulator.py:addEventAlgo DEBUG Adding Algo/NestedAlgo2 to sequence sub2Sequence1 Complex sequences construction also OK ComponentAccumulator.py:printConfig INFO Event Inputs ComponentAccumulator.py:printConfig INFO set([]) ComponentAccumulator.py:printConfig INFO Event Algorithm Sequences -ComponentAccumulator.py:printConfig INFO /***** Algorithm AthSequencer/AthAlgSeq ************************************************************ -|-Atomic = False -|-AuditAlgorithms = False -|-AuditBeginRun = False -|-AuditEndRun = False -|-AuditExecute = False -|-AuditFinalize = False -|-AuditInitialize = False -|-AuditReinitialize = False -|-AuditRestart = False -|-AuditStart = False -|-AuditStop = False -|-Cardinality = 1 -|-ContinueEventloopOnFPE = False -|-DetStore = ServiceHandle('StoreGateSvc/DetectorStore') -|-Enable = True -|-ErrorCounter = 0 -|-ErrorMax = 1 -|-EvtStore = ServiceHandle('StoreGateSvc') -|-ExtraInputs = [] (default: []) -|-ExtraOutputs = [] (default: []) -|-FilterCircularDependencies = True -|-IgnoreFilterPassed = False -|-IsIOBound = False -|-Members = ['Algo/Algo1', 'Algo/Algo2', 'Algo/Algo3', 'AthSequencer/subSequence1', 'AthSequencer/subSequence2'] -| (default: []) -|-ModeOR = False -|-MonitorService = 'MonitorSvc' -|-NeededResources = [] (default: []) -|-OutputLevel = 0 -|-RegisterForContextService = False -|-Sequential = False -|-StopOverride = False -|-TimeOut = 0.0 -|-Timeline = True -|=/***** Algorithm Algo/Algo1 ************************************************************************ -| |-AuditAlgorithms = 0 -| |-AuditBeginRun = 0 -| |-AuditEndRun = 0 -| |-AuditExecute = 0 -| |-AuditFinalize = 0 -| |-AuditInitialize = 0 -| |-AuditReinitialize = 0 -| |-Enable = 1 -| |-ErrorCounter = 0 -| |-ErrorMax = 1 -| |-OutputLevel = 0 -| \----- (End of Algorithm Algo/Algo1) --------------------------------------------------------------- -|=/***** Algorithm Algo/Algo2 ************************************************************************ -| |-AuditAlgorithms = 0 -| |-AuditBeginRun = 0 -| |-AuditEndRun = 0 -| |-AuditExecute = 0 -| |-AuditFinalize = 0 -| |-AuditInitialize = 0 -| |-AuditReinitialize = 0 -| |-Enable = 1 -| |-ErrorCounter = 0 -| |-ErrorMax = 1 -| |-OutputLevel = 0 -| \----- (End of Algorithm Algo/Algo2) --------------------------------------------------------------- -|=/***** Algorithm Algo/Algo3 ************************************************************************ -| |-AuditAlgorithms = 0 -| |-AuditBeginRun = 0 -| |-AuditEndRun = 0 -| |-AuditExecute = 0 -| |-AuditFinalize = 0 -| |-AuditInitialize = 0 -| |-AuditReinitialize = 0 -| |-Enable = 1 -| |-ErrorCounter = 0 -| |-ErrorMax = 1 -| |-OutputLevel = 0 -| \----- (End of Algorithm Algo/Algo3) --------------------------------------------------------------- -|=/***** Algorithm AthSequencer/subSequence1 ********************************************************* -| |-Atomic = False -| |-AuditAlgorithms = False -| |-AuditBeginRun = False -| |-AuditEndRun = False -| |-AuditExecute = False -| |-AuditFinalize = False -| |-AuditInitialize = False -| |-AuditReinitialize = False -| |-AuditRestart = False -| |-AuditStart = False -| |-AuditStop = False -| |-Cardinality = 1 -| |-ContinueEventloopOnFPE = False -| |-DetStore = ServiceHandle('StoreGateSvc/DetectorStore') -| |-Enable = True -| |-ErrorCounter = 0 -| |-ErrorMax = 1 -| |-EvtStore = ServiceHandle('StoreGateSvc') -| |-ExtraInputs = [] (default: []) -| |-ExtraOutputs = [] (default: []) -| |-FilterCircularDependencies = True -| |-IgnoreFilterPassed = False -| |-IsIOBound = False -| |-Members = ['AthSequencer/sub2Sequence1', 'Algo/NestedAlgo1', 'Algo/NestedAlgo2'] -| | (default: []) -| |-ModeOR = False (default: False) -| |-MonitorService = 'MonitorSvc' -| |-NeededResources = [] (default: []) -| |-OutputLevel = 0 -| |-RegisterForContextService = False -| |-Sequential = True (default: False) -| |-StopOverride = False (default: False) -| |-TimeOut = 0.0 -| |-Timeline = True -| |=/***** Algorithm AthSequencer/sub2Sequence1 ******************************************************** -| | |-Atomic = False -| | |-AuditAlgorithms = False -| | |-AuditBeginRun = False -| | |-AuditEndRun = False -| | |-AuditExecute = False -| | |-AuditFinalize = False -| | |-AuditInitialize = False -| | |-AuditReinitialize = False -| | |-AuditRestart = False -| | |-AuditStart = False -| | |-AuditStop = False -| | |-Cardinality = 1 -| | |-ContinueEventloopOnFPE = False -| | |-DetStore = ServiceHandle('StoreGateSvc/DetectorStore') -| | |-Enable = True -| | |-ErrorCounter = 0 -| | |-ErrorMax = 1 -| | |-EvtStore = ServiceHandle('StoreGateSvc') -| | |-ExtraInputs = [] (default: []) -| | |-ExtraOutputs = [] (default: []) -| | |-FilterCircularDependencies = True -| | |-IgnoreFilterPassed = False -| | |-IsIOBound = False -| | |-Members = [] (default: []) -| | |-ModeOR = False (default: False) -| | |-MonitorService = 'MonitorSvc' -| | |-NeededResources = [] (default: []) -| | |-OutputLevel = 0 -| | |-RegisterForContextService = False -| | |-Sequential = True (default: False) -| | |-StopOverride = False (default: False) -| | |-TimeOut = 0.0 -| | |-Timeline = True -| | \----- (End of Algorithm AthSequencer/sub2Sequence1) ----------------------------------------------- -| |=/***** Algorithm Algo/NestedAlgo1 ****************************************************************** -| | |-AuditAlgorithms = 0 -| | |-AuditBeginRun = 0 -| | |-AuditEndRun = 0 -| | |-AuditExecute = 0 -| | |-AuditFinalize = 0 -| | |-AuditInitialize = 0 -| | |-AuditReinitialize = 0 -| | |-Enable = 1 -| | |-ErrorCounter = 0 -| | |-ErrorMax = 1 -| | |-OutputLevel = 0 -| | \----- (End of Algorithm Algo/NestedAlgo1) --------------------------------------------------------- -| |=/***** Algorithm Algo/NestedAlgo2 ****************************************************************** -| | |-AuditAlgorithms = 0 -| | |-AuditBeginRun = 0 -| | |-AuditEndRun = 0 -| | |-AuditExecute = 0 -| | |-AuditFinalize = 0 -| | |-AuditInitialize = 0 -| | |-AuditReinitialize = 0 -| | |-Enable = 1 -| | |-ErrorCounter = 0 -| | |-ErrorMax = 1 -| | |-OutputLevel = 7 (default: 0) -| | \----- (End of Algorithm Algo/NestedAlgo2) --------------------------------------------------------- -| \----- (End of Algorithm AthSequencer/subSequence1) ------------------------------------------------ -|=/***** Algorithm AthSequencer/subSequence2 ********************************************************* -| |-Atomic = False -| |-AuditAlgorithms = False -| |-AuditBeginRun = False -| |-AuditEndRun = False -| |-AuditExecute = False -| |-AuditFinalize = False -| |-AuditInitialize = False -| |-AuditReinitialize = False -| |-AuditRestart = False -| |-AuditStart = False -| |-AuditStop = False -| |-Cardinality = 1 -| |-ContinueEventloopOnFPE = False -| |-DetStore = ServiceHandle('StoreGateSvc/DetectorStore') -| |-Enable = True -| |-ErrorCounter = 0 -| |-ErrorMax = 1 -| |-EvtStore = ServiceHandle('StoreGateSvc') -| |-ExtraInputs = [] (default: []) -| |-ExtraOutputs = [] (default: []) -| |-FilterCircularDependencies = True -| |-IgnoreFilterPassed = False -| |-IsIOBound = False -| |-Members = [] (default: []) -| |-ModeOR = True (default: False) -| |-MonitorService = 'MonitorSvc' -| |-NeededResources = [] (default: []) -| |-OutputLevel = 0 -| |-RegisterForContextService = False -| |-Sequential = False (default: False) -| |-StopOverride = True (default: False) -| |-TimeOut = 0.0 -| |-Timeline = True -| \----- (End of Algorithm AthSequencer/subSequence2) ------------------------------------------------ -\----- (End of Algorithm AthSequencer/AthAlgSeq) --------------------------------------------------- +ComponentAccumulator.py:printSeqAndAlgs INFO \__ AthAlgSeq (seq: PAR AND) +ComponentAccumulator.py:printSeqAndAlgs INFO \__ Algo1 (alg) +ComponentAccumulator.py:printSeqAndAlgs INFO \__ Algo2 (alg) +ComponentAccumulator.py:printSeqAndAlgs INFO \__ Algo3 (alg) +ComponentAccumulator.py:printSeqAndAlgs INFO \__ Nest (seq: SEQ AND) +ComponentAccumulator.py:printSeqAndAlgs INFO \__ subSequence1 (seq: SEQ AND) +ComponentAccumulator.py:printSeqAndAlgs INFO \__ sub2Sequence1 (seq: SEQ AND) +ComponentAccumulator.py:printSeqAndAlgs INFO \__ NestedAlgo1 (alg) +ComponentAccumulator.py:printSeqAndAlgs INFO \__ NestedAlgo2 (alg) +ComponentAccumulator.py:printSeqAndAlgs INFO \__ sub3Sequence1 (seq: SEQ AND) +ComponentAccumulator.py:printSeqAndAlgs INFO \__ sub4Sequence1 (seq: SEQ AND) +ComponentAccumulator.py:printSeqAndAlgs INFO \__ subSequence2 (seq: PAR OR) ComponentAccumulator.py:printConfig INFO Conditions Inputs ComponentAccumulator.py:printConfig INFO set([]) ComponentAccumulator.py:printConfig INFO Condition Algorithms @@ -227,6 +32,11 @@ ComponentAccumulator.py:printConfig INFO Services ComponentAccumulator.py:printConfig INFO [] ComponentAccumulator.py:printConfig INFO Outputs ComponentAccumulator.py:printConfig INFO {} +ComponentAccumulator.py:addConfig INFO Executing configuration function AlgsConf2 +ComponentAccumulator.py:addConfig INFO Executing configuration function AlgsConf1 +ComponentAccumulator.py:addEventAlgo DEBUG Adding Algo/Algo1 to sequence hltTop +ComponentAccumulator.py:addEventAlgo DEBUG Adding Algo/Algo2 to sequence hltTop +ComponentAccumulator.py:addEventAlgo DEBUG Adding Algo/Algo3 to sequence hltTop ComponentAccumulator.py:printConfig INFO Event Inputs ComponentAccumulator.py:printConfig INFO set([]) ComponentAccumulator.py:printConfig INFO Event Algorithm Sequences @@ -234,11 +44,22 @@ ComponentAccumulator.py:printSeqAndAlgs INFO \__ AthAlgSeq (seq: PAR AND) ComponentAccumulator.py:printSeqAndAlgs INFO \__ Algo1 (alg) ComponentAccumulator.py:printSeqAndAlgs INFO \__ Algo2 (alg) ComponentAccumulator.py:printSeqAndAlgs INFO \__ Algo3 (alg) -ComponentAccumulator.py:printSeqAndAlgs INFO \__ subSequence1 (seq: SEQ AND) -ComponentAccumulator.py:printSeqAndAlgs INFO \__ sub2Sequence1 (seq: SEQ AND) -ComponentAccumulator.py:printSeqAndAlgs INFO \__ NestedAlgo1 (alg) -ComponentAccumulator.py:printSeqAndAlgs INFO \__ NestedAlgo2 (alg) -ComponentAccumulator.py:printSeqAndAlgs INFO \__ subSequence2 (seq: PAR OR) +ComponentAccumulator.py:printSeqAndAlgs INFO \__ Nest (seq: SEQ AND) +ComponentAccumulator.py:printSeqAndAlgs INFO \__ subSequence1 (seq: SEQ AND) +ComponentAccumulator.py:printSeqAndAlgs INFO \__ sub2Sequence1 (seq: SEQ AND) +ComponentAccumulator.py:printSeqAndAlgs INFO \__ NestedAlgo1 (alg) +ComponentAccumulator.py:printSeqAndAlgs INFO \__ NestedAlgo2 (alg) +ComponentAccumulator.py:printSeqAndAlgs INFO \__ sub3Sequence1 (seq: SEQ AND) +ComponentAccumulator.py:printSeqAndAlgs INFO \__ sub4Sequence1 (seq: SEQ AND) +ComponentAccumulator.py:printSeqAndAlgs INFO \__ subSequence2 (seq: PAR OR) +ComponentAccumulator.py:printSeqAndAlgs INFO \__ hltTop (seq: SEQ OR) +ComponentAccumulator.py:printSeqAndAlgs INFO \__ Algo1 (alg) +ComponentAccumulator.py:printSeqAndAlgs INFO \__ Algo2 (alg) +ComponentAccumulator.py:printSeqAndAlgs INFO \__ Algo3 (alg) +ComponentAccumulator.py:printSeqAndAlgs INFO \__ hltSteps (seq: SEQ AND) +ComponentAccumulator.py:printSeqAndAlgs INFO \__ hltStep_1 (seq: PAR OR) +ComponentAccumulator.py:printSeqAndAlgs INFO \__ L2CaloEgammaSeq (seq: SEQ AND) +ComponentAccumulator.py:printSeqAndAlgs INFO \__ hltStep_2 (seq: PAR OR) ComponentAccumulator.py:printConfig INFO Conditions Inputs ComponentAccumulator.py:printConfig INFO set([]) ComponentAccumulator.py:printConfig INFO Condition Algorithms diff --git a/Trigger/TrigAlgorithms/TrigT2CaloEgamma/src/T2CaloEgammaFastAlgo.cxx b/Trigger/TrigAlgorithms/TrigT2CaloEgamma/src/T2CaloEgammaFastAlgo.cxx index d65a5b8f3874c42271c7fa7256594010aaebde8f..acca7c561aa76c675016f2b5544d59a967cfe7b4 100755 --- a/Trigger/TrigAlgorithms/TrigT2CaloEgamma/src/T2CaloEgammaFastAlgo.cxx +++ b/Trigger/TrigAlgorithms/TrigT2CaloEgamma/src/T2CaloEgammaFastAlgo.cxx @@ -68,6 +68,8 @@ StatusCode T2CaloEgammaFastAlgo::initialize() ATH_CHECK( m_regionSelector.retrieve()); ATH_CHECK( m_clusterContainerKey.initialize() ); ATH_CHECK( m_roiCollectionKey.initialize() ); + CHECK( m_calibsBarrel.retrieve() ); + CHECK( m_calibsEndcap.retrieve() ); ATH_MSG_DEBUG( "Initialize done !" ); return StatusCode::SUCCESS; } @@ -92,7 +94,10 @@ StatusCode T2CaloEgammaFastAlgo::execute() ATH_MSG_INFO( name() << " running with store " << getContext().getExtension<Atlas::ExtendedEventContext>()->proxy()->name() ); auto roisHandle = SG::makeHandle( m_roiCollectionKey ); + CHECK( roisHandle.isValid() ); ATH_MSG_DEBUG( "Made handle " << m_roiCollectionKey ); + + const TrigRoiDescriptorCollection* roiCollection = roisHandle.cptr(); // ATH_CHECK(m_roiCollectionKey.isValid()); diff --git a/Trigger/TrigValidation/TrigUpgradeTest/python/EgammaCaloMod.py b/Trigger/TrigValidation/TrigUpgradeTest/python/EgammaCaloMod.py index 9bba4de26b78dfe15f92f74aca10719d4f25f193..492c405e98cc77075bea453b1d73a802c9c6b46c 100644 --- a/Trigger/TrigValidation/TrigUpgradeTest/python/EgammaCaloMod.py +++ b/Trigger/TrigValidation/TrigUpgradeTest/python/EgammaCaloMod.py @@ -1,8 +1,164 @@ +# +# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# + from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator -from AthenaCommon.CFElements import parOR, seqOR, seqAND -from TrigT2CaloEgamma.TrigT2CaloEgammaConfig import * + + +def CaloLUMIBCIDTool( flags, name='CaloLumiBCIDToolDefault' ): + acc = ComponentAccumulator() + from CaloTools.CaloToolsConf import CaloLumiBCIDTool + from IOVDbSvc.IOVDbSvcConfig import addFolders + + if flags.get('global.isMC') == False: + from LumiBlockComps.LuminosityToolDefault import LuminosityToolDefault + theLumiTool = LuminosityToolDefault() + acc.addPublicTool( theLumiTool ) + + + if flags.get('global.isOnline'): + acc.addConfig(addFolders, flags, ['/LAR/LArPileup/LArPileupShape<key>LArShape32</key>', + '/LAR/LArPileup/LArPileupAverage'], 'LAR_ONL') + else: + acc.addConfig( addFolders, flags, ['/LAR/ElecCalibOfl/LArPileupShape<key>LArShape32</key>', + '/LAR/ElecCalibOfl/LArPileupAverage'], 'LAR_OFL') + theTool = CaloLumiBCIDTool(name, + isMC=False, + LumiTool=theLumiTool, keyShape='LArShape32') + + else: + from LArRecUtils.LArOFCToolDefault import LArOFCToolDefault + theOFCTool = LArOFCToolDefault() + + acc.addPublicTool( theOFCTool ) + from TrigBunchCrossingTool.BunchCrossingTool import BunchCrossingTool + theBunchCrossingTool = BunchCrossingTool() + + acc.addConfig( addFolders, flags, ['/LAR/ElecCalibMC/Shape', + '/LAR/ElecCalibMC/LArPileupAverage'], 'LAR_OFL') + theTool = CaloLumiBCIDTool(name, + isMC=True, + LArOFCTool = theOFCTool, BunchCrossingTool = theBunchCrossingTool) + acc.addPublicTool( theTool ) + + return acc + +def TileCond( flags ): + from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator + acc = ComponentAccumulator() + + from TileConditions.TileConditionsConf import TileCondToolEmscale + tool = TileCondToolEmscale() + tool.OnlCacheUnit = 'OnlineMegaElectronVolts' + # from TileConditions.TileConditionsConf import TileCondProxyFile_TileCalibDrawerFlt_ as TileCondProxyFileFlt + # from TileConditions.TileConditionsConf import TileCondProxyFile_TileCalibDrawerBch_ as TileCondProxyFileBch + from TileConditions.TileConditionsConf import TileCondProxyCool_TileCalibDrawerFlt_ as TileCondProxyCoolFlt + from TileConditions.TileConditionsConf import TileCondProxyCool_TileCalibDrawerBch_ as TileCondProxyCoolBch + # from TileConditions.TileConditionsConf import TileCondProxyCool_TileCalibDrawerOfc_ as TileCondProxyCoolOfc + + from IOVDbSvc.IOVDbSvcConfig import addFolders + def __addFolder(f): + acc.addConfig( addFolders, flags, '%s <key>%s</key>' %(f,f), 'TILE_OFL' if '/OFL' in f else 'TILE_ONL') + + tool.ProxyOflCes = acc.addAlgTool( TileCondProxyCoolFlt('TileCondProxyCool_OflCes', Source = '/TILE/OFL02/CALIB/CES') ) + tool.ProxyOflCisLin = acc.addAlgTool( TileCondProxyCoolFlt('TileCondProxyCool_OflCisLin', Source = '/TILE/OFL02/CALIB/CIS/LIN') ) + tool.ProxyOflCisNln = acc.addAlgTool( TileCondProxyCoolFlt('TileCondProxyCool_OflCisNln', Source = '/TILE/OFL02/CALIB/CIS/NLN') ) + tool.ProxyOflEms = acc.addAlgTool( TileCondProxyCoolFlt('TileCondProxyCool_OflEms', Source = '/TILE/OFL02/CALIB/EMS') ) + tool.ProxyOflLasFib = acc.addAlgTool( TileCondProxyCoolFlt('TileCondProxyCool_OflLasFib', Source = '/TILE/OFL02/CALIB/LAS/FIBER') ) + tool.ProxyOflLasLin = acc.addAlgTool( TileCondProxyCoolFlt('TileCondProxyCool_OflLasLin', Source = '/TILE/OFL02/CALIB/LAS/LIN') ) + tool.ProxyOflLasNln = acc.addAlgTool( TileCondProxyCoolFlt('TileCondProxyCool_OflLasNln', Source = '/TILE/OFL02/CALIB/LAS/NLN') ) + tool.ProxyOnlCes = acc.addAlgTool( TileCondProxyCoolFlt('TileCondProxyCool_OnlCes', Source = '/TILE/ONL01/CALIB/CES') ) + tool.ProxyOnlCis = acc.addAlgTool( TileCondProxyCoolFlt('TileCondProxyCool_OnlCis', Source = '/TILE/ONL01/CALIB/CIS/LIN') ) + tool.ProxyOnlEms = acc.addAlgTool( TileCondProxyCoolFlt('TileCondProxyCool_OnlEms', Source = '/TILE/ONL01/CALIB/EMS') ) + tool.ProxyOnlLas = acc.addAlgTool( TileCondProxyCoolFlt('TileCondProxyCool_OnlLas', Source = '/TILE/ONL01/CALIB/LAS/LIN') ) + + __addFolder( '/TILE/OFL02/CALIB/CES') + __addFolder( '/TILE/OFL02/CALIB/CIS/LIN') + __addFolder( '/TILE/OFL02/CALIB/CIS/NLN') + __addFolder( '/TILE/OFL02/CALIB/EMS') + __addFolder( '/TILE/OFL02/CALIB/LAS/FIBER') + __addFolder( '/TILE/OFL02/CALIB/LAS/LIN') + __addFolder( '/TILE/OFL02/CALIB/LAS/NLN') + __addFolder( '/TILE/ONL01/CALIB/CES') + __addFolder( '/TILE/ONL01/CALIB/CIS/LIN') + __addFolder( '/TILE/ONL01/CALIB/EMS') + __addFolder( '/TILE/ONL01/CALIB/LAS/LIN') + acc.addPublicTool( tool ) + + from TileConditions.TileConditionsConf import TileCondToolNoiseSample + noiseSampleTool = TileCondToolNoiseSample() + noiseSampleTool.ProxyNoiseSample = TileCondProxyCoolFlt( 'TileCondProxyCool_NoiseSample', Source = '/TILE/OFL02/NOISE/SAMPLE' ) + noiseSampleTool.ProxyOnlineNoiseSample = TileCondProxyCoolFlt( 'TileCondProxyCool_OnlineNoiseSample', Source = '/TILE/ONL01/NOISE/SAMPLE' ) + __addFolder( '/TILE/OFL02/NOISE/SAMPLE' ) + __addFolder( '/TILE/ONL01/NOISE/SAMPLE' ) + acc.addPublicTool( noiseSampleTool ) + + from TileConditions.TileConditionsConf import TileCondToolTiming + timingTool = TileCondToolTiming() + timingTool.ProxyAdcOffset = TileCondProxyCoolFlt('TileCondProxyCool_AdcOffset', Source = '/TILE/OFL02/TIME/CHANNELOFFSET/PHY' ) + __addFolder( '/TILE/OFL02/TIME/CHANNELOFFSET/PHY' ) + acc.addPublicTool( timingTool ) + + + from TileConditions.TileConditionsConf import TileBadChanTool + badChanTool = TileBadChanTool() + badChanTool.ProxyOflBch = TileCondProxyCoolBch('TileCondProxyCool_OflBch', Source = '/TILE/OFL02/STATUS/ADC' ) + badChanTool.ProxyOnlBch = TileCondProxyCoolBch('TileCondProxyCool_OnlBch', Source = '/TILE/ONL01/STATUS/ADC' ) + __addFolder( '/TILE/OFL02/STATUS/ADC' ) + __addFolder( '/TILE/ONL01/STATUS/ADC' ) + acc.addPublicTool( badChanTool ) + + acc.addConfig( addFolders, flags, ['/LAR/BadChannelsOfl/BadChannels <key>/LAR/BadChannels/BadChannels</key>', + '/LAR/BadChannelsOfl/MissingFEBs<key>/LAR/BadChannels/MissingFEBs</key>'], 'LAR_OFL') + + + + from TileConditions.TileConditionsConf import TileInfoLoader, TileCablingSvc + infoLoaderSvc = TileInfoLoader() + infoLoaderSvc.NoiseScaleIndex= 2 + acc.addService( infoLoaderSvc ) +# acc.addToAppProperty('CreateSvc', [infoLoaderSvc.getFullName()] ) + + + + + cabligSvc = TileCablingSvc() + cabligSvc.CablingType = 4 + acc.addService( cabligSvc ) + + return acc + +def TrigCaloDataAccessConfig(flags): + from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator + from IOVDbSvc.IOVDbSvcConfig import addFolders + acc = ComponentAccumulator() + acc.addConfig(CaloLUMIBCIDTool, flags) + from TrigT2CaloCommon.TrigT2CaloCommonConf import TrigDataAccess + da = TrigDataAccess() + # ??? so we do not need the tools (quick hack) + da.ApplyOffsetCorrection = False + + # ??? does not realy belong here + acc.addConfig( addFolders, flags, ['/LAR/Identifier/OnOffIdMap', '/LAR/Identifier/CalibIdMap', + '/LAR/Identifier/LArTTCellMapAtlas'], 'LAR') + + acc.addConfig( addFolders, flags, ['/CALO/Identifier/CaloTTOnOffIdMapAtlas', '/CALO/Identifier/CaloTTOnAttrIdMapAtlas', + '/CALO/Identifier/CaloTTPpmRxIdMapAtlas'], 'CALO') + # ??? should be moved to tile domain + + acc.addConfig( TileCond, flags ) + + acc.addPublicTool( da ) + + # configure trigger tools + return acc + def EgammaCaloMod( flags ): + from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator + from AthenaCommon.CFElements import parOR, seqOR, seqAND + from TrigT2CaloEgamma.TrigT2CaloEgammaConfig import * + from AthenaCommon.Constants import DEBUG acc = ComponentAccumulator() @@ -11,79 +167,139 @@ def EgammaCaloMod( flags ): from TileGeoModel.TileGMConfig import TileGMCfg acc.addConfig( LArGMCfg, flags ) acc.addConfig( TileGMCfg, flags ) + acc.getService('GeoModelSvc').DetectorTools['TileDetectorTool'].GeometryConfig = 'RECO' + + # ??? likely should be elsewhere + from IOVDbSvc.IOVDbSvcConfig import addFolders + acc.addConfig( addFolders, flags, ['/LAR/Identifier/FebRodMap'], 'LAR' ) + + acc.addConfig( TrigCaloDataAccessConfig, flags ) + # setup algorithms - acc.addSequence( seqAND("L2CaloEgamma") ) + acc.addSequence( seqAND('L2CaloEgamma') ) from DecisionHandling.DecisionHandlingConf import RoRSeqFilter - filterL1RoIsAlg = RoRSeqFilter("filterL1RoIsAlg") - filterL1RoIsAlg.Input = ["EMRoIDecisions"] - filterL1RoIsAlg.Output = ["FilteredEMRoIDecisions"] + filterL1RoIsAlg = RoRSeqFilter('filterL1RoIsAlg') + filterL1RoIsAlg.Input = ['EMRoIDecisions'] + filterL1RoIsAlg.Output = ['FilteredEMRoIDecisions'] from TrigUpgradeTest.TestUtils import MenuTest - filterL1RoIsAlg.Chains = [ m.split(":")[1].strip() for m in MenuTest.EMThresholdToChainMapping ] + filterL1RoIsAlg.Chains = [ m.split(':')[1].strip() for m in MenuTest.EMThresholdToChainMapping ] filterL1RoIsAlg.OutputLevel = DEBUG - acc.addEventAlgo( filterL1RoIsAlg, "L2CaloEgamma" ) - inViewAlgsSeqName = "fastCaloInViewAlgs" + acc.addEventAlgo( filterL1RoIsAlg, sequence='L2CaloEgamma' ) + inViewAlgsSeqName = 'fastCaloInViewAlgs' - from ViewAlgs.ViewAlgsConf import EventViewCreatorAlgorithm + from ViewAlgs.ViewAlgsConf import TestEventViewCreatorAlgorithm from AthenaCommon.Constants import DEBUG - fastCaloViewsMaker = EventViewCreatorAlgorithm("fastCaloViewsMaker", OutputLevel=DEBUG) + fastCaloViewsMaker = TestEventViewCreatorAlgorithm('fastCaloViewsMaker', OutputLevel=DEBUG) fastCaloViewsMaker.ViewFallThrough = True - fastCaloViewsMaker.Decisions = "FilteredEMRoIDecisions" # from EMRoIsUnpackingTool - fastCaloViewsMaker.RoIsLink = "initialRoI" # -||- - fastCaloViewsMaker.InViewRoIs = "EMCaloRoIs" # contract with the fastCalo - fastCaloViewsMaker.Views = "EMCaloViews" + fastCaloViewsMaker.InputMakerInputDecisions = ['FilteredEMRoIDecisions'] # from EMRoIsUnpackingTool + fastCaloViewsMaker.RoIsLink = 'initialRoI' # -||- + fastCaloViewsMaker.InViewRoIs = 'EMCaloRoIs' # contract with the fastCalo + fastCaloViewsMaker.Views = 'EMCaloViews' + fastCaloViewsMaker.InputMakerOutputDecisions = [ 'L2CaloLinks'] fastCaloViewsMaker.ViewNodeName = inViewAlgsSeqName - acc.addEventAlgo( fastCaloViewsMaker, "L2CaloEgamma" ) + acc.addEventAlgo( fastCaloViewsMaker, sequence='L2CaloEgamma' ) + + from TrigT2CaloEgamma.TrigT2CaloEgammaConfig import RingerFexConfig + ringer = RingerFexConfig('RingsMaker') + ringer.RingsKey='CaloRings' + from TrigT2CaloEgamma.TrigT2CaloEgammaConfig import EgammaEmEnFexNoTimerConfig, EgammaHadEnFexNoTimerConfig, EgammaSamp1FexNoTimerConfig, EgammaSamp2FexNoTimerConfig, RingerFexConfig - acc.addSequence( seqAND( inViewAlgsSeqName ), "L2CaloEgamma" ) + samp2 = EgammaSamp2FexNoTimerConfig(name='FaAlgoSamp2FexConfig') + acc.addPublicTool( samp2 ) + samp1 = EgammaSamp1FexNoTimerConfig('FaAlgoSamp1FexConfig') + acc.addPublicTool( samp1 ) + + sampe = EgammaEmEnFexNoTimerConfig('FaAlgoEmEnFexConfig') + acc.addPublicTool( sampe ) + + samph = EgammaHadEnFexNoTimerConfig('FaAlgoHadEnFexConfig') + acc.addPublicTool( samph ) + + ring = RingerFexConfig('RingsMaker') + ring.OutputLevel=DEBUG + ring.RingsKey='CaloRings' + acc.addPublicTool( ring ) + + __fex_tools = [ samp2, samp1, sampe, samph, ring ] + + acc.addSequence( seqAND( inViewAlgsSeqName ), sequence='L2CaloEgamma' ) + from TrigT2CaloEgamma.TrigT2CaloEgammaConf import T2CaloEgammaFastAlgo - fastCalo = T2CaloEgammaFastAlgo( "FastCaloAlgo" ) - fastCalo.OutputLevel=DEBUG - fastCalo.ClustersName="L2CaloClusters" - fastCalo.RoIs="EMCaloRoIs" - fastCalo.EtaWidth = 0.2 - fastCalo.PhiWidth = 0.2 - # will be replace by the service, which shoudl drive its confing via flags + fastCalo = T2CaloEgammaFastAlgo( 'FastCaloAlgo' ) + fastCalo.OutputLevel = DEBUG + fastCalo.ClustersName = 'L2CaloClusters' + fastCalo.RoIs = 'EMCaloRoIs' + fastCalo.EtaWidth = 0.2 + fastCalo.PhiWidth = 0.2 + # will be replace by the service, which should drive its confing via flags # i.e. sth along this line acc.addConfig( TrigCaloDataAccessSvc, flags ) # for the moment this is done by hand here from TrigT2CaloCommon.TrigT2CaloCommonConf import TrigDataAccess - accessTool = TrigDataAccess() - accessTool.ApplyOffsetCorrection=False + accessTool = TrigDataAccess() + accessTool.ApplyOffsetCorrection = False + acc.addAlgTool( accessTool ) - # the tools should becone private at some point - ringer = RingerFexConfig("RingsMaker") - ringer.RingsKey="CaloRings" - tools = [ EgammaSamp2FexNoTimerConfig("FaAlgoSamp2FexConfig"), - EgammaSamp1FexNoTimerConfig("FaAlgoSamp1FexConfig"), - EgammaEmEnFexNoTimerConfig("FaAlgoEmEnFexConfig"), - EgammaHadEnFexNoTimerConfig("FaAlgoHadEnFexConfig"), - ringer ] - [ acc.addPublicTool( t ) for t in tools ] - fastCalo.IAlgToolList = tools #[t.getFullName() for t in tools ] + fastCalo.IAlgToolList = __fex_tools + from TrigT2CaloCalibration.EgammaCalibrationConfig import EgammaHitsCalibrationBarrelConfig, EgammaHitsCalibrationEndcapConfig, EgammaGapCalibrationConfig + from TrigT2CaloCalibration.EgammaCalibrationConfig import EgammaTransitionRegionsConfig + + from TrigT2CaloCalibration.EgammaCalibrationConfig import EgammaSshapeCalibrationBarrelConfig, EgammaSshapeCalibrationEndcapConfig + from TrigT2CaloEgamma.TrigT2CaloEgammaMonitoring import TrigT2CaloEgammaValMonitoring, TrigT2CaloEgammaCosmicMonitoring, TrigT2CaloEgammaOnMonitoring, TrigT2CaloEgammaSwValMonitoring, TrigT2CaloEgammaSwOnMonitoring, TrigT2CaloEgammaSwCosMonitoring, TrigT2CaloEgammaTimeMonitoring, TrigT2CaloEgammaAllTimeMonitoring, TrigT2CaloEgammaRingerTimeMonitoring + + __sshape = EgammaSshapeCalibrationBarrelConfig() + __hits = EgammaHitsCalibrationBarrelConfig() + __gap = EgammaGapCalibrationConfig() + __transition = EgammaTransitionRegionsConfig() + __barrelTools = [ __sshape, __hits, __gap, __transition ] + + fastCalo.CalibListBarrel = __barrelTools + [ acc.addAlgTool( t ) for t in __barrelTools ] - fastCalo.CalibListBarrel=[ EgammaSshapeCalibrationBarrelConfig(), - EgammaHitsCalibrationBarrelConfig(), - EgammaGapCalibrationConfig(), - EgammaTransitionRegionsConfig() ] + __endcapTools = [ EgammaSshapeCalibrationEndcapConfig(), + EgammaHitsCalibrationEndcapConfig(), + EgammaGapCalibrationConfig() ] + [ acc.addAlgTool( t ) for t in __endcapTools ] + fastCalo.CalibListEndcap= __endcapTools + + acc.addEventAlgo( fastCalo, sequence=inViewAlgsSeqName ) - fastCalo.CalibListEndcap=[ EgammaSshapeCalibrationEndcapConfig(), - EgammaHitsCalibrationEndcapConfig(), - EgammaGapCalibrationConfig() ] + from TrigEgammaHypo.TrigEgammaHypoConf import TrigL2CaloHypoAlgMT + hypo = TrigL2CaloHypoAlgMT( 'L2CaloHypo' ) + hypo.HypoInputDecisions = fastCaloViewsMaker.InputMakerOutputDecisions[0] + hypo.CaloClusters = 'L2CaloClusters' + hypo.HypoOutputDecisions = 'EgammaCaloDecisions' + + # Here the menu needs to be used. + # The other option is to do it later when all sequences are setup, + # but that would mean relying on HypoAlg names that will need to be searched for + # For now ... a hack + chains = ["HLT_e3_etcut", + "HLT_e5_etcut", + "HLT_2e3_etcut", + "HLT_e3e5_etcut", + "HLT_e3e5_etcut", + "HLT_g5_etcut", + "HLT_e7_etcut"] + + from TrigEgammaHypo.TrigL2CaloHypoTool import TrigL2CaloHypoToolFromName + hypo.HypoTools = [ TrigL2CaloHypoToolFromName( c ) for c in chains ] + acc.addEventAlgo( hypo, sequence = 'L2CaloEgamma' ) - acc.addEventAlgo( fastCalo, inViewAlgsSeqName ) return acc -if __name__ == "__main__": - from AthenaConfiguration.ConfigFlags import ConfigFlagContainer - flags = ConfigFlagContainer() - acc = EgammaCaloMod( flags ) +if __name__ == '__main__': + from AthenaConfiguration.AllConfigFlags import ConfigFlags + ConfigFlags.lock() + + acc = EgammaCaloMod( ConfigFlags ) acc.printConfig() - print "All ok" + print 'All ok' diff --git a/Trigger/TrigValidation/TrigUpgradeTest/python/RegSelConfig.py b/Trigger/TrigValidation/TrigUpgradeTest/python/RegSelConfig.py new file mode 100644 index 0000000000000000000000000000000000000000..094702bc5dc9f58e799c098242c4f060cbcf81d3 --- /dev/null +++ b/Trigger/TrigValidation/TrigUpgradeTest/python/RegSelConfig.py @@ -0,0 +1,49 @@ +# +# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# + + + +def RegSelConfig( flags ): + from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator + from RegionSelector.RegionSelectorConf import RegSelSvc + from AthenaCommon.SystemOfUnits import mm + acc = ComponentAccumulator() + + regSel = RegSelSvc() + regSel.DeltaZ = 225 * mm + + # there will be ifology here enabling only the configured detectors + from LArRegionSelector.LArRegionSelectorConf import LArRegionSelectorTable + larTable = LArRegionSelectorTable(name="LArRegionSelectorTable") + acc.addPublicTool( larTable ) + regSel.LArRegionSelectorTable = larTable + + + from TileRawUtils.TileRawUtilsConf import TileRegionSelectorTable + tileTable = TileRegionSelectorTable(name="TileRegionSelectorTable") + acc.addPublicTool( tileTable ) + # ??? that is puzzle, the RegSelSvc seems not to ahev such a property + # while it is set in:RegSelSvcDefault.py + #regSel.TileRegionSelectorTable = tileTable + + regSel.enableCalo = True + + acc.addService( regSel ) + return acc + + +if __name__ == "__main__": + from AthenaConfiguration.AllConfigFlags import ConfigFlags + + ConfigFlags.lock() + + from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator + acc = ComponentAccumulator() + + + acc.addConfig( RegSelConfig, ConfigFlags ) + + f=open('RegSelConfig.pkl','w') + acc.store(f) + f.close() diff --git a/Trigger/TrigValidation/TrigUpgradeTest/python/TestUtils.py b/Trigger/TrigValidation/TrigUpgradeTest/python/TestUtils.py index 629452dee3ce8c9ce2f97b4bc4477283b6db46dc..e1c4b6edd257082177d0e8dbb0166048b00923c9 100644 --- a/Trigger/TrigValidation/TrigUpgradeTest/python/TestUtils.py +++ b/Trigger/TrigValidation/TrigUpgradeTest/python/TestUtils.py @@ -68,7 +68,7 @@ class L1DecoderTest(L1Decoder) : ctpUnpacker = CTPUnpackingTool(OutputLevel = self.OutputLevel, ForceEnableAllChains = True) - ctpUnpacker.MonTool = CTPUnpackingMonitoring(512, 200) + #ctpUnpacker.MonTool = CTPUnpackingMonitoring(512, 200) # Hard-coded CTP IDs from v7 menu ctpUnpacker.CTPToChainMapping = MenuTest.CTPToChainMapping self.ctpUnpacker = ctpUnpacker diff --git a/Trigger/TrigValidation/TrigUpgradeTest/python/TriggerHistSvcConfig.py b/Trigger/TrigValidation/TrigUpgradeTest/python/TriggerHistSvcConfig.py new file mode 100644 index 0000000000000000000000000000000000000000..8e2e9daadd33672001521c5b63b00c4cd4e97e9d --- /dev/null +++ b/Trigger/TrigValidation/TrigUpgradeTest/python/TriggerHistSvcConfig.py @@ -0,0 +1,16 @@ +# +# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +# + +def TriggerHistSvcConfig(flags): + from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator + acc = ComponentAccumulator() + from GaudiSvc.GaudiSvcConf import THistSvc + histSvc = THistSvc() + histSvc.Output = ["SHIFT DATAFILE='shift-monitoring.root' OPT='RECREATE'", + "EXPERT DATAFILE='expert-monitoring.root' OPT='RECREATE'", + "run_1 DATAFILE='lbn-monitoring.root' OPT='RECREATE'", + "RUNSTAT DATAFILE='runstat-monitoring.root' OPT='RECREATE'", + "DEBUG DATAFILE='debug-monitoring.root' OPT='RECREATE'"] + acc.addService( histSvc ) + return acc diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/newJOtest.py b/Trigger/TrigValidation/TrigUpgradeTest/share/newJOtest.py index fb02663d35c974a855fd7864802a6856d685f162..45a997061fa4308f98ddf50a58dc63d9b6bc7b99 100644 --- a/Trigger/TrigValidation/TrigUpgradeTest/share/newJOtest.py +++ b/Trigger/TrigValidation/TrigUpgradeTest/share/newJOtest.py @@ -21,22 +21,41 @@ flags.set( "Trigger.inputLVL1ConfigFile", "LVL1config_Physics_pp_v7.xml" ) flags.set( "Trigger.L1Decoder.doMuon", True ) flags.lock() - +from AthenaCommon.Constants import INFO,DEBUG acc = ComponentAccumulator() -from ByteStreamCnvSvc.ByteStreamConfig import TrigBSReadCfg -acc.addConfig( TrigBSReadCfg, flags ) -from AtlasGeoModel.GeoModelConfig import GeoModelCfg -acc.addConfig( GeoModelCfg, flags ) +# make sure we run the right scheduler +# need to move elsewhere +nThreads=1 +from StoreGate.StoreGateConf import SG__HiveMgrSvc +eventDataSvc = SG__HiveMgrSvc("EventDataSvc") +eventDataSvc.NSlots = nThreads +eventDataSvc.OutputLevel = DEBUG +acc.addService( eventDataSvc ) +from SGComps.SGCompsConf import SGInputLoader +inputLoader = SGInputLoader(DetStore = 'StoreGateSvc/DetectorStore', + EvtStore = 'StoreGateSvc', + ExtraInputs = [], + ExtraOutputs = [], + FailIfNoProxy = False, + Load = [], + NeededResources = []) +acc.addEventAlgo( inputLoader, sequence='AthAlgSeq' ) -# that is how the L1 decoder can be added but it needs more work to bring all needed services (i.e. muon rois decoding) -acc.addSequence( seqOR( "hltTop") ) +from ByteStreamCnvSvc.ByteStreamConfig import TrigBSReadCfg +acc.addConfig( TrigBSReadCfg, flags ) +from AtlasGeoModel.GeoModelConfig import GeoModelCfg +acc.addConfig( GeoModelCfg, flags ) + +from TrigUpgradeTest.TriggerHistSvcConfig import TriggerHistSvcConfig +acc.addConfig( TriggerHistSvcConfig, flags ) +acc.addSequence( seqOR( "hltTop") ) from L1Decoder.L1DecoderConfig import L1DecoderCfg acc.addConfig( L1DecoderCfg, flags, sequence="hltTop" ) @@ -44,7 +63,6 @@ l1 = acc.getEventAlgo( "L1Decoder" ) from TrigUpgradeTest.TestUtils import applyMenu applyMenu( l1 ) - from EventInfoMgt.EventInfoMgtConf import TagInfoMgr tagInfoMgr = TagInfoMgr() tagInfoMgr.ExtraTagValuePairs = ['AtlasRelease', 'Athena-22.0.1'] # this has to come from somewhere else @@ -61,7 +79,17 @@ athenaPoolSvcSvc.PoolAttributes = ["DEFAULT_SPLITLEVEL ='0'", "STREAM_MEMBER_WIS acc.addService( athenaPoolSvcSvc ) acc.getService("EventPersistencySvc").CnvServices += [ athenaPoolSvcSvc.getName() ] +acc.addSequence( seqAND("hltSteps"), sequence="hltTop" ) +acc.addSequence( parOR("hltStep_1"), sequence="hltSteps" ) +acc.addSequence( parOR("hltStep_2"), sequence="hltSteps" ) +# setup algorithm sequences here, need few additional components +from TrigUpgradeTest.RegSelConfig import RegSelConfig +acc.addConfig( RegSelConfig, flags ) + + +from TrigUpgradeTest.EgammaCaloMod import EgammaCaloMod +acc.addConfig( EgammaCaloMod, flags, sequence="hltStep_1" ) # adding calo requires more infrastructure than we actually have #from TrigUpgradeTest.EgammaCaloMod import EgammaCaloMod @@ -74,3 +102,5 @@ print "Storing config in the config", fname with file(fname, "w") as p: acc.store( p ) p.close() + + diff --git a/Trigger/TrigValidation/TrigUpgradeTest/test/test_egamma_run_data.sh b/Trigger/TrigValidation/TrigUpgradeTest/test/test_egamma_run_data.sh index 6e115cb0bc39c8a2a11ae2440812a1492d7a3ecc..22ba9893239b7d60ecd25c950a7309e9d9f9a1d4 100755 --- a/Trigger/TrigValidation/TrigUpgradeTest/test/test_egamma_run_data.sh +++ b/Trigger/TrigValidation/TrigUpgradeTest/test/test_egamma_run_data.sh @@ -2,4 +2,4 @@ # art-type: build # art-ci: master -athena --threads=1 --evtMax=10 --filesInput="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data17_13TeV.00327265.physics_EnhancedBias.merge.RAW._lb0100._SFO-1._0001.1" TrigUpgradeTest/egamma.withViews.py +athena --dump-config=CONF.txt --threads=1 --evtMax=10 --filesInput="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data17_13TeV.00327265.physics_EnhancedBias.merge.RAW._lb0100._SFO-1._0001.1" TrigUpgradeTest/egamma.withViews.py diff --git a/Trigger/TrigValidation/TrigUpgradeTest/test/test_newJO.sh b/Trigger/TrigValidation/TrigUpgradeTest/test/test_newJO.sh index 66bf810ba1caa548c9f645a7a7768129af070540..230fceffbe3c1ca2e88d14b51eb1c64499e1af10 100755 --- a/Trigger/TrigValidation/TrigUpgradeTest/test/test_newJO.sh +++ b/Trigger/TrigValidation/TrigUpgradeTest/test/test_newJO.sh @@ -1,7 +1,19 @@ #!/bin/sh # art-type: build # art-ci: master -rm -rf newJOtest.py +rm -rf newJOtest.py bootstrap.pkl bootstrap.py + +# this is a hack to pre-confgure scheduler and other MT services, +#will be taken away once NEW system has better means to influence the bootstrap content +cat <<EOF >> bootstrap.py +from AthenaCommon.AppMgr import theApp, ServiceMgr as svcMgr +svcMgr.AvalancheSchedulerSvc.ShowControlFlow=True +svcMgr.AvalancheSchedulerSvc.ShowDataDependencies=True +EOF + +athena --threads=1 --config-only=bootstrap.pkl bootstrap.py + + get_files -jo TrigUpgradeTest/newJOtest.py python newJOtest.py # generate pickle status=$? @@ -13,5 +25,5 @@ else echo echo "JOs reading stage finished, launching Athena from pickle file" echo - athena --evtMax=20 --threads=1 newJOtest.pkl + athena --evtMax=20 newJOtest.pkl fi \ No newline at end of file