DetFlags.readRIOBS.all_setOff() DetFlags.readRIOPool.all_setOff() DetFlags.writeRIOPool.all_setOff() import AtlasGeoModel.SetGeometryVersion import AtlasGeoModel.GeoModelInit #-------------------------------------------------------------- # Load ReadCalibData Alg and Service #-------------------------------------------------------------- from AthenaCommon.AlgSequence import AlgSequence topSequence = AlgSequence() if not hasattr(topSequence, "xAODMaker::EventInfoCnvAlg"): from xAODEventInfoCnv.xAODEventInfoCreator import xAODMaker__EventInfoCnvAlg topSequence += xAODMaker__EventInfoCnvAlg(OutputLevel=2) from SCT_ConditionsTools.SCT_ReadCalibChipDataToolSetup import SCT_ReadCalibChipDataToolSetup sct_ReadCalibChipDataToolSetup = SCT_ReadCalibChipDataToolSetup() sct_ReadCalibChipDataToolSetup.setNoiseFolderTag( "SctDaqCalibrationChipNoise-UPD1-002-00") sct_ReadCalibChipDataToolSetup.setGainFolderTag( "SctDaqCalibrationChipGain-UPD1-002-00") sct_ReadCalibChipDataToolSetup.setup() SCT_ReadCalibChipDataTool = sct_ReadCalibChipDataToolSetup.getTool() from SCT_ConditionsAlgorithms.SCT_ConditionsAlgorithmsConf import SCT_ReadCalibChipDataTestAlg topSequence += SCT_ReadCalibChipDataTestAlg( SCT_ReadCalibChipDataTool=SCT_ReadCalibChipDataTool)
#Switch Off for TAG - end from AthenaPoolExampleAlgorithms.AthenaPoolExampleAlgorithmsConf import AthPoolEx__QueryTag QueryTag = AthPoolEx__QueryTag("QueryTag") #svcMgr.EventSelector.HelperTools = [ QueryTag ] #PoolSvc.ReadCatalog = [ "mysqlcatalog_mysql://CollTester:[email protected]:3306/CollectionTest" ] svcMgr.PoolSvc.WriteCatalog = "file:Catalog1.xml" #svcMgr.PoolSvc.AttemptCatalogPatch = True; #-------------------------------------------------------------- # Private Application Configuration options #-------------------------------------------------------------- # Create xAOD::EventInfo from xAODEventInfoCnv.xAODEventInfoCreator import xAODMaker__EventInfoCnvAlg topSequence += xAODMaker__EventInfoCnvAlg("EventInfoCnvAlg") # Load "user algorithm" top algorithms to be run, and the libraries that house them from AthenaPoolExampleAlgorithms.AthenaPoolExampleAlgorithmsConf import AthPoolEx__ReadData topSequence += AthPoolEx__ReadData("ReadData") #-------------------------------------------------------------- # ROOT streaming service #-------------------------------------------------------------- from AthenaPoolServices.AthenaRootStreamerSvcConf import AthenaRootStreamerSvc StreamerSvc = AthenaRootStreamerSvc() StreamerSvc.Streamers += ["ExampleHitStreamer_p0"] svcMgr += StreamerSvc #-------------------------------------------------------------- # Set output level threshold (2=DEBUG, 3=INFO, 4=WARNING, 5=ERROR, 6=FATAL)
print larCondFlags from IOVDbSvc.CondDB import conddb larCondDBFolders = ["/LAR/ElecCalibMC/fSampl"] for i in larCondDBFolders: conddb.addFolder(LArDB, i + LArDBConnection) ## allow onverride larCondFlags.addTag(i, conddb) ## apply hierarchical tag larCondFlags.addTag('/LAR/ElecCalibMC', conddb) ## Algorithm sequence from AthenaCommon.AlgSequence import AlgSequence topSeq = AlgSequence() from xAODEventInfoCnv.xAODEventInfoCreator import xAODMaker__EventInfoCnvAlg topSeq += xAODMaker__EventInfoCnvAlg() import AthenaPoolCnvSvc.ReadAthenaPool svcMgr.MessageSvc.OutputLevel = INFO #svcMgr.MessageSvc.defaultLimit = 100000 # 999999 bdir = "/usatlas/groups/bnl_local2/flanni/HITS/" #"mc12_14TeV.119995.Pythia8_A2MSTW2008LO_minbias_inelastic_low.merge.HITS.e1133_s1638_s1659_tid01222101_00/" #"mc12_14TeV.119995.Pythia8_A2MSTW2008LO_minbias_inelastic_low.merge.HITS.e1133_s1638_s1659_tid01222102_00/" bdsdir = "mc12_14TeV.119995.Pythia8_A2MSTW2008LO_minbias_inelastic_low.merge.HITS.e1133_s1638_s1659_tid01222103_00/" bfile = "HITS.01222103._001912.pool.root.1" if "inputFile" not in dir(): inputFile = bdir + bdsdir + bfile svcMgr.EventSelector.InputCollections = [inputFile]
# Algorithms #-------------------------------------------------------------- # Beam spot conditions from AthenaCommon.AlgSequence import AthSequencer condSeq = AthSequencer("AthCondSeq") from IOVDbSvc.CondDB import conddb conddb.addFolderSplitOnline("INDET", "/Indet/Onl/Beampos", "/Indet/Beampos", className="AthenaAttributeList") from BeamSpotConditions.BeamSpotConditionsConf import BeamSpotCondAlg condSeq += BeamSpotCondAlg("BeamSpotCondAlg") # Make the signal xAOD::EventInfo from xAODEventInfoCnv.xAODEventInfoCreator import xAODMaker__EventInfoCnvAlg EventInfoCnvAlg = xAODMaker__EventInfoCnvAlg() EventInfoCnvAlg.AODKey = "Sig_McEventInfo" EventInfoCnvAlg.xAODKey = "Sig_EventInfo" topSequence += EventInfoCnvAlg # Run the overlay from AthenaCommon import CfgGetter EventInfoOverlay = CfgGetter.getAlgorithm("EventInfoOverlay") EventInfoOverlay.OutputLevel = DEBUG topSequence += EventInfoOverlay #-------------------------------------------------------------- # EventLoop #-------------------------------------------------------------- from AthenaCommon.ConcurrencyFlags import jobproperties as jp nThreads = jp.ConcurrencyFlags.NumThreads()
from AthenaCommon.Logging import log from AthenaCommon.Constants import DEBUG log.setLevel(DEBUG) from AthenaCommon.Configurable import Configurable Configurable.configurableRun3Behavior = 1 from AthenaConfiguration.AllConfigFlags import ConfigFlags from AthenaConfiguration.TestDefaults import defaultTestFiles ConfigFlags.Input.Files = defaultTestFiles.RDO ConfigFlags.lock() cfg = ComponentAccumulator() from xAODEventInfoCnv.xAODEventInfoCreator import xAODMaker__EventInfoCnvAlg cfg.addEventAlgo(xAODMaker__EventInfoCnvAlg()) from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg cfg.merge(PoolReadCfg(ConfigFlags)) acc = CaloCellMakerCfg(ConfigFlags) acc.getPrimary().CaloCellsOutputName = "AllCaloNew" cfg.merge(acc) f = open("CaloCellMaker.pkl", "wb") cfg.store(f) f.close() #ConfigFlags.dump()
theAuditorSvc = ServiceMgr.AuditorSvc theAuditorSvc.Auditors += ["ChronoAuditor"] theAuditorSvc.Auditors += ["MemStatAuditor"] theApp.AuditAlgorithms = True from AthenaCommon.GlobalFlags import globalflags globalflags.DetDescrVersion = "ATLAS-R2-2016-01-00-01" globalflags.DetGeo = "atlas" globalflags.InputFormat = "pool" globalflags.DataSource = "data" from AthenaCommon.AlgSequence import AthSequencer condSeq = AthSequencer("AthCondSeq") from xAODEventInfoCnv.xAODEventInfoCreator import xAODMaker__EventInfoCnvAlg condSeq += xAODMaker__EventInfoCnvAlg(OutputLevel=2) #-------------------------------------------------------------- # Set Detector setup #-------------------------------------------------------------- # --- switch on InnerDetector from AthenaCommon.DetFlags import DetFlags DetFlags.ID_setOff() DetFlags.Calo_setOff() DetFlags.Muon_setOff() DetFlags.Truth_setOff() DetFlags.LVL1_setOff() DetFlags.SCT_setOn() # ---- switch parts of ID off/on as follows #switch off tasks
def configure(self): log = logging.getLogger("HLTTriggergetter.py") from AthenaCommon.AlgSequence import AlgSequence topSequence = AlgSequence() #scheduling eventinfo from RecExConfig.ObjKeyStore import objKeyStore if ( not objKeyStore.isInInput( "xAOD::EventInfo_v1") ) and ( not hasattr( topSequence, "xAODMaker::EventInfoCnvAlg" ) ): from xAODEventInfoCnv.xAODEventInfoCreator import xAODMaker__EventInfoCnvAlg topSequence += xAODMaker__EventInfoCnvAlg() log.info("Loading RegionSelector") from AthenaCommon.AppMgr import ServiceMgr ServiceMgr += RegSelSvcDefault() # Configure the Data Preparation for Calo if TriggerFlags.doCalo(): try: from TrigT2CaloCommon.TrigT2CaloCommonConfig import TrigDataAccess ServiceMgr.ToolSvc += TrigDataAccess() except ImportError: include('TrigT2CaloCommon/TrigDataAccessConfigured.py') if TriggerFlags.doFTK(): # FTK algorithm inclusions # TrigFTK_DataProviderSvc moved to TrigFTK_RecExample pass if TriggerFlags.doHLT(): log.info("configuring HLT Steering") from TrigSteering.TrigSteeringConfig import TrigSteer_HLT, ReruningTrigSteer_HLT if TriggerFlags.doFEX(): from RecExConfig.RecFlags import rec from AthenaCommon.GlobalFlags import globalflags # schedule the conversion of the L1Calo ROIB data to topo simulation input # this ROIB converter should only be scheduled if # - we run on data # - L1Calo simulation has not been scheduled # - and ROIB converter has not been scheduled yet before if globalflags.DataSource()=='data' \ and not hasattr( topSequence, 'CPCMX' ) \ and not hasattr( topSequence, 'RoiB2TopoInputDataCnv' ): log.info("Setting up RoiB2TopoInputDataCnv") from L1TopoSimulation.L1TopoSimulationConfig import RoiB2TopoInputDataCnv roib2Topo = RoiB2TopoInputDataCnv() topSequence += roib2Topo log.info("configuring HLT merged system, for normal running (FEX + Hypo)") TrigSteer_HLT = TrigSteer_HLT('TrigSteer_HLT', hltFile=TriggerFlags.inputHLTconfigFile(), lvl1File=TriggerFlags.inputLVL1configFile()) TrigSteer_HLT.doHypo = TriggerFlags.doHypo() if not TriggerFlags.doFEX() and TriggerFlags.doHypo(): log.info("configuring merged HLT for re-running (Hypo only)") TrigSteer_HLT = ReruningTrigSteer_HLT('TrigSteer_HLT', hltFile=TriggerFlags.inputHLTconfigFile(), lvl1File=TriggerFlags.inputLVL1configFile()) # TrigSteer_HLT.doL1TopoSimulation = TriggerFlags.doL1Topo() # this later needs to be extented to also run when we take data with L1Topo TrigSteer_HLT.doL1TopoSimulation = True # always needs to run if the HLT is simulated if hasattr(TrigSteer_HLT.LvlTopoConverter, 'MuonInputProvider'): print "TrigSteer_HLT.LvlTopoConverter has attribute MuonInputProvider" 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() TrigSteer_HLT.LvlTopoConverter.MuonInputProvider.MuctpiSimTool = L1MuctpiTool() except ImportError: pass from AthenaCommon.GlobalFlags import globalflags if globalflags.DataSource()!='data': log.info("Muon eta/phi encoding with reduced granularity for MC (L1Topo emulation for HLT seeding)") TrigSteer_HLT.LvlTopoConverter.MuonInputProvider.MuonEncoding = 1 # reduced granularity muon input else: log.info("Muon eta/phi encoding with full granularity for data (L1Topo emulation for HLT seeding) - should be faced out") TrigSteer_HLT.LvlTopoConverter.MuonInputProvider.MuonEncoding = 0 # full granularity muon input - should be faced out from TrigEDMConfig.TriggerEDM import getHLTPreregistrationList, getEDMLibraries TrigSteer_HLT.Navigation.ClassesToPreregister = getHLTPreregistrationList() TrigSteer_HLT.Navigation.Dlls = getEDMLibraries() monitoringTools(TrigSteer_HLT) topSequence += TrigSteer_HLT if TriggerFlags.writeBS(): # declare objects to go to BS (from the lists above) ## if TriggerFlags.doLVL2(): ## from TrigEDMConfig.TriggerEDM import getL2BSList ## TrigSteer_L2.Navigation.ClassesToPayload = getL2BSList() ## TrigSteer_L2.Navigation.ClassesToPreregister = [] ## ## if TriggerFlags.doEF(): ## from TrigEDMConfig.TriggerEDM import getEFBSList ## TrigSteer_EF.Navigation.ClassesToPayload = getEFBSList() ## TrigSteer_EF.Navigation.ClassesToPreregister = [] ## try: ## from TrigEDMConfig.TriggerEDM import getEFDSList ## TrigSteer_EF.Navigation.ClassesToPayload_DSonly = getEFDSList() ## except ImportError: ## log.warning("DataScouting not available in this release") if TriggerFlags.doHLT(): from TrigEDMConfig.TriggerEDM import getHLTBSList TrigSteer_HLT.Navigation.ClassesToPayload = getHLTBSList() TrigSteer_HLT.Navigation.ClassesToPreregister = [] try: from TrigEDMConfig.TriggerEDM import getHLTDSList TrigSteer_HLT.Navigation.ClassesToPayload_DSonly = getHLTDSList() except ImportError: log.warning("DataScouting not available in this release") #configure tools for serialization from TrigSerializeTP.TrigSerializeTPConf import TrigSerTPTool TrigSerToolTP = TrigSerTPTool('TrigSerTPTool') from TrigEDMConfig.TriggerEDM import getTPList TrigSerToolTP.TPMap = getTPList(TriggerFlags.doHLT()) from AthenaCommon.AppMgr import ToolSvc ToolSvc += TrigSerToolTP from TrigSerializeCnvSvc.TrigSerializeCnvSvcConf import TrigSerializeConvHelper TrigSerializeConvHelper = TrigSerializeConvHelper(doTP = True) ToolSvc += TrigSerializeConvHelper #do not activate T/P of EF classes at L2 ## if TriggerFlags.doLVL2(): ## from TrigEDMConfig.TriggerEDM import getL2BSTypeList ## TrigSerToolTP.ActiveClasses = getL2BSTypeList() ## if TriggerFlags.doEF(): ## from TrigEDMConfig.TriggerEDM import getL2BSTypeList, getEFBSTypeList ## TrigSerToolTP.ActiveClasses = getL2BSTypeList() + getEFBSTypeList() if TriggerFlags.doHLT(): from TrigEDMConfig.TriggerEDM import getHLTBSTypeList TrigSerToolTP.ActiveClasses = getHLTBSTypeList() from TriggerJobOpts.HLTTriggerResultGetter import HLTTriggerResultGetter result = HLTTriggerResultGetter() return True