Example #1
0
def SetHIPMode():
    if not rec.doHIP(): return
    print 'Setting HIJetRec in HIPMode'
    HIJetFlags.HarmonicsForSubtraction.set_Value_and_Lock([])
    HIJetFlags.ExtraFlowMoments.set_Value_and_Lock(False)
    HIJetFlags.SeedPtMin.set_Value_and_Lock(8 * Units.GeV)
    HIJetFlags.RecoOutputPtMin.set_Value_and_Lock(8 * Units.GeV)
    HIJetFlags.TrackJetPtMin.set_Value_and_Lock(4 * Units.GeV)
Example #2
0
log.info("Project name %s",projectName)
log.info("DetDescription %s", globalflags.DetDescrVersion())
log.info("File type %s",data_type)
log.info("Beam type %s",beam_type)
log.info("Trigger stream %s",rec.triggerStream())
#log.info("Event type %s",evt_type)

# enable PerfMon
from PerfMonComps.PerfMonFlags import jobproperties
jobproperties.PerfMonFlags.doFastMon = True

#set up DQMonFlags required for HLTMonitoring
from AthenaMonitoring.DQMonFlags import DQMonFlags
if globalflags.DataSource.get_Value() == 'geant4':
    DQMonFlags.monManDataType = 'monteCarlo'
elif (rec.doHeavyIon() or rec.doHIP()):
    # requires something from InputFileSummary rather than rec flag
    DQMonFlags.monManDataType = 'heavyioncollisions'
    DQMonFlags.doHIMon = True
elif jobproperties.Beam.beamType()   == 'cosmics':
    DQMonFlags.monManDataType = 'cosmics'
elif jobproperties.Beam.beamType() == 'collisions':
    DQMonFlags.monManDataType = 'collisions'
elif jobproperties.Beam.beamType() == 'singlebeam':
    ## There is no singlebeam in AthenaMonitoring
    DQMonFlags.monManDataType = 'collisions'
else:
    log.warning("invalid jobproperties.Beam.beamType(): %s, using default (%s)", 
            jobproperties.Beam.beamType(), DQMonFlags.monManDataType)
                             
if data_type == 'bytestream':
Example #3
0
def AODFix_Init():
    ''' This function is called to correctly setup AODFix.'''

    global _aodFixInstance

    from RecExConfig.RecFlags import rec

    ##################
    # exit if locked to false
    ##################
    if rec.doApplyAODFix.is_locked() and rec.doApplyAODFix.get_Value(
    ) == False:
        logAODFix.info(
            "doApplyAODFix is locked to False; not applying anything")
        return

    ##################
    # deterimine in what release we are running (and fill some rec variables
    ##################

    import os
    curRelease = os.getenv("AtlasVersion") or ''

    logAODFix.debug("curRelease set to " + curRelease)

    ##################
    # determine athena with which input file was created and previous AODFix
    ##################

    # RDO doesn't have MetaData
    prevAODFix = ''
    prevRelease = ''
    isMC = False
    isHI = rec.doHeavyIon()
    isHIP = rec.doHIP()

    # is it better to do this or to look at GlobalFlags?
    from RecExConfig.InputFilePeeker import inputFileSummary
    try:
        isMC = (inputFileSummary['evt_type'][0] == "IS_SIMULATION")
    except Exception:
        logAODFix.warning(
            "Could not tell if the input file is data or MC; setting to data")
        isMC = False

    if not rec.readRDO():

        try:
            AtlasReleaseVersionString = inputFileSummary['metadata'][
                '/TagInfo']['AtlasRelease']
            rv = AtlasReleaseVersionString.split('-')
            if len(rv) > 1:
                prevRelease = rv[1]
        except Exception:
            logAODFix.warning(
                "no AthenRelease found in input file, setting to <none> !!")
            prevRelease = ''

        ##################
        # determine which is the previous verion of the AODFix
        ##################
        try:
            prevAODFix = inputFileSummary['tag_info']['AODFixVersion']
            if prevAODFix.startswith("AODFix_"):
                prevAODFix = prevAODFix[7:]
                prevAODFix = prevAODFix.split("_")[0]
        except Exception:
            logAODFix.debug(
                "no AODFixVersion found in input file, setting to <none>.")
            prevAODFix = ''

    logAODFix.info("Summary of MetaData for AODFix:")
    if isMC:
        logAODFix.info(" Input file is MC")
    else:
        logAODFix.info(" Input file is DATA")
    logAODFix.info(" Input file produced with Athena version <%s>." %
                   prevRelease)
    logAODFix.info(" AODFix version <%s> was previously applied." % prevAODFix)
    if rec.doApplyAODFix.is_locked():
        logAODFix.info(" AODFix is forced to run!")

    ##################
    # determine which AODFix to run (if actually running--to be determined later)
    ##################

    doAODFix = False
    if rec.readAOD():  # change in policy: no AODFix if reading ESD.
        doAODFix = True
        # check to see if it's a DAOD; do not run by default in DAODs
        from RecExConfig.InputFilePeeker import inputFileSummary
        try:
            streamNames = inputFileSummary['stream_names']
            if any(map(lambda x: "StreamDAOD" in x,
                       streamNames)) and not rec.doApplyAODFix.is_locked():
                logAODFix.info("Running on a DAOD, so not scheduling AODFix")
                doAODFix = False
        except Exception:
            logAODFix.warning("Could not determine the stream name")

    elif rec.readESD() and rec.doApplyAODFix.is_locked():
        # only run on ESDs if forcing
        doAODFix = True

    #exit if not doing AODFix
    if not doAODFix:
        return

    curReleaseSplit = curRelease.split('.')
    prevReleaseSplit = prevRelease.split('.')
    if len(curReleaseSplit) >= 2 and (rec.doApplyAODFix.is_locked()
                                      or len(prevReleaseSplit) >= 2):
        ### If adding an AODFix for a release family that does not have it,
        ### please add it to the if-elif... statement below
        # if (curReleaseSplit[0] == '21' and (curReleaseSplit[1] == '0' or curReleaseSplit[1] == '2') and
        #       (rec.doApplyAODFix.is_locked() or
        #        (prevReleaseSplit[0] == '21' and (prevReleaseSplit[1] == '0' or prevReleaseSplit[1] == '2')))):
        #     _aodFixInstance = AODFix_r210(prevAODFix, isMC, rec.doApplyAODFix.is_locked(), isHI, isHIP)
        # else:
        #     logAODFix.info("No AODFix scheduled for this release.")
        logAODFix.info("AODFix disabled.")

    else:
        logAODFix.info("Current release is of strange form: %s" % curRelease)
Example #4
0
                                         , histoPathBase     = "/Tile/Jet")

        from JetRec.JetRecFlags import jetFlags
        if jetFlags.useTracks():
            jvt = CfgMgr.JetVertexTaggerTool('JVT')
            ToolSvc += jvt
            cleaning = CfgMgr.JetCleaningTool("MyCleaningTool")
            cleaning.CutLevel = "LooseBad"
            cleaning.DoUgly = False
            ToolSvc += cleaning
            ToolSvc.TileJetMonTool.do_jet_cleaning   = True
            ToolSvc.TileJetMonTool.useJVTTool        = jvt
            ToolSvc.TileJetMonTool.useJetCleaning    = cleaning

        if DQMonFlags.monManDataType == 'heavyioncollisions':
            if not rec.doHIP(): 
                ToolSvc.TileJetMonTool.jetCollectionName = 'AntiKt4HIJets'
            ToolSvc.TileJetMonTool.do_event_cleaning = False
            ToolSvc.TileJetMonTool.do_jet_cleaning   = False
        
        ManagedAthenaTileMon.AthenaMonTools += [ ToolSvc.TileJetMonTool ]

    if (not 'doTileTMDBRawChannelMon' in dir() or doTileTMDBRawChannelMon)  and (DQMonFlags.useTrigger() and rec.doTrigger()):
        from TileConditions.TileCondToolConf import getTileCondToolTMDB
        tileCondToolTMDB = getTileCondToolTMDB('COOL')
        if tileCondToolTMDB:
            ToolSvc += tileCondToolTMDB
            ToolSvc += CfgMgr.TileTMDBRawChannelMonTool(name            = 'TileTMDBRawChannelDspMon'
                                                        , OutputLevel   = INFO
                                                        , NotDSP        = False
                                                        , Efficiency    = True
Example #5
0
if DetFlags.detdescr.Muon_on() or DetFlags.detdescr.Calo_on():
    protectedInclude("MuonCombinedRecExample/MuonCombined_OutputItemsESD.py")
    fullESDList += CfgItemList("MuonCombinedEsd", items=MuonCombinedESDList)

from RecExConfig.RecAlgsFlags import recAlgs

# Atlfast, note ESD and AOD lists are equal
if recAlgs.doAtlfast():
    protectedInclude("AtlfastAlgs/AtlfastOutputList_jobOptions.py")
    fullESDList += CfgItemList("AtlfastEsd", items=AtlfastAODList)

# Trigger
# Now filled through objKeyStore in configurables (see HLTTriggerGetter)

# Heavy Ion:
if rec.doHeavyIon() or rec.doHIP():
    protectedInclude("HIRecExample/HIRecOutputESDList_jobOptions.py")
    fullESDList += CfgItemList("HeavyIonsEsd", items=HIESDItemList)

## StreamESD_Augmented.AddItem( "RecoTimingObj#RAWtoESD_timings" )
#fullESDList += CfgItemList( "TimingEsd",
#                            items=["RecoTimingObj#RAWtoESD_timings",
#                                   "RecoTimingObj#RAWtoESD_mems",
#                                   "RecoTimingObj#EVNTtoHITS_timings",
#                                   "RecoTimingObj#HITStoRDO_timings"] )

# Request for W. Ehrenfeld: Add Calibration hits to ESD/AOD files if present in input RDO
if rec.doWriteCalibHits():
    fullESDList += CfgItemList(
        "CalibrationHits",
        items=[
Example #6
0
if DQMonFlags.doStreamAwareMon:
    local_logger.info("Setting stream-aware monitoring for stream %s",
                      rec.triggerStream())

    from TrigHLTMonitoring.HLTMonFlags import HLTMonFlags
    from LArMonTools.LArMonFlags import LArMonFlags

    # Some LAr monitoring is only done on a couple of streams for cpu sake
    # So set them as false by default. Turn them on as needed
    LArMonFlags.doLArRODMonTool = False  # savannah bug report #83390
    LArMonFlags.doLArRawMonitorSignal = False

    # All monitoring turned on for express stream (except LArRawChannelMon)
    # HIP runs will use the express settings for MinBias, MinBiasOverlay, HardProbes, bulk, and UPC
    if (rec.triggerStream() == 'express' or
        (rec.doHIP() and rec.triggerStream()
         in ['MinBias', 'MinBiasOverlay', 'HardProbes', 'bulk', 'UPC'])):
        LArMonFlags.doLArRawChannelMon = False
        LArMonFlags.doLArRODMonTool = True  # savannah bug report #83390

    elif (rec.triggerStream() == 'CosmicCalo'):
        LArMonFlags.doLArRawMonitorSignal = True
        HLTMonFlags.doBjet = False
        DQMonFlags.doJetTagMon = False
    elif (rec.triggerStream() == 'JetTauEtmiss'):
        DQMonFlags.doEgammaMon = False
        DQMonFlags.doPixelMon = False
        DQMonFlags.doSCTMon = False
        DQMonFlags.doTRTMon = False
        LArMonFlags.doLArRawChannelMon = False
    elif (rec.triggerStream() == 'Egamma'):
Example #7
0
    include("RecExConfig/AutoConfigConsistencyCheck.py")

#special commisioning job options
if rec.Commissioning():
    include("RecExCommission/RecExCommission.py")

if rec.triggerStream().startswith('express'):
    logRecExCommon_flags.info('Disabling track slimming for express stream.')
    include("RecJobTransforms/NoTrackSlimming.py")

#Some special (monitoring) setting for Heavy Ions:
if rec.doHeavyIon():
    logRecExCommon_flags.info('Heavy Ion case: Calling HIEarlyIncludes.py')
    include("HIRecExample/HIEarlyIncludes.py")

if rec.doHIP():
    logRecExCommon_flags.info(
        'Heavy Ion p+Pb case: Calling HIPEarlyIncludes.py')
    include("HIRecExample/HIPEarlyIncludes.py")

varInit = dir()

# mgallas
logRecExCommon_flags.info(
    'starting the migration to JobProperties. WILL SOON BE DISABLED.')

# first update RecExCommonFlags value according to variable set
for i in RecExCommonFlags.keys():
    if i in varInit:
        i_value = eval(str(i))
        if not i_value == RecExCommonFlags[i]:
Example #8
0
if not 'rec' in dir():
    from RecExConfig.RecFlags import rec

from RecExConfig.RecAlgsFlags import recAlgs

if rec.doTrigger() == False:
    DQMonFlags.useTrigger = False  # steers trigger-awareness
    DQMonFlags.doLVL1CaloMon = False
    DQMonFlags.doCTPMon = False
    DQMonFlags.doHLTMon = False

# Set the data type based on beamType/HI flag
if globalflags.DataSource.get_Value() == 'geant4':
    DQMonFlags.monManDataType = 'monteCarlo'
elif (rec.doHeavyIon() or rec.doHIP()):
    DQMonFlags.monManDataType = 'heavyioncollisions'
    DQMonFlags.doHIMon = True
elif jobproperties.Beam.beamType() == 'cosmics':
    DQMonFlags.monManDataType = 'cosmics'
elif jobproperties.Beam.beamType() == 'collisions':
    DQMonFlags.monManDataType = 'collisions'
elif jobproperties.Beam.beamType() == 'singlebeam':
    ## There is no singlebeam in AthenaMonitoring
    DQMonFlags.monManDataType = 'collisions'
else:
    local_logger.warning(
        "invalid jobproperties.Beam.beamType(): %s, using default (%s)",
        jobproperties.Beam.beamType(), DQMonFlags.monManDataType)

# First, test to see if this is being run online
if DQMonFlags.doStreamAwareMon:
   local_logger.info("Setting stream-aware monitoring for stream %s", rec.triggerStream())

   from TrigHLTMonitoring.HLTMonFlags import HLTMonFlags
   from LArMonTools.LArMonFlags import LArMonFlags

   # Some LAr monitoring is only done on a couple of streams for cpu sake
   # So set them as false by default. Turn them on as needed
   LArMonFlags.doLArRODMonTool=False            # savannah bug report #83390
   LArMonFlags.doLArRawMonitorSignal=False

   # All monitoring turned on for express stream (except LArRawChannelMon)
   # HIP runs will use the express settings for MinBias, MinBiasOverlay, HardProbes, bulk, and UPC
   if (rec.triggerStream()=='express' or 
       (rec.doHIP() and rec.triggerStream() in ['MinBias', 'MinBiasOverlay', 'HardProbes', 'bulk', 'UPC'])):
      LArMonFlags.doLArRawChannelMon=False
      LArMonFlags.doLArRODMonTool=True          # savannah bug report #83390

   elif (rec.triggerStream()=='CosmicCalo'):
      LArMonFlags.doLArRawMonitorSignal=True
      HLTMonFlags.doBjet=False
      DQMonFlags.doJetTagMon=False
   elif (rec.triggerStream()=='JetTauEtmiss'):
      DQMonFlags.doEgammaMon=False
      DQMonFlags.doPixelMon=False
      DQMonFlags.doSCTMon=False
      DQMonFlags.doTRTMon=False
      LArMonFlags.doLArRawChannelMon=False
   elif (rec.triggerStream()=='Egamma'):
      DQMonFlags.doJetMon=False