From 3044222a245a8721af61fa22ab25ca23738db94a Mon Sep 17 00:00:00 2001 From: Graeme Stewart <graemes.cern@gmail.com> Date: Thu, 2 Feb 2017 22:04:34 +0100 Subject: [PATCH] Tools/FullChainTransforms deleted from master --- Tools/FullChainTransforms/cmt/requirements | 12 - .../scripts/FastChain_tf.py | 100 ---- .../scripts/FullChain_tf.py | 84 ---- .../share/skeleton.EVGENtoRDO.py | 435 ------------------ 4 files changed, 631 deletions(-) delete mode 100644 Tools/FullChainTransforms/cmt/requirements delete mode 100755 Tools/FullChainTransforms/scripts/FastChain_tf.py delete mode 100755 Tools/FullChainTransforms/scripts/FullChain_tf.py delete mode 100644 Tools/FullChainTransforms/share/skeleton.EVGENtoRDO.py diff --git a/Tools/FullChainTransforms/cmt/requirements b/Tools/FullChainTransforms/cmt/requirements deleted file mode 100644 index 6f52a7a3f4b..00000000000 --- a/Tools/FullChainTransforms/cmt/requirements +++ /dev/null @@ -1,12 +0,0 @@ -package FullChainTransforms - -use AtlasPolicy AtlasPolicy-* -use AtlasPython AtlasPython-* External -no_auto_imports -use PyJobTransforms PyJobTransforms-* Tools -use PATJobTransforms PATJobTransforms-* PhysicsAnalysis -use RecJobTransforms RecJobTransforms-* Reconstruction -use SimuJobTransforms SimuJobTransforms-* Simulation - -apply_pattern declare_python_modules files="*.py" - -apply_pattern declare_job_transforms tfs='*.py' jo='*.py' diff --git a/Tools/FullChainTransforms/scripts/FastChain_tf.py b/Tools/FullChainTransforms/scripts/FastChain_tf.py deleted file mode 100755 index cb0a0188ae7..00000000000 --- a/Tools/FullChainTransforms/scripts/FastChain_tf.py +++ /dev/null @@ -1,100 +0,0 @@ -#! /usr/bin/env python - -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration - -# FastChain_tf.py -# One step transform to run SIM+DIGI as one job, then reco -# to ESD/AOD output -# Richard Hawkings, adapted from FullChain_tf.py by Graeme Stewart - -import sys -import time - -import logging - -# Setup core logging here -from PyJobTransforms.trfLogger import msg -msg.info('logging set in %s' % sys.argv[0]) - -from PyJobTransforms.transform import transform -from PyJobTransforms.trfExe import athenaExecutor -from PyJobTransforms.trfArgs import addAthenaArguments, addDetectorArguments, addTriggerArguments -from PyJobTransforms.trfDecorators import stdTrfExceptionHandler, sigUsrStackTrace -from RecJobTransforms.recTransformUtils import addRecoSubsteps, addAllRecoArgs -from SimuJobTransforms.simTrfArgs import addForwardDetTrfArgs, addForwardDetTrfArgs, addCommonSimTrfArgs, addBasicDigiArgs, addCommonSimDigTrfArgs, addTrackRecordArgs, addSim_tfArgs - -from PyJobTransforms.trfArgClasses import argFactory,argList - -@stdTrfExceptionHandler -@sigUsrStackTrace -def main(): - - msg.info('This is %s' % sys.argv[0]) - - trf = getTransform() - trf.parseCmdLineArgs(sys.argv[1:]) - trf.execute() - trf.generateReport() - - msg.info("%s stopped at %s, trf exit code %d" % (sys.argv[0], time.asctime(), trf.exitCode)) - sys.exit(trf.exitCode) - -def getTransform(): - executorSet = set() - - addRecoSubsteps(executorSet) - - # Sim + Digi - factor these out into an importable function in time - executorSet.add(athenaExecutor(name = 'EVNTtoRDO', skeletonFile = 'FullChainTransforms/skeleton.EVGENtoRDO.py', - substep = 'simdigi', tryDropAndReload = False, perfMonFile = 'ntuple.pmon.gz', - inData=['NULL','EVNT'], - outData=['RDO','NULL'] )) - - trf = transform(executor = executorSet, description = 'Fast chain ATLAS transform with ISF simulation, digitisation' - ' and reconstruction. Inputs can be EVNT, with outputs of RDO, ESD, AOD or DPDs.' - ' See https://twiki.cern.ch/twiki/bin/viewauth/AtlasComputing/FastChainTf for more details.') - - # Common arguments - addAthenaArguments(trf.parser) - addDetectorArguments(trf.parser) - addTriggerArguments(trf.parser) - - # Reconstruction arguments and outputs (use the factorised 'do it all' function) - addAllRecoArgs(trf) - - # Simulation and digitisation options - addCommonSimTrfArgs(trf.parser) - addCommonSimDigTrfArgs(trf.parser) - addBasicDigiArgs(trf.parser) - addSim_tfArgs(trf.parser) - # addForwardDetTrfArgs(trf.parser) - addCommonSimDigTrfArgs(trf.parser) - addTrackRecordArgs(trf.parser) - addFastChainTrfArgs(trf.parser) - - return trf - -def addFastChainTrfArgs(parser): - "Add transformation arguments for fast chain" - parser.defineArgGroup('FastChain','Fast chain options') - parser.add_argument('--preSimExec',type=argFactory(argList),nargs='+', - help='preExec before simulation step', - group='FastChain') - parser.add_argument('--postSimExec',type=argFactory(argList),nargs='+', - help='postExec after simulation step', - group='FastChain') - parser.add_argument('--preDigiExec',type=argFactory(argList),nargs='+', - help='preExec before digitisation step', - group='FastChain') - parser.add_argument('--preSimInclude',type=argFactory(argList),nargs='+', - help='preInclude before simulation step', - group='FastChain') - parser.add_argument('--postSimInclude',type=argFactory(argList),nargs='+', - help='postInclude after simulation step', - group='FastChain') - parser.add_argument('--preDigiInclude',type=argFactory(argList),nargs='+', - help='preInclude before digitisation step', - group='FastChain') - -if __name__ == '__main__': - main() diff --git a/Tools/FullChainTransforms/scripts/FullChain_tf.py b/Tools/FullChainTransforms/scripts/FullChain_tf.py deleted file mode 100755 index 790c6b0ff70..00000000000 --- a/Tools/FullChainTransforms/scripts/FullChain_tf.py +++ /dev/null @@ -1,84 +0,0 @@ -#! /usr/bin/env python - -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration - -## FullChain_tf.py -# One step transform that will start from EVNT and run ISF right through -# to AOD output -# @version $Id: FullChain_tf.py 592310 2014-04-10 09:51:28Z graemes $ - -import sys -import time - -import logging - -# Setup core logging here -from PyJobTransforms.trfLogger import msg -msg.info('logging set in %s' % sys.argv[0]) - -from PyJobTransforms.transform import transform -from PyJobTransforms.trfExe import athenaExecutor -from PyJobTransforms.trfArgs import addAthenaArguments, addDetectorArguments, addTriggerArguments -from PyJobTransforms.trfDecorators import stdTrfExceptionHandler, sigUsrStackTrace -from RecJobTransforms.recTransformUtils import addRecoSubsteps, addAllRecoArgs -from SimuJobTransforms.simTrfArgs import addForwardDetTrfArgs, addCosmicsTrfArgs, addForwardDetTrfArgs, addCommonSimTrfArgs, addBasicDigiArgs, addPileUpTrfArgs, addCommonSimDigTrfArgs, addTrackRecordArgs, addSim_tfArgs -from SimuJobTransforms.SimTransformUtils import addDigitizationSubstep - -import PyJobTransforms.trfArgClasses as trfArgClasses - -ListOfDefaultPositionalKeys=['--AFPOn', '--ALFAOn', '--AMIConfig', '--AMITag', '--AddCaloDigi', '--CosmicFilterVolume', '--CosmicFilterVolume2', '--CosmicPtSlice', '--DBRelease', '--DataRunNumber', '--FwdRegionOn', '--LucidOn', '--ZDCOn', '--asetup', '--athena', '--athenaopts', '--autoConfiguration', '--beamType', '--bunchSpacing', '--checkEventCount', '--command', '--conditionsTag', '--digiRndmSvc', '--digiSeedOffset1', '--digiSeedOffset2', '--doAllNoise', '--enableLooperKiller', '--env', '--eventAcceptanceEfficiency', '--execOnly', '--firstEvent', '--geometryVersion', '--ignoreErrors', '--ignoreFiles', '--ignorePatterns', '--imf', '--inputAODFile', '--inputBSFile', '--inputBeamGasHitsFile', '--inputBeamHaloHitsFile', '--inputCavernHitsFile', '--inputESDFile', '--inputEVNTFile', '--inputEVNT_CAVERNFile', '--inputEVNT_COSMICSFile', '--inputHITSFile', '--inputHighPtMinbiasHitsFile', '--inputLowPtMinbiasHitsFile', '--inputNTUP_COMMONFile', '--inputRDOFile', '--jobNumber', '--maxEvents', '--numberOfBeamGas', '--numberOfBeamHalo', '--numberOfCavernBkg', '--numberOfHighPtMinBias', '--numberOfLowPtMinBias', '--orphanKiller', '--outputAODFile', '--outputAOD_SKIMFile', '--outputD2AODM_WMUNUFile', '--outputD2AODM_ZEEFile', '--outputD2AODM_ZMUMUFile', '--outputD2AOD_DIONIAFile', '--outputD2AOD_DIPHOFile', '--outputD2AOD_H4LFile', '--outputD2AOD_WENUFile', '--outputD2AOD_ZEEFile', '--outputD2ESDM_TRKJETFile', '--outputD2ESD_DIPHOFile', '--outputD2ESD_JPSIUPSMMFile', '--outputD2ESD_WENUFile', '--outputD2ESD_WMUNUFile', '--outputD2ESD_ZMMFile', '--outputDAODFile', '--outputDAODM_HIGHMJJFile', '--outputDAODM_HSG1File', '--outputDAODM_SGLEMFile', '--outputDAODM_SGLMUFile', '--outputDAODM_SGLPHFile', '--outputDAODM_SGLTAUFile', '--outputDAOD_2EMFile', '--outputDAOD_2L2QHSG2File', '--outputDAOD_2LHSG2File', '--outputDAOD_2MUFile', '--outputDAOD_2PHFile', '--outputDAOD_4LHSG2File', '--outputDAOD_EGLOOSEFile', '--outputDAOD_ELLOOSE18File', '--outputDAOD_ELLOOSEFile', '--outputDAOD_EMJETFile', '--outputDAOD_EMMETFile', '--outputDAOD_EMMUFile', '--outputDAOD_EMTAUFile', '--outputDAOD_H4LBREMRECFile', '--outputDAOD_HIGHMDIJETFile', '--outputDAOD_HSG2File', '--outputDAOD_JETMETFile', '--outputDAOD_JPSIMUMUFile', '--outputDAOD_MUFile', '--outputDAOD_MUJETFile', '--outputDAOD_MUMETFile', '--outputDAOD_MUTAUFile', '--outputDAOD_ONIAMUMUFile', '--outputDAOD_PHLOOSEFile', '--outputDAOD_RNDMFile', '--outputDAOD_SKIMELFile', '--outputDAOD_SUSYEGAMMAFile', '--outputDAOD_SUSYJETSFile', '--outputDAOD_SUSYMUONSFile', '--outputDAOD_TAUJETFile', '--outputDAOD_TESTFile', '--outputDAOD_UPSIMUMUFile', '--outputDAOD_ZEEGAMMAFile', '--outputDAOD_ZMUMUGAMMAFile', '--outputDESDM_ALLCELLSFile', '--outputDESDM_BEAMSPOTFile', '--outputDESDM_EGAMMAFile', '--outputDESDM_METFile', '--outputDESDM_MUONFile', '--outputDESDM_RPVLLCCFile', '--outputDESDM_RPVLLFile', '--outputDESDM_TRACKFile', '--outputDESD_CALJETFile', '--outputDESD_CALOCOMMFile', '--outputDESD_COLLCANDFile', '--outputDESD_CTLFWJETFile', '--outputDESD_EGTAUCOMMFile', '--outputDESD_EMCLUSCOMMFile', '--outputDESD_FWJETFile', '--outputDESD_HIRAREFile', '--outputDESD_IDCOMMFile', '--outputDESD_IDPROJCOMMFile', '--outputDESD_MBIASFile', '--outputDESD_MUONCOMMFile', '--outputDESD_ONIAMUMUHIFile', '--outputDESD_PHOJETFile', '--outputDESD_PIXELCOMMFile', '--outputDESD_PRESCALEDFile', '--outputDESD_RANDOMCOMMFile', '--outputDESD_RPCCOMMFile', '--outputDESD_SCTCOMMFile', '--outputDESD_SGLELFile', '--outputDESD_SGLMUFile', '--outputDESD_SKIMELFile', '--outputDESD_TGCCOMMFile', '--outputDESD_TILECOMMFile', '--outputDNTUPFile', '--outputDRAW_IDPROJCOMMFile', '--outputDRAW_WENUFile', '--outputDRAW_WMUNUFile', '--outputDRAW_ZEEFile', '--outputDRAW_ZMUMUFile', '--outputESDFile', '--outputEVNT_CAVERNTRFile', '--outputEVNT_COSMICSTRFile', '--outputHISTFile', '--outputHIST_AODFile', '--outputHITSFile', '--outputNTUP_2L2QHSG2File', '--outputNTUP_2LHSG2File', '--outputNTUP_4LHSG2File', '--outputNTUP_BKGDFile', '--outputNTUP_BTAGD3PDFile', '--outputNTUP_BTAGEFFFile', '--outputNTUP_BTAGFULLFile', '--outputNTUP_BTAGGHOSTFile', '--outputNTUP_BTAGSLIMFile', '--outputNTUP_CLUSTERCORRECTIONFile', '--outputNTUP_COMMONFile', '--outputNTUP_EGAMMAFile', '--outputNTUP_ENHBIASFile', '--outputNTUP_FASTMONFile', '--outputNTUP_HECNOISEFile', '--outputNTUP_HIFile', '--outputNTUP_HIGHMULTFile', '--outputNTUP_HSG2File', '--outputNTUP_HSG5GAMHFile', '--outputNTUP_HSG5GAMZFile', '--outputNTUP_HSG5WHFile', '--outputNTUP_HSG5WHQFile', '--outputNTUP_HSG5WHUFile', '--outputNTUP_HSG5ZBBFile', '--outputNTUP_HSG5ZHLLFile', '--outputNTUP_HSG5ZHLLUFile', '--outputNTUP_HSG5ZHMETFile', '--outputNTUP_HSG5ZHMETUFile', '--outputNTUP_IDVTXFile', '--outputNTUP_IDVTXLUMIFile', '--outputNTUP_JETMETEMCLFile', '--outputNTUP_JETMETFULLFile', '--outputNTUP_JETMETFile', '--outputNTUP_JETMETWZFile', '--outputNTUP_L1CALOFile', '--outputNTUP_L1CALOPROBFile', '--outputNTUP_L1TGCFile', '--outputNTUP_LARNOISEFile', '--outputNTUP_MCPFile', '--outputNTUP_MINBIASFile', '--outputNTUP_MUFASTFile', '--outputNTUP_MUONCALIBFile', '--outputNTUP_MUONFile', '--outputNTUP_PHOTONFile', '--outputNTUP_PHYSICSFile', '--outputNTUP_PROMPTPHOTFile', '--outputNTUP_SCTFile', '--outputNTUP_SMBKGEFile', '--outputNTUP_SMBKGMUFile', '--outputNTUP_SMDILEPFile', '--outputNTUP_SMDYEEFile', '--outputNTUP_SMDYMUMUFile', '--outputNTUP_SMLIGHTFile', '--outputNTUP_SMQCDFile', '--outputNTUP_SMTRILEPFile', '--outputNTUP_SMWENUFile', '--outputNTUP_SMWENUJJFile', '--outputNTUP_SMWMUNUFile', '--outputNTUP_SMWMUNUJJFile', '--outputNTUP_SMWZFile', '--outputNTUP_SMWZSOFTFile', '--outputNTUP_SMZEEFile', '--outputNTUP_SMZMUMUFile', '--outputNTUP_SUSY01LEPFile', '--outputNTUP_SUSY23LEPFile', '--outputNTUP_SUSY34LEPFile', '--outputNTUP_SUSYBOOSTFile', '--outputNTUP_SUSYFile', '--outputNTUP_SUSYLEPTAUFile', '--outputNTUP_SUSYLLPFile', '--outputNTUP_SUSYRAZORFile', '--outputNTUP_SUSYSKIMFile', '--outputNTUP_SUSYTAGFile', '--outputNTUP_SUSYTRUTHFile', '--outputNTUP_TAUFULLFile', '--outputNTUP_TAUFile', '--outputNTUP_TAUMEDIUMFile', '--outputNTUP_TAUSMALLFile', '--outputNTUP_TOPBOOSTFile', '--outputNTUP_TOPEJETFile', '--outputNTUP_TOPELFile', '--outputNTUP_TOPFile', '--outputNTUP_TOPJETFile', '--outputNTUP_TOPMUFile', '--outputNTUP_TPHSG2File', '--outputNTUP_TRIGBJETFile', '--outputNTUP_TRIGFile', '--outputNTUP_TRIGMUFile', '--outputNTUP_TRKVALIDFile', '--outputNTUP_TRTFile', '--outputNTUP_TRUTHFile', '--outputNTUP_WPRIMEENFile', '--outputNTUP_WPRIMEMNFile', '--outputNTUP_WZFile', '--outputNTUP_ZPRIMEEEFile', '--outputNTUP_ZPRIMEMMFile', '--outputRDOFile', '--outputTAGFile', '--physicsList', '--pileupFinalBunch', '--pileupInitialBunch', '--postExec', '--postInclude', '--preExec', '--preInclude', '--randomSeed', '--reductionConf', '--reportName', '--reportType', '--runNumber', '--samplingFractionDbTag', '--showGraph', '--showPath', '--showSteps', '--simulator', '--skipEvents', '--skipFileValidation', '--skipInputFileValidation', '--skipOutputFileValidation', '--tcmalloc', '--testPileUpConfig', '--tmpRDO', '--trigFilterList', '--triggerConfig', '--useISF'] - -@stdTrfExceptionHandler -@sigUsrStackTrace -def main(): - - msg.info('This is %s' % sys.argv[0]) - - trf = getTransform() - trf.parseCmdLineArgs(sys.argv[1:]) - trf.execute() - trf.generateReport() - - msg.info("%s stopped at %s, trf exit code %d" % (sys.argv[0], time.asctime(), trf.exitCode)) - sys.exit(trf.exitCode) - -def getTransform(): - executorSet = set() - - addRecoSubsteps(executorSet) - addDigitizationSubstep(executorSet) - - - # Sim + Digi - factor these out into an importable function in time - executorSet.add(athenaExecutor(name = 'EVNTtoHITS', skeletonFile = 'SimuJobTransforms/skeleton.EVGENtoHIT_ISF.py', - substep = 'sim', tryDropAndReload = False, perfMonFile = 'ntuple.pmon.gz', - inData=['NULL','EVNT','EVNT_CAVERN','EVNT_COSMICS'], - outData=['EVNT_CAVERNTR','EVNT_COSMICSTR','HITS','NULL'] )) - - trf = transform(executor = executorSet, description = 'Full chain ATLAS transform with ISF simulation, digitisation' - ' and reconstruction. Inputs can be EVNT, HITS, RDO, BS, ESD or AOD, with outputs of RDO, ESD, AOD or DPDs.' - ' See https://twiki.cern.ch/twiki/bin/viewauth/Atlas/FullChainTf for more details.') - - # Common arguments - addAthenaArguments(trf.parser) - addDetectorArguments(trf.parser) - addTriggerArguments(trf.parser) - - # Reconstruction arguments and outputs (use the factorised 'do it all' function) - addAllRecoArgs(trf) - - # Simulation and digitisation options - addCommonSimTrfArgs(trf.parser) - addCommonSimDigTrfArgs(trf.parser) - addCosmicsTrfArgs(trf.parser) - addBasicDigiArgs(trf.parser) - addSim_tfArgs(trf.parser) - addForwardDetTrfArgs(trf.parser) - addPileUpTrfArgs(trf.parser) - addCommonSimDigTrfArgs(trf.parser) - addTrackRecordArgs(trf.parser) - - return trf - -if __name__ == '__main__': - main() diff --git a/Tools/FullChainTransforms/share/skeleton.EVGENtoRDO.py b/Tools/FullChainTransforms/share/skeleton.EVGENtoRDO.py deleted file mode 100644 index cde0666c019..00000000000 --- a/Tools/FullChainTransforms/share/skeleton.EVGENtoRDO.py +++ /dev/null @@ -1,435 +0,0 @@ -# skeleton.EVGENtoRDO.py -# skeleton file for running simulation+digi in one job for FastChain -# currently using full simulation and digi, will swap in fast components later -# Richard Hawkings, Dec 2014, based on work by Robert Harrington -# started by merging simulation and digitisaton skeletons, then modifying -# removed cosmics, beam gas/halo and pileup configuration -# trigger will not be run - -### Start of Sim - -## Include common skeleton -include("SimuJobTransforms/skeleton.EVGENtoHIT.py") - -if hasattr(runArgs, 'useISF') and not runArgs.useISF: - raise RuntimeError("Unsupported configuration! If you want to run with useISF=False, please use AtlasG4_tf.py!") - -## Get the logger -from AthenaCommon.Logging import * -fast_chain_log = logging.getLogger('ISF') -fast_chain_log.info('****************** STARTING ISF ******************') - -### Force trigger to be off -from RecExConfig.RecFlags import rec -rec.doTrigger.set_Value_and_Lock(False) - - -## Simulation flags need to be imported first -from G4AtlasApps.SimFlags import simFlags -simFlags.load_atlas_flags() -simFlags.ISFRun=True -from ISF_Config.ISF_jobProperties import ISF_Flags - -## Set simulation geometry tag -if hasattr(runArgs, 'geometryVersion'): - simFlags.SimLayout.set_Value_and_Lock(runArgs.geometryVersion) - globalflags.DetDescrVersion = simFlags.SimLayout.get_Value() - fast_chain_log.debug('SimLayout set to %s' % simFlags.SimLayout) -else: - raise RuntimeError("No geometryVersion provided.") - -## AthenaCommon flags -from AthenaCommon.AthenaCommonFlags import athenaCommonFlags -# Jobs should stop if an include fails. -if hasattr(runArgs, "IgnoreConfigError"): - athenaCommonFlags.AllowIgnoreConfigError = runArgs.IgnoreConfigError -else: - athenaCommonFlags.AllowIgnoreConfigError = False - -athenaCommonFlags.DoFullChain=True - -from AthenaCommon.BeamFlags import jobproperties - -## Input Files -def setInputEvgenFileJobProperties(InputEvgenFile): - from AthenaCommon.GlobalFlags import globalflags - globalflags.InputFormat.set_Value_and_Lock('pool') - from AthenaCommon.AthenaCommonFlags import athenaCommonFlags - athenaCommonFlags.PoolEvgenInput.set_Value_and_Lock( InputEvgenFile ) - athenaCommonFlags.FilesInput.set_Value_and_Lock( InputEvgenFile ) - -if hasattr(runArgs, "inputFile"): - athenaCommonFlags.FilesInput.set_Value_and_Lock( runArgs.inputFile ) -# We don't expect both inputFile and inputEVNT*File to be specified -if hasattr(runArgs, "inputEVNTFile"): - setInputEvgenFileJobProperties( runArgs.inputEVNTFile ) -elif hasattr(runArgs, "inputEVNT_COSMICSFile"): - setInputEvgenFileJobProperties( runArgs.inputEVNT_COSMICSFile ) -elif hasattr(runArgs, "inputEVNT_CAVERNFile"): - setInputEvgenFileJobProperties( runArgs.inputEVNT_CAVERNFile ) -elif hasattr(runArgs, "inputEVNT_STOPPEDFile"): - setInputEvgenFileJobProperties( runArgs.inputEVNT_STOPPEDFile ) -elif jobproperties.Beam.beamType.get_Value() == 'cosmics': - fast_chain_log.debug('No inputEVNTFile provided. OK, as performing cosmics simulation.') - athenaCommonFlags.PoolEvgenInput.set_Off() -else: - fast_chain_log.info('No inputEVNTFile provided. Assuming that you are running a generator on the fly.') - athenaCommonFlags.PoolEvgenInput.set_Off() - -## Output hits file config -if hasattr(runArgs, "outputHITSFile"): - athenaCommonFlags.PoolHitsOutput.set_Value_and_Lock( runArgs.outputHITSFile ) -else: - if hasattr(runArgs, "outputEVNT_STOPPEDFile"): - simFlags.StoppedParticleFile.set_Value_and_Lock( runArgs.outputEVNT_STOPPEDFile ) - #raise RuntimeError("No outputHITSFile provided.") - fast_chain_log.info('No outputHITSFile provided. This simulation job will not write out any HITS file.') - athenaCommonFlags.PoolHitsOutput = "" - athenaCommonFlags.PoolHitsOutput.statusOn = False - -#============================================================== -# Job Configuration parameters: -#============================================================== -## Pre-exec -if hasattr(runArgs, "preSimExec"): - fast_chain_log.info("transform pre-sim exec") - for cmd in runArgs.preSimExec: - fast_chain_log.info(cmd) - exec(cmd) - -## Pre-include -if hasattr(runArgs, "preSimInclude"): - for fragment in runArgs.preSimInclude: - include(fragment) - - -# Avoid command line preInclude for stopped particles -if hasattr(runArgs, "inputEVNT_STOPPEDFile"): - include('SimulationJobOptions/preInclude.ReadStoppedParticles.py') - -# Avoid command line preInclude for cavern background -if hasattr(runArgs, "inputEVNT_CAVERNFile"): - include('SimulationJobOptions/preInclude.G4ReadCavern.py') -if hasattr(runArgs, "outputEVNT_CAVERNTRFile"): - include('SimulationJobOptions/preInclude.G4WriteCavern.py') - -# temporary fix to ensure TRT will record hits if using FATRAS -# this should eventually be removed when it is configured properly in ISF -if hasattr(runArgs, 'simulator') and runArgs.simulator.find('ATLFASTIIF')>=0: - from TrkDetDescrSvc.TrkDetDescrJobProperties import TrkDetFlags - TrkDetFlags.TRT_BuildStrawLayers=True - fast_chain_log.info('Enabled TRT_BuildStrawLayers to get hits in ATLFASTIIF') - - -## Select detectors - - -if 'DetFlags' not in dir(): - ## If you configure one det flag, you're responsible for configuring them all! - from AthenaCommon.DetFlags import DetFlags - DetFlags.all_setOn() - -DetFlags.LVL1_setOff() # LVL1 is not part of G4 sim -DetFlags.Truth_setOn() -DetFlags.digitize.LVL1_setOff() -# note this makeRIO enables forward detectors, so have to set them off after -DetFlags.makeRIO.all_setOn() -DetFlags.Forward_setOff() -DetFlags.ZDC_setOff() -DetFlags.digitize.ZDC_setOff() -DetFlags.digitize.Micromegas_setOff() -DetFlags.digitize.sTGC_setOff() - -# removed configuration of forward detectors from standard simulation config -# corresponding code block removed - -## Set the PhysicsList -if hasattr(runArgs, 'physicsList'): - simFlags.PhysicsList = runArgs.physicsList - - -## Random seed -if hasattr(runArgs, "randomSeed"): - simFlags.RandomSeedOffset = int(runArgs.randomSeed) -else: - fast_chain_log.warning('randomSeed not set') -## Don't use the SeedsG4 override -simFlags.SeedsG4.set_Off() - - -## Set the Run Number (if required) -if hasattr(runArgs,"DataRunNumber"): - if runArgs.DataRunNumber>0: - fast_chain_log.info( 'Overriding run number to be: %s ', runArgs.DataRunNumber ) - simFlags.RunNumber=runArgs.DataRunNumber -elif hasattr(runArgs,'jobNumber'): - if runArgs.jobNumber>=0: - fast_chain_log.info( 'Using job number '+str(runArgs.jobNumber)+' to derive run number.' ) - simFlags.RunNumber = simFlags.RunDict.GetRunNumber( runArgs.jobNumber ) - fast_chain_log.info( 'Set run number based on dictionary to '+str(simFlags.RunNumber) ) - -## removed code block for handling cosmics track record - -# get top sequence -from AthenaCommon.AlgSequence import AlgSequence -topSeq = AlgSequence() - -## Set Overall per-Algorithm time-limit on the AlgSequence -topSeq.TimeOut = 43200 * Units.s - -try: - from RecAlgs.RecAlgsConf import TimingAlg - topSeq+=TimingAlg("SimTimerBegin", TimingObjOutputName = "EVNTtoHITS_timings") -except: - fast_chain_log.warning('Could not add TimingAlg, no timing info will be written out.') - -from ISF_Config.ISF_jobProperties import ISF_Flags -if hasattr(runArgs, 'simulator'): - ISF_Flags.Simulator = runArgs.simulator -else: - ISF_Flags.Simulator = 'MC12G4' - -#### *********** import ISF_Example code here **************** #### - -include("ISF_Config/ISF_ConfigJobInclude.py") - -## check to see if pileup emulation is being used, if so do post-ISF-config -## actions to enable simulation of pileup collection -if 'AthSequencer/EvgenGenSeq' in topSeq.getSequence(): - fast_chain_log.info("Pileup emulation enabled - setup GenEventStackFiller") - include("FastChainPileup/FastPileupSimConfig.py") - -## Add AMITag MetaData to TagInfoMgr -if hasattr(runArgs, 'AMITag'): - if runArgs.AMITag != "NONE": - from AthenaCommon.AppMgr import ServiceMgr as svcMgr - svcMgr.TagInfoMgr.ExtraTagValuePairs += ["AMITag", runArgs.AMITag] - -## Increase max RDO output file size to 10 GB -## NB. We use 10GB since Athena complains that 15GB files are not supported -from AthenaCommon.AppMgr import ServiceMgr as svcMgr -svcMgr.AthenaPoolCnvSvc.MaxFileSizes = [ "10000000000" ] - -### Changing to post-sim include/exec -## Post-include -if hasattr(runArgs, "postSimInclude"): - for fragment in runArgs.postSimInclude: - include(fragment) - -# Avoid command line postInclude for stopped particles -if hasattr(runArgs, "outputEVNT_STOPPEDFile"): - include('SimulationJobOptions/postInclude.StoppedParticleWrite.py') - -## Post-exec -if hasattr(runArgs, "postSimExec"): - fast_chain_log.info("transform post-sim exec") - for cmd in runArgs.postSimExec: - fast_chain_log.info(cmd) - exec(cmd) - -## Always enable the looper killer, unless it's been disabled -if not hasattr(runArgs, "enableLooperKiller") or runArgs.enableLooperKiller: - def use_looperkiller(): - from G4AtlasApps import PyG4Atlas, AtlasG4Eng - lkAction = PyG4Atlas.UserAction('G4UserActions', 'LooperKiller', ['BeginOfRun', 'EndOfRun', 'BeginOfEvent', 'EndOfEvent', 'Step']) - AtlasG4Eng.G4Eng.menu_UserActions.add_UserAction(lkAction) - simFlags.InitFunctions.add_function("postInit", use_looperkiller) -else: - fast_chain_log.warning("The looper killer will NOT be run in this job.") - -### End of Sim - - -### Start of Digi - -include("SimuJobTransforms/CommonSkeletonJobOptions.py") - -if hasattr(runArgs, "jobNumber"): - if runArgs.jobNumber < 1: - raise ValueError('jobNumber must be a postive integer. %s lies outside this range', str(runArgs.jobNumber)) - -from AthenaCommon.GlobalFlags import globalflags -if hasattr(runArgs,"geometryVersion"): - # strip _VALIDATION - print "stripping _VALIDATION" - if runArgs.geometryVersion.endswith("_VALIDATION"): - pos=runArgs.geometryVersion.find("_VALIDATION") - globalflags.DetDescrVersion.set_Value_and_Lock( runArgs.geometryVersion[:pos] ) - else: - globalflags.DetDescrVersion.set_Value_and_Lock( runArgs.geometryVersion ) - -### Do not invoke another logger -# get the logger -#from AthenaCommon.Logging import logging -digilog = logging.getLogger('Digi_trf') -fast_chain_log.info( '****************** STARTING DIGITIZATION *****************' ) - - -fast_chain_log.info( '**** Transformation run arguments' ) -fast_chain_log.info( str(runArgs) ) - -#============================================================== -# Job Configuration parameters: -#============================================================== -### Changing pre-exec to pre-digi exec -## Pre-exec -if hasattr(runArgs,"preDigiExec"): - fast_chain_log.info("transform pre-digi exec") - for cmd in runArgs.preDigiExec: - fast_chain_log.info(cmd) - exec(cmd) - -## Pre-include -if hasattr(runArgs,"preDigiInclude"): - for fragment in runArgs.preDigiInclude: - include(fragment) - -#-------------------------------------------------------------- -# Override pile-up configuration on the command-line -#-------------------------------------------------------------- - -from Digitization.DigitizationFlags import digitizationFlags - -#-------------------------------------------------------------- -# Get the flags -#-------------------------------------------------------------- -if hasattr(runArgs,"digiSeedOffset1"): - digitizationFlags.rndmSeedOffset1=int(runArgs.digiSeedOffset1) -else: - fast_chain_log.warning( 'digiSeedOffset1 not set' ) - digitizationFlags.rndmSeedOffset1=1 - -if hasattr(runArgs,"digiSeedOffset2"): - digitizationFlags.rndmSeedOffset2=int(runArgs.digiSeedOffset2) -else: - fast_chain_log.warning( 'digiSeedOffset2 not set' ) - digitizationFlags.rndmSeedOffset2=2 - -if hasattr(runArgs,"samplingFractionDbTag"): #FIXME change this to PhysicsList? - digitizationFlags.physicsList=runArgs.samplingFractionDbTag - -if hasattr(runArgs,"digiRndmSvc"): - digitizationFlags.rndmSvc=runArgs.digiRndmSvc - -if hasattr(runArgs,"conditionsTag"): - if(runArgs.conditionsTag!='NONE'): - digitizationFlags.IOVDbGlobalTag = runArgs.conditionsTag - -### Avoid meta data reading -digitizationFlags.overrideMetadata=['ALL'] - -if hasattr(runArgs,"digiSteeringConf"): - if not (digitizationFlags.digiSteeringConf.get_Value()==runArgs.digiSteeringConf+"PileUpToolsAlg"): - digilog.info( "Changing digitizationFlags.digiSteeringConf from %s to %s", digitizationFlags.digiSteeringConf.get_Value(),runArgs.digiSteeringConf) - digitizationFlags.digiSteeringConf=runArgs.digiSteeringConf+"PileUpToolsAlg" - PileUpConfigOverride=True - -#-------------------------------------------------------------- -# Pileup configuration - removed as pileup will be handled on-the-fly -#-------------------------------------------------------------- - -#-------------------------------------------------------------- -# Other configuration: LVL1, turn off sub detectors, calo noise -#-------------------------------------------------------------- - -if hasattr(runArgs,"doAllNoise"): - if runArgs.doAllNoise!="NONE": - fast_chain_log.info('doAllNoise = %s: Overriding doInDetNoise, doCaloNoise and doMuonNoise', runArgs.doAllNoise) - if runArgs.doAllNoise=="True": - digitizationFlags.doInDetNoise=True - digitizationFlags.doCaloNoise=True - digitizationFlags.doMuonNoise=True - else: - digitizationFlags.doInDetNoise=False - digitizationFlags.doCaloNoise=False - digitizationFlags.doMuonNoise=False - - - -### No RDO output -## Output RDO File -if hasattr(runArgs,"outputRDOFile") or hasattr(runArgs,"tmpRDO"): - if hasattr(runArgs,"outputRDOFile"): - if hasattr(runArgs,"tmpRDO"): - fast_chain_log.fatal("Both outputRDOFile and tmpRDO specified - this configuration should not be used!") - raise SystemError - athenaCommonFlags.PoolRDOOutput.set_Value_and_Lock( runArgs.outputRDOFile ) - if hasattr(runArgs,"tmpRDO"): - athenaCommonFlags.PoolRDOOutput.set_Value_and_Lock( runArgs.tmpRDO ) - if hasattr(runArgs, "AddCaloDigi"): - AddCaloDigi = runArgs.AddCaloDigi - if AddCaloDigi: - fast_chain_log.info("Will write out all LArDigitContainers and TileDigitsContainers to RDO file.") - digitizationFlags.experimentalDigi+=["AddCaloDigi"] -else: - fast_chain_log.info("no output file (outputRDOFile or tmpRDO) specified - switching off output StreamRDO") - -# force writing of RDO file -fast_chain_log.info('Forcing writeRDOPool all on') -DetFlags.writeRDOPool.all_setOn() - -#-------------------------------------------------------------- -# Go for it -#-------------------------------------------------------------- -if hasattr(runArgs,"DataRunNumber"): - if runArgs.DataRunNumber>0: - fast_chain_log.info( 'Overriding run number to be: %s ', runArgs.DataRunNumber ) - digitizationFlags.dataRunNumber=runArgs.DataRunNumber - -print "lvl1: -14... " + str(DetFlags.digitize.LVL1_on()) - -### Set digitize all except forward detectors -DetFlags.digitize.all_setOn() -DetFlags.digitize.LVL1_setOff() -DetFlags.digitize.ZDC_setOff() -DetFlags.digitize.Micromegas_setOff() -DetFlags.digitize.sTGC_setOff() -DetFlags.digitize.Forward_setOff() -DetFlags.digitize.Lucid_setOff() -DetFlags.digitize.AFP_setOff() -DetFlags.digitize.ALFA_setOff() - - - - - -from AthenaCommon.AlgSequence import AlgSequence -topSeq = AlgSequence() - -## Set Overall per-Algorithm time-limit on the AlgSequence -topSeq.TimeOut = 43200 * Units.s - -try: - from RecAlgs.RecAlgsConf import TimingAlg - topSeq+=TimingAlg("DigiTimerBegin", TimingObjOutputName = "HITStoRDO_timings") -except: - fast_chain_log.warning('Could not add TimingAlg, no timing info will be written out.') - -include ("Digitization/Digitization.py") - -if hasattr(runArgs,"AMITag"): - from AthenaCommon.AppMgr import ServiceMgr as svcMgr - svcMgr.TagInfoMgr.ExtraTagValuePairs += ["AMITag", runArgs.AMITag ] - -### No RDO output to increase file size of -# Increase max RDO output file size to 10 GB - -#from AthenaCommon.AppMgr import ServiceMgr as svcMgr -#svcMgr.AthenaPoolCnvSvc.MaxFileSizes = [ "10000000000" ] #[ "15000000000" ] #Athena complains that 15GB files are not supported - -## Post-include -if hasattr(runArgs,"postInclude"): - for fragment in runArgs.postInclude: - include(fragment) - -## Post-exec -if hasattr(runArgs,"postExec"): - fast_chain_log.info("transform post-exec") - for cmd in runArgs.postExec: - fast_chain_log.info(cmd) - exec(cmd) - -### End of Digi - -#from AthenaCommon.ConfigurationShelve import saveToAscii -#saveToAscii('config.txt') -- GitLab