def setDefaults(self, handle): from TriggerJobOpts.TriggerFlags import TriggerFlags handle.DoCalo = TriggerFlags.doCalo() handle.DoMuon = TriggerFlags.doMuon() handle.DoBCM = TriggerFlags.doBcm() handle.DoLUCID = TriggerFlags.doLucid() handle.DoZDC = TriggerFlags.doZdc()
def configure(self): log = logging.getLogger("Lvl1SimulationGetter") from AthenaCommon.AppMgr import ServiceMgr from AthenaCommon.AlgSequence import AlgSequence topSequence = AlgSequence() if (not TriggerFlags.fakeLVL1()) and TriggerFlags.doLVL1(): if TriggerFlags.doCalo(): from CaloRec.CaloCellFlags import jobproperties if TriggerFlags.useCaloTTL( ) and not jobproperties.CaloCellFlags.doFastCaloSim(): import re if re.search("pp_v[5-9]|HI_v[3-9]|LS1_v[1-9]|DC14", TriggerFlags.triggerMenuSetup()): log.info("Using L1Calo Run 2 simulation") include( "TrigT1CaloSim/TrigT1CaloSimJobOptions_Run2.py") else: if TriggerFlags.doCosmicSim(): include( "TrigT1CaloSim/TrigT1CaloSimJobOptions_TTL1_cosmic.py" ) elif TriggerFlags.useL1CaloCalibration(): include( "TrigT1CaloSim/TrigT1CaloSimJobOptions_TTL1.py" ) elif 'pp_v4' in TriggerFlags.triggerMenuSetup( ): #temporary should be steered by run configuration include( "TrigT1CaloSim/TrigT1CaloSimJobOptions_TTL1_2012.py" ) else: include( "TrigT1CaloSim/TrigT1CaloSimJobOptions_TTL1_NoCalib.py" ) else: include("TrigT1CaloSim/TrigT1CaloSimJobOptions_Cell.py") log.info("adding MBTS simulation to the topSequence") from TrigT1MBTS.TrigT1MBTSConf import LVL1__TrigT1MBTS topSequence += LVL1__TrigT1MBTS() # schedule simulation if TriggerFlags.doMuon() and (not DetFlags.readRIOPool.LVL1_on()): from MuonByteStreamCnvTest.MuonByteStreamCnvTestConf import MuonRdoToMuonDigitTool MuonRdoToMuonDigitTool = MuonRdoToMuonDigitTool( DecodeMdtRDO=False, DecodeRpcRDO=True, DecodeTgcRDO=True, DecodeCscRDO=False, DecodeSTGC_RDO=False, DecodeMM_RDO=False, # for those subdetectors where the decoding is turned off, no need to create a RDO_Decoder ToolHandle mdtRdoDecoderTool="", cscRdoDecoderTool="", stgcRdoDecoderTool="", mmRdoDecoderTool="") from AthenaCommon.AppMgr import ToolSvc ToolSvc += MuonRdoToMuonDigitTool from MuonByteStreamCnvTest.MuonByteStreamCnvTestConf import MuonRdoToMuonDigit topSequence += MuonRdoToMuonDigit( "MuonRdoToMuonDigit", MuonRdoToMuonDigitTool=ToolSvc.MuonRdoToMuonDigitTool) import TrigT1RPCRecRoiSvc.TrigT1RPCRecRoiConfig # noqa: F401 import TrigT1TGCRecRoiSvc.TrigT1TGCRecRoiConfig # noqa: F401 import TrigT1RPCsteering.TrigT1RPCsteeringConfig # noqa: F401 import TrigT1TGC.TrigT1TGCConfig # noqa: F401 from TrigT1Muctpi.TrigT1MuctpiConfig import L1Muctpi topSequence += L1Muctpi() if TriggerFlags.doBcm(): from TrigT1BCM.TrigT1BCMConf import LVL1__TrigT1BCM alg = LVL1__TrigT1BCM() try: sgKey = alg.BcmL1ContainerName except AttributeError: sgKey = alg.getDefaultProperty('BcmL1ContainerName') if keyInInputFile(sgKey): log.info("adding BCM simulation to the topSequence") topSequence += alg else: log.warning( "%s input (%s) missing, not adding to the topSequence", alg.getName(), sgKey) TriggerFlags.doBcm.set_Value(False) if TriggerFlags.doTrt(): from TrigT1TRT.TrigT1TRTConf import LVL1__TrigT1TRT alg = LVL1__TrigT1TRT() try: sgKey = alg.TRTL1ContainerName except AttributeError: sgKey = alg.getDefaultProperty('TRTL1ContainerName') if keyInInputFile(sgKey): log.info("adding TRTfast simulation to the topSequence") topSequence += alg else: log.warning( "%s input (%s) missing, not adding to the topSequence", alg.getName(), sgKey) TriggerFlags.doTrt.set_Value(False) if TriggerFlags.doZdc(): from TrigT1ZDC.TrigT1ZDCConf import LVL1__TrigT1ZDC alg = LVL1__TrigT1ZDC() # ZDC simulation is using truth information at the moment, so do not do any fancy configuration log.info("adding ZDC simulation to the topSequence") topSequence += alg if TriggerFlags.doLucid(): from TrigT1Lucid.TrigT1LucidConf import LVL1__TrigT1Lucid alg = LVL1__TrigT1Lucid() try: sgKey = alg.LVL1T1ContainerName except AttributeError: sgKey = alg.getDefaultProperty('LVL1T1ContainerName') if keyInInputFile(sgKey): log.info("adding Lucid simulation to the topSequence") topSequence += alg else: log.warning( "%s input (%s) missing, not adding to the topSequence", alg.getName(), sgKey) TriggerFlags.doLucid.set_Value(False) if TriggerFlags.doL1Topo(): log.info("Enabling L1Topo simulation") from L1TopoSimulation.L1TopoSimulationConfig import L1TopoSimulation topSequence += L1TopoSimulation() try: # this is temporary until TrigT1Muctpi-00-06-29 is in the release from TrigT1Muctpi.TrigT1MuctpiConfig import L1MuctpiTool from AthenaCommon.AppMgr import ToolSvc ToolSvc += L1MuctpiTool() topSequence.L1TopoSimulation.MuonInputProvider.MuctpiSimTool = L1MuctpiTool( ) except ImportError: pass # enable the reduced (coarse) granularity topo simulation # currently only for MC from AthenaCommon.GlobalFlags import globalflags if globalflags.DataSource() != 'data': log.info( "Muon eta/phi encoding with reduced granularity for MC (L1 Simulation)" ) topSequence.L1TopoSimulation.MuonInputProvider.MuonEncoding = 1 else: log.info( "Muon eta/phi encoding with full granularity for data (L1 Simulation) - should be faced out" ) topSequence.L1TopoSimulation.MuonInputProvider.MuonEncoding = 0 log.info("adding ctp simulation to the topSequence") from TrigT1CTP.TrigT1CTPConfig import CTPSimulationInReco topSequence += CTPSimulationInReco("CTPSimulation") log.info("adding ROIB simulation to the topSequence") from TrigT1RoIB.TrigT1RoIBConfig import RoIBuilder topSequence += RoIBuilder("RoIBuilder") # monitoring LVL1MonitoringTools() #jtb if not TriggerFlags.fakeLVL1(): # LVL1 #jtb theApp.Dlls += [ "TrigT1ResultByteStream" ] if not (TriggerFlags.fakeLVL1() or TriggerFlags.doLVL1()): DetFlags.readRIOPool.LVL1_setOn() # need to following when reading LVL1 to o/p to AOD # RoI reconstruction svc # if ( doWriteESD or readESD) or ( doWriteAOD or readAOD) or doWriteRDO : # include("TrigT1EventAthenaPool/TrigT1EventAthenaPool_joboptions.py") # if (doWriteESD or doWriteAOD): # Pool convertors for LVL1 # include("AnalysisTriggerEventAthenaPool/AnalysisTriggerEventAthenaPool_joboptions.py") # -------------------------------------------------------------- # digitize the muon detector first if needed # -------------------------------------------------------------- if TriggerFlags.doMuon() and DetFlags.digitize.Muon_on(): # configure Pileup theApp.Dlls += ["PileUpTools"] # RPC Digitization include("RPC_Digitization/RPC_Digitization_jobOptions.py") # MDT Digitization include("MDT_Digitization/MDT_Digitization_jobOptions.py") # CSC Digitization include("CSC_Digitization/CSC_Digitization_jobOptions.py") # TGC Digitization include("TGC_Digitization/TGC_Digitization_jobOptions.py") include("MuonByteStreamCnvTest/MuonRdoDigit_jobOptions.py") # from TriggerJobOpts.Lvl1ResultBuilderGetter import Lvl1ResultBuilderGetter # result = Lvl1ResultBuilderGetter() # ***Temp : needed to enable required combination of thresholds # mu4,mu6,mu10,mu11,mu20,mu40 # Will be replaced by config. from Lvl1ConfigSvc if hasattr(ServiceMgr, 'RPCcablingSimSvc'): ServiceMgr.RPCcablingSimSvc.HackFor1031 = True from AthenaCommon.GlobalFlags import jobproperties if jobproperties.Global.InputFormat() != 'bytestream': if TriggerFlags.doCalo() and DetFlags.writeBS.Calo_on(): from AthenaCommon.AppMgr import ToolSvc from LArByteStream.LArByteStreamConfig import LArRawDataContByteStreamToolConfig ToolSvc += LArRawDataContByteStreamToolConfig( InitializeForWriting=True) # if jobproperties.Global.InputFormat() == 'bytestream': # theApp.Dlls += [ "TrigT1Calo" ] # include("TrigT1CaloByteStream/ReadLVL1CaloBS_jobOptions.py") # from RecExConfig.RecFlags import rec # if (rec.doESD() or rec.doAOD()) and (not(rec.readAOD() or rec.readESD())): #fix for bug 64345 # from AnalysisTriggerAlgs.AnalysisTriggerAlgsConfig import RoIBResultToAOD # topSequence += RoIBResultToAOD("RoIBResultToAOD") # from RecExConfig.ObjKeyStore import objKeyStore # from TrigEDMConfig.TriggerEDM import getLvl1ESDList # objKeyStore.addManyTypesStreamESD(getLvl1ESDList()) # from TrigEDMConfig.TriggerEDM import getLvl1AODList # objKeyStore.addManyTypesStreamAOD(getLvl1AODList()) return True