[atlas] / offline / Reconstruction / RecExample / RecExCommon / share / RecExCommon_flags.py Repository:
ViewVC logotype

View of /offline/Reconstruction/RecExample/RecExCommon/share/RecExCommon_flags.py

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.47 - (download) (as text) (annotate)
Wed Jan 5 16:52:40 2005 UTC (4 years, 10 months ago) by droussea
Branch: MAIN
CVS Tags: RecExCommon-00-03-10, offline-09-03-00, RecExample-00-01-12, RecExCommon-00-03-05, RecExCommon-00-03-02-01, RecExCommon-00-03-02-02, RecExCommon-00-03-02-03, RecExCommon-00-03-04, RecExCommon-00-03-06, RecExCommon-00-03-02, RecExCommon-00-03-03, Reconstruction-01-05-44, RecExCommon-00-03-07, RecExCommon-00-03-08, RecExCommon-00-03-09
Changes since 1.46: +1 -0 lines
 fixes
# flags to configure RecExCommon
# Default values are set only if the variables do not exist yet.
# To configure it 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
#    Note: please use \" if a " is needed inside the command line
#    athena -c "include(\"RecExCommon/RecExCommon_flags.py\") ; DetFlags.Muon_setOff()" RecExCommon_topOptions.py
#  - create a file myconfig.py with the values to be changed
#     (myconfig.py could be copied/edited from RecExCommon_flags.py),
#    then run
#    athena 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 


varInit=dir()

# some very general flags, EvtMax, SkipEvents, PoolESDInput etc...
include ("AthenaCommon/AthenaCommonFlags.py")
# prevent this file to be included a second time
include.block("AthenaCommon/AthenaCommonFlags.py")

# prevent the current file to be included a second time
include.block("RecExCommon/RecExCommon_flags.py")
#guard to include it only once


# use python ntuple to store variables (from wim)
# these are default values
RecExCommonFlags = {
      'BSRDOInput' :      ["dc2_evtmix_0066666_file100003.data"],
      #["/castor/cern.ch/grid/atlas/datafiles/dc2/mixing/dc2.006666.mixing.all_A/dc2_evtmix_0066666_file100001.data.2"], # Bytestream input file
       #      ["/castor/cern.ch/atlas/project/dc2/preprod/evtmix808/dc2_evtmix808_0065432/data/dc2_evtmix808_0065432_file100001.data"]
      'PoolRDOInput' :  ["LFN:zee_RDO_extract.pool"], # input RDO file
      # Z ee (just 10 events)
      # (LFN for logical file name, otherwise specify full path (preceded by rfio: for castor files)
      # be careful to set correctly GlobalFlags according to the
      # nature of the input file
      # Z ee (100 events) 
      # PoolRDOInput = [ "LFN:zee_RDO.pool" ]
      # Z mumu 
      # PoolRDOInput = [ "LFN:zmumu_RDO.pool" ]
      # Z mumu with pile up (same input file) ( need change GlobalFlag.Luminosity)
      # PoolRDOInput = [ "LFN:zmumu_highlumi_RDO.pool" ]
      # H->llll initial layout
      # PoolRDOInput = [ "LFN:hllll_initial_RDO.pool" ] ; DetDescrVersion="Rome-Initial"
      
      'RootNtupleOutput' : "ntuple.root", # Root Ntuple output  
      'RootHistoOutput' : "histo.root", # Root Histogram output       
      'HbookNtupleOutput' : "ntuple.hbook", # Hbook Ntuple output  
      'HbookHistoOutput' : "histo.hbook", # Hbook Histogram output       
      'readG3' : False,  # if run on Geant3 data
      'useNova' : True, # if True maximise use of Nova and minimize Oracle
      'readESD' : False,  # if run on ESD file
      'doWriteESD' : False, # if write out ESD file
      'doWriteAOD' : False, # if write out AOD file (not fully debugged)
      'OutputLevel': INFO,  # general msg output level VERBOSE DEBUG INFO
      'doTimeLimit': False, # if stop execution when allocated time elapsed
      'doTruth' : True, # id use the truth
      'doDumpMC' : False, # if dump mc truth in log file
      'doNameAuditor' : False, # if NameAuditor switched on (one line print out per alg)
      'doShowSizeStatistics' : False, # if print pool object size stat of input file
      'doDumpTES' : False, # if dump storegate transient event store
      'doDumpTDS' : False, # if dump storegate transient detector store
      'doDumpProperties' : False, # if dump all algs properties
      'doDetailedAuditor' : False, # if monitor alg/tools and services memory and CPU time  
      'doCheckDictionary' : False, # if check dictionary
      'doCBNT' : True, # if output combined ntuple
      'doHist' : True, # if output some histograms
      'doJiveXML' : False, # if output xml file for atlantis
      'useROOTNtuple'  : True, # if use root ntuple rather than hbook
      'AllAlgs' : True, # if false the default is to have all algs off
      'UserAlgs' : "",
      } # user algorithm(s) e.g  ["MyPackage/MyAlg_jobOptions.py"]

# set variable to default if not already set
for o in [ o for o in RecExCommonFlags.keys() if not o in varInit ]:
   exec '%s = RecExCommonFlags[ "%s" ]' % (o,o)

         

# Algorithm switches (separated so that they can be manipulated all together
RecExCommonAlgs = {
      'makeSimpleTracks' : False, # if make simpleTracks
      'doxKalman' : True,
      'doiPatRec' : True,
      'doEmCluster' : True,
      'doCaloCluster' : True,
      'doCaloTopoCluster' : True,
      'doMoore' : True,
      'doMuonbox' : True,
      'doConversion' : True,
      'doBtagging' : True,
      'doEgamma' : True,
      'doJetRec' : True,
      'doTauRec' : True,
      'doMuonID' : True,
      'doStaco' : True,
      'doMuonAlgs' : not readG3, # cannot be run on Geant3
      'doTileMuID' : True,
      'doMissingET' : True,
      'doEFlow' : False,
      'doEFlowJet' : False,
      'doAODLVL1' : True,
      # not readG3 and not DetDescrVersion=\"Rome-Initial\", #
      # cannot be run on geant3
      # nor on initial layout (missing muon info)
      'doTrigger' : False,
      'doAtlfast' : False

}

   

if AllAlgs:
   for o in [ o for o in RecExCommonAlgs.keys() if not o in varInit ]:
      exec '%s = RecExCommonAlgs[ "%s" ]' % (o,o)
else:
   print "By default switch off all algorithms"
   for o in [ o for o in RecExCommonAlgs.keys() if not o in varInit ]:
      exec '%s = False' % (o)
         
# merge Algs flag with the other flags for future reference
RecExCommonFlags.update (AthenaCommonFlags)
RecExCommonFlags.update (RecExCommonAlgs)



# GlobalFlags : Author Tadashi Maeno, David Rousseau
# This is class for main jobs configuration flags
#
# Category : DetGeo has states : atlas ctbh6 ctbh8    (ctbh6 and ctbh8 grouped in ctb)
# Category : DataSource has states : data geant3 geant4
# Category : InputFormat has states : zebra pool bytestream
# Category : Luminosity has states :  zero, verylow (10^33), low (2 10^33),
#                                              high (10^34)
#
# Each category can be set once and only once by the main topOptions.
# states are mutually exclusive
#
# from AthenaCommon.GlobalFlags import GlobalFlags
# GlobalFlags.DetGeo.set_atlas()  # set DetGeo to be atlas
#  (trying to set again the same category will throw an error)
#
# state can be interrogated as follows (by construction, one category
#   is only in one state. Testing a category that has not been set
#          throws an error):
# if GlobalFlags.DetGeo.is_atlas():
#
# Groupings canbe used to interrogate (no set methods available):
# if GlobalFlags.DetGeo.is_ctb():  (or of is_ctbh6() and is_ctbh8())

if 'GlobalFlags' in varInit:
   print "GlobalFlags already imported:"
else:
   from AthenaCommon.GlobalFlags import GlobalFlags

# default is atlas geometry
try:
   GlobalFlags.DetGeo.set_atlas()
except RuntimeError:
   print "GlobalFlags.DetGeo already set"
    




if readG3:
   try:
      GlobalFlags.DataSource.set_geant3()
   except RuntimeError:
      print "GlobalFlags.DataSource already set"
         
   try:
      GlobalFlags.InputFormat.set_zebra()
   except RuntimeError:
      print "GlobalFlags.InputFormat already set"
else:
   try:
      GlobalFlags.DataSource.set_geant4()
   except RuntimeError:
      print "GlobalFlags.DataSource already set"

   try:
      GlobalFlags.InputFormat.set_pool()
   except RuntimeError:
      print "GlobalFlags.InputFormat already set"        

try:
   # default is zero luminosity
   GlobalFlags.Luminosity.set_zero()
   # for high lumi
   # GlobalFlags.Luminosity.set_high()
except RuntimeError:
   print "GlobalFlags.Luminosity already set"        

# set here the geometry version

if (not "DetDescrVersion" in varInit) or (DetDescrVersion == "" or DetDescrVersion == "Default"):
    DetDescrVersion = "DC2"
    if ("GlobalFlags" in dir()):
        if GlobalFlags.DataSource.is_geant3():
            DetDescrVersion = "DC1"
        elif GlobalFlags.DetGeo.is_ctb():
            DetDescrVersion = "CTB"

# data for Rome have  Muon Digit unless otherwise specified

if  DetDescrVersion=="Rome-Initial" or DetDescrVersion=="Rome-Final" :    
   if 'readMuonDigit' not in dir():    
      readMuonDigit=True
   elif readMuonDigit==False:
      print "%sNING: Rome data normally should have readMuonDigit=True" % "WAR"
else:   
   if 'readMuonDigit' not in dir():    
      readMuonDigit=False
   elif readMuonDigit==True:
      print "%sNING: non-Rome data normally should have readMuonDigit=False" % "WAR"

# DetFlags : Author Tadashi Maeno
#
# detectors : ID = pixel SCT TRT
#             LAr = em HEC FCal 
#             Calo = em HEC FCal Tile
#             Muon = MDT CSC TGC RPC 
# tasks:
#   geometry : setup the geometry
#   digitize : hit -> RDO (raw data objects)
#   makeRIO  : RDO -> RIO (Reconstruction Input Objects)
#   writeBS  : write RDO byte stream
#   readRDOBS : read RDO from byte stream
#   readRDOPool : read RDO from pool
#   readRIOBS : read RIO directly from BS
#   writeRDOPool : write RDO in pool
#
# subdetectors and tasks from a matrix of flags which are all
#    off by default
# changing the flags:
# tasks can be switched on/off for all detectors:
#    DetFlags.detdescr.all_setOn() (or all_setOff()
# a task for a given subdetector can be switched on/off
#    DetFlags.readRDOPool.Pixel_setOn() (or setOff() )
# setting off/on a group of subdetectors (e.g. LAr or Muon) switch off/on
#     all the corresponding subdetectors
# a subdetector can be switched on/off for all tasks:
#       DetFlags.Muon_setOn() (or setOff() )
#
# Flags can be tested individually:
# if DetFlags.detdescr.pixel_on():
#    print "pix Geo On"
# else:
#    print "pix Geo Off"    
# there is no off() method, just use not
# Group of subdetectors can also be tested:
# if DetFlags.detdescr.any_on() : true if any subdet is true
# if DetFlags.detdescr.allOn() : true if all subdet is true
# if DetFlags.detdescr.LAr_on() : true if any LAr det is true
# if DetFlags.detdescr.LAr_allOn() : true if all LAr det is true 
if 'DetFlags' in varInit:
   print "DetFlags already defined:"
   DetFlags.Print()   
else:
   # include DetFlags
   # by default everything is off
   from AthenaCommon.DetFlags import DetFlags
   # switch on tasks for all detectors
   DetFlags.detdescr.all_setOn()
   DetFlags.makeRIO.all_setOn()

   if  GlobalFlags.InputFormat.is_pool():
      DetFlags.readRDOPool.all_setOn()
      DetFlags.readRDOBS.all_setOff()
      DetFlags.readRIOBS.all_setOff()
   elif GlobalFlags.InputFormat.is_bytestream():
      DetFlags.readRDOPool.all_setOff()
      DetFlags.readRDOBS.all_setOn()
      # DetFlags.readRIOBS.all_setOn()
   else:
      DetFlags.readRDOPool.all_setOff()
      DetFlags.readRDOBS.all_setOff()
      # DetFlags.readRIOBS.all_setOff()

# very special case for normal Rome production
if readMuonDigit:
   DetFlags.makeRIO.Muon_setOff()
   DetFlags.readRDOPool.Muon_setOff()
   DetFlags.readRIOPool.Muon_setOn()


         

# (note that these flags are visible from within included fragments)
# doTracking=True is Obsolete. Tests are now done on DetFlags.makeRIO.ID_On()
# internal calorimeter configuration
if GlobalFlags.InputFormat.is_zebra():
   # set to true if want calo noise
   if not 'doCaloNoise' in varInit:
      doCaloNoise=False

# normally in geant4 data noise has already been simulated
if GlobalFlags.DataSource.is_geant4():
   if not 'doCaloNoise' in varInit:
      doCaloNoise=True


# internal tracking configuration

if 'InDetFlags' in varInit:
   print "InDetFlags already defined"
else:
   include ( "InDetRecExample/InDetFlags.py" )
   # change default indet flags
   InDetFlags.doxKalman = doxKalman
   InDetFlags.doiPatRec = doiPatRec


# AOD Flags
if 'AODFlags' in varInit:
   print "AODFlags already defined"
else:
   from ParticleEventAthenaPool.AODFlags import AODFlags
   AODFlags.Print()
      

# if trigger complete larcell simulation (especially for geant3)
if doTrigger:
   include ("CaloRec/CaloCellMaker_config.py")
   print "doTrigger on : complete LArCell and TileCell simulation"
   CaloCellMakerFlags.doLArHitToCellDirect=False
   CaloCellMakerFlags.doTileHitToRawChannelDirect=False

CERN Central CVS service
ViewVC Help
Powered by ViewVC 1.0.4