def GetProjectName(): # special option for online running from AthenaCommon.AthenaCommonFlags import athenaCommonFlags if athenaCommonFlags.isOnline(): from RecExOnline.OnlineISConfiguration import GetRunType rec.projectName = GetRunType()[2] # continue with options for offline running if rec.projectName() == "": from PyUtils.MetaReaderPeeker import metadata whatIsIt = None try: whatIsIt = metadata['eventTypes'][0] except: pass if whatIsIt == 'IS_SIMULATION': project = 'IS_SIMULATION' else: try: project = metadata['project_name'] except: from RecExConfig.GetCool import cool project = cool.fileNameTag() pass #rec.projectName.set_Value_and_Lock(project) logAutoConfiguration.info( "Success! GetProjectName() found a project named %s" % project) else: project = rec.projectName() if not project in KnownProjects: logAutoConfiguration.warning( "Project '%s' is not part of the KnownProjects list." % project) #print(KnownProjects) return project
def ConfigureConditionsTag(): if globalflags.ConditionsTag.is_locked(): logAutoConfiguration.info("conditionsTag is locked to value: '%s'." % globalflags.ConditionsTag()) return from PyUtils.MetaReaderPeeker import metadata if metadata['file_type'] == 'POOL' or metadata[ 'file_type'] == 'BS' and metadata['eventTypes'][ 0] == 'IS_SIMULATION': try: globalflags.ConditionsTag.set_Value_and_Lock( metadata['IOVDbGlobalTag']) logAutoConfiguration.info( "Auto-configured ConditionsTag '%s' from MetaReaderPeeker ", globalflags.ConditionsTag()) except: logAutoConfiguration.error( "ConditionsTag could not be auto-configured no info stored in MetaReaderPeeker!!!" ) #logAutoConfiguration.warning("Input simulated bs file does not contain bs_metadata with conditions_tag !") pass pass else: #Regular data files try: year = int(rec.projectName()[4:6]) except: logAutoConfiguration.warning( "Failed to extract year from project tag " + rec.projectName() + ". Guessing 2015") year = 15 if (year < 14): #Run1 globalflags.ConditionsTag.set_Value_and_Lock( "COMCOND-BLKPA-RUN1-09") logAutoConfiguration.info( "Found run 1 input bytestream file, autoconfigure conditions tag to '%s'" % globalflags.ConditionsTag()) else: globalflags.ConditionsTag.set_Value_and_Lock( "CONDBR2-BLKPA-2015-17") logAutoConfiguration.info( "Found run 2 input bytestream file, autoconfigure conditions tag to '%s'" % globalflags.ConditionsTag()) pass pass return
def _InstanceFromProjectName(): from AthenaCommon.Logging import logging from RecExConfig.RecFlags import rec projectName=rec.projectName() try: year=int(projectName[4:6]); except: log = logging.getLogger('BadLBFilterTool') log.error("Failed to extract year from project tag "+ projectName+". Guessing run2") return "CONDBR2" if (year>13): return "CONDBR2" else: return "COMP200"
def ConfigureConditionsTag(): if globalflags.ConditionsTag.is_locked(): logAutoConfiguration.info("conditionsTag is locked to value: '%s'." % globalflags.ConditionsTag()) return from RecExConfig.InputFilePeeker import inputFileSummary if inputFileSummary['file_type'] == 'pool' or inputFileSummary[ 'file_type'] == 'bs' and inputFileSummary['evt_type'][ 0] == 'IS_SIMULATION': try: globalflags.ConditionsTag.set_Value_and_Lock( inputFileSummary['conditions_tag']) logAutoConfiguration.info( "Auto-configured ConditionsTag '%s' from inputFileSummary ", globalflags.ConditionsTag()) except: logAutoConfiguration.error( "ConditionsTag could not be auto-configured no info stored in inputFileSummary!!!" ) #logAutoConfiguration.warning("Input simulated bs file does not contain bs_metadata with conditions_tag !") pass pass else: #Regular data files try: year = int(rec.projectName()[4:6]) except: logAutoConfiguration.warning( "Failed to extract year from project tag " + projectName + ". Guessing 2015") year = 15 if (year < 14): #Run1 globalflags.ConditionsTag.set_Value_and_Lock( "COMCOND-BLKPA-RUN1-09") logAutoConfiguration.info( "Found run 1 input bytestream file, autoconfigure conditions tag to '%s'" % globalflags.ConditionsTag()) else: globalflags.ConditionsTag.set_Value_and_Lock( "CONDBR2-BLKPA-2015-17") logAutoConfiguration.info( "Found run 2 input bytestream file, autoconfigure conditions tag to '%s'" % globalflags.ConditionsTag()) pass pass return
def pileup_preInclude(self): """ This fixes the problem with the in-time pileup number in xAOD::EventInfo, as described in: https://its.cern.ch/jira/browse/ATLASRECTS-3204 Incremented version to r207v4. """ # Tell the user what's happening: logAODFix_r207.debug("Executing AODFix_r207_pileup_preInclude") # This fix is only needed for 20.7 data files made from data15, # without this fix. from AthenaCommon.GlobalFlags import globalflags if globalflags.DataSource() != "data": return from RecExConfig.RecFlags import rec if rec.projectName() != "data15_13TeV": return # Access the main algorithm sequence: from AthenaCommon.AlgSequence import AlgSequence topSequence = AlgSequence() # Make sure that the LuminosityTool is configured. This needs at # least LumiBlockComps-01-00-27 to work correctly. from AthenaCommon.AppMgr import ToolSvc if not hasattr(ToolSvc, "LuminosityTool"): from LumiBlockComps.LuminosityToolDefault import LuminosityToolDefault ToolSvc += LuminosityToolDefault() pass # Set up the xAOD::EventInfo creator algorithm to overwrite the # existing object. This needs at least xAODEventInfoCnv-00-00-17-01, # or xAODEventInfoCnv-00-00-23. from AthenaCommon import CfgMgr topSequence += \ CfgMgr.xAODMaker__EventInfoCnvAlg( "AODFix_EventInfoCnvAlg", ForceOverwrite = True ) return
from InDetRecExample.InDetJobProperties import InDetFlags from InDetRecExample.InDetKeys import InDetKeys # --- load cabling setup include("InDetRecExample/InDetRecCabling.py") if DetFlags.readRDOBS.pixel_on(): from PixelRawDataByteStreamCnv.PixelRawDataByteStreamCnvConf import PixelRodDecoder InDetPixelRodDecoder = PixelRodDecoder(name="InDetPixelRodDecoder") # Disable duplcated pixel check for data15 because duplication mechanism was used. from RecExConfig.RecFlags import rec if len(rec.projectName()) >= 6 and rec.projectName()[:6] == "data15": InDetPixelRodDecoder.CheckDuplicatedPixel = False ToolSvc += InDetPixelRodDecoder if (InDetFlags.doPrintConfigurables()): printfunc(InDetPixelRodDecoder) #InDetPixelRodDecoder.OutputLevel = VERBOSE from PixelRawDataByteStreamCnv.PixelRawDataByteStreamCnvConf import PixelRawDataProviderTool InDetPixelRawDataProviderTool = PixelRawDataProviderTool( name="InDetPixelRawDataProviderTool", Decoder=InDetPixelRodDecoder) #ToolSvc += InDetPixelRawDataProviderTool if (InDetFlags.doPrintConfigurables()): printfunc(InDetPixelRawDataProviderTool) #InDetPixelRawDataProviderTool.OutputLevel = VERBOSE # load the PixelRawDataProvider from PixelRawDataByteStreamCnv.PixelRawDataByteStreamCnvConf import PixelRawDataProvider InDetPixelRawDataProvider = PixelRawDataProvider( name="InDetPixelRawDataProvider", RDOKey=InDetKeys.PixelRDOs(), ProviderTool=InDetPixelRawDataProviderTool)
def __init__(self,doOldStyleConfig=False): "Setup conditions DB - IOVDbSvc and connections according to GlobalFlags" from AthenaCommon.AppMgr import ServiceMgr as svcMgr from AthenaCommon.Logging import logging self.msg = logging.getLogger( 'IOVDbSvc.CondDB' ) self.msg.debug("Loading basic services for CondDBSetup...") # AthenaPool and IOVDbSvc configuration from AthenaPoolCnvSvc import AthenaPool # noqa: F401 from IOVDbSvc import IOVDb # noqa: F401 # local access to IOVDbSvc parameters self.iovdbsvc=svcMgr.IOVDbSvc # initialise list of allowed DBs self.dblist={} # and list of blocked folders self.blocklist=[] # decide which instance to setup # default database self.dbname='' # names for MC and data database in case forceMC/forceData are used self.dbmc='' self.dbdata='' self.poolcats=[] from AthenaCommon.GlobalFlags import globalflags from AthenaCommon.AthenaCommonFlags import athenaCommonFlags self.isOnline=athenaCommonFlags.isOnline() self.isMC=not globalflags.DataSource()=='data' if (globalflags.DetGeo() in ['atlas','commis']): # ATLAS full or commissioning geometry self.dbmc='OFLP200' self.dbdata=globalflags.DatabaseInstance() #could be 'auto' if self.isMC: # Monte Carlo self.dbname=self.dbmc self.poolcats=['oflcond'] else: # real data if (self.dbdata=='auto'): from RecExConfig.RecFlags import rec self.dbdata=self._InstanceFromProjectName(rec.projectName()) self.msg.info("Configuring database instance %s based on project tag %s", self.dbdata, rec.projectName()) self.dbname=self.dbdata self.poolcats=['comcond','oflcond'] elif (globalflags.DetGeo() in ['ctbh8','ctbh6']): self.dbmc='TMCP200' self.dbdata='TBDP200' if self.isMC: # 2004 combined testbeam, Monte Carlo self.dbname=self.dbmc self.poolcats=['tbcond','oflcond'] else: # 2004 combined testbeam, real data self.dbname=self.dbdata self.poolcats=['tbcond','oflcond'] else: raise RuntimeError("Unknown globalflags.DetGeo: %s" % globalflags.DetGeo()) if (self.dbname!=''): self.msg.info('Setting up conditions DB access to instance %s', self.dbname) # set up all access options - online schemas self._SetAcc('INDET','COOLONL_INDET') self._SetAcc('INDET_ONL','COOLONL_INDET') self._SetAcc('PIXEL','COOLONL_PIXEL') self._SetAcc('PIXEL_ONL','COOLONL_PIXEL') self._SetAcc('SCT','COOLONL_SCT') self._SetAcc('SCT_ONL','COOLONL_SCT') self._SetAcc('TRT','COOLONL_TRT') self._SetAcc('TRT_ONL','COOLONL_TRT') self._SetAcc('LAR','COOLONL_LAR') self._SetAcc('LAR_ONL','COOLONL_LAR') self._SetAcc('TILE','COOLONL_TILE') self._SetAcc('TILE_ONL','COOLONL_TILE') self._SetAcc('MUON','COOLONL_MUON') self._SetAcc('MUON_ONL','COOLONL_MUON') self._SetAcc('MUONALIGN','COOLONL_MUONALIGN') self._SetAcc('MUONALIGN_ONL','COOLONL_MUONALIGN') self._SetAcc('MDT','COOLONL_MDT') self._SetAcc('MDT_ONL','COOLONL_MDT') self._SetAcc('RPC','COOLONL_RPC') self._SetAcc('RPC_ONL','COOLONL_RPC') self._SetAcc('TGC','COOLONL_TGC') self._SetAcc('TGC_ONL','COOLONL_TGC') self._SetAcc('CSC','COOLONL_CSC') self._SetAcc('CSC_ONL','COOLONL_CSC') self._SetAcc('TDAQ','COOLONL_TDAQ') self._SetAcc('TDAQ_ONL','COOLONL_TDAQ') self._SetAcc('GLOBAL','COOLONL_GLOBAL') self._SetAcc('GLOBAL_ONL','COOLONL_GLOBAL') self._SetAcc('TRIGGER','COOLONL_TRIGGER') self._SetAcc('TRIGGER_ONL','COOLONL_TRIGGER') self._SetAcc('CALO','COOLONL_CALO') self._SetAcc('CALO_ONL','COOLONL_CALO') self._SetAcc('FWD','COOLONL_FWD') self._SetAcc('FWD_ONL','COOLONL_FWD') # set up all access options - offline schemas # only do this if isOnline flag is NOT set # or MC flag is set, to allow HLT testing using MC database if (self.isMC or not self.isOnline): self._SetAcc('INDET_OFL','COOLOFL_INDET') self._SetAcc('PIXEL_OFL','COOLOFL_PIXEL') self._SetAcc('SCT_OFL','COOLOFL_SCT') self._SetAcc('TRT_OFL','COOLOFL_TRT') self._SetAcc('LAR_OFL','COOLOFL_LAR') self._SetAcc('TILE_OFL','COOLOFL_TILE') self._SetAcc('MUON_OFL','COOLOFL_MUON') self._SetAcc('MUONALIGN_OFL','COOLOFL_MUONALIGN') self._SetAcc('MDT_OFL','COOLOFL_MDT') self._SetAcc('RPC_OFL','COOLOFL_RPC') self._SetAcc('TGC_OFL','COOLOFL_TGC') self._SetAcc('CSC_OFL','COOLOFL_CSC') self._SetAcc('TDAQ_OFL','COOLOFL_TDAQ') self._SetAcc('DCS_OFL','COOLOFL_DCS') self._SetAcc('GLOBAL_OFL','COOLOFL_GLOBAL') self._SetAcc('TRIGGER_OFL','COOLOFL_TRIGGER') self._SetAcc('CALO_OFL','COOLOFL_CALO') self._SetAcc('FWD_OFL','COOLOFL_FWD') else: self.msg.info('Running in online mode - no access to COOLOFL schemas') self.iovdbsvc.OnlineMode=True # setup default connection to localfile, and put in LOCAL symbol localfile="sqlite://;schema=mycool.db;dbname=" self.dblist['LOCAL']=localfile self.iovdbsvc.dbConnection=localfile+self.dbname # setup knowledge of dbinstance in IOVDbSvc, for global tag x-check self.iovdbsvc.DBInstance=self.dbname # setup DBReplicaSvc to veto DBRelease SQLite files if real data if not self.isMC: from DBReplicaSvc.DBReplicaSvcConf import DBReplicaSvc svcMgr+=DBReplicaSvc(COOLSQLiteVetoPattern="/DBRelease/") # enable Frontier cache alignment if it looks like Frontier will # be used (via FRONTIER_SERVER variable) if 'FRONTIER_SERVER' in os.environ.keys() and os.environ['FRONTIER_SERVER']!="": self.iovdbsvc.CacheAlign=3 # setup PoolSvc catalogues from PoolSvc.PoolSvcConf import PoolSvc if not hasattr (svcMgr, 'PoolSvc'): svcMgr+=PoolSvc() # add the standard catalogues for i in self.poolcats: svcMgr.PoolSvc.ReadCatalog+=["prfile:poolcond/PoolCat_%s.xml" % i] # also add entries which will be resolved using ATLAS_POOLCOND_PATH # (if set) - the actual resolution is done inside PoolSvc C++ for i in self.poolcats: svcMgr.PoolSvc.ReadCatalog+=["apcfile:poolcond/PoolCat_%s.xml" % i] svcMgr.PoolSvc.ReadCatalog+=["apcfile:poolcond/PoolFileCatalog.xml"] else: raise RuntimeError('Not enough configuration information to setup ConditionsDB access (are GlobalFlags being used?)') self.msg.debug("Loading basic services for CondDBSetup... [DONE]")
loadInDetRec_Options["globalTag"]) if len(loadInDetRec_Options["detectorDescription"]) != 0: globalflags.DetDescrVersion.set_Value_and_Lock( loadInDetRec_Options["detectorDescription"]) if len(loadInDetRec_Options["dataSource"]) != 0: globalflags.DataSource.set_Value_and_Lock( loadInDetRec_Options["dataSource"]) if len(loadInDetRec_Options["projectName"]) != 0: rec.projectName.set_Value_and_Lock(loadInDetRec_Options["projectName"]) if len(globalflags.ConditionsTag()) != 0: print "setting global tag" print rec.projectName() from IOVDbSvc.CondDB import conddb conddb.setGlobalTag(globalflags.ConditionsTag()) import MagFieldServices.SetupField # --- number of events to process athenaCommonFlags.EvtMax = int(loadInDetRec_Options["numberOfEvents"]) athenaCommonFlags.SkipEvents = 0 doVP1 = False # --- disable error protection of RecExCommon athenaCommonFlags.AllowIgnoreConfigError.set_Value_and_Lock(False) #--------------------------------------------------------------
def makeInDetAlgs(whichSignature='', separateTrackParticleCreator='', rois='EMViewRoIs', doFTF=True, viewVerifier='IDViewDataVerifier'): #If signature specified add suffix to the algorithms signature = whichSignature if whichSignature else '' if signature != "" and separateTrackParticleCreator == "": separateTrackParticleCreator = signature if signature == "": raise ValueError('makeInDetAlgs() No signature specified') #Global keys/names for Trigger collections from .InDetTrigCollectionKeys import TrigPixelKeys, TrigSCTKeys from InDetRecExample.InDetKeys import InDetKeys from TrigInDetConfig.TrigInDetConfig import InDetCacheNames from AthenaCommon.GlobalFlags import globalflags viewAlgs = [] ViewDataVerifier = None if viewVerifier: import AthenaCommon.CfgMgr as CfgMgr ViewDataVerifier = CfgMgr.AthViews__ViewDataVerifier(viewVerifier + signature) ViewDataVerifier.DataObjects = [ ('InDet::PixelClusterContainerCache', InDetCacheNames.Pixel_ClusterKey), ('PixelRDO_Cache', InDetCacheNames.PixRDOCacheKey), ('InDet::SCT_ClusterContainerCache', InDetCacheNames.SCT_ClusterKey), ('SCT_RDO_Cache', InDetCacheNames.SCTRDOCacheKey), ('SpacePointCache', InDetCacheNames.SpacePointCachePix), ('SpacePointCache', InDetCacheNames.SpacePointCacheSCT), ('IDCInDetBSErrContainer_Cache', InDetCacheNames.SCTBSErrCacheKey), ('IDCInDetBSErrContainer_Cache', InDetCacheNames.SCTFlaggedCondCacheKey), ('xAOD::EventInfo', 'StoreGateSvc+EventInfo'), ('TagInfo', 'DetectorStore+ProcessingTags') ] viewAlgs.append(ViewDataVerifier) # Load RDOs if we aren't loading bytestream from AthenaCommon.AlgSequence import AlgSequence topSequence = AlgSequence() topSequence.SGInputLoader.Load += [('TagInfo', 'DetectorStore+ProcessingTags')] if not globalflags.InputFormat.is_bytestream(): ViewDataVerifier.DataObjects += [ ('PixelRDO_Container', InDetKeys.PixelRDOs()), ('SCT_RDO_Container', InDetKeys.SCT_RDOs()), ('IDCInDetBSErrContainer', InDetKeys.SCT_ByteStreamErrs()) ] topSequence.SGInputLoader.Load += [ ('PixelRDO_Container', InDetKeys.PixelRDOs()), ('SCT_RDO_Container', InDetKeys.SCT_RDOs()), ('IDCInDetBSErrContainer', InDetKeys.SCT_ByteStreamErrs()) ] from InDetTrigRecExample.InDetTrigFlags import InDetTrigFlags from AthenaCommon.AppMgr import ToolSvc #Only add raw data decoders if we're running over raw data if globalflags.InputFormat.is_bytestream(): #Pixel from PixelRawDataByteStreamCnv.PixelRawDataByteStreamCnvConf import PixelRodDecoder InDetPixelRodDecoder = PixelRodDecoder(name="InDetPixelRodDecoder_" + signature) # Disable duplcated pixel check for data15 because duplication mechanism was used. from RecExConfig.RecFlags import rec if len(rec.projectName()) >= 6 and rec.projectName()[:6] == "data15": InDetPixelRodDecoder.CheckDuplicatedPixel = False ToolSvc += InDetPixelRodDecoder from PixelRawDataByteStreamCnv.PixelRawDataByteStreamCnvConf import PixelRawDataProviderTool InDetPixelRawDataProviderTool = PixelRawDataProviderTool( name="InDetPixelRawDataProviderTool_" + signature, Decoder=InDetPixelRodDecoder, checkLVL1ID=False) ToolSvc += InDetPixelRawDataProviderTool if (InDetTrigFlags.doPrintConfigurables()): print(InDetPixelRawDataProviderTool) # noqa: ATL901 # load the PixelRawDataProvider from PixelRawDataByteStreamCnv.PixelRawDataByteStreamCnvConf import PixelRawDataProvider InDetPixelRawDataProvider = PixelRawDataProvider( name="InDetPixelRawDataProvider_" + signature, RDOKey=InDetKeys.PixelRDOs(), ProviderTool=InDetPixelRawDataProviderTool, ) InDetPixelRawDataProvider.isRoI_Seeded = True InDetPixelRawDataProvider.RoIs = rois InDetPixelRawDataProvider.RDOCacheKey = InDetCacheNames.PixRDOCacheKey viewAlgs.append(InDetPixelRawDataProvider) if (InDetTrigFlags.doPrintConfigurables()): print(InDetPixelRawDataProvider) # noqa: ATL901 #SCT from SCT_RawDataByteStreamCnv.SCT_RawDataByteStreamCnvConf import SCT_RodDecoder InDetSCTRodDecoder = SCT_RodDecoder(name="InDetSCTRodDecoder_" + signature) ToolSvc += InDetSCTRodDecoder from SCT_RawDataByteStreamCnv.SCT_RawDataByteStreamCnvConf import SCTRawDataProviderTool InDetSCTRawDataProviderTool = SCTRawDataProviderTool( name="InDetSCTRawDataProviderTool_" + signature, Decoder=InDetSCTRodDecoder) ToolSvc += InDetSCTRawDataProviderTool if (InDetTrigFlags.doPrintConfigurables()): print(InDetSCTRawDataProviderTool) # noqa: ATL901 # load the SCTRawDataProvider from SCT_RawDataByteStreamCnv.SCT_RawDataByteStreamCnvConf import SCTRawDataProvider InDetSCTRawDataProvider = SCTRawDataProvider( name="InDetSCTRawDataProvider_" + signature, RDOKey=InDetKeys.SCT_RDOs(), ProviderTool=InDetSCTRawDataProviderTool) InDetSCTRawDataProvider.isRoI_Seeded = True InDetSCTRawDataProvider.RoIs = rois InDetSCTRawDataProvider.RDOCacheKey = InDetCacheNames.SCTRDOCacheKey InDetSCTRawDataProvider.BSErrCacheKey = InDetCacheNames.SCTBSErrCacheKey from RegionSelector.RegSelToolConfig import makeRegSelTool_SCT InDetSCTRawDataProvider.RegSelTool = makeRegSelTool_SCT() viewAlgs.append(InDetSCTRawDataProvider) # load the SCTEventFlagWriter from SCT_RawDataByteStreamCnv.SCT_RawDataByteStreamCnvConf import SCTEventFlagWriter InDetSCTEventFlagWriter = SCTEventFlagWriter( name="InDetSCTEventFlagWriter_" + signature) viewAlgs.append(InDetSCTEventFlagWriter) #Pixel clusterisation from InDetTrigRecExample.InDetTrigConfigRecLoadTools import TrigPixelLorentzAngleTool, TrigSCTLorentzAngleTool from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelConfigCondAlg PixelConfigCondAlg.UseCalibConditions = False from SiClusterizationTool.SiClusterizationToolConf import InDet__ClusterMakerTool InDetClusterMakerTool = InDet__ClusterMakerTool( name="InDetClusterMakerTool_" + signature, SCTLorentzAngleTool=TrigSCTLorentzAngleTool, PixelLorentzAngleTool=TrigPixelLorentzAngleTool) ToolSvc += InDetClusterMakerTool from SiClusterizationTool.SiClusterizationToolConf import InDet__MergedPixelsTool InDetMergedPixelsTool = InDet__MergedPixelsTool( name="InDetMergedPixelsTool_" + signature, globalPosAlg=InDetClusterMakerTool, MinimalSplitSize=0, MaximalSplitSize=49, MinimalSplitProbability=0, DoIBLSplitting=True, ) # Enable duplcated RDO check for data15 because duplication mechanism was used. from RecExConfig.RecFlags import rec if len(rec.projectName()) >= 6 and rec.projectName()[:6] == "data15": InDetMergedPixelsTool.CheckDuplicatedRDO = True ToolSvc += InDetMergedPixelsTool from SiClusterizationTool.SiClusterizationToolConf import InDet__PixelGangedAmbiguitiesFinder InDetPixelGangedAmbiguitiesFinder = InDet__PixelGangedAmbiguitiesFinder( name="InDetPixelGangedAmbiguitiesFinder_" + signature) ToolSvc += InDetPixelGangedAmbiguitiesFinder from InDetPrepRawDataFormation.InDetPrepRawDataFormationConf import InDet__PixelClusterization InDetPixelClusterization = InDet__PixelClusterization( name="InDetPixelClusterization_" + signature, clusteringTool=InDetMergedPixelsTool, gangedAmbiguitiesFinder=InDetPixelGangedAmbiguitiesFinder, DataObjectName=InDetKeys.PixelRDOs(), AmbiguitiesMap=TrigPixelKeys.PixelClusterAmbiguitiesMap, ClustersName=TrigPixelKeys.Clusters) InDetPixelClusterization.isRoI_Seeded = True InDetPixelClusterization.RoIs = rois InDetPixelClusterization.ClusterContainerCacheKey = InDetCacheNames.Pixel_ClusterKey viewAlgs.append(InDetPixelClusterization) # Create SCT_ConditionsSummaryTool from SCT_ConditionsTools.SCT_ConditionsSummaryToolSetup import SCT_ConditionsSummaryToolSetup sct_ConditionsSummaryToolSetup = SCT_ConditionsSummaryToolSetup( "InDetSCT_ConditionsSummaryTool_" + signature) sct_ConditionsSummaryToolSetup.setup() InDetSCT_ConditionsSummaryTool = sct_ConditionsSummaryToolSetup.getTool( ) # noqa: F841 sct_ConditionsSummaryToolSetupWithoutFlagged = SCT_ConditionsSummaryToolSetup( "InDetSCT_ConditionsSummaryToolWithoutFlagged_" + signature) sct_ConditionsSummaryToolSetupWithoutFlagged.setup() InDetSCT_ConditionsSummaryToolWithoutFlagged = sct_ConditionsSummaryToolSetupWithoutFlagged.getTool( ) # Add conditions tools to SCT_ConditionsSummaryTool from SCT_ConditionsTools.SCT_ConfigurationConditionsToolSetup import SCT_ConfigurationConditionsToolSetup sct_ConfigurationConditionsToolSetup = SCT_ConfigurationConditionsToolSetup( ) sct_ConfigurationConditionsToolSetup.setToolName( "InDetSCT_ConfigurationConditionsTool_" + signature) sct_ConfigurationConditionsToolSetup.setup() InDetSCT_ConditionsSummaryToolWithoutFlagged.ConditionsTools.append( sct_ConfigurationConditionsToolSetup.getTool().getFullName()) from SCT_ConditionsTools.SCT_ReadCalibDataToolSetup import SCT_ReadCalibDataToolSetup sct_ReadCalibDataToolSetup = SCT_ReadCalibDataToolSetup() sct_ReadCalibDataToolSetup.setToolName("InDetSCT_ReadCalibDataTool_" + signature) sct_ReadCalibDataToolSetup.setup() InDetSCT_ConditionsSummaryToolWithoutFlagged.ConditionsTools.append( sct_ReadCalibDataToolSetup.getTool().getFullName()) from SCT_ConditionsTools.SCT_ByteStreamErrorsToolSetup import SCT_ByteStreamErrorsToolSetup sct_ByteStreamErrorsToolSetup = SCT_ByteStreamErrorsToolSetup() sct_ByteStreamErrorsToolSetup.setToolName("InDetSCT_BSErrorTool_" + signature) sct_ByteStreamErrorsToolSetup.setConfigTool( sct_ConfigurationConditionsToolSetup.getTool()) sct_ByteStreamErrorsToolSetup.setup() InDetSCT_ConditionsSummaryToolWithoutFlagged.ConditionsTools.append( sct_ByteStreamErrorsToolSetup.getTool().getFullName()) if (InDetTrigFlags.doPrintConfigurables()): print(InDetSCT_ConditionsSummaryToolWithoutFlagged) # # --- SCT_ClusteringTool # from SiClusterizationTool.SiClusterizationToolConf import InDet__SCT_ClusteringTool InDetSCT_ClusteringTool = InDet__SCT_ClusteringTool( name="InDetSCT_ClusteringTool_" + signature, globalPosAlg=InDetClusterMakerTool, conditionsTool=InDetSCT_ConditionsSummaryToolWithoutFlagged) if InDetTrigFlags.doSCTIntimeHits(): if InDetTrigFlags.InDet25nsec(): InDetSCT_ClusteringTool.timeBins = "01X" else: InDetSCT_ClusteringTool.timeBins = "X1X" # # --- SCT_Clusterization algorithm # from InDetPrepRawDataFormation.InDetPrepRawDataFormationConf import InDet__SCT_Clusterization InDetSCT_Clusterization = InDet__SCT_Clusterization( name="InDetSCT_Clusterization_" + signature, clusteringTool=InDetSCT_ClusteringTool, # ChannelStatus = InDetSCT_ChannelStatusAlg, DataObjectName=InDetKeys.SCT_RDOs(), ClustersName=TrigSCTKeys.Clusters, #Adding the suffix to flagged conditions SCT_FlaggedCondData="SCT_FlaggedCondData_TRIG", conditionsTool=InDetSCT_ConditionsSummaryToolWithoutFlagged) InDetSCT_Clusterization.isRoI_Seeded = True InDetSCT_Clusterization.RoIs = rois InDetSCT_Clusterization.ClusterContainerCacheKey = InDetCacheNames.SCT_ClusterKey InDetSCT_Clusterization.FlaggedCondCacheKey = InDetCacheNames.SCTFlaggedCondCacheKey from RegionSelector.RegSelToolConfig import makeRegSelTool_SCT InDetSCT_Clusterization.RegSelTool = makeRegSelTool_SCT() viewAlgs.append(InDetSCT_Clusterization) #Space points and FTF from SiSpacePointTool.SiSpacePointToolConf import InDet__SiSpacePointMakerTool InDetSiSpacePointMakerTool = InDet__SiSpacePointMakerTool( name="InDetSiSpacePointMakerTool_" + signature) from AthenaCommon.DetFlags import DetFlags from SiSpacePointFormation.SiSpacePointFormationConf import InDet__SiTrackerSpacePointFinder from SiSpacePointFormation.InDetOnlineMonitor import InDetMonitoringTool InDetSiTrackerSpacePointFinder = InDet__SiTrackerSpacePointFinder( name="InDetSiTrackerSpacePointFinder_" + signature, SiSpacePointMakerTool=InDetSiSpacePointMakerTool, PixelsClustersName=TrigPixelKeys.Clusters, SpacePointsPixelName=TrigPixelKeys.SpacePoints, SCT_ClustersName=TrigSCTKeys.Clusters, SpacePointsSCTName=TrigSCTKeys.SpacePoints, SpacePointsOverlapName=InDetKeys.OverlapSpacePoints(), ProcessPixels=DetFlags.haveRIO.pixel_on(), ProcessSCTs=DetFlags.haveRIO.SCT_on(), ProcessOverlaps=DetFlags.haveRIO.SCT_on(), SpacePointCacheSCT=InDetCacheNames.SpacePointCacheSCT, SpacePointCachePix=InDetCacheNames.SpacePointCachePix, monTool=InDetMonitoringTool()) viewAlgs.append(InDetSiTrackerSpacePointFinder) # Condition algorithm for SiTrackerSpacePointFinder if InDetSiTrackerSpacePointFinder.ProcessSCTs: from AthenaCommon.AlgSequence import AthSequencer condSeq = AthSequencer("AthCondSeq") if not hasattr(condSeq, "InDetSiElementPropertiesTableCondAlg"): # Setup alignment folders and conditions algorithms from SiSpacePointFormation.SiSpacePointFormationConf import InDet__SiElementPropertiesTableCondAlg condSeq += InDet__SiElementPropertiesTableCondAlg( name="InDetSiElementPropertiesTableCondAlg") #FIXME have a flag for now set for True( as most cases call FTF) but potentially separate if doFTF: from TrigFastTrackFinder.TrigFastTrackFinder_Config import TrigFastTrackFinderBase theFTF = TrigFastTrackFinderBase( "TrigFastTrackFinder_" + whichSignature, whichSignature) theFTF.RoIs = rois theFTF.TracksName = "TrigFastTrackFinder_Tracks_" + separateTrackParticleCreator #the following doCloneRemoval modification should be set up in the InDetTrigSliceSettings once legacy trigger not needed if whichSignature == "Electron": theFTF.doCloneRemoval = True viewAlgs.append(theFTF) from TrigInDetConf.TrigInDetPostTools import InDetTrigParticleCreatorToolFTF from TrigEDMConfig.TriggerEDMRun3 import recordable from InDetTrigParticleCreation.InDetTrigParticleCreationConf import InDet__TrigTrackingxAODCnvMT trackCollection = "HLT_IDTrack_" + separateTrackParticleCreator + "_FTF" theTrackParticleCreatorAlg = InDet__TrigTrackingxAODCnvMT( name="InDetTrigTrackParticleCreatorAlg" + whichSignature, TrackName="TrigFastTrackFinder_Tracks_" + separateTrackParticleCreator, ParticleCreatorTool=InDetTrigParticleCreatorToolFTF) if separateTrackParticleCreator == "BeamSpot": theTrackParticleCreatorAlg.TrackParticlesName = trackCollection else: theTrackParticleCreatorAlg.TrackParticlesName = recordable( trackCollection) viewAlgs.append(theTrackParticleCreatorAlg) return viewAlgs, ViewDataVerifier
from CaloRec.CaloRecFlags import jobproperties from AthenaCommon.Resilience import treatException from RecExConfig.RecFlags import rec from AthenaCommon.GlobalFlags import globalflags from AthenaCommon.DetFlags import DetFlags from AthenaCommon.Logging import logging if globalflags.DataSource() == 'data': if rec.projectName() == "data09_calophys": # for data09_calophys project, force to use DSP output for the cell energy, perform reco like DSP, no dead cell correction if rec.doLArg(): from LArROD.LArRODFlags import larRODFlags larRODFlags.readDigits = False if rec.doTile(): from TileRecUtils.TileRecFlags import jobproperties jobproperties.TileRecFlags.readDigits = False from CaloRec.CaloCellFlags import jobproperties jobproperties.CaloCellFlags.doDeadCellCorr = False jobproperties.CaloCellFlags.doLArCreateMissingCells = False jobproperties.CaloCellFlags.doLArDeadOTXCorr = False else: if rec.doLArg() and globalflags.InputFormat( ) == 'bytestream' and jobproperties.CaloRecFlags.doLArAutoConfiguration( ): # for bytestream reco of real data, autoconfigure based on the run format information # use digits only when digits available for all cells (transparent or rawdataresult)
# Job options file for accessing LArRawConditions objects from COOL # For real data # #================================================================== include.block("LArConditionsCommon/LArConditionsCommon_comm_jobOptions.py") if not "SuperCells" in dir(): SuperCells = False from RecExConfig.RecFlags import rec from LArConditionsCommon.LArCondFlags import larCondFlags from IOVDbSvc.CondDB import conddb if rec.projectName().startswith("data09"): larCondFlags.LArCoolChannelSelection = "3:238,306,313,319,325,331,338,344,350,1001:1012,1021,1022" larCondFlags.OFCShapeFolder = "5samples3bins17phases" if svcMgr.MessageSvc.OutputLevel <= DEBUG: print larCondFlags if larCondFlags.LArElecCalibSqlite.statusOn and larCondFlags.LArElecCalibSqlite( ) != "": # Assume sqlite file contains the online database. Adjust other flags as needed sqlDB = "<db>sqlite://;schema=" + larCondFlags.LArElecCalibSqlite( ) + ";dbname=CONDB2</db>" ONLDB = "" larCondFlags.ua2MeVFolder = "" larCondFlags.MphysOverMcalFolder = "" larCondFlags.OFCShapeFolder = ""
def __init__(self, name="PixelClustering_Electron_EF", type="electron"): super(InDet__Pixel_TrgClusterization, self).__init__(name) from AthenaCommon.AppMgr import ToolSvc # configure tools used from PixelRawDataByteStreamCnv.PixelRawDataByteStreamCnvConf import PixelRodDecoder InDetTrigPixelRodDecoder = PixelRodDecoder( name="InDetTrigPixelRodDecoder") #InDetTrigPixelRodDecoder.OutputLevel=1 # Disable duplcated pixel check for data15 because duplication mechanism was used. from RecExConfig.RecFlags import rec if len(rec.projectName()) >= 6 and rec.projectName()[:6] == "data15": InDetTrigPixelRodDecoder.CheckDuplicatedPixel = False ToolSvc += InDetTrigPixelRodDecoder from PixelRawDataByteStreamCnv.PixelRawDataByteStreamCnvConf import PixelRawDataProviderTool InDetTrigPixelRawDataProviderTool = PixelRawDataProviderTool( name="InDetTrigPixelRawDataProviderTool", Decoder=InDetTrigPixelRodDecoder) ToolSvc += InDetTrigPixelRawDataProviderTool from InDetTrigRawDataProvider.InDetTrigRawDataProviderConf import InDet__TrigPixRawDataProvider InDetTrigPixRawDataProvider = \ InDet__TrigPixRawDataProvider(name="TrigPixRawDataProvider_EF", RawDataProviderTool = InDetTrigPixelRawDataProviderTool, RDOKey = EF_PixRDOKey) ToolSvc += InDetTrigPixRawDataProvider # ClusterMakerTool (public), needed by Pixel and SCT Clusterization from InDetTrigRecExample.InDetTrigConfigRecLoadTools import InDetTrigClusterMakerTool from InDetTrigRecExample.InDetTrigConditionsAccess import PixelConditionsSetup # MergedPixelTool (public) from SiClusterizationTool.SiClusterizationToolConf import InDet__MergedPixelsTool from InDetTrigRecExample.InDetTrigConfigRecLoadTools import InDetTrigPixelConditionsSummaryTool InDetTrigMergedPixelsTool = InDet__MergedPixelsTool( name="InDetTrigMergedPixelsTool", globalPosAlg=InDetTrigClusterMakerTool, PixelConditionsSummaryTool=InDetTrigPixelConditionsSummaryTool, #UseSpecialPixelMap = False #simpler setup for EFID UseSpecialPixelMap=True, MinimalSplitSize=0, MaximalSplitSize=49, MinimalSplitProbability=0, ) # Enable duplcated RDO check for data15 because duplication mechanism was used. from RecExConfig.RecFlags import rec if len(rec.projectName()) >= 6 and rec.projectName()[:6] == "data15": InDetTrigMergedPixelsTool.CheckDuplicatedRDO = True ToolSvc += InDetTrigMergedPixelsTool # PixelGangedAmbiguitiesFinder tool (public) from SiClusterizationTool.SiClusterizationToolConf import InDet__PixelGangedAmbiguitiesFinder InDetTrigPixelGangedAmbiguitiesFinder = InDet__PixelGangedAmbiguitiesFinder( name="InDetTrigPixelGangedAmbiguitiesFinder") ToolSvc += InDetTrigPixelGangedAmbiguitiesFinder self.RawDataProvider = InDetTrigPixRawDataProvider self.clusteringTool = InDetTrigMergedPixelsTool self.gangedAmbiguitiesFinder = InDetTrigPixelGangedAmbiguitiesFinder self.Pixel_RDOContainerName = EF_PixRDOKey from AthenaCommon.GlobalFlags import globalflags self.skipBSDecoding = globalflags.InputFormat == 'pool' and not TriggerFlags.doTransientByteStream( ) from InDetTrigRecExample.InDetTrigSliceSettings import InDetTrigSliceSettings self.EtaHalfWidth = InDetTrigSliceSettings[('etaHalfWidth', type)] self.PhiHalfWidth = InDetTrigSliceSettings[('phiHalfWidth', type)] self.doFullScan = InDetTrigSliceSettings[('doFullScan', type)] #monitoring from InDetTrigPrepRawDataFormat.InDetTrigPrepRawDataFormatMonitoring import PixelTrigPrepRawDataFormatValidationMonitor from InDetTrigPrepRawDataFormat.InDetTrigPrepRawDataFormatMonitoring import PixelTrigPrepRawDataFormatOnlineMonitor from TrigTimeMonitor.TrigTimeHistToolConfig import TrigTimeHistToolConfig pixtime = TrigTimeHistToolConfig("PixTime") pixtime.TimerHistLimits = [0, 100] self.AthenaMonTools = [ PixelTrigPrepRawDataFormatValidationMonitor(type=type), PixelTrigPrepRawDataFormatOnlineMonitor(type=type), pixtime ]
loadInDetRec_Options["globalTag"]) if len(loadInDetRec_Options["detectorDescription"]) != 0: globalflags.DetDescrVersion.set_Value_and_Lock( loadInDetRec_Options["detectorDescription"]) if len(loadInDetRec_Options["dataSource"]) != 0: globalflags.DataSource.set_Value_and_Lock( loadInDetRec_Options["dataSource"]) if len(loadInDetRec_Options["projectName"]) != 0: rec.projectName.set_Value_and_Lock(loadInDetRec_Options["projectName"]) if len(globalflags.ConditionsTag()) != 0: printfunc("setting global tag") printfunc(rec.projectName()) from IOVDbSvc.CondDB import conddb conddb.setGlobalTag(globalflags.ConditionsTag()) import MagFieldServices.SetupField # --- number of events to process athenaCommonFlags.EvtMax = int(loadInDetRec_Options["numberOfEvents"]) athenaCommonFlags.SkipEvents = 0 doVP1 = False # --- disable error protection of RecExCommon athenaCommonFlags.AllowIgnoreConfigError.set_Value_and_Lock(False) #--------------------------------------------------------------