def createTBSimulationParametersMetadata(): from IOVDbMetaDataTools import ParameterDbFiller dbFiller = ParameterDbFiller.ParameterDbFiller() from ISF_Example.ISF_Metadata import inputAthFileObject ## Set run numbers minrunnum = 0 maxrunnum = 2147483647 # MAX from AthenaCommon.AthenaCommonFlags import athenaCommonFlags from G4AtlasApps.SimFlags import simFlags if hasattr(simFlags, 'RunNumber') and simFlags.RunNumber.statusOn: minrunnum = simFlags.RunNumber() ## FIXME need to use maxrunnum = 2147483647 for now to keep overlay working but in the future this should be set properly. #maxrunnum = minrunnum + 1 elif inputAthFileObject is not None: if len(inputAthFileObject.run_numbers) > 0: minrunnum = inputAthFileObject.run_numbers[0] maxrunnum = minrunnum + 1 else: raise Exception('IllegalRunNumber') else: simMDlog.info( 'Skipping run number setting - would need to set simFlags.RunNumber for this.' ) simMDlog.info("Using the following run number range for MetaData IOV: (" + str(minrunnum) + "," + str(maxrunnum) + ").") dbFiller.setBeginRun(myMinRunNumber) dbFiller.setEndRun(myMaxRunNumber) fillTestBeamMetadata(dbFiller) if simFlags.ISFRun: fillISFMetadata(dbFiller) ## Write the db info dbFiller.genSimDb() folder = "/Simulation/Parameters" dbConnection = "sqlite://;schema=SimParams.db;dbname=SIMPARAM" import IOVDbSvc.IOVDb from AthenaCommon.AppMgr import ServiceMgr ServiceMgr.IOVDbSvc.Folders += [ folder + "<dbConnection>" + dbConnection + "</dbConnection>" ] ServiceMgr.IOVDbSvc.FoldersToMetaData += [folder] ServiceMgr.IOVSvc.partialPreLoadData = True
ss = patt.search(gbltg) if (type(ss) != type(None)): version = ss.group(1) if (version == 'CSC'): msg.warning( "Old geometry tag detected %s - will not use COOL DB for TileCal calibration" % gbltg) TileUseCOOL = False TileFrameLength = 9 if (not 'TileCablingType' in dir()): if rn is None: try: from G4AtlasApps.SimFlags import simFlags if simFlags.RunNumber.statusOn: rn = simFlags.RunNumber() except: msg.info("No SimFlags available - looks like HLT job") if rn is None: try: from RecExConfig.AutoConfiguration import GetRunNumber rn = GetRunNumber() except: msg.info("No Run Number available - assume latest cabling") from AtlasGeoModel.CommonGMJobProperties import CommonGeometryFlags as geoFlags if geoFlags.Run() == "RUN1": if rn > 219651: # choose RUN2 cabling for old geometry tags starting from 26-MAR-2013 TileCablingType = 4 msg.warning("Forcing RUN2 cabling for run %s with geometry %s" % (rn, gbltg))