############################################################### # # Main jobOptions.file seting up general parameters # and sourcing one auxilliary jobOption per major algorithm # # To use it : athena RecExCommon_topOptions.py >! athena.log # # To have a full trace back of what's happening in the python scripts do: # athena -s RecExCommon_topOptions.py >! athena.log # # To trace memory usage while loading libraries: # # athena -s AthenaCommon/MemTraceInclude.py RecExCommon_topOptions.py >! athena.log # # WARNIN ! in python indentation is used to define block ! # (emacs knows about it, just use tab) #============================================================== # Flags default values are set only if the flags do not exist yet. # # To configure the flags there are several possibilities, from the most # recommended to the least: # - specify values to be changed with the -c option # athena -c 'readG3=True ; EvtMax = 100' RecExCommon_topOptions.py # - use a file myconfig.py with the values to be changed # (see RecExCommon/share/myconfig.py as an example), # then run # athena -s myconfig.py RecExCommon_topOptions.py # - edit/modify RecExCommon_topOptions.py and add the new values # specification inside # - edit/modify the default values in RecExCommon_flags.py # # To configure Algorithms properties (not flags, beware!) there are # different possibilities, from the most recommended to the least: # - use a file myproperties.py with the new algorithm properties # (see RecExCommon/share/myproperties.py as an example) # then run # athena -s myconfig.py RecExCommon_topOptions.py myproperties.py # - edit/modify RecExCommon_topOptions.py and add the new algorithm # modifiers inside (towards the end) include ( "RecExCommon/RecExCommon_flags.py" ) # possible user flags specification # dump flag content print "RecExCommon_flags.py flags values:" for o in RecExCommonFlags.keys(): exec 'print "%s =",%s ' % (o,o) DetFlags.Print() GlobalFlags.Print() # end flag settings section ########################################################################## # set up job # to read ByteStream data if GlobalFlags.InputFormat.is_bytestream(): #for geant3 bsinclude( "ByteStreamCnvSvc/ByteStreamSelector_jobOptions.py" ) #from fredrik theApp.Dlls += [ "ByteStreamCnvSvc", "ByteStreamCnvSvcBase"] # Services theApp.ExtSvc += ["ByteStreamEventStorageInputSvc/ByteStreamInputSvc"] theApp.ExtSvc += [ "ROBDataProviderSvc/ROBDataProviderSvc" ] theApp.ExtSvc += [ "EventSelectorByteStream/EventSelector"] theApp.EvtSel = "EventSelector"; # Properties EventSelector = Service( "EventSelector" ) EventSelector.ByteStreamInputSvc = "ByteStreamInputSvc"; EventPersistencySvc = Service( "EventPersistencySvc" ) EventPersistencySvc.CnvServices += [ "ByteStreamCnvSvc" ] ProxyProviderSvc = Service( "ProxyProviderSvc" ) ProxyProviderSvc.ProviderNames += [ "ByteStreamAddressProviderSvc" ] ByteStreamInputSvc = Service( "ByteStreamInputSvc" ) ByteStreamInputSvc.FullFileName = BSRDOInput # Reader type "Castor" or "Simple" ByteStreamEventStorageInputSvc = Service( "ByteStreamEventStorageInputSvc" ) ByteStreamEventStorageInputSvc.ReaderType = "Castor"; # to read Zebra data if GlobalFlags.InputFormat.is_zebra(): theApp.setup( ZEBRA ) #this meaningless line should be there EventSelector = Service( "EventSelector" ) EventSelector.dataSetNames = ["Y01606.1"] # Select the events to read by their event number: # Examples: 24, 35: 37, 45: selects 24, 35 to 37 and 45 and above # : 35 selects up to and including 35 # 53: selects from 53 # be careful to respects the spaces after " and : #EventSelector.EventNumbers = " 24, 35: 37, 45: " ; # # Get only relevant digits from Event # EventSelector.calos = FALSE; EventSelector.muons = FALSE; EventSelector.trt = FALSE EventSelector.sct = FALSE EventSelector.pixel = FALSE #to read G4 POOL RDO if GlobalFlags.InputFormat.is_pool(): # to read pool Data include( "AthenaPoolCnvSvc/ReadAthenaPool_jobOptions.py" ) # G4 Pool input CHANGEME # make sure the file listed is in PoolFileCatalog.xml in run directory # AND that you have a copy or soft link of this file in the run directory # it is possible to specify a list of files to be processed consecutively EventSelector = Service( "EventSelector" ) if doShowSizeStatistics: EventSelector.ShowSizeStatistics = True # show size inform if not readESD: # dummy line in case this file is edited by a batch script dummy=0 EventSelector.InputCollections = PoolRDOInput else: # dummy line in case this file is edited by a batch script dummy=0 EventSelector.InputCollections = PoolESDInput #particle property service include( "PartPropSvc/PartPropSvc.py" ) ####################################################################### # useful debugging/info tools # Use auditors theApp.Dlls += [ "GaudiAud" ] # # write out a summary of the time spent # theAuditorSvc = AuditorSvc() theAuditorSvc.Auditors += [ "ChronoAuditor"] # # write out a short message upon entering or leaving each algorithm # if doNameAuditor: theAuditorSvc.Auditors += [ "NameAuditor" ] # ChronoStatSvc = Service ( "ChronoStatSvc") # write out summary of the memory usage # number of events to be skip to detect memory leak # Set to 50 to give some time to stabilise ChronoStatSvc.NumberOfSkippedEventsForMemStat = 50 theAuditorSvc.Auditors += [ "MemStatAuditor" ] MemStatAuditor = theAuditorSvc.auditor( "MemStatAuditor" ) theApp.AuditAlgorithms=True if doDetailedAuditor: MemStatAuditor.OutputLevel = INFO theApp.AuditServices=True # theApp.AuditTools=True # FIXME crash on finalisation else: MemStatAuditor.OutputLevel = WARNING # # write out a list of all Storegate collection with their keys and # lock/unlock state. Very useful for debugging purpose # StoreGateSvc = Service ("StoreGateSvc" ) if doDumpTES: StoreGateSvc.Dump = True if doDumpTDS: DetectorStore.Dump = True # Set output level threshold # ( ALL, VERBOSE, DEBUG, INFO, WARNING, ERROR, FATAL ) MessageSvc = Service( "MessageSvc" ) MessageSvc.OutputLevel = OutputLevel #increase the number of letter reserved to the alg/tool name from 18 to 30 MessageSvc.Format = "% F%30W%S%7W%R%T %0W%M" # to change the default limit on number of message MessageSvc.defaultLimit = 9999999 # all messages # MessageSvc.debugLimit = 10000000 # all debug message etc... # to get couloured messages (not in emacs though) # MessageSvc.useColors = true ######################################################################## # Number of events to be processed theApp.EvtMax = EvtMax # possibly skip events EventSelector.SkipEvents = SkipEvents if doTimeLimit: include ("LSFTimeKeeper/LSFTimeKeeperOptions.py") LSFTimeKeeperSvc= Service("LSFTimeKeeperSvc") LSFTimeKeeperSvc.OutputLevel=DEBUG if doCBNT: NTupleSvc = Service( "NTupleSvc" ) CBNT_Athena = Algorithm( "CBNT_Athena" ) if useROOTNtuple: # Root Ntuple output theApp.Dlls += [ "RootHistCnv" ] #ntuple output name NTupleSvc.Output = [ "FILE1 DATAFILE='ntuple.root' OPT='NEW'" ] exec 'NTupleSvc.Output = [ "FILE1 DATAFILE=\'%s\' OPT=\'NEW\'" ] ' % RootNtupleOutput #for root file, it is easier to start ntuple ID with a letter CBNT_Athena.NtupleLocID="/FILE1/CBNT/t3333" else: #hbook ntuple # Also please make sure that all ntuple ID are plain number (in # particular CBNT_Athena) # Note that due to hbook limitations all variables cannot # be stored in hbook ntuples theApp.Dlls += [ "HbookCnv"] exec 'NTupleSvc.Output = [ "FILE1 DATAFILE=\'%s\' OPT=\'NEW\'" ] ' % HbookNtupleOutput HbookHistSvc = Service ( "HbookHistSvc") HbookHistSvc.NPAWC = 1500000 # if need histogram output # note that it has been observed an interference with histogram input if doWriteAOD and doHist: print "cannot write histogram if write AOD" doHist=False if doHist : # Histogram output, if any. HistogramPersistencySvc = Service( "HistogramPersistencySvc" ) if useROOTNtuple: theApp.Dlls += [ "RootHistCnv" ] theApp.HistogramPersistency = "ROOT" HistogramPersistencySvc.OutputFile = RootHistoOutput else: theApp.HistogramPersistency="HBOOK" HistogramPersistencySvc.OutputFile = HbookHistoOutput ########################################################################## # put quasi empty first algorithm so that the first real # algorithm does not see the memory change due to event manipulation theApp.DLLs += [ "GaudiAlg" ] theApp.TopAlg += [ "EventCounter" ] EventCounter = Algorithm( "EventCounter" ) EventCounter.Frequency=100 # one print every 100 event # set up all detector description description include ("RecExCommon/AllDet_detDescr.py") # # G4 : RDO Pool converters # if DetFlags.readRDOPool.any_on() or DetFlags.readRIOPool.any_on() or readESD : if DetFlags.readRDOPool.ID_on(): include( "InDetEventAthenaPool/InDetEventAthenaPool_joboptions.py" ) if DetFlags.readRDOPool.LAr_on() : include( "LArAthenaPool/LArAthenaPool_joboptions.py" ) if DetFlags.readRDOPool.Tile_on(): include( "TileEventAthenaPool/TileEventAthenaPool_joboptions.py" ) if DetFlags.readRDOPool.Muon_on() or DetFlags.readRIOPool.Muon_on() : include( "MuonEventAthenaPool/MuonEventAthenaPool_joboptions.py" ) #needed to read MuonEntryRecord include( "G4SimAthenaPOOL/G4SimAthenaPOOL_joboptions.py" ) if DetFlags.haveRIO.LVL1_on() and ( doAODLVL1 or doTrigger): include("TrigT1EventAthenaPool/TrigT1EventAthenaPool_joboptions.py") else: doAODLVL1=False doTrigger=False include( "EventAthenaPool/EventAthenaPool_joboptions.py" ) if doTruth: include( "GeneratorObjectsAthenaPool/GeneratorObjectsAthenaPool_joboptions.py" ) #-------------------------------------------------------------- # Now specify the list of algorithms to be run # The order of the jobOption specify the order of the algorithms # (don't modify it) #-------------------------------------------------------------- # # # functionality : read truth # if doTruth: # this algorithm dump the content of the MC event: big output if doDumpMC: theApp.DLLs += [ "TruthExamples" ] # generator truth theApp.TopAlg += [ "DumpMC" ] DumpMC=Algorithm ( "DumpMC" ) if DetDescrVersion=="DC2" or DetDescrVersion=="DC2-Final" or DetDescrVersion=="DC2-Initial" : # geant 4 truth theApp.TopAlg += [ "DumpMC/DumpMCG4" ] DumpMCG4=Algorithm ( "DumpMCG4" ) DumpMCG4.McEventKey = "G4Truth" if GlobalFlags.InputFormat.is_zebra(): # # Genz/kine->HepMc converter for true particle, Generators and Kine # theApp.Dlls += [ "GenzModule"] # run the GenzKine->HepMC converter theApp.TopAlg += [ "GenzModule"] #FIXME IOVDbSvc = Service ("IOVDbSvc") IOVDbSvc.OutputLevel=INFO if not readESD: # # functionality : atlfast # if doAtlfast: include ("AtlfastAlgs/Atlfast_CBNT.py") # # System Reconstruction # include ("RecExCommon/SystemRec_config.py") # # Combined reconstruction # include ("RecExCommon/CombinedRec_config.py") # # Trigger simulation if doTrigger or doAODLVL1 : include ("RecExCommon/Trigger_config.py") ################################################################" # # possible user code and property modifiers should come here # could be several algorithms for UserAlg in UserAlgs: include (UserAlg) # CBNT_Athena.Members specify the ntuple block corresponding to a given ntuple # Comment CBNT_Athena.Members line to remove a ntuple block # It is also possible to disable a ntuple block by # disabling the corresponding # CBNT_Athena.Members with the line: .Enable = False # The ntuple specification is in file CBNT_jobOptions.py # and can be modified by adding properties below # # ----- CBNT_Athena algorithm # if doCBNT: include( "RecExCommon/CBNT_config.py" ) if doJiveXML: include ( "RecExCommon/JiveXML_config.py") ################################################################### # Property modifier for specific release ################################################################" # # possible userproperty modifiers should come here # (do NOT put flags modification here!) #TrackParticleTruthMaker.Enable=False ################################################################### # # functionality : monitor memory and cpu time # # # functionality : build combined ntuple, # gathering info from all the reco algorithms # #if read or write ESD load the converters if doWriteESD or doWriteAOD or readESD: # Converters: include ( "RecExCommon/RecoOutputPoolCnv_jobOptions.py" ) #check dictionary AthenaSealSvc = Service( "AthenaSealSvc" ) AthenaSealSvc.CheckDictionary = doCheckDictionary if not doCheckDictionary: AthenaSealSvc.OutputLevel=WARNING # # #now write out Transient Event Store content in POOL # # if doWriteESD or doWriteAOD : if not ( DetFlags.readRDOPool.any_on() or readESD ) : include ("AthenaPoolCnvSvc/WriteAthenaPool_jobOptions.py") else: # WriteAthenaPool is inconsistent with ReadAthenaPool # there should be a specific file for that theApp.OutStream += [ "Stream1" ] theApp.OutStreamType = "AthenaOutputStream" Stream1 = Algorithm( "Stream1" ) Stream1.EvtConversionSvc = "AthenaPoolCnvSvc" # allows objects to be copied in output even if not read in Stream1 = Algorithm( "Stream1" ) Stream1.ForceRead= True #force read of input data to write in output data Stream1.ForceRead = True if doWriteESD: # Define the output file name Stream1.OutputFile = PoolESDOutput include ( "RecExCommon/RecoOutputItemList_jobOptions.py" ) if doWriteAOD: # Define the output file name Stream1.OutputFile = PoolAODOutput include ("ParticleEventAthenaPool/AODtoPool_jobOptions.py") print "List all DLL" print theApp.DLLs print "List all ExtSvc" print theApp.ExtSvc print "List of all top algorithms" print theApp.TopAlg if doDumpProperties: # does not work in 8.7.0 # print "Dump alg properties BEFORE initialisation" # from AthenaCommon import DumpProperties # DumpProperties.dumpAlgorithms() # Careful properties not in jobOption are not listed for name in theApp.TopAlg: instance = string.split( name, '/' )[-1] exec 'alg = Algorithm( "%s" )' % instance alg.AuditInitialize = True try: print '****** properties of:', name print alg.properties() except AttributeError: print 'pb printing (float) property of %s (to be fixed soon)' % name # switch on auditor on specific alg or service # to measure CPU time and memory spend in initialisation # alg.AuditInitialize = True # svc.AuditInitialize = True # if readMuonDigit: print "%sNING Rome-Initial production, need to switch off RoIBResultToAOD" % "WAR" RoIBResultToAOD=Algorithm("RoIBResultToAOD") RoIBResultToAOD.Enable=False