コード例 #1
0
def addExtraMonitoring():
    '''
  IF monitoring is wished for GSF or DBM TrackParticles find the monitoring manager and 
  add the corresponding monitoring tools.
  '''
    # hack to add monitors for DBM and GSF
    # the job option fragment which adds the InDetPhysValMonitoringTool for the default tracks
    # will call this method, so can abuse this method to also add the monitoring tools for DBM and GSF tracks
    try:
        from InDetPhysValMonitoring.InDetPhysValJobProperties import InDetPhysValFlags
        # flags are at this stage already initialised, so do not need to  InDetPhysValFlags.init()
        if InDetPhysValFlags.doValidateGSFTracks(
        ) or InDetPhysValFlags.doValidateDBMTracks(
        ) or InDetPhysValFlags.doValidateTightPrimaryTracks():
            mon_index = findMonMan()
            if mon_index != None:
                from AthenaCommon.AlgSequence import AlgSequence
                topSequence = AlgSequence()
                mon_manager = topSequence.getChildren()[mon_index]
                from InDetPhysValMonitoring.InDetPhysValMonitoringTool import InDetPhysValMonitoringTool

    except ImportError:
        import sys, traceback
        exc_type, exc_value, exc_traceback = sys.exc_info()
        print "*** print_tb:"
        traceback.print_tb(exc_traceback, limit=1, file=sys.stdout)
        print "*** print_exception:"
        traceback.print_exception(exc_type,
                                  exc_value,
                                  exc_traceback,
                                  limit=2,
                                  file=sys.stdout)
        print "*** print_exc:"
        traceback.print_exc()
        raise
コード例 #2
0
import InDetPhysValMonitoring.InDetPhysValDecoration
decoration = InDetPhysValMonitoring.InDetPhysValDecoration.addDecoratorIfNeeded()

# add ID physics validation monitoring tool

from InDetPhysValMonitoring.InDetPhysValJobProperties import InDetPhysValFlags
import InDetPhysValMonitoring.InDetPhysValMonitoringTool as InDetPhysValMonitoringTool

mons=[ (True                                             , InDetPhysValMonitoringTool.getInDetPhysValMonitoringTool),
       (InDetPhysValFlags.doValidateLooseTracks()        , InDetPhysValMonitoringTool.getInDetPhysValMonitoringToolLoose),
       (InDetPhysValFlags.doValidateTightPrimaryTracks() , InDetPhysValMonitoringTool.getInDetPhysValMonitoringToolTightPrimary),
       (InDetPhysValFlags.doValidateDBMTracks()          , InDetPhysValMonitoringTool.getInDetPhysValMonitoringToolDBM),
       (InDetPhysValFlags.doValidateGSFTracks()          , InDetPhysValMonitoringTool.getInDetPhysValMonitoringToolGSF)
     ]

for enabled, creator in mons :
    if enabled :
        monMan.AthenaMonTools += [ creator() ]


from InDetPhysValMonitoring.InDetPhysValMonitoringTool import getInDetPhysValMonitoringTool
from  InDetPhysValMonitoring.InDetPhysValJobProperties import InDetPhysValFlags
from  InDetPhysValMonitoring.ConfigUtils import extractCollectionPrefix
for col in InDetPhysValFlags.validateExtraTrackCollections() :
    prefix=extractCollectionPrefix(col)
    monMan.AthenaMonTools += [ getInDetPhysValMonitoringTool(name                       = 'InDetPhysValMonitoringTool'+prefix,
                                                             SubFolder                  = prefix+'Tracks/',
                                                             TrackParticleContainerName = prefix+'TrackParticles') ]
コード例 #3
0
from InDetPhysValMonitoring.InDetPhysValMonitoringTool import InDetPhysValMonitoringTool
from InDetPhysValMonitoring.InDetPhysValJobProperties import InDetPhysValFlags

indet_mon_tool = InDetPhysValMonitoringTool.InDetPhysValMonitoringTool()
ToolSvc += [indet_mon_tool]
monMan.AthenaMonTools += [indet_mon_tool]

if InDetPhysValFlags.doValidateDBMTracks():
    indet_mon_tool_DBM = InDetPhysValMonitoringTool.InDetPhysValMonitoringToolDBM(
    )
    ToolSvc += [indet_mon_tool_DBM]
    monMan.AthenaMonTools += [indet_mon_tool_DBM]

if InDetPhysValFlags.doValidateGSFTracks():
    indet_mon_tool_GSF = InDetPhysValMonitoringTool.InDetPhysValMonitoringToolGSF(
    )
    ToolSvc += [indet_mon_tool_GSF]
    monMan.AthenaMonTools += [indet_mon_tool_GSF]

if InDetPhysValFlags.doValidateLooseTracks():
    indet_mon_tool_Loose = InDetPhysValMonitoringTool.InDetPhysValMonitoringToolLoose(
    )
    ToolSvc += [indet_mon_tool_Loose]
    monMan.AthenaMonTools += [indet_mon_tool_Loose]

if InDetPhysValFlags.doValidateTightPrimaryTracks():
    indet_mon_tool_TightPrimary = InDetPhysValMonitoringTool.InDetPhysValMonitoringToolTightPrimary(
    )
    ToolSvc += [indet_mon_tool_TightPrimary]
    monMan.AthenaMonTools += [indet_mon_tool_TightPrimary]