def __init__(self, name=Configurable.DefaultName): super(TGCcablingConfig, self).__init__(name) if (globalflags.DetDescrVersion().startswith('DC1') or globalflags.DetDescrVersion().startswith('DC2')): self.databaseASDToPP = "ASD2PP_P03.db" self.databaseInPP = "PP_P03.db"
def __init__(self,name = Configurable.DefaultName ): super(RpcCablingServerConfig ,self).__init__(name) if ( globalflags.DetDescrVersion().startswith('DC1') or \ globalflags.DetDescrVersion().startswith('DC2') or \ globalflags.DetDescrVersion().startswith('DC3') or \ globalflags.DetDescrVersion().startswith('ATLAS-CSC')): self.Atlas = False if muonByteStreamFlags.RpcDataType()=='atlas': self.Atlas = True if muonByteStreamFlags.RpcDataType()=='oldSimulation': self.Atlas = False
def __init__(self,name = Configurable.DefaultName ): super(TgcCablingServerConfig ,self).__init__(name) # make default Atlas # *TODO* How do we handle the case of old CSC data? Is new DetDescrVersion CSC too? EJWM self.Atlas = True if ( globalflags.DetDescrVersion().startswith('DC1') or \ globalflags.DetDescrVersion().startswith('DC2') or \ globalflags.DetDescrVersion().startswith('DC3')) : self.Atlas = False print "DC" if (muonByteStreamFlags.TgcDataType()=='m3' or \ muonByteStreamFlags.TgcDataType()=='oldSimulation') : self.Atlas = False if (muonByteStreamFlags.TgcDataType()=='m3'): print "TgcDataType is set to m3" else: print "TgcDataType is set to oldSim" # setting the default to ATLAS cabling print self.Atlas; # Setting of the default 12-fold (ATLAS) cabling # New MuonTGC_CablingSvc (True) uses COOL DB and old TGCcabling12Svc (False) does not use COOL DB self.useMuonTGC_CablingSvc = True # do not use the call-back for digitization job self.forcedUse = True # if we run from RDO (overlay or other jobs) we must use the call-back, # even if we have hits to digitize if DetFlags.haveRDO.TGC_on() and not DetFlags.digitize.TGC_on(): self.forcedUse = False #use the call-back in the overlay job that has no bytestream data as input if globalflags.isOverlay(): self.forcedUse = False # superseed the previos configuration if we run from Atlas data if globalflags.DataSource.is_data(): self.forcedUse = True self.Atlas = True # avoid to use call-back if input is bytestream if globalflags.InputFormat.is_bytestream(): self.forcedUse = True
def calibration_dict(dbtag=""): #-- DB tag provided if dbtag != "": calibdic = { "Cone4Topo" : "CaloH1WeightsCone4Topo-"+dbtag, "Cone4Tower" : "CaloH1WeightsCone4Tower-"+dbtag, "ConeTopo" : "CaloH1WeightsConeTopo-"+dbtag, "ConeTower" : "CaloH1WeightsConeTower-"+dbtag, "Kt4Topo" : "CaloH1WeightsKt4Topo-"+dbtag, "Kt4Tower" : "CaloH1WeightsKt4Tower-"+dbtag, "Kt6Topo" : "CaloH1WeightsKt6Topo-"+dbtag, "Kt6Tower" : "CaloH1WeightsKt6Tower-"+dbtag } return calibdic #-- default extraction else: from AthenaCommon.GlobalFlags import globalflags ddv = globalflags.DetDescrVersion() #-- establish relation between detector description and calibration if ddv.startswith("ATLAS-CSC"): if ddv >= "ATLAS-CSC-01-00-01": return H1Calibration.calibdicV13 else: return H1Calibration.calibdicV12 elif ddv.startswith("ATLAS-Comm"): return H1Calibration.calibdicV13 else: return H1Calibration.calibdicV14
def GetApproximateFieldFromGeo(): #Note that the values returned are not exact. They should be interpreted only as Field ON/OFF. #The values are set in line 26 at the beginning of this script #fullSolenoidCurrent is set to 7700.0 #fullToroidCurrent is set to 20500.0 logAutoConfiguration.info( "Trying to guess magnetic field status from geometryVersion.") solenoidCurrent = None toroidCurrent = None from AthenaCommon.GlobalFlags import globalflags geo = globalflags.DetDescrVersion() if geo.startswith('ATLAS-GEONSF-'): solenoidCurrent = 0.0 toroidCurrent = fullToroidCurrent elif geo.startswith('ATLAS-GEONTF-'): solenoidCurrent = fullSolenoidCurrent toroidCurrent = 0.0 elif geo.startswith('ATLAS-GEONF-'): solenoidCurrent = 0.0 toroidCurrent = 0.0 elif geo.startswith('ATLAS-'): solenoidCurrent = fullSolenoidCurrent toroidCurrent = fullToroidCurrent else: logAutoConfiguration.warning( "Don't know how to interpret magnetic field status from geometry '%s'." % geo) return solenoidCurrent, toroidCurrent
def __init__(self, name, *args, **kwargs): super(TrigmuCombMTConfig, self).__init__(name) self.MuCombStrategy = 0 self.UseBackExtrapolatorG4 = True if len(args) == 3: if args[2] == 'OLDextr': self.UseBackExtrapolatorG4 = False self.MinPtTRK = 0. * GeV # matchign windows parameters tuned in 2016 and 2015 data (T&P Z and J/psi samples) self.WinEtaSigma_g4 = 7.0 self.WinPhiSigma_g4 = 7.0 self.Chi2Weight_g4 = 2.0 if TriggerFlags.run2Config == '2016': self.WinEtaSigma_g4 = 4.0 self.WinPhiSigma_g4 = 4.0 self.Chi2Weight_g4 = 1.0 # pt resolution parameters for ID-SAmuon match from SAmuon developers (2016 data) if globalflags.DetDescrVersion().find('CSC') != -1: self.IDSCANBarrelRes = [0.02169, 0.0004186] self.IDSCANEndcap1Res = [0.03054, 0.000325] self.IDSCANEndcap2Res = [0.03557, 0.0005383] self.IDSCANEndcap3Res = [0.04755, 0.0007718] self.IDSCANEndcap4Res = [0.06035, 0.0001145] self.MonTool = TrigMuCombMonitoring()
def __init__(self, geoTag="none"): self.__dict__ = {} # set geometry tag name self.__dict__["geomTag"] = globalflags.DetDescrVersion() if geoTag != "none": self.__dict__["geomTag"] = geoTag self.dbGeomCursor = 0 self.connectToDB() self.InitializeGeometryParameters()
def ConfigureFieldAndGeoESDtoESD(): from PyUtils.MetaReaderPeeker import metadata if metadata['file_type'] == 'POOL': logAutoConfiguration.info( "InputFile is pool format. Configuring B-Field based on Geometry.") # configure Geometry for pool input if globalflags.DetDescrVersion.is_locked(): logAutoConfiguration.error( "Geometry was locked to '%s'. This is not expected.", globalflags.DetDescrVersion()) inGeo = metadata['GeoAtlas'] if inGeo == 'ATLAS-GEO-03-00-00': newGeo = 'ATLAS-GEO-16-00-00' elif inGeo == 'ATLAS-GEO-04-00-00': newGeo = 'ATLAS-GEO-16-00-00' elif inGeo == 'ATLAS-GEONF-04-00-00': newGeo = 'ATLAS-GEO-16-00-00' elif inGeo == 'ATLAS-GEONTF-05-00-00': newGeo = 'ATLAS-GEO-16-00-00' else: newGeo = 'ATLAS-GEO-16-00-00' #raise RuntimeError("Don't know how to configure geometry for input geo: '%s'"%inGeo) globalflags.DetDescrVersion.set_Value_and_Lock(newGeo) #configure B-Field ConfigureField() else: raise RuntimeError( "file_type is %s but ConfigureFieldAndGeoESDtoESD is only defined for pool inputs" % metadata['file_type']) logAutoConfiguration.info("Auto configured Geometry: %s ", globalflags.DetDescrVersion()) from AthenaCommon.BFieldFlags import jobproperties logAutoConfiguration.info("Auto configured B Field: ") logAutoConfiguration.info("BField: barrelToroidOn = %s ", jobproperties.BField.barrelToroidOn()) logAutoConfiguration.info("BField: BField.endcapToroidOn = %s ", jobproperties.BField.endcapToroidOn()) logAutoConfiguration.info("BField: BField.solenoidOn = %s ", jobproperties.BField.solenoidOn()) return
def ConfigureGeo(): from AthenaCommon.GlobalFlags import globalflags if globalflags.DetDescrVersion.is_locked(): logAutoConfiguration.info("Geometry was locked to: %s ", globalflags.DetDescrVersion()) return from RecExConfig.InputFilePeeker import inputFileSummary if inputFileSummary['file_type'] == 'bs': geo = "ATLAS-R2-2015-03-01-00" #geo='ATLAS-GEO-20-00-01' project = GetProjectName() if "data12" in project: geo = "ATLAS-R1-2012-03-00-00" if "data11" in project: geo = "ATLAS-R1-2011-02-00-00" #'ATLAS-GEO-18-01-01' if "data10" in project or "data09" in project or "data08" in project: geo = "ATLAS-R1-2010-02-00-00" #geo='ATLAS-GEO-16-00-01' if inputFileSummary['evt_type'][0] == 'IS_SIMULATION': try: geo = inputFileSummary['geometry'] except: logAutoConfiguration.warning( "Input simulated bs file does not contain bs_metadata with geometry. Probably an old file." ) pass globalflags.DetDescrVersion.set_Value_and_Lock(geo) logAutoConfiguration.info("Set GeometryVersion to '%s'" % geo) elif inputFileSummary['file_type'] == 'pool': # configure Geometry from input file globalflags.DetDescrVersion.set_Value_and_Lock( inputFileSummary['geometry']) logAutoConfiguration.info("Configured geometry from input file: %s ", globalflags.DetDescrVersion()) else: raise RuntimeError("Don't know how to interpret file_type '%s'" % inputFileSummary['file_type']) return
def ConfigureGeo(): from AthenaCommon.GlobalFlags import globalflags if globalflags.DetDescrVersion.is_locked(): logAutoConfiguration.info("Geometry was locked to: %s ", globalflags.DetDescrVersion()) return from PyUtils.MetaReaderPeeker import metadata if metadata['file_type'] == 'BS': geo = "ATLAS-R2-2015-03-01-00" #geo='ATLAS-GEO-20-00-01' project = GetProjectName() if "data12" in project: geo = "ATLAS-R1-2012-03-00-00" if "data11" in project: geo = "ATLAS-R1-2011-02-00-00" #'ATLAS-GEO-18-01-01' if "data10" in project or "data09" in project or "data08" in project: geo = "ATLAS-R1-2010-02-00-00" #geo='ATLAS-GEO-16-00-01' if metadata['eventTypes'][0] == 'IS_SIMULATION': try: geo = metadata['GeoAtlas'] except: logAutoConfiguration.warning( "Input simulated bs file does not contain bs_metadata with geometry. Probably an old file." ) pass globalflags.DetDescrVersion.set_Value_and_Lock(geo) logAutoConfiguration.info("Set GeometryVersion to '%s'" % geo) elif metadata['file_type'] == 'POOL': # configure Geometry from input file globalflags.DetDescrVersion.set_Value_and_Lock(metadata['GeoAtlas']) logAutoConfiguration.info("Configured geometry from input file: %s ", globalflags.DetDescrVersion()) else: raise RuntimeError("Don't know how to interpret file_type {}".format( metadata['file_type'])) return
def __init__(self, name="CaloDepthToolBaseUNSET", depth="CDTBunset"): from AthenaCommon.Logging import logging mlog = logging.getLogger(name + '(Base)::__init__ depth=' + depth) mlog.info('called with depth=' + depth) CaloDepthTool.__init__(self, name) # call base class constructor if name == "CaloDepthToolBaseUNSET": raise RuntimeError( "CaloDepthToolBase should not be called with default name") if depth == "CDTBunset": mlog.info("depth should be explicitly set. OK only if copy") return if depth == "showerdefault": # get optimal version of shower parameterisation from AthenaCommon.GlobalFlags import globalflags detdescrversion = globalflags.DetDescrVersion() if detdescrversion[0:4] == "Rome" or detdescrversion[ 0:3] == "DC1" or detdescrversion[ 0:3] == "DC2" or detdescrversion[0:9] == "ATLAS-DC3": depthchoice = "egparam" mlog.info('picked showerdefault=egparam for detdescrversion=' + detdescrversion) else: depthchoice = "cscopt2" mlog.info('picked showerdefault=' + depthchoice + ' for detdescrversion=' + detdescrversion) else: depthchoice = depth mlog.info("Setting up CaloDepthTool/" + name + " with depth " + depthchoice) # depthchoice should be one of depthList = [ "egparam", "cscopt", "cscopt2", "TBparam", "entrance", "middle", "flat" ] if depthchoice not in depthList: raise RuntimeError("depth not among autorised value", depthchoice) # assign property value self.DepthChoice = depthchoice
def GetFieldFromInputFile(): logAutoConfiguration.info( "Reading magnetic field status from input file metadata.") from PyUtils.MetaReaderPeeker import metadata solenoidCurrent = None toroidCurrent = None if '/EXT/DCS/MAGNETS/SENSORDATA' in metadata: # where index in ['/EXT/DCS/MAGNETS/SENSORDATA']['value'][index] or # ['/EXT/DCS/MAGNETS/SENSORDATA']['quality_invalid'][index] is: # 0 = CentralSol_Current # 1 = CentralSol_SCurrent # 2 = Toroids_Current # 3 = Toroids_SCurrent try: solenoidCurrent = metadata['/EXT/DCS/MAGNETS/SENSORDATA']['value'][ 0] # CentralSol_Current toroidCurrent = metadata['/EXT/DCS/MAGNETS/SENSORDATA']['value'][ 2] # Toroids_Current except: logAutoConfiguration.warning( "Unable to find solenoid and toroid currents in /EXT/DCS/MAGNETS/SENSORDATA" ) # consistency check of GEO and b field values in case of simulated data if metadata['eventTypes'][0] == 'IS_SIMULATION': from AthenaCommon.GlobalFlags import globalflags if globalflags.DetDescrVersion().startswith('ATLAS-') and ( solenoidCurrent, toroidCurrent) != (GetApproximateFieldFromGeo()): # if the values differ, the Field is configured due to GEO tempSol, tempTor = GetApproximateFieldFromGeo() logAutoConfiguration.warning( "BField current in input file (%s,%s) differs from GEO version (%s,%s)!! Field is configured due to GEO version", solenoidCurrent, toroidCurrent, tempSol, tempTor) logAutoConfiguration.warning( "Field is configured due to GEO version") solenoidCurrent, toroidCurrent = GetApproximateFieldFromGeo() else: logAutoConfiguration.warning( "Input file metadata don't have necessary info to get field conditions. It's probably too old." ) return solenoidCurrent, toroidCurrent
def __init__(self, name, *args, **kwargs): super(TrigmuCombConfig, self).__init__(name) self.UseAthenaFieldService = True self.MuCombStrategy = 0 self.UseBackExtrapolatorG4 = True if len(args) == 3: if args[2] == 'OLDextr': self.UseBackExtrapolatorG4 = False self.MinPtTRK = 0. self.WinEtaSigma_g4 = 7.0 self.WinPhiSigma_g4 = 7.0 self.Chi2Weight_g4 = 2.0 if TriggerFlags.run2Config == '2016': self.WinEtaSigma_g4 = 4.0 self.WinPhiSigma_g4 = 4.0 self.Chi2Weight_g4 = 1.0 if globalflags.DetDescrVersion().find('CSC') != -1: self.IDSCANBarrelRes = [0.02169, 0.0004186] self.IDSCANEndcap1Res = [0.03054, 0.000325] self.IDSCANEndcap2Res = [0.03557, 0.0005383] self.IDSCANEndcap3Res = [0.04755, 0.0007718] self.IDSCANEndcap4Res = [0.06035, 0.0001145] self.IDalgo = 'InDetTrigTrackingxAODCnv_Muon_FTF' validation = TrigmuCombValidationMonitoring() online = TrigmuCombOnlineMonitoring() cosmic = TrigmuCombCosmicMonitoring() time = TrigTimeHistToolConfig("Time") time.TimerHistLimits = [0, 5] self.AthenaMonTools = [validation, online, cosmic, time]
def GetFieldFromInputFile(): logAutoConfiguration.info( "Reading magnetic field status from input file metadata.") from RecExConfig.InputFilePeeker import inputFileSummary solenoidCurrent = None toroidCurrent = None if inputFileSummary['metadata'].has_key('/EXT/DCS/MAGNETS/SENSORDATA'): try: solenoidCurrent = inputFileSummary['metadata'][ '/EXT/DCS/MAGNETS/SENSORDATA']['CentralSol_Current']['value'] toroidCurrent = inputFileSummary['metadata'][ '/EXT/DCS/MAGNETS/SENSORDATA']['Toroids_Current']['value'] except: logAutoConfiguration.warning( "Unable to find solenoid and toroid currents in /EXT/DCS/MAGNETS/SENSORDATA" ) # consistency check of GEO and b field values in case of simulated data if inputFileSummary['evt_type'][0] == 'IS_SIMULATION': from AthenaCommon.GlobalFlags import globalflags if globalflags.DetDescrVersion().startswith('ATLAS-') and ( solenoidCurrent, toroidCurrent) != (GetApproximateFieldFromGeo()): # if the values differ, the Field is configured due to GEO tempSol, tempTor = GetApproximateFieldFromGeo() logAutoConfiguration.warning( "BField current in input file (%s,%s) differs from GEO version (%s,%s)!! Field is configured due to GEO version", solenoidCurrent, toroidCurrent, tempSol, tempTor) logAutoConfiguration.warning( "Field is configured due to GEO version") solenoidCurrent, toroidCurrent = GetApproximateFieldFromGeo() else: logAutoConfiguration.warning( "Input file metadata don't have necessary info to get field conditions. It's probably too old." ) return solenoidCurrent, toroidCurrent
#if DetFlags.Micromegas_on() and DetFlags.digitize.Micromegas_on(): from MuonFastDigitization.MuonFastDigitizationConf import MM_FastDigitizer topSequence += MM_FastDigitizer("MM_FastDigitizer") #if DetFlags.sTGC_on() and DetFlags.digitize.sTGC_on(): from MuonFastDigitization.MuonFastDigitizationConf import sTgcFastDigitizer topSequence += sTgcFastDigitizer("sTgcFastDigitizer") # filter TrackRecordCollection (true particles in muon spectrometer) if recAlgs.doTrackRecordFilter() and rec.doTruth(): from MCTruthAlgs.MCTruthAlgsConf import TrackRecordFilter topSequence += TrackRecordFilter() # container had a different name in older releases import re if re.match("DC1|DC2|Rome|ATLAS-DC3-01|ATLAS-DC3-02", globalflags.DetDescrVersion()): topSequence.TrackRecordFilter.inputName = "MuonEntryRecord" if muonRecFlags.writeMuonExitLayer(): topSequence += TrackRecordFilter("TrackRecordFilterMuonExitLayer", inputName="MuonExitLayer", outputName="MuonExitLayerFilter") # only do PRD truth if PRD's are being made if rec.doTruth() and DetFlags.makeRIO.Muon_on(): from MuonTruthAlgs.MuonTruthAlgsConf import MuonPRD_MultiTruthMaker topSequence += MuonPRD_MultiTruthMaker() from AthenaCommon.CfgGetter import getService getService("AtlasTrackingGeometrySvc") from MuonTruthAlgs.MuonTruthAlgsConf import Muon__MuonTruthDecorationAlg topSequence += Muon__MuonTruthDecorationAlg("MuonTruthDecorationAlg")
import sys, os from TrkNeuralNetworkUtils.TrkNeuralNetworkUtilsConf import Trk__NeuralNetworkToHistoTool egNeuralNetworkToHistoTool = Trk__NeuralNetworkToHistoTool( name="egNeuralNetworkToHistoTool") ToolSvc += egNeuralNetworkToHistoTool #--- new NN factor # COOL binding from IOVDbSvc.CondDB import conddb conddb.addFolder("PIXEL_OFL", "/PIXEL/PixelClustering/PixelClusNNCalib") # --- Select the necessary settings when running on run 1 data/MC # --- since a correction is needed to fix biases when running on new run 2 compatible calibation from SiClusterizationTool.SiClusterizationToolConf import InDet__NnClusterizationFactory if not "R2" in globalflags.DetDescrVersion( ) and not "IBL3D25" in globalflags.DetDescrVersion(): egNnClusterizationFactory = InDet__NnClusterizationFactory( name="egNnClusterizationFactory", NetworkToHistoTool=egNeuralNetworkToHistoTool, doRunI=True, useToT=False, useRecenteringNNWithoutTracks=True, useRecenteringNNWithTracks=False, correctLorShiftBarrelWithoutTracks=0, correctLorShiftBarrelWithTracks=0.030, LoadNoTrackNetwork=True, LoadWithTrackNetwork=True) else: egNnClusterizationFactory = InDet__NnClusterizationFactory( name="egNnClusterizationFactory",
from AthenaCommon.BeamFlags import jobproperties runNb=GetRunNumber() projectName=GetProjectName() rec.projectName=projectName ConfigureFieldAndGeo() ConfigureTriggerStream() ConfigureSimulationOrRealData() ConfigureBeamType() ConfigureConditionsTag() data_type=globalflags.InputFormat.get_Value() beam_type=jobproperties.Beam.beamType.get_Value() #evt_type=inputFileSummary['evt_type'] log.info("Run Number %s",runNb) log.info("Project name %s",projectName) log.info("DetDescription %s", globalflags.DetDescrVersion()) log.info("File type %s",data_type) log.info("Beam type %s",beam_type) log.info("Trigger stream %s",rec.triggerStream()) #log.info("Event type %s",evt_type) # enable PerfMon from PerfMonComps.PerfMonFlags import jobproperties jobproperties.PerfMonFlags.doFastMon = True #set up DQMonFlags required for HLTMonitoring from AthenaMonitoring.DQMonFlags import DQMonFlags if globalflags.DataSource.get_Value() == 'geant4': DQMonFlags.monManDataType = 'monteCarlo' elif (rec.doHeavyIon() or rec.doHIP()): # requires something from InputFileSummary rather than rec flag
import os, sys, string, commands import pickle from AthenaCommon.GlobalFlags import globalflags from AthenaCommon.AthenaCommonFlags import jobproperties, athenaCommonFlags onlinegoodies = {} onlinegoodies['DataSource'] = globalflags.DataSource() onlinegoodies['InputFormat'] = globalflags.InputFormat() onlinegoodies['ConditionsTag'] = globalflags.ConditionsTag() onlinegoodies['beamType'] = jobproperties.Beam.beamType() onlinegoodies['DetDescrVersion'] = globalflags.DetDescrVersion() file = open("globalflags.pickle", 'w') pickle.dump(onlinegoodies, file) file.close()
# jobproperties.Global.DetDescrVersion = defaultGeoVersion from AthenaCommon.DetFlags import DetFlags DetFlags.Calo_setOn() DetFlags.ID_setOff() DetFlags.Muon_setOff() DetFlags.Truth_setOff() DetFlags.LVL1_setOff() DetFlags.digitize.all_setOff() DetFlags.Print() #from AtlasGeoModel import SetGeometryVersion from AtlasGeoModel import GeoModelInit from AtlasGeoModel import SetupRecoGeometry svcMgr.GeoModelSvc.AtlasVersion = globalflags.DetDescrVersion() if hasattr(runArgs, "outputNTUP_HECNOISEFile"): from LArConditionsCommon.LArCondFlags import larCondFlags larCondFlags.LoadElecCalib.set_Value_and_Lock(True) #Get identifier mapping include("LArConditionsCommon/LArIdMap_comm_jobOptions.py") include("LArIdCnv/LArIdCnv_joboptions.py") # Event selector import AthenaPoolCnvSvc.ReadAthenaPool ############################################################### from LArConditionsCommon.LArCondFlags import larCondFlags
persOutput = cfgRecExPers['streamAOD'].list() allInput = objKeyStore['inputFile'].list() diff = [] for i in persOutput: if not i in allInput: diff += [i] if len(diff) > 0: print " (experimental) the following objects should be written in AOD according to RecExPers/share/OKS_streamAOD_fromESD.py" print "but are not in input ESD file.File probably need to be updated, or maybe this is not full reco", diff if rec.doWriteAOD() and rec.doESD(): persOutput = cfgRecExPers['streamAOD'].list() schedOutput = objKeyStore['streamAOD'].list() diff = [] for i in persOutput: if not i in schedOutput: diff += [i] if len(diff) > 0: print " (experimental) the following objects should be written in AOD according to RecExPers/share/OKS_streamAOD_fromESD.py" print "but are not in new streamAOD. File probably need to be updated, or maybe this is non full reco", diff except Exception: print "Could not check cfgRecExpers" from AthenaCommon.GlobalFlags import globalflags from AthenaCommon.BeamFlags import jobproperties print "TrfJobReport metaData_geometryVersion = %s" % globalflags.DetDescrVersion( ) print "TrfJobReport metaData_conditionsTag = %s" % globalflags.ConditionsTag() print "TrfJobReport metaData_BeamType = %s" % jobproperties.Beam.beamType()
theApp.HistogramPersistency = "ROOT" # run/event number protectedInclude("CBNT_Athena/CBNT_EventInfo_jobOptions.py") from AthenaCommon.GlobalFlags import globalflags from RecExConfig.RecFlags import rec from RecExConfig.RecAlgsFlags import recAlgs if rec.Commissioning: CBNTAthenaAware = True if rec.doTruth(): protectedInclude("RecExCommon/CBNT_Truth_jobOptions.py") if not (globalflags.DetDescrVersion()[0:3] == "DC1" or globalflags.DetDescrVersion()[0:3] == "DC2"): protectedInclude("MCTruthAlgs/CBNT_TrackRecord.py") if (DetFlags.haveRIO.ID_on() or rec.readESD() or rec.readAOD()): # no CBNT for ID anymore (use track validation ntuple) if jobproperties.Beam.beamType() == "collisions": # # functionality : put tracks from any tracking algorithm in combined ntuple # protectedInclude("InDetPriVxCBNT/InDetPriVxCBNT_jobOptions.py") if rec.readAOD(): try:
from AthenaCommon.Logging import logging msg = logging.getLogger('TileConditions_jobOptions.py') from TileConditions.TileInfoConfigurator import TileInfoConfigurator tileInfoConfigurator = TileInfoConfigurator() if 'RunNumber' in dir(): rn = RunNumber elif '_run_number' in dir(): rn = _run_number else: rn = None import re from AthenaCommon.GlobalFlags import globalflags gbltg = globalflags.DetDescrVersion() patt = re.compile(r'-([A-Z]+.)-') 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
#globalflags.DetGeo = 'atlas' from RecExConfig.InputFilePeeker import inputFileSummary globalflags.DataSource = 'data' if inputFileSummary['evt_type'][ 0] == "IS_DATA" else 'geant4' globalflags.DetDescrVersion = inputFileSummary['geometry'] xmlTags = [ ["ATLAS-P2-ITK-09-01-01", "InclBrl_4", "GMX"], ["ATLAS-P2-ITK-09-02-01", "InclBrl_4", "GMX"], ["ATLAS-P2-ITK-10-01-01", "InclBrl_4", "GMX"], ["ATLAS-P2-ITK-10-02-01", "InclBrl_4", "GMX"], ] print "InputFile DetDescrVersion : ", globalflags.DetDescrVersion() for geoTag, layoutDescr, gmx in xmlTags: if (globalflags.DetDescrVersion().startswith(geoTag)): print "preIncludes for ", layoutDescr, " layout" from InDetRecExample.InDetJobProperties import InDetFlags include('InDetSLHC_Example/preInclude.SLHC.SiliconOnly.Reco.py') include('InDetSLHC_Example/preInclude.SLHC_Setup_' + layoutDescr + '.py') if gmx == "GMX": print "preIncludes for GMX strip layout" include('InDetSLHC_Example/preInclude.SLHC_Setup_Strip_GMX.py') if geoTag == "ATLAS-P2-ITK-10-00-00" or geoTag == "ATLAS-P2-ITK-09-00-00": include( 'InDetSLHC_Example/SLHC_Setup_Reco_TrackingGeometry.py') else:
from PrimaryDPDMaker.PrimaryDPDFlags import primDPD jobConfig = {} jobConfig['inputfiles'] = runArgs.inputESDFile jobConfig['bytestream'] = False jobConfig['evtmax'] = runArgs.maxEvents jobConfig['outputlevel'] = WARNING jobConfig['beamspotfile'] = '' jobConfig['beamspotdb'] = '' jobConfig['beamspottag'] = '' jobConfig['alignmentfile'] = '' jobConfig['alignmentindettag'] = runArgs.indetAlignTag jobConfig['alignmenttrttag'] = runArgs.trtAlignTag jobConfig['GlobalTag'] = runArgs.conditionsTag jobConfig['DetDescrVersion'] = globalflags.DetDescrVersion() jobConfig['doTruth'] = False jobConfig['doPrintIndetConfig'] = False jobConfig['doMonitoring'] = True jobConfig['DataSource'] = globalflags.DataSource() jobConfig['alignmentfile'] = runArgs.indetAlginFile jobConfig['doPatternRecoAndTracking'] = True jobConfig['doPrimaryVertexing'] = True jobConfig['primaryVertexCutSetup'] = 'StartUp' jobConfig['primaryVertexSetup'] = 'DefaultFullFinding' if not 'runBatch' in dir(): runBatch = False # hopefully to be removed # Extra inputs from the command line for the jobConfig settings
try: from InDetRecExample.InDetJobProperties import InDetFlags if not rec.doTruth(): InDetFlags.doTruth = False except Exception: treatException("Could not instantiate InDetFlags=>switch off ID ") DetFlags.ID_setOff() ## if rec.doAODall() and oneTrackingAlg : ## if recAlgs.donewTracking() + recAlgs.doiPatRec() +recAlgs.doxKalman() <= 1 : ## logRecExCommon_flags.warning('doAODall=True : more than one tracking alg should be enabled ! So switching doAODall=False') ## rec.doAODall=False ## else: ## InDetFlags.setAODall() if not rec.doTruth() or (globalflags.DetDescrVersion()[0:3] == "DC1" or globalflags.DetDescrVersion()[0:3] == "DC2"): logRecExCommon_flags.info("TrackRecordFilter alg switched off ") recAlgs.doTrackRecordFilter = False # AOD Flags if rec.doWriteAOD() and not rec.doAOD() and not rec.readAOD(): logRecExCommon_flags.warning( "doAOD False and doWriteAOD True and readAOD False. Most likely meaninglesss !! " ) if rec.doWriteTAGCOM() and not rec.Commissioning(): logRecExCommon_flags.info("Not commissioning, switching of doWriteTAGCOM ") rec.doWriteTAGCOM = False # If no AOD objects made, then do not write out a TAG
if jobproperties.CaloTopoClusterFlags.doCellWeightCalib(): CaloTopoForTausMaker.ClusterCorrectionTools += [CellWeights.getFullName()] CaloTopoForTausMaker += CellWeights if jobproperties.CaloTopoClusterFlags.doTopoClusterLocalCalib(): CaloTopoForTausMaker.ClusterCorrectionTools += [ LocalCalib.getFullName(), OOCCalib.getFullName(), OOCPi0Calib.getFullName(), DMCalib.getFullName() ] CaloTopoForTausMaker += LocalCalib CaloTopoForTausMaker += OOCCalib CaloTopoForTausMaker += OOCPi0Calib CaloTopoForTausMaker += DMCalib # # pool/cool part # if jobproperties.CaloTopoClusterFlags.doTopoClusterLocalCalib(): from CaloRec import CaloClusterTopoCoolFolder if globalflags.DetDescrVersion().startswith("Rome"): CaloTopoForTausMaker.LocalCalibForTaus.LCClassify.MaxProbability = 0.85 CaloTopoForTausMaker.LocalCalibForTaus.LCClassify.UseNormalizedEnergyDensity = False else: CaloTopoForTausMaker.LocalCalibForTaus.LCClassify.MaxProbability = 0.50 CaloTopoForTausMaker.LocalCalibForTaus.LCClassify.UseNormalizedEnergyDensity = True topSequence += CaloTopoForTausMaker
# (move it to the job options if not meant to be automatic!) #-------------------------------------------------------------- import AthenaCommon.SystemOfUnits as Units from ISF_Config.ISF_jobProperties import ISF_Flags # IMPORTANT: Flags must be finalised before these functons are called from AthenaCommon.GlobalFlags import globalflags # --- set globalflags globalflags.DataSource.set_Value_and_Lock('geant4') globalflags.InputFormat.set_Value_and_Lock('pool') globalflags.DetGeo.set_Value_and_Lock('atlas') globalflags.Luminosity.set_Off() # --- set SimLayout (synchronised to globalflags) from G4AtlasApps.SimFlags import simFlags if globalflags.DetDescrVersion() not in simFlags.SimLayout.get_Value(): printfunc( "ERROR globalFlags.DetDescrVersion and simFlags.SimLayout do not match!" ) printfunc("Please correct your job options.") # TODO: theApp.exit(1)? import sys sys.exit(1) simFlags.load_atlas_flags() simFlags.EventFilter.set_Off() # --- Read in special simulation job option fragments based on # --- metadata passed by the evgen stage (move earlier?) from ISF_Example.ISF_Metadata import checkForSpecialConfigurationMetadata checkForSpecialConfigurationMetadata()
"ConvertedMuIdCBTracks", "CombinedInDetTracks", "ExtendedTracks" ] ### initial try for jOs to make Upgrade event xml-files smaller (target <15MB): # jpt 27Sep11 # theEventData2XML.DataTypes.remove( "JiveXML::SiSpacePointRetriever/SiSpacePointRetriever") theEventData2XML.DataTypes.remove( "JiveXML::SiClusterRetriever/SiClusterRetriever") theEventData2XML.DataTypes.remove( "JiveXML::PixelClusterRetriever/PixelClusterRetriever") theEventData2XML.DataTypes.remove("JiveXML::TRTRetriever/TRTRetriever") theEventData2XML.DataTypes.remove( "JiveXML::TrigSiSpacePointRetriever/TrigSiSpacePointRetriever") # # for real data input: theEventData2XML.DataTypes.remove("JiveXML::SCTRDORetriever/SCTRDORetriever") theEventData2XML.DataTypes.remove( "JiveXML::PixelRDORetriever/PixelRDORetriever") theCaloLArRetriever.LArlCellThreshold = 200. theCaloHECRetriever.HEClCellThreshold = 200. ### Default collection 'Tracks' has no spacepoints anymore, ### ie wrong tracks in Polyline mode, so switch to this collection: theVertexRetriever.TrackCollection = "CombinedInDetTracks" # geometry version written intoxml-file (for upgrade) from AthenaCommon.GlobalFlags import globalflags theEventData2XML.GeometryVersion = globalflags.DetDescrVersion()
if "outFilename" not in dir(): outFilename = 'TestConstantsOut.root' outdbFilename = 'TestConstantsOut.db' outTxtFilename = 'TestConstantsOut.txt' if "onlySilicon" not in dir(): onlySilicon = False # To extract constants from the database select the appropriate database tag. from AthenaCommon.GlobalFlags import globalflags #globalflags.DataSource='geant4' globalflags.DataSource = 'data' # Select the geometry version. globalflags.DetDescrVersion = 'ATLAS-GEO-03-00-00' print globalflags.DetDescrVersion() from IOVDbSvc.CondDB import conddb conddb.setGlobalTag("COMCOND-REPC-002-13") #conddb.setGlobalTag("OFLCOND-CSC-00-02-00") #conddb.setGlobalTag("COMCOND-HLTC-000-00") # Setup geometry from AthenaCommon.DetFlags import DetFlags DetFlags.ID_setOn() DetFlags.Calo_setOff() DetFlags.Muon_setOff() if onlySilicon: DetFlags.TRT_setOff() DetFlags.detdescr.TRT_setOn()
["ATLAS-P2-SFCAL-01-05-01","ExtBrl_32","GMX"], ["ATLAS-P2-ITK-06","ExtBrl_4",""], ["ATLAS-P2-SFCAL-01-06-01","ExtBrl_4","GMX"], ["ATLAS-P2-ITK-07","IExtBrl_4",""], ["ATLAS-P2-SFCAL-01-07-01","IExtBrl_4","GMX"], ["ATLAS-P2-ITK-08","InclBrl_4",""], ["ATLAS-P2-SFCAL-01-08-01","InclBrl_4","GMX"], ["ATLAS-P2-ITK-10-00-00","InclBrl_4","GMX"], ["ATLAS-P2-ITK-09-00-00","ExtBrl_4","GMX"], ["ATLAS-P2-ITK-10-00-01","InclBrl_4","GMX"], ["ATLAS-P2-ITK-09-00-01","ExtBrl_4","GMX"], ["ATLAS-P2-ITK-11-00-01","ExtBrl_4_33mm","GMX"], ["ATLAS-P2-ITK-12-00-01","IExtBrl_4","GMX"],] for geoTag, layoutDescr, gmx in xmlTags: if (globalflags.DetDescrVersion().startswith(geoTag)): print "preIncludes for ",layoutDescr, " layout" from InDetRecExample.InDetJobProperties import InDetFlags include('InDetSLHC_Example/preInclude.SLHC.SiliconOnly.Reco.py') include('InDetSLHC_Example/preInclude.SLHC_Setup_'+layoutDescr+'.py') if gmx=="GMX": print "preIncludes for GMX strip layout" include('InDetSLHC_Example/preInclude.SLHC_Setup_Strip_GMX.py') if geoTag=="ATLAS-P2-ITK-10-00-00" or geoTag=="ATLAS-P2-ITK-09-00-00" : include('InDetSLHC_Example/SLHC_Setup_Reco_TrackingGeometry.py') else: include('InDetSLHC_Example/SLHC_Setup_Reco_TrackingGeometry_GMX.py') else : include('InDetSLHC_Example/SLHC_Setup_Reco_TrackingGeometry.py') break