def __init__(self,name="MuonSegmentRegionRecoveryTool",**kwargs):
    self.applyUserDefaults(kwargs,name)
    super(MuonSegmentRegionRecoveryTool,self).__init__(name,**kwargs)
    global ServiceMgr
    from RegionSelector.RegSelSvcDefault import RegSelSvcDefault
    SegRecoveryRegSelSvc = RegSelSvcDefault()
    SegRecoveryRegSelSvc.enableMuon = True
    ServiceMgr += SegRecoveryRegSelSvc
Beispiel #2
0
    def __init__(self, name=Configurable.DefaultName):
        super(MuGirlNS__CandidateToolConfig, self).__init__(name)

        global ToolSvc, ServiceMgr
        from RegionSelector.RegSelSvcDefault import RegSelSvcDefault
        MuGirlCandidateRegSelSvc = RegSelSvcDefault()
        MuGirlCandidateRegSelSvc.enableMuon = True
        ServiceMgr += MuGirlCandidateRegSelSvc
        self.doCSC = True
        self.RegionSelector = MuGirlCandidateRegSelSvc
        from DCMathSegmentMaker.DCMathSegmentMakerConf import Muon__MdtMathSegmentFinder
        finder_candidate = Muon__MdtMathSegmentFinder(
            "MuGirlCandidateSegmentFinder")
        ToolSvc += finder_candidate

        #from DCMathSegmentMaker.DCMathSegmentMakerConf import Muon__DCMathSegmentMaker
        #maker_candidate = Muon__DCMathSegmentMaker("MuGirlCandidateSegmentMaker")
        #maker_candidate.MdtSegmentFinder = finder_candidate
        #       maker_candidate.CurvedErrorScaling=True
        #ToolSvc += maker_candidate
        #from MdtDriftCircleOnTrackCreator.MdtDriftCircleOnTrackCreatorConf import Muon__MdtDriftCircleOnTrackCreator
        #DriftCircleOnTrack = Muon__MdtDriftCircleOnTrackCreator("MuGirlCandidateDriftCircleOnTrack")
        #ToolSvc += DriftCircleOnTrack
        #self.MdtSegmentMaker = maker_candidate
        self.MdtSegmentMaker = MuonRecTools.getPublicTool("DCMathSegmentMaker")
        self.MdtDriftCircleOnTrackCreator = MuonRecTools.getPublicTool(
            "MdtDriftCircleOnTrackCreator")
        #self.MdtDriftCircleOnTrackCreator = DriftCircleOnTrack
        import MuonRecExample.MuonReadCalib  # setup the calibration service
        #from CscSegmentMakers.Csc2dSegmentMaker import Csc2dSegmentMaker
        #from CscSegmentMakers.Csc4dSegmentMaker import Csc4dSegmentMaker
        self.CscSegmentMaker = MuonRecTools.getPublicTool("Csc4dSegmentMaker")
        #from MuidCaloEnergyTools.MuidCaloEnergyToolsConf import Rec__MuidCaloEnergyTool
        #ToolSvc += Rec__MuidCaloEnergyTool(name = 'MuidCaloEnergyToolParam',EnergyLossMeasurement = False)
        #ToolSvc += Rec__MuidCaloEnergyTool(name = 'MuidCaloEnergyTool')
        from MuonRecExample import MuonPrdProviderToolsConfig
        from AthenaCommon.DetFlags import DetFlags

        if DetFlags.haveRDO.MDT_on():
            self.MdtRdoToPrepDataTool = ToolSvc.MdtPrepDataProviderTool
        else:
            self.MdtRdoToPrepDataTool = None
        if DetFlags.haveRDO.RPC_on():
            self.RpcRdoToPrepDataTool = ToolSvc.RpcPrepDataProviderTool
        else:
            self.RpcRdoToPrepDataTool = None
        if DetFlags.haveRDO.TGC_on():
            self.TgcRdoToPrepDataTool = ToolSvc.TgcPrepDataProviderTool
        else:
            self.TgcRdoToPrepDataTool = None
        if DetFlags.haveRDO.CSC_on():
            self.CscRdoToPrepDataTool = ToolSvc.CscPrepDataProviderTool
        else:
            self.CscRdoToPrepDataTool = None

        #from CscClusterization.CscThresholdClusterBuilderTool import CscThresholdClusterBuilderTool
        self.CscClusterProviderTool = MuonRecTools.getPublicTool(
            "CscThresholdClusterBuilderTool")
Beispiel #3
0
def setMinimalCaloSetup():
    from AthenaCommon.AppMgr import ServiceMgr as svcMgr
    if not hasattr(svcMgr, 'TrigCaloDataAccessSvc'):
        from TrigT2CaloCommon.TrigT2CaloCommonConfig import TrigCaloDataAccessSvc
        svcMgr += TrigCaloDataAccessSvc()
        svcMgr.TrigCaloDataAccessSvc.OutputLevel = ERROR
    if not hasattr(svcMgr, 'RegSelSvcDefault'):
        from RegionSelector.RegSelSvcDefault import RegSelSvcDefault
        svcMgr += RegSelSvcDefault()
Beispiel #4
0
#printfunc ("   ******** Documentation may be found at:******** "  )
#printfunc ("   **** https://twiki.cern.ch/twiki/bin/view/Atlas/MuonOfflineDQA ***** "  )
#printfunc ('\n****************************************************************************************\n')

from AthenaCommon.AlgSequence import AlgSequence
topSequence = AlgSequence()

from MuonRecExample.MuonRecFlags import muonRecFlags
from RecExConfig.RecFlags import rec as recFlags

##################################################################
### To fix the bug --> https://savannah.cern.ch/bugs/?45447
### This will make sure RegSelSvc is correctly configured
from AthenaCommon.AppMgr import ServiceMgr
from RegionSelector.RegSelSvcDefault import RegSelSvcDefault
RegSelSvcMuonMon = RegSelSvcDefault()
RegSelSvcMuonMon.enableMuon = True
ServiceMgr += RegSelSvcMuonMon 
##################################################################
 
if not 'MuonDQADetFlags' in dir():
    printfunc ("MuonDQADetFlags.py: MuonDQADetFlags not yet imported - I import them now")
    from MuonDQAMonFlags.MuonDQAProperFlags import MuonDQADetFlags

MuonDQADetFlags.doMuonMonitoring = True

## --- sudetector specific flags
if muonRecFlags.doCSCs():
    MuonDQADetFlags.doCSCMon = True
    MuonDQADetFlags.doCSCClusMon = True
else:
Beispiel #5
0
    def configure(self):

        if self._done:
            log.info("configuration already done, who is calling it again?")
            return True
        self._done = True

        # start with print some information what this will do
        log.info(
            "Basic configuration flags RecAlgsFlag.doTrigger: %d   RecFlags.doTrigger: %d TriggerFlags.doTriggerConfigOnly %d"
            % (recAlgs.doTrigger(), rec.doTrigger(), TF.doTriggerConfigOnly()))
        log.info(
            "TriggerFlags: doL1Topo: %s, doLVL1: %s, doLVL2: %s, doEF: %s, doHLT: %s"
            % (TF.doL1Topo(), TF.doLVL1(), TF.doLVL2(), TF.doEF(), TF.doHLT()))

        willGenerateMenu = recAlgs.doTrigger() and (
            TF.doLVL1() or TF.doLVL2() or TF.doEF()
            or TF.doHLT()) and not TF.doTriggerConfigOnly()
        willRunTriggerConfigGetter = recAlgs.doTrigger() or rec.doTrigger(
        ) or TF.doTriggerConfigOnly()
        willRunLVL1SimulationGetter = recAlgs.doTrigger(
        ) and not TF.doTriggerConfigOnly()
        willRunHLTSimulationGetter = willRunLVL1SimulationGetter and (
            TF.doLVL2() or TF.doEF() or TF.doHLT())

        log.info("Will run: %s%s%s%s" % (
            "GenerateMenu " if willGenerateMenu else "",
            "TriggerConfigGetter " if willRunTriggerConfigGetter else "",
            "LVL1SimulationGetter " if willRunLVL1SimulationGetter else "",
            "HLTSimulationGetter " if willRunHLTSimulationGetter else "",
        ))
        log.info("Will not run: %s%s%s%s" % (
            "GenerateMenu " if not willGenerateMenu else "",
            "TriggerConfigGetter " if not willRunTriggerConfigGetter else "",
            "LVL1SimulationGetter " if not willRunLVL1SimulationGetter else "",
            "HLTSimulationGetter " if not willRunHLTSimulationGetter else "",
        ))

        if recAlgs.doTrigger():

            # setup the trigger from the DB
            if TF.readConfigFromTriggerDb():
                return self.configureTriggerFromDB()

            if ((TF.doLVL1() == True or TF.doLVL2() == True
                 or TF.doEF() == True or TF.doHLT() == True)
                    and TF.doTriggerConfigOnly() == False):
                log.info("generating menu")
                # trigger menu files generation
                g = GenerateMenu()
                g.generate()

                # after the menu xml file has been created or the TriggerDB access is configured,
                # the COOL/SQlite db can be written
                # TB this needs to be optimized -- we do not need ti always but only when AOD or ESD are created

        if recAlgs.doTrigger() or rec.doTrigger() or TF.doTriggerConfigOnly():
            # setup configuration services
            from TriggerJobOpts.TriggerConfigGetter import TriggerConfigGetter
            cfg = TriggerConfigGetter()

            from TrigConfigSvc.TrigConf2COOL import theConfCOOLWriter
            theConfCOOLWriter.writeConf2COOL()

        # preconfigure TrigDecisionTool
        from TrigDecisionTool.TrigDecisionToolConf import Trig__TrigDecisionTool
        from AthenaCommon.AppMgr import ToolSvc
        ToolSvc += Trig__TrigDecisionTool("TrigDecisionTool")
        # tell tdt to use TrigConfigSvc (Since TrigDecisionTool-00-03-40, defaults to not use it)
        ToolSvc.TrigDecisionTool.TrigConfigSvc = "Trig::TrigConfigSvc/TrigConfigSvc"

        from TrigEDMConfig.TriggerEDM import EDMLibraries
        ToolSvc.TrigDecisionTool.Navigation.Dlls = [
            e for e in EDMLibraries if 'TPCnv' not in e
        ]

        # actuall trigger simulation running
        if recAlgs.doTrigger() and not TF.doTriggerConfigOnly():
            # setup Lvl1
            # initialize LVL1ConfigSvc
            log.info("configuring lvl1")
            from TriggerJobOpts.Lvl1TriggerGetter import Lvl1SimulationGetter
            lvl1 = Lvl1SimulationGetter()

            if jobproperties.Global.InputFormat() != 'bytestream' and (
                    TF.doLVL2 == True or TF.doEF == True or TF.doHLT == True):
                # Transient BS construction and intialization
                from ByteStreamCnvSvc import WriteByteStream
                StreamBS = WriteByteStream.getStream("Transient", "StreamBS")
                StreamBS.ForceRead = True
                StreamBS.ItemList += [
                    "DataVector<LVL1::TriggerTower>#TriggerTowers"
                ]
                StreamBS.ItemList += ["TRT_RDO_Container#TRT_RDOs"]
                StreamBS.ItemList += ["SCT_RDO_Container#SCT_RDOs"]
                StreamBS.ItemList += ["PixelRDO_Container#PixelRDOs"]
                # StreamBS.ItemList +=["LArRawChannelContainer#*"]
                StreamBS.ItemList += ["2721#*"]
                # StreamBS.ItemList +=["TileRawChannelContainer#*"]
                StreamBS.ItemList += ["2927#*"]
                StreamBS.ItemList += [
                    "2934#*"
                ]  # added on request from: Arantxa Ruiz Martinez for TileRODMu

                # don't need Muons in transient BS
                # StreamBS.ItemList +=["MdtCsmContainer#*"]
                # StreamBS.ItemList +=["RpcPadContainer#*"]
                # StreamBS.ItemList +=["TgcRdoContainer#*"]
                # StreamBS.ItemList +=["CscRawDataContainer#*"]

                from AthenaCommon.Include import include
                # setup trans BS for the ID
                include("InDetRecExample/InDetRecCabling.py")

            # setup HLT
            # initialize HLT config svc
            log.info("TriggerFlags: doLVL2 %r" % TF.doLVL2())
            log.info("TriggerFlags: doEF   %r" % TF.doEF())
            log.info("TriggerFlags: doHLT  %r" % TF.doHLT())
            if TF.doLVL2() == True or TF.doEF() == True or TF.doHLT() == True:
                log.info("configuring hlt")
                from TriggerJobOpts.HLTTriggerGetter import HLTSimulationGetter
                hlt = HLTSimulationGetter(g)
            else:
                from RegionSelector.RegSelSvcDefault import RegSelSvcDefault
                from AthenaCommon.AppMgr import ServiceMgr
                ServiceMgr += RegSelSvcDefault()
                ServiceMgr.RegSelSvc.enablePixel = False
                ServiceMgr.RegSelSvc.enableSCT = False

        # prepare result making of L1
        from TriggerJobOpts.Lvl1ResultBuilderGetter import Lvl1ResultBuilderGetter
        hltouput = Lvl1ResultBuilderGetter()

        # prepare result making of HLT
        if TF.doLVL2() == True or TF.doEF() == True or TF.doHLT() or (
                recAlgs.doTrigger() and TF.readBS()):
            from TriggerJobOpts.HLTTriggerResultGetter import HLTTriggerResultGetter
            hltouput = HLTTriggerResultGetter()

        return True
Beispiel #6
0
    def configure(self):

        if self._done:
            log.info("configuration already done, who is calling it again?")
            return True
        self._done = True

        # start with print some information what this will do
        log.info(
            "Basic configuration flags RecAlgsFlag.doTrigger: %d   RecFlags.doTrigger: %d TriggerFlags.doTriggerConfigOnly %d",
            recAlgs.doTrigger(), rec.doTrigger(), TF.doTriggerConfigOnly())
        log.info(
            "TriggerFlags: doL1Topo: %s, doLVL1: %s, doLVL2: %s, doEF: %s, doHLT: %s, doMT: %s",
            TF.doL1Topo(), TF.doLVL1(), TF.doLVL2(), TF.doEF(), TF.doHLT(),
            TF.doMT())

        # RDOtoRDOTrigger MT temporarily coded in the transform skeleton, so skip here
        if TF.doMT() and rec.readRDO() and rec.doWriteRDO():
            log.info("Nothing happens in TriggerGetter for RDOtoRDOTrigger MT")
            return True
        else:  #GenerateMenu imports slice flags, which are Menu/MenuMT dependent
            from TriggerMenu.menu.GenerateMenu import GenerateMenu

        willGenerateMenu = recAlgs.doTrigger() and (
            TF.doLVL1() or TF.doLVL2() or TF.doEF()
            or TF.doHLT()) and not TF.doTriggerConfigOnly()
        willRunTriggerConfigGetter = recAlgs.doTrigger() or rec.doTrigger(
        ) or TF.doTriggerConfigOnly()
        willRunLVL1SimulationGetter = recAlgs.doTrigger(
        ) and not TF.doTriggerConfigOnly()
        willRunHLTSimulationGetter = willRunLVL1SimulationGetter and (
            TF.doLVL2() or TF.doEF() or TF.doHLT())

        log.info(
            "Will run: %s%s%s%s", "GenerateMenu " if willGenerateMenu else "",
            "TriggerConfigGetter " if willRunTriggerConfigGetter else "",
            "LVL1SimulationGetter " if willRunLVL1SimulationGetter else "",
            "HLTSimulationGetter " if willRunHLTSimulationGetter else "")

        log.info(
            "Will not run: %s%s%s%s",
            "GenerateMenu " if not willGenerateMenu else "",
            "TriggerConfigGetter " if not willRunTriggerConfigGetter else "",
            "LVL1SimulationGetter " if not willRunLVL1SimulationGetter else "",
            "HLTSimulationGetter " if not willRunHLTSimulationGetter else "")
        if recAlgs.doTrigger():

            if ((TF.doLVL1() or TF.doLVL2() or TF.doEF() or TF.doHLT())
                    and not TF.doTriggerConfigOnly()):
                log.info("generating menu")
                # trigger menu files generation
                g = GenerateMenu()
                g.generate()

                # after the menu xml file has been created or the TriggerDB access is configured,
                # the COOL/SQlite db can be written
                # TB this needs to be optimized -- we do not need ti always but only when AOD or ESD are created

        if recAlgs.doTrigger() or rec.doTrigger() or TF.doTriggerConfigOnly():
            # setup configuration services
            from TriggerJobOpts.TriggerConfigGetter import TriggerConfigGetter
            cfg = TriggerConfigGetter()  # noqa: F841

            from TrigConfigSvc.TrigConf2COOL import theConfCOOLWriter
            theConfCOOLWriter.writeConf2COOL()

        # preconfigure TrigDecisionTool
        from TrigDecisionTool.TrigDecisionToolConf import Trig__TrigDecisionTool
        from AthenaCommon.AppMgr import ToolSvc
        ToolSvc += Trig__TrigDecisionTool("TrigDecisionTool")
        from PyUtils.MetaReaderPeekerFull import metadata
        if "metadata_items" in metadata and any(
            ('TriggerMenu' in key)
                for key in metadata["metadata_items"].keys()):
            # Use xAOD configuration.
            from AthenaCommon.AppMgr import ServiceMgr as svcMgr
            if not hasattr(svcMgr, 'xAODConfigSvc'):
                from TrigConfxAOD.TrigConfxAODConf import TrigConf__xAODConfigSvc
                svcMgr += TrigConf__xAODConfigSvc('xAODConfigSvc')
            ToolSvc += Trig__TrigDecisionTool("TrigDecisionTool")
            ToolSvc.TrigDecisionTool.TrigConfigSvc = svcMgr.xAODConfigSvc
        else:
            # Use TrigConfigSvc
            ToolSvc.TrigDecisionTool.TrigConfigSvc = "TrigConf::TrigConfigSvc/TrigConfigSvc"

        from TrigEDMConfig.TriggerEDM import EDMLibraries
        ToolSvc.TrigDecisionTool.Navigation.Dlls = [
            e for e in EDMLibraries if 'TPCnv' not in e
        ]

        # actuall trigger simulation running
        if recAlgs.doTrigger() and not TF.doTriggerConfigOnly():
            # setup Lvl1
            # initialize LVL1ConfigSvc
            log.info("configuring lvl1")
            from TriggerJobOpts.Lvl1TriggerGetter import Lvl1SimulationGetter
            lvl1 = Lvl1SimulationGetter()  # noqa: F841

            if TF.doTransientByteStream() or (
                    jobproperties.Global.InputFormat() != 'bytestream' and
                (TF.doLVL2() or TF.doEF() or TF.doHLT())):
                # Transient BS construction and intialization
                from ByteStreamCnvSvc import WriteByteStream
                StreamBS = WriteByteStream.getStream("Transient", "StreamBS")
                StreamBS.ItemList += [
                    "DataVector<LVL1::TriggerTower>#TriggerTowers"
                ]
                StreamBS.ItemList += ["TRT_RDO_Container#TRT_RDOs"]
                StreamBS.ItemList += ["SCT_RDO_Container#SCT_RDOs"]
                StreamBS.ItemList += ["PixelRDO_Container#PixelRDOs"]
                # StreamBS.ItemList +=["LArRawChannelContainer#*"]
                StreamBS.ItemList += ["2721#*"]
                # StreamBS.ItemList +=["TileRawChannelContainer#*"]
                StreamBS.ItemList += ["2927#*"]
                StreamBS.ItemList += [
                    "2934#*"
                ]  # added on request from: Arantxa Ruiz Martinez for TileRODMu

                # don't need Muons in transient BS
                # StreamBS.ItemList +=["MdtCsmContainer#*"]
                # StreamBS.ItemList +=["RpcPadContainer#*"]
                # StreamBS.ItemList +=["TgcRdoContainer#*"]
                # StreamBS.ItemList +=["CscRawDataContainer#*"]

                from AthenaCommon.Include import include
                # setup trans BS for the ID
                include("InDetRecExample/InDetRecCabling.py")

            # setup HLT
            # initialize HLT config svc
            log.info("TriggerFlags: doLVL2 %r", TF.doLVL2())
            log.info("TriggerFlags: doEF   %r", TF.doEF())
            log.info("TriggerFlags: doHLT  %r", TF.doHLT())
            if TF.doLVL2() or TF.doEF() or TF.doHLT():
                log.info("configuring hlt")
                from TriggerJobOpts.HLTTriggerGetter import HLTSimulationGetter
                hlt = HLTSimulationGetter(g)  # noqa: F841
            else:
                from RegionSelector.RegSelSvcDefault import RegSelSvcDefault
                from AthenaCommon.AppMgr import ServiceMgr
                ServiceMgr += RegSelSvcDefault()
                ServiceMgr.RegSelSvc.enablePixel = False
                ServiceMgr.RegSelSvc.enableSCT = False

        # prepare result making of L1
        from TriggerJobOpts.Lvl1ResultBuilderGetter import Lvl1ResultBuilderGetter
        hltouput = Lvl1ResultBuilderGetter()

        # prepare result making of HLT
        if TF.doLVL2() or TF.doEF() or TF.doHLT() or (recAlgs.doTrigger()
                                                      and TF.readBS()):
            from TriggerJobOpts.HLTTriggerResultGetter import HLTTriggerResultGetter
            hltouput = HLTTriggerResultGetter()  # noqa: F841

        return True
Beispiel #7
0
#InDetTrigCutValues.printInfo()


#
from AthenaCommon.DetFlags import DetFlags
from AthenaCommon.GlobalFlags import globalflags

#conditions setup
if InDetTrigFlags.useConditionsClasses():
  log.info("Setting up conditions using the new classes")
else:
  include ("InDetRecExample/InDetRecConditionsAccess.py")

#manipulate RegSelSvc settings to be aware of the inactive detelems
from RegionSelector.RegSelSvcDefault import RegSelSvcDefault
RegSelSvc = RegSelSvcDefault()

RegSelSvc.DisableFromConditions = False
RegSelSvc.DisablePixelFromConditions = False
RegSelSvc.DisableTRTFromConditions = False
RegSelSvc.DisableSCTFromConditions = False
from InDetTrigRecExample.InDetTrigConfigConditions import \
         SCT_ConditionsSetup, TRT_ConditionsSetup
RegSelSvc.PixConditionsSvc = ""      #empty as it does not work
RegSelSvc.SCTConditionsTool = "SCT_ConditionsSummaryTool/"+SCT_ConditionsSetup.instanceName("InDetSCT_ConditionsSummaryTool")
RegSelSvc.TRTConditionsSvc = "TRT_ConditionsSummarySvc/"+TRT_ConditionsSetup.instanceName("InDetTRTConditionsSummaryService")

#this should be our common cabling setup/
# online running data are dealt with in the TriggerJobOpts 
include ("InDetRecExample/InDetRecCabling.py")
Beispiel #8
0
    def configure(self):

        log = logging.getLogger("HLTTriggergetter.py")

        from AthenaCommon.AlgSequence import AlgSequence
        topSequence = AlgSequence()

        # If no xAOD::EventInfo is found in a POOL file, schedule conversion from old EventInfo
        from AthenaCommon.GlobalFlags import globalflags
        if globalflags.InputFormat.is_pool():
            from RecExConfig.ObjKeyStore import objKeyStore
            from PyUtils.MetaReaderPeeker import convert_itemList
            objKeyStore.addManyTypesInputFile(convert_itemList(layout='#join'))
            from AthenaCommon.AlgSequence import AthSequencer
            condSeq = AthSequencer("AthCondSeq")
            if (not objKeyStore.isInInput("xAOD::EventInfo")) and (not hasattr(
                    condSeq, "xAODMaker::EventInfoCnvAlg")):
                from xAODEventInfoCnv.xAODEventInfoCnvAlgDefault import xAODEventInfoCnvAlgDefault
                xAODEventInfoCnvAlgDefault(sequence=condSeq)

        if jobproperties.Global.InputFormat() == 'bytestream':
            # Decode ROIB::RoIBResult from ByteStream
            from TrigT1ResultByteStream.TrigT1ResultByteStreamConfig import L1ByteStreamDecodersRecExSetup
            L1ByteStreamDecodersRecExSetup()

        log.info("Loading RegionSelector")
        from AthenaCommon.AppMgr import ServiceMgr
        from RegionSelector.RegSelSvcDefault import RegSelSvcDefault
        ServiceMgr += RegSelSvcDefault()

        # Configure the Data Preparation for Calo
        if TriggerFlags.doCalo():
            try:
                from TrigT2CaloCommon.TrigT2CaloCommonConfig import TrigDataAccess
                ServiceMgr.ToolSvc += TrigDataAccess()
            except ImportError:
                include('TrigT2CaloCommon/TrigDataAccessConfigured.py')

        if TriggerFlags.doFTK():
            # FTK algorithm inclusions
            # TrigFTK_DataProviderSvc moved to TrigFTK_RecExample
            pass

        if TriggerFlags.doHLT():
            log.info("configuring HLT Steering")

            from TrigSteering.TrigSteeringConfig import TrigSteer_HLT, ReruningTrigSteer_HLT
            if TriggerFlags.doFEX():

                # schedule the conversion of the L1Calo ROIB data to topo simulation input

                # this ROIB converter should only be scheduled if
                # - we run on data
                # - L1Calo simulation has not been scheduled
                # - and ROIB converter has not been scheduled yet before
                if globalflags.DataSource()=='data' \
                       and not hasattr( topSequence, 'CPCMX' ) \
                       and not hasattr( topSequence, 'RoiB2TopoInputDataCnv' ):
                    log.info("Setting up RoiB2TopoInputDataCnv")
                    from L1TopoSimulation.L1TopoSimulationConfig import RoiB2TopoInputDataCnv
                    roib2Topo = RoiB2TopoInputDataCnv()
                    topSequence += roib2Topo

                log.info(
                    "configuring HLT merged system, for normal running (FEX + Hypo)"
                )
                TrigSteer_HLT = TrigSteer_HLT(
                    'TrigSteer_HLT',
                    hltFile=TriggerFlags.inputHLTconfigFile(),
                    lvl1File=TriggerFlags.inputLVL1configFile())
                TrigSteer_HLT.doHypo = TriggerFlags.doHypo()

            if not TriggerFlags.doFEX() and TriggerFlags.doHypo():
                log.info("configuring merged HLT for re-running (Hypo only)")
                TrigSteer_HLT = ReruningTrigSteer_HLT(
                    'TrigSteer_HLT',
                    hltFile=TriggerFlags.inputHLTconfigFile(),
                    lvl1File=TriggerFlags.inputLVL1configFile())

            # TrigSteer_HLT.doL1TopoSimulation = TriggerFlags.doL1Topo() # this later needs to be extented to also run when we take data with L1Topo
            TrigSteer_HLT.doL1TopoSimulation = True  # always needs to run if the HLT is simulated
            if hasattr(TrigSteer_HLT.LvlTopoConverter, 'MuonInputProvider'):

                try:  # this is temporary until TrigT1Muctpi-00-06-29 is in the release
                    from TrigT1Muctpi.TrigT1MuctpiConfig import L1MuctpiTool
                    from AthenaCommon.AppMgr import ToolSvc
                    ToolSvc += L1MuctpiTool()
                    TrigSteer_HLT.LvlTopoConverter.MuonInputProvider.MuctpiSimTool = L1MuctpiTool(
                    )
                except ImportError:
                    pass

                from AthenaCommon.GlobalFlags import globalflags
                if globalflags.DataSource() != 'data':
                    log.info(
                        "Muon eta/phi encoding with reduced granularity for MC (L1Topo emulation for HLT seeding)"
                    )
                    TrigSteer_HLT.LvlTopoConverter.MuonInputProvider.MuonEncoding = 1  # reduced granularity muon input
                else:
                    log.info(
                        "Muon eta/phi encoding with full granularity for data (L1Topo emulation for HLT seeding) - should be faced out"
                    )
                    TrigSteer_HLT.LvlTopoConverter.MuonInputProvider.MuonEncoding = 0  # full granularity muon input - should be faced out

            from TrigEDMConfig.TriggerEDM import getHLTPreregistrationList, getEDMLibraries
            TrigSteer_HLT.Navigation.ClassesToPreregister = getHLTPreregistrationList(
            )

            TrigSteer_HLT.Navigation.Dlls = getEDMLibraries()

            monitoringTools(TrigSteer_HLT)
            topSequence += TrigSteer_HLT

        if TriggerFlags.writeBS():
            # declare objects to go to BS (from the lists above)
            ## if TriggerFlags.doLVL2():
            ##     from TrigEDMConfig.TriggerEDM import getL2BSList
            ##     TrigSteer_L2.Navigation.ClassesToPayload = getL2BSList()
            ##     TrigSteer_L2.Navigation.ClassesToPreregister = []
            ##
            ## if TriggerFlags.doEF():
            ##     from TrigEDMConfig.TriggerEDM import getEFBSList
            ##     TrigSteer_EF.Navigation.ClassesToPayload = getEFBSList()
            ##     TrigSteer_EF.Navigation.ClassesToPreregister = []
            ##     try:
            ##         from TrigEDMConfig.TriggerEDM import getEFDSList
            ##         TrigSteer_EF.Navigation.ClassesToPayload_DSonly = getEFDSList()
            ##     except ImportError:
            ##         log.warning("DataScouting not available in this release")

            if TriggerFlags.doHLT():
                from TrigEDMConfig.TriggerEDM import getHLTBSList
                TrigSteer_HLT.Navigation.ClassesToPayload = getHLTBSList()
                TrigSteer_HLT.Navigation.ClassesToPreregister = []
                try:
                    from TrigEDMConfig.TriggerEDM import getHLTDSList
                    TrigSteer_HLT.Navigation.ClassesToPayload_DSonly = getHLTDSList(
                    )
                except ImportError:
                    log.warning("DataScouting not available in this release")

            #configure tools for serialization
            from TrigSerializeTP.TrigSerializeTPConf import TrigSerTPTool
            TrigSerToolTP = TrigSerTPTool('TrigSerTPTool')
            from TrigEDMConfig.TriggerEDM import getTPList
            TrigSerToolTP.TPMap = getTPList(TriggerFlags.doHLT())
            from AthenaCommon.AppMgr import ToolSvc
            ToolSvc += TrigSerToolTP

            from TrigSerializeCnvSvc.TrigSerializeCnvSvcConf import TrigSerializeConvHelper
            TrigSerializeConvHelper = TrigSerializeConvHelper(doTP=True)
            ToolSvc += TrigSerializeConvHelper

            #do not activate T/P of EF classes at L2
            ## if TriggerFlags.doLVL2():
            ##     from TrigEDMConfig.TriggerEDM import getL2BSTypeList
            ##     TrigSerToolTP.ActiveClasses = getL2BSTypeList()
            ## if TriggerFlags.doEF():
            ##     from TrigEDMConfig.TriggerEDM import getL2BSTypeList, getEFBSTypeList
            ##     TrigSerToolTP.ActiveClasses = getL2BSTypeList() + getEFBSTypeList()

            if TriggerFlags.doHLT():
                from TrigEDMConfig.TriggerEDM import getHLTBSTypeList
                TrigSerToolTP.ActiveClasses = getHLTBSTypeList()

        from TriggerJobOpts.HLTTriggerResultGetter import HLTTriggerResultGetter
        result = HLTTriggerResultGetter()  # noqa: F841
        return True
Beispiel #9
0
    # iPatRec algorithm
    from iPatRecAlgs.iPatRecAlgsConf import iPatRec
    iPatRec = iPatRec(TRT_DataSelector="TRT_DataSelector/TRT_DataSelector")
    ## iPatRec = iPatRec(TRT_DataSelector = "")
    iPatRec.Fitter = iPatRecFitter
    topSequence += iPatRec

    from iPatTrackFollower.iPatTrackFollowerConf import TrackFollower
    ToolSvc += TrackFollower(name='TrackFollower',
                             TRT_Recon="TRT_Recon/TRT_Recon")

    # include the RegionSelector service
    if DetFlags.haveRIO.TRT_on():
        from AthenaCommon.AppMgr import ServiceMgr
        from RegionSelector.RegSelSvcDefault import RegSelSvcDefault
        iPatRegSelSvc = RegSelSvcDefault()
        iPatRegSelSvc.enableTRT = True
        ServiceMgr += iPatRegSelSvc

    # -------------------------------------------------------------
    # Algorithm Private Options: iPatRec
    # -------------------------------------------------------------
    iPatRec.maxSecondaryImpact = InDetNewTrackingCuts.maxSecondaryImpact()
    iPatRec.minPt = InDetNewTrackingCuts.minPT()

    # specify vertex region (for primary track finding)
    # iPatRec.vertex       	= [0.0*mm, 0.0*mm, 0.0*mm]
    # iPatRec.vertexWidth	= [1.0*mm, 1.0*mm, 250.0*mm]

    # -------------------------------------------------------------
    # Heavy Ion
Beispiel #10
0
def HLTCaloMonitoringTool():

    if not 'DQMonFlags' in dir():
        from AthenaMonitoring.DQMonFlags import DQMonFlags
    if DQMonFlags.monManEnvironment == 'tier0Raw':
        from TrigCaloRec.TrigCaloRecConf import RoILArEMCellContMaker, RoILArHadCellContMaker, RoITileCellContMaker, RoIFCalEmCellContMaker, RoIFCalHadCellContMaker, FullCaloCellContMaker

        from TrigCaloMonitoring.TrigCaloMonitoringConf import HLTCaloTool, HLTCaloFEBTool
        from CaloTools.CaloNoiseToolDefault import CaloNoiseToolDefault
        theCaloNoiseTool = CaloNoiseToolDefault()
        from AthenaCommon.AppMgr import ToolSvc
        if not hasattr(ToolSvc, "CaloNoiseToolDefault"):
            ToolSvc += theCaloNoiseTool

        from TrigT2CaloCommon.TrigT2CaloCommonConfig import TrigDataAccess
        ToolSvc += TrigDataAccess()
        ToolSvc.TrigDataAccess.loadAllSamplings = True

        roilaremcellcontmaker = RoILArEMCellContMaker()
        roilaremcellcontmaker.CaloNoiseTool = theCaloNoiseTool
        roilarhadcellcontmaker = RoILArHadCellContMaker()
        roilarhadcellcontmaker.CaloNoiseTool = theCaloNoiseTool
        roilaremcellcontmaker.DoLArCellsNoiseSuppression = 0
        roilarhadcellcontmaker.DoLArCellsNoiseSuppression = 0
        roifcalemcellcontmaker = RoIFCalEmCellContMaker()
        roifcalemcellcontmaker.CaloNoiseTool = theCaloNoiseTool
        roifcalemcellcontmaker.DoLArCellsNoiseSuppression = 0
        roifcalhadcellcontmaker = RoIFCalHadCellContMaker()
        roifcalhadcellcontmaker.CaloNoiseTool = theCaloNoiseTool
        roifcalhadcellcontmaker.DoLArCellsNoiseSuppression = 0
        #fullcalocellcontmaker = FullCaloCellContMaker()
        #fullcalocellcontmaker.CaloNoiseTool = theCaloNoiseTool
        #fullcalocellcontmaker.DoLArCellsNoiseSuppression = 0

        HLTCalo = HLTCaloTool(name='HLTCalo', histoPathBase="/Trigger/HLT")
        HLTCalo.TCRTools = [
            roilaremcellcontmaker, roilarhadcellcontmaker,
            roifcalemcellcontmaker, roifcalhadcellcontmaker,
            RoITileCellContMaker()
        ]

        # From Ignacio
        HLTCaloFEB = HLTCaloFEBTool(name='HLTCaloFEB',
                                    histoPathBase="/Trigger/HLT")
        HLTCaloFEB.TCRTools = [
            roilaremcellcontmaker, roilarhadcellcontmaker,
            roifcalemcellcontmaker, roifcalhadcellcontmaker,
            RoITileCellContMaker()
        ]
        HLTCaloFEB.sigma = 3
        #
        # Add Region Selector if there is none
        from AthenaCommon.AppMgr import ServiceMgr
        if not hasattr(ServiceMgr, "RegSelSvcDefault"):
            from RegionSelector.RegSelSvcDefault import RegSelSvcDefault
            ServiceMgr += RegSelSvcDefault()

        #HLTFullCalo = HLTCaloTool(name             = 'HLTFullCalo',
        #                                histoPathBase    = "/Trigger/HLT")
        #HLTFullCalo.TCRTools = [fullcalocellcontmaker]
        ToolSvc += HLTCalo
        list = ["HLTCaloTool/HLTCalo"]
        ToolSvc += HLTCaloFEB
        list += ["HLTCaloFEBTool/HLTCaloFEB"]
        #ToolSvc += HLTFullCalo;
        #list += [ "HLTCaloTool/HLTFullCalo" ];
        return list

    #elif DQMonFlags.monManEnvironment == 'tier0ESD':
    elif ((DQMonFlags.monManEnvironment == 'tier0ESD')
          or (DQMonFlags.monManEnvironment == 'tier0')):
        from TrigCaloMonitoring.TrigCaloMonitoringConf import HLTCaloToolL2
        from TrigCaloMonitoring.TrigCaloMonitoringConf import HLTCaloClusterTool
        from TrigCaloMonitoring.TrigCaloMonitoringConf import HLTCaloESD_xAODTrigEMClusters
        from TrigCaloMonitoring.TrigCaloMonitoringConf import HLTCaloESD_xAODCaloClusters
        from TrigCaloMonitoring.TrigCaloMonitoringConf import HLTCaloESD_CaloCells

        xAODTrigEMClusters = HLTCaloESD_xAODTrigEMClusters(
            "xAODTrigEMClusters")
        xAODCaloClusters = HLTCaloESD_xAODCaloClusters("xAODCaloClusters")
        CaloCells = HLTCaloESD_CaloCells("CaloCells")

        HLTCaloL2 = HLTCaloToolL2(
            name='HLTCaloL2',
            histoPathBase="/Trigger/HLT",
            ListOfCellsKeys=[
                'HLT_CaloCellContainer_TrigT2CaloTauCells',
                'HLT_CaloCellContainer_TrigT2CaloEgammaCells'
            ])
        HLTCaloCluster = HLTCaloClusterTool(name='HLTCaloCluster',
                                            histoPathBase="/Trigger/HLT")
        from AthenaCommon.AppMgr import ToolSvc
        #ToolSvc += HLTCaloL2;
        ToolSvc += xAODTrigEMClusters
        #list = [ "HLTCaloToolL2/HLTCaloL2" ];
        list = ["HLTCaloESD_xAODTrigEMClusters/xAODTrigEMClusters"]
        #ToolSvc += HLTCaloCluster;
        ToolSvc += xAODCaloClusters
        #list += [ "HLTCaloClusterTool/HLTCaloCluster" ];
        list += ["HLTCaloESD_xAODCaloClusters/xAODCaloClusters"]
        ToolSvc += CaloCells
        list += ["HLTCaloESD_CaloCells/CaloCells"]

        return list
    else:
        list = []
        return list
Beispiel #11
0
    def __init__(self,
                 InputCollections=None,
                 NewTrackingCuts=None,
                 TrackCollectionKeys=[],
                 TrackCollectionTruthKeys=[]):

        from InDetRecExample.InDetJobProperties import InDetFlags
        from InDetRecExample.InDetKeys import InDetKeys
        #
        # get ToolSvc and topSequence
        #
        from AthenaCommon.AppMgr import ToolSvc
        from AthenaCommon.AlgSequence import AlgSequence
        topSequence = AlgSequence()

        #
        # --- decide if use the association tool
        #
        if len(InputCollections) > 0:
            usePrdAssociationTool = True
        else:
            usePrdAssociationTool = False

        # --- the PRD association tool is filled by the Segment making
        #     no need to run again

        # ------------------------------------------------------------
        #
        # ---------- TRT Seeded Tracking
        #
        # ------------------------------------------------------------

        if InDetFlags.doTRTSeededTrackFinder():
            #
            # --- decide which TRT seed space point finder to use
            #
            if InDetFlags.loadTRTSeededSPFinder():
                #
                # --- defaul space point finder
                #
                from TRT_SeededSpacePointFinderTool.TRT_SeededSpacePointFinderToolConf import InDet__TRT_SeededSpacePointFinder_ATL
                InDetTRT_SeededSpacePointFinder = InDet__TRT_SeededSpacePointFinder_ATL(
                    name='InDetTRT_SeededSpFinder',
                    SpacePointsSCTName=InDetKeys.SCT_SpacePoints(),
                    SpacePointsOverlapName=InDetKeys.OverlapSpacePoints(),
                    AssociationTool=InDetPrdAssociationTool,
                    UseAssociationTool=usePrdAssociationTool,
                    NeighborSearch=True,
                    LoadFull=False,
                    DoCosmics=InDetFlags.doCosmics(),
                    pTmin=NewTrackingCuts.minSecondaryPt())
                #InDetTRT_SeededSpacePointFinder.OutputLevel = VERBOSE

            elif InDetFlags.loadSimpleTRTSeededSPFinder():
                #
                # --- alternative version using the region selector
                #
                from RegionSelector.RegSelSvcDefault import RegSelSvcDefault
                InDetRegSelSvc = RegSelSvcDefault()
                InDetRegSelSvc.enablePixel = DetFlags.pixel_on()
                InDetRegSelSvc.enableSCT = DetFlags.SCT_on()

                ServiceMgr += InDetRegSelSvc
                if (InDetFlags.doPrintConfigurables()):
                    print InDetRegSelSvc

                from TRT_SeededSpacePointFinderTool.TRT_SeededSpacePointFinderToolConf import InDet__SimpleTRT_SeededSpacePointFinder_ATL
                InDetTRT_SeededSpacePointFinder = InDet__SimpleTRT_SeededSpacePointFinder_ATL(
                    name='InDetTRT_SeededSpFinder',
                    SpacePointsSCTName=InDetKeys.SCT_SpacePoints(),
                    SpacePointsOverlapName=InDetKeys.OverlapSpacePoints(),
                    PerigeeCut=1000.,
                    DirectionPhiCut=.3,
                    DirectionEtaCut=1.,
                    MaxHoles=2,
                    AssociationTool=InDetPrdAssociationTool,
                    RestrictROI=True)
                #InDetTRT_SeededSpacePointFinder.OutputLevel = VERBOSE
                if not usePrdAssociationTool:
                    InDetTRT_SeededSpacePointFinder.AssociationTool = None

            # add either into the Tool Service
            ToolSvc += InDetTRT_SeededSpacePointFinder
            if (InDetFlags.doPrintConfigurables()):
                print InDetTRT_SeededSpacePointFinder
            #
            # Silicon det elements road maker tool
            #
            from SiDetElementsRoadTool_xk.SiDetElementsRoadTool_xkConf import InDet__SiDetElementsRoadMaker_xk
            InDetTRT_SeededSiRoadMaker = InDet__SiDetElementsRoadMaker_xk(
                name='InDetTRT_SeededSiRoad',
                PropagatorTool=InDetPatternPropagator,
                usePixel=NewTrackingCuts.usePixel(),
                PixManagerLocation=InDetKeys.PixelManager(),
                useSCT=NewTrackingCuts.useSCT(),
                SCTManagerLocation=InDetKeys.SCT_Manager(),
                RoadWidth=35.,
                MaxStep=20.)  # NOT DEFAULT ?
            #InDetTRT_SeededSiRoadMaker.OutputLevel = VERBOSE
            if InDetFlags.doCosmics():
                InDetTRT_SeededSiRoadMaker.RoadWidth = 50

            ToolSvc += InDetTRT_SeededSiRoadMaker
            if (InDetFlags.doPrintConfigurables()):
                print InDetTRT_SeededSiRoadMaker
            #
            # --- TRT seeded back tracking tool
            #
            from TRT_SeededTrackFinderTool.TRT_SeededTrackFinderToolConf import InDet__TRT_SeededTrackFinder_ATL
            InDetTRT_SeededTrackTool = InDet__TRT_SeededTrackFinder_ATL(
                name='InDetTRT_SeededTrackMaker',
                PropagatorTool=InDetPatternPropagator,
                UpdatorTool=InDetPatternUpdator,
                RoadTool=InDetTRT_SeededSiRoadMaker,
                SeedTool=InDetTRT_SeededSpacePointFinder,
                CombinatorialTrackFinder=InDetSiComTrackFinder,
                pTmin=NewTrackingCuts.minSecondaryPt(),
                nHolesMax=NewTrackingCuts.SecondarynHolesMax(),
                # ME bugfix: nHolesGapMax             = 2*NewTrackingCuts.SecondarynHolesGapMax(),
                nHolesGapMax=NewTrackingCuts.SecondarynHolesGapMax(),
                Xi2max=NewTrackingCuts.SecondaryXi2max(),
                Xi2maxNoAdd=NewTrackingCuts.SecondaryXi2maxNoAdd(),
                ConsistentSeeds=True,
                #BremCorrection           = True,
                BremCorrection=False,
                UseAssociationTool=usePrdAssociationTool)
            if InDetFlags.doCosmics():
                InDetTRT_SeededTrackTool.nWClustersMin = 0

            ToolSvc += InDetTRT_SeededTrackTool
            if (InDetFlags.doPrintConfigurables()):
                print InDetTRT_SeededTrackTool

            #
            # --- Output key for the finder
            #
            self.__TRTSeededTracks = InDetKeys.TRTSeededTracks()
            #
            # TRT seeded back tracking algorithm
            #
            from TRT_SeededTrackFinder.TRT_SeededTrackFinderConf import InDet__TRT_SeededTrackFinder
            InDetTRT_SeededTrackFinder = InDet__TRT_SeededTrackFinder(
                name='InDetTRT_SeededTrackFinder',
                RefitterTool=InDetTrackFitter,
                TrackTool=InDetTRT_SeededTrackTool,
                TrackExtensionTool=InDetTRTExtensionTool,
                MinTRTonSegment=NewTrackingCuts.minSecondaryTRTonTrk(),
                MinTRTonly=NewTrackingCuts.minTRTonly(),
                TrtExtension=True,
                SiExtensionCuts=NewTrackingCuts.SiExtensionCuts(),
                minPt=NewTrackingCuts.minSecondaryPt(),
                maxRPhiImp=NewTrackingCuts.maxSecondaryImpact(),
                maxZImp=NewTrackingCuts.maxZImpact(),
                maxEta=NewTrackingCuts.maxEta(),
                Extrapolator=InDetExtrapolator,
                RejectShortExtension=NewTrackingCuts.rejectShortExtensions(),
                FinalRefit=False,
                FinalStatistics=False,
                OutputSegments=False,
                InputSegmentsLocation=InDetKeys.TRT_Segments(),
                OutputTracksLocation=self.__TRTSeededTracks)
            # InDetTRT_SeededTrackFinder.OutputLevel = VERBOSE
            topSequence += InDetTRT_SeededTrackFinder
            if (InDetFlags.doPrintConfigurables()):
                print InDetTRT_SeededTrackFinder

            #
            # ------------ Track truth.
            #
            if not InDetFlags.doSGDeletion():
                if InDetFlags.doTruth():
                    #
                    # set up the truth info for this container
                    #
                    include("InDetRecExample/ConfiguredInDetTrackTruth.py")
                    InDetTracksTruth = ConfiguredInDetTrackTruth(
                        self.__TRTSeededTracks,
                        self.__TRTSeededTracks + "DetailedTruth",
                        self.__TRTSeededTracks + "TruthCollection")
                    #
                    # add final output for statistics
                    #
                    TrackCollectionKeys += [InDetTracksTruth.Tracks()]
                    TrackCollectionTruthKeys += [
                        InDetTracksTruth.TracksTruth()
                    ]
                else:
                    TrackCollectionKeys += [self.__TRTSeededTracks]

            # --- output track collection
            self.__BackTrackingTracks = self.__TRTSeededTracks

        # ------------------------------------------------------------
        #
        # --- Resolve back tracking tracks ?
        #
        # ------------------------------------------------------------

        if InDetFlags.doResolveBackTracks():
            #
            # --- set up special Scoring Tool for TRT seeded tracks
            #
            if InDetFlags.doCosmics():
                from InDetTrackScoringTools.InDetTrackScoringToolsConf import InDet__InDetCosmicScoringTool
                InDetTRT_SeededScoringTool = InDet__InDetCosmicScoringTool(
                    name='InDetCosmicScoringTool_TRT',
                    nWeightedClustersMin=0,
                    minTRTHits=NewTrackingCuts.minSecondaryTRTonTrk(),
                    SummaryTool=InDetTrackSummaryTool)
            else:
                from InDetTrackScoringTools.InDetTrackScoringToolsConf import InDet__InDetAmbiScoringTool
                InDetTRT_SeededScoringTool = InDet__InDetAmbiScoringTool(
                    name='InDetTRT_SeededScoringTool',
                    Extrapolator=InDetExtrapolator,
                    DriftCircleCutTool=InDetTRTDriftCircleCut,
                    SummaryTool=InDetTrackSummaryTool,
                    useTRT_AmbigFcn=InDetFlags.doNewTracking(
                    ),  # full search => use NewT
                    useAmbigFcn=not InDetFlags.doNewTracking(
                    ),  # full search => use NewT
                    minPt=NewTrackingCuts.minSecondaryPt(),
                    maxRPhiImp=NewTrackingCuts.maxSecondaryImpact(),
                    maxZImp=NewTrackingCuts.maxZImpact(),
                    maxEta=NewTrackingCuts.maxEta(),
                    minSiClusters=NewTrackingCuts.minSecondaryClusters(),
                    maxSiHoles=NewTrackingCuts.maxSecondaryHoles(),
                    maxPixelHoles=NewTrackingCuts.maxSecondaryPixelHoles(),
                    maxSCTHoles=NewTrackingCuts.maxSecondarySCTHoles(),
                    maxDoubleHoles=NewTrackingCuts.maxSecondaryDoubleHoles(),
                    usePixel=NewTrackingCuts.usePixel(),
                    useSCT=NewTrackingCuts.useSCT(),
                    minTRTonTrk=NewTrackingCuts.minSecondaryTRTonTrk(),
                    minTRTPrecisionFraction=NewTrackingCuts.
                    minSecondaryTRTPrecFrac())
            # InDetTRT_SeededScoringTool.OutputLevel = DEBUG
            ToolSvc += InDetTRT_SeededScoringTool
            if (InDetFlags.doPrintConfigurables()):
                print InDetTRT_SeededScoringTool

            #
            # --- Load selection tool
            #
            from InDetAmbiTrackSelectionTool.InDetAmbiTrackSelectionToolConf import InDet__InDetAmbiTrackSelectionTool
            InDetTRT_SeededAmbiTrackSelectionTool = InDet__InDetAmbiTrackSelectionTool(
                name='InDetTRT_SeededAmbiTrackSelectionTool',
                AssociationTool=InDetPrdAssociationTool,
                DriftCircleCutTool=InDetTRTDriftCircleCut,
                minScoreShareTracks=-1.,  # off !
                minHits=NewTrackingCuts.minSecondaryClusters(),
                minNotShared=NewTrackingCuts.minSecondarySiNotShared(),
                maxShared=NewTrackingCuts.maxSecondaryShared(),
                minTRTHits=NewTrackingCuts.minSecondaryTRTonTrk(),
                UseParameterization=NewTrackingCuts.useParameterizedTRTCuts(),
                Cosmics=InDetFlags.doCosmics(),
                doPixelSplitting=InDetFlags.doPixelClusterSplitting())

            # InDetTRT_SeededAmbiTrackSelectionTool.OutputLevel = DEBUG
            ToolSvc += InDetTRT_SeededAmbiTrackSelectionTool
            if (InDetFlags.doPrintConfigurables()):
                print InDetTRT_SeededAmbiTrackSelectionTool

            #
            # --- load Ambiguity Processor
            #
            from TrkAmbiguityProcessor.TrkAmbiguityProcessorConf import Trk__SimpleAmbiguityProcessorTool
            InDetTRT_SeededAmbiguityProcessor = Trk__SimpleAmbiguityProcessorTool(
                name='InDetTRT_SeededAmbiguityProcessor',
                Fitter=InDetTrackFitter,
                SelectionTool=InDetTRT_SeededAmbiTrackSelectionTool,
                RefitPrds=not InDetFlags.refitROT(),
                SuppressTrackFit=False,
                SuppressHoleSearch=False,
                ScoringTool=InDetTRT_SeededScoringTool)
            # InDetTRT_SeededAmbiguityProcessor.OutputLevel = DEBUG
            if InDetFlags.materialInteractions():
                InDetTRT_SeededAmbiguityProcessor.MatEffects = InDetFlags.materialInteractionsType(
                )
            else:
                InDetTRT_SeededAmbiguityProcessor.MatEffects = 0
            #
            ToolSvc += InDetTRT_SeededAmbiguityProcessor
            if (InDetFlags.doPrintConfigurables()):
                print InDetTRT_SeededAmbiguityProcessor

            #
            # --- load the algorithm
            #
            self.__ResolvedTRTSeededTracks = InDetKeys.ResolvedTRTSeededTracks(
            )
            #
            from TrkAmbiguitySolver.TrkAmbiguitySolverConf import Trk__TrkAmbiguitySolver
            InDetTRT_SeededAmbiguitySolver = Trk__TrkAmbiguitySolver(
                name='InDetTRT_SeededAmbiguitySolver',
                TrackInput=[self.__TRTSeededTracks],
                TrackOutput=self.__ResolvedTRTSeededTracks,
                AmbiguityProcessor=InDetTRT_SeededAmbiguityProcessor)
            topSequence += InDetTRT_SeededAmbiguitySolver
            if (InDetFlags.doPrintConfigurables()):
                print InDetTRT_SeededAmbiguitySolver

            # --- Delete (non-resloved) TRT seeded tracks
            from InDetRecExample.ConfiguredInDetSGDeletion import InDetSGDeletionAlg
            InDetSGDeletionAlg(key=InDetKeys.TRTSeededTracks())

            #
            # ------------ Track truth.
            #
            if not InDetFlags.doSGDeletion():
                if InDetFlags.doTruth():
                    #
                    # set up the truth info for this container
                    #
                    include("InDetRecExample/ConfiguredInDetTrackTruth.py")
                    InDetTracksTruth = ConfiguredInDetTrackTruth(
                        self.__ResolvedTRTSeededTracks,
                        self.__ResolvedTRTSeededTracks + "DetailedTruth",
                        self.__ResolvedTRTSeededTracks + "TruthCollection")
                    #
                    # add final output for statistics
                    #
                    TrackCollectionKeys += [InDetTracksTruth.Tracks()]
                    TrackCollectionTruthKeys += [
                        InDetTracksTruth.TracksTruth()
                    ]
                else:
                    TrackCollectionKeys += [self.__ResolvedTRTSeededTracks]

            # --- output track collection
            self.__BackTrackingTracks = self.__ResolvedTRTSeededTracks
Beispiel #12
0
# create the MuonDetectorTool (which creates the MuonDetectorManager needed by PadTdsOfflineTool)
from MuonGeoModel.MuonGeoModelConf import MuonDetectorTool

GeoModelSvc.DetectorTools += [
    MuonDetectorTool(HasCSC=MuonGeometryFlags.hasCSC(),
                     HasSTgc=MuonGeometryFlags.hasSTGC(),
                     HasMM=MuonGeometryFlags.hasMM())
]
#######################################

#######################################
# now the trigger related things
#######################################
from RegionSelector.RegSelSvcDefault import RegSelSvcDefault

svcMgr += RegSelSvcDefault()

include('TrigT1NSW/TrigT1NSW_jobOptions.py')

#Switch on and off trigger simulaton components sTGC / MicroMegas
#October 2019 : MM not working so keep it False until fixed

topSequence.NSWL1Simulation.DosTGC = True
topSequence.NSWL1Simulation.UseLookup = False  #use lookup table for the pad trigger
topSequence.NSWL1Simulation.DoMM = False
topSequence.NSWL1Simulation.NSWTrigRDOContainerName = "NSWTRGRDO"
topSequence.NSWL1Simulation.StripSegmentTool.rIndexScheme = 0

#Toggle Ntuple making for Tools, if set to False for NSWL1Simulation, all the tools are set to False automatically as well
topSequence.NSWL1Simulation.DoNtuple = True
topSequence.NSWL1Simulation.PadTdsTool.DoNtuple = True
Beispiel #13
0
    def __init__(self,
                 name="InDetTrigTRT_SeededTrackFinder_Photon_EF",
                 type="photon"):
        super(InDet__TRT_TrigSeededTrackFinder, self).__init__(name)

        from AthenaCommon.AppMgr import ToolSvc
        from InDetTrigRecExample.ConfiguredNewTrackingTrigCuts import EFIDTrackingCuts
        InDetTrigCutValues = EFIDTrackingCuts
        from InDetTrigRecExample.InDetTrigFlags import InDetTrigFlags
        from InDetTrigRecExample.InDetTrigConfigRecLoadTools import InDetTrigPrdAssociationTool, InDetTrigPatternPropagator, InDetTrigPatternUpdator, InDetTrigRotCreator, InDetTrigExtrapolator, InDetTrigTrackFitter, InDetTrigSCTConditionsSummaryTool

        if InDetTrigFlags.loadTRTSeededSPFinder():
            # configure tools used
            # TRT seeded space points seed maker
            #
            from TRT_SeededSpacePointFinderTool.TRT_SeededSpacePointFinderToolConf import InDet__TRT_SeededSpacePointFinder_ATL
            InDetTrigTRT_SeededSpacePointFinder = InDet__TRT_SeededSpacePointFinder_ATL(
                name='InDetTrigTRT_SeededSpFinder_' + type,
                SpacePointsSCTName="SCT_TrigSpacePoints",
                #SpacePointsOverlapName = None ,
                PRDtoTrackMap="",
                NeighborSearch=True,
                LoadFull=False,
                #DoCosmics
            )
            if type == 'photon':
                InDetTrigTRT_SeededSpacePointFinder.PRDtoTrackMap = 'InDetTrigPRDtoTrackMap_Photon_EF'

        elif InDetTrigFlags.loadSimpleTRTSeededSPFinder():
            from RegionSelector.RegSelSvcDefault import RegSelSvcDefault
            InDetTrigRegSelSvc = RegSelSvcDefault()
            InDetTrigRegSelSvc.enablePixel = DetFlags.pixel_on()
            InDetTrigRegSelSvc.enableSCT = DetFlags.SCT_on()

            ServiceMgr += InDetTrigRegSelSvc
            if (InDetTrigFlags.doPrintConfigurables()):
                print(InDetTrigRegSelSvc)

            from TRT_SeededSpacePointFinderTool.TRT_SeededSpacePointFinderToolConf import InDet__SimpleTRT_SeededSpacePointFinder_ATL
            InDetTrigTRT_SeededSpacePointFinder = InDet__SimpleTRT_SeededSpacePointFinder_ATL(
                name='InDetTrigTRT_SeededSpFinder_' + type,
                SpacePointsSCTName="SCT_TrigSpacePoints",
                #SpacePointsOverlapName = None,
                PerigeeCut=1000.,
                DirectionPhiCut=.3,
                DirectionEtaCut=1.,
                MaxHoles=2,
                PRDtoTrackMap="",
                RestrictROI=True)
            if type == 'photon':
                InDetTrigTRT_SeededSpacePointFinder.PRDtoTrackMap = 'InDetTrigPRDtoTrackMap_Photon_EF'  # @TODO correct ?

        ToolSvc += InDetTrigTRT_SeededSpacePointFinder
        if (InDetTrigFlags.doPrintConfigurables()):
            print(InDetTrigTRT_SeededSpacePointFinder)

        # Silicon det elements road maker tool
        #
        from SiDetElementsRoadTool_xk.SiDetElementsRoadTool_xkConf import InDet__SiDetElementsRoadMaker_xk
        InDetTrigTRT_SeededSiRoadMaker = InDet__SiDetElementsRoadMaker_xk(
            name='InDetTrigTRT_SeededSiRoad',
            PropagatorTool=InDetTrigPatternPropagator,
            PixManagerLocation="Pixel",
            SCTManagerLocation="SCT",
            RoadWidth=35.,
            MaxStep=20.)
        ToolSvc += InDetTrigTRT_SeededSiRoadMaker
        if (InDetTrigFlags.doPrintConfigurables()):
            print(InDetTrigTRT_SeededSiRoadMaker)

        # Local combinatorial track finding using space point seed and detector element road
        from InDetTrigRecExample.InDetTrigConfigRecLoadTools import InDetTrigSiComTrackFinder
        # uncomment the following only if modification to the previously defined InDetTrigSiComTrackFinder are needed
        # and also change the name of the instance
        #

        # if (DetFlags.haveRIO.SCT_on()):
        #    InDetTrigSiComTrackFinder.SctSummaryTool = InDetTrigSCTConditionsSummaryTool
        # else:
        #    InDetTrigSiComTrackFinder.SctSummaryTool = None

        # ToolSvc += InDetTrigSiComTrackFinder
        # if (InDetTrigFlags.doPrintConfigurables()):
        #   print      (InDetTrigSiComTrackFinder)

        # TRT seeded back tracking tool
        #
        from InDetTrigRecExample.InDetTrigSliceSettings import InDetTrigSliceSettings

        from TRT_SeededTrackFinderTool.TRT_SeededTrackFinderToolConf import InDet__TRT_SeededTrackFinder_ATL
        InDetTrigTRT_SeededTrackTool = InDet__TRT_SeededTrackFinder_ATL(
            name='InDetTrigTRT_SeededTrackTool_' + type,
            PropagatorTool=InDetTrigPatternPropagator,
            UpdatorTool=InDetTrigPatternUpdator,
            RoadTool=InDetTrigTRT_SeededSiRoadMaker,
            SeedTool=InDetTrigTRT_SeededSpacePointFinder,
            CombinatorialTrackFinder=InDetTrigSiComTrackFinder,
            nHolesMax=InDetTrigCutValues.SecondarynHolesMax(),
            nHolesGapMax=2 * InDetTrigCutValues.SecondarynHolesGapMax(),
            Xi2max=InDetTrigCutValues.SecondaryXi2max(),
            Xi2maxNoAdd=InDetTrigCutValues.SecondaryXi2maxNoAdd(),
            ConsistentSeeds=True,
            BremCorrection=False)

        InDetTrigTRT_SeededTrackTool.pTmin = InDetTrigSliceSettings[('pTmin',
                                                                     type)]

        ToolSvc += InDetTrigTRT_SeededTrackTool
        if (InDetTrigFlags.doPrintConfigurables()):
            print(InDetTrigTRT_SeededTrackTool)

        self.RefitterTool = InDetTrigTrackFitter
        self.TrackTool = InDetTrigTRT_SeededTrackTool
        self.TrackExtensionTool = ToolSvc.InDetTrigTRTExtensionTool
        self.TrtExtension = True
        self.FinalRefit = False
        self.OutputSegments = False

        self.EtaHalfWidth = InDetTrigSliceSettings[('etaHalfWidth', type)]
        self.PhiHalfWidth = InDetTrigSliceSettings[('phiHalfWidth', type)]
        self.doFullScan = InDetTrigSliceSettings[('doFullScan', type)]

        #monitoring
        from TRT_TrigSeededTrackFinder.TRT_TrigSeededTrackFinderMonitoring import TRT_TrigSeededTrackFinderValidationMonitor
        from TRT_TrigSeededTrackFinder.TRT_TrigSeededTrackFinderMonitoring import TRT_TrigSeededTrackFinderOnlineMonitor
        from TrigTimeMonitor.TrigTimeHistToolConfig import TrigTimeHistToolConfig
        seedtime = TrigTimeHistToolConfig("SeedTime")
        seedtime.TimerHistLimits = [0, 80]
        self.AthenaMonTools = [
            TRT_TrigSeededTrackFinderValidationMonitor(),
            TRT_TrigSeededTrackFinderOnlineMonitor(), seedtime
        ]
# Joboptions fragement for backward compatability;
# please import configurables yourself instead.
from RegionSelector.RegSelSvcDefault import RegSelSvcDefault
from AthenaCommon.AppMgr import ServiceMgr
theRegSelSvc = RegSelSvcDefault()
ServiceMgr += theRegSelSvc

   def __init__(self, InputCollections = None, NewTrackingCuts = None, TrackCollectionKeys=[] , TrackCollectionTruthKeys=[]):

      from InDetRecExample.InDetJobProperties import InDetFlags
      from InDetRecExample.InDetKeys          import InDetKeys
      #
      # get ToolSvc and topSequence
      #
      from AthenaCommon.AppMgr                import ToolSvc
      from AthenaCommon.AlgSequence           import AlgSequence
      topSequence = AlgSequence()

      #
      # --- decide if use the association tool
      #
      if len(InputCollections) > 0:
         usePrdAssociationTool = True
      else:
         usePrdAssociationTool = False

      # --- the PRD association tool is filled by the Segment making
      #     no need to run again
      
      # ------------------------------------------------------------
      #
      # ---------- TRT Seeded Tracking
      #
      # ------------------------------------------------------------

      if InDetFlags.doTRTSeededTrackFinder():
         #
         # --- decide which TRT seed space point finder to use
         #
         if InDetFlags.loadTRTSeededSPFinder():
            #
            # --- defaul space point finder
            #
            from TRT_SeededSpacePointFinderTool.TRT_SeededSpacePointFinderToolConf import InDet__TRT_SeededSpacePointFinder_ATL
            InDetTRT_SeededSpacePointFinder = InDet__TRT_SeededSpacePointFinder_ATL(name                   = 'InDetTRT_SeededSpFinder'  ,
                                                                                    SpacePointsSCTName     = InDetKeys.SCT_SpacePoints(),
                                                                                    SpacePointsOverlapName = InDetKeys.OverlapSpacePoints(),
                                                                                    AssociationTool        = InDetPrdAssociationTool    ,
                                                                                    UseAssociationTool     = usePrdAssociationTool      ,
                                                                                    NeighborSearch         = True,
                                                                                    LoadFull               = False,
                                                                                    DoCosmics              = InDetFlags.doCosmics(),
                                                                                    pTmin                  = NewTrackingCuts.minSecondaryPt())
            #InDetTRT_SeededSpacePointFinder.OutputLevel = VERBOSE

         elif InDetFlags.loadSimpleTRTSeededSPFinder():
            #
            # --- alternative version using the region selector
            #
            from RegionSelector.RegSelSvcDefault import RegSelSvcDefault
            InDetRegSelSvc             = RegSelSvcDefault()
            InDetRegSelSvc.enablePixel = DetFlags.pixel_on()
            InDetRegSelSvc.enableSCT   = DetFlags.SCT_on()

            ServiceMgr += InDetRegSelSvc
            if (InDetFlags.doPrintConfigurables()):
               print InDetRegSelSvc
               
            from TRT_SeededSpacePointFinderTool.TRT_SeededSpacePointFinderToolConf import InDet__SimpleTRT_SeededSpacePointFinder_ATL
            InDetTRT_SeededSpacePointFinder = InDet__SimpleTRT_SeededSpacePointFinder_ATL(name                   = 'InDetTRT_SeededSpFinder'  ,
                                                                                          SpacePointsSCTName     = InDetKeys.SCT_SpacePoints(),
                                                                                          SpacePointsOverlapName = InDetKeys.OverlapSpacePoints(),
                                                                                          PerigeeCut             = 1000.,
                                                                                          DirectionPhiCut        = .3,
                                                                                          DirectionEtaCut        = 1.,
                                                                                          MaxHoles               = 2,
                                                                                          AssociationTool        = InDetPrdAssociationTool,
                                                                                          RestrictROI            = True)
            #InDetTRT_SeededSpacePointFinder.OutputLevel = VERBOSE
            if not usePrdAssociationTool:
               InDetTRT_SeededSpacePointFinder.AssociationTool = None 

         # add either into the Tool Service
         ToolSvc += InDetTRT_SeededSpacePointFinder
         if (InDetFlags.doPrintConfigurables()):
            print InDetTRT_SeededSpacePointFinder
         #
         # Silicon det elements road maker tool
         #
         from SiDetElementsRoadTool_xk.SiDetElementsRoadTool_xkConf import InDet__SiDetElementsRoadMaker_xk
         InDetTRT_SeededSiRoadMaker = InDet__SiDetElementsRoadMaker_xk(name               = 'InDetTRT_SeededSiRoad'  ,
                                                                       PropagatorTool     = InDetPatternPropagator   ,
                                                                       usePixel           = NewTrackingCuts.usePixel(),
                                                                       PixManagerLocation = InDetKeys.PixelManager() ,
                                                                       useSCT             = NewTrackingCuts.useSCT(), 
                                                                       SCTManagerLocation = InDetKeys.SCT_Manager()  ,
                                                                       RoadWidth          = 35.,
                                                                       MaxStep            = 20.)                       # NOT DEFAULT ?
         #InDetTRT_SeededSiRoadMaker.OutputLevel = VERBOSE
         if InDetFlags.doCosmics():
            InDetTRT_SeededSiRoadMaker.RoadWidth = 50
      
         ToolSvc += InDetTRT_SeededSiRoadMaker
         if (InDetFlags.doPrintConfigurables()):
            print InDetTRT_SeededSiRoadMaker
         #
         # --- TRT seeded back tracking tool
         #
         from TRT_SeededTrackFinderTool.TRT_SeededTrackFinderToolConf import InDet__TRT_SeededTrackFinder_ATL
         InDetTRT_SeededTrackTool =  InDet__TRT_SeededTrackFinder_ATL(name                     = 'InDetTRT_SeededTrackMaker',
                                                                      PropagatorTool           = InDetPatternPropagator,
                                                                      UpdatorTool              = InDetPatternUpdator,
                                                                      RoadTool                 = InDetTRT_SeededSiRoadMaker,
                                                                      SeedTool                 = InDetTRT_SeededSpacePointFinder,
                                                                      CombinatorialTrackFinder = InDetSiComTrackFinder,
                                                                      pTmin                    = NewTrackingCuts.minSecondaryPt(),
                                                                      nHolesMax                = NewTrackingCuts.SecondarynHolesMax(),
                                                                      # ME bugfix: nHolesGapMax             = 2*NewTrackingCuts.SecondarynHolesGapMax(),
                                                                      nHolesGapMax             = NewTrackingCuts.SecondarynHolesGapMax(),
                                                                      Xi2max                   = NewTrackingCuts.SecondaryXi2max(),
                                                                      Xi2maxNoAdd              = NewTrackingCuts.SecondaryXi2maxNoAdd(),
                                                                      ConsistentSeeds          = True,
                                                                      #BremCorrection           = True,
                                                                      BremCorrection           = False,
                                                                      UseAssociationTool       = usePrdAssociationTool)
         if InDetFlags.doCosmics():
            InDetTRT_SeededTrackTool.nWClustersMin = 0
      
         ToolSvc   += InDetTRT_SeededTrackTool
         if (InDetFlags.doPrintConfigurables()):
            print InDetTRT_SeededTrackTool

         #
         # --- Output key for the finder
         #
         self.__TRTSeededTracks = InDetKeys.TRTSeededTracks()
         #
         # TRT seeded back tracking algorithm
         #
         from TRT_SeededTrackFinder.TRT_SeededTrackFinderConf import InDet__TRT_SeededTrackFinder
         InDetTRT_SeededTrackFinder = InDet__TRT_SeededTrackFinder(name                  = 'InDetTRT_SeededTrackFinder',
                                                                   RefitterTool          = InDetTrackFitter,
                                                                   TrackTool             = InDetTRT_SeededTrackTool,
                                                                   TrackExtensionTool    = InDetTRTExtensionTool,
                                                                   MinTRTonSegment       = NewTrackingCuts.minSecondaryTRTonTrk(),
                                                                   MinTRTonly            = NewTrackingCuts.minTRTonly(),
                                                                   TrtExtension          = True,
                                                                   SiExtensionCuts       = NewTrackingCuts.SiExtensionCuts(),
                                                                   minPt                 = NewTrackingCuts.minSecondaryPt(),
                                                                   maxRPhiImp            = NewTrackingCuts.maxSecondaryImpact(),
                                                                   maxZImp               = NewTrackingCuts.maxZImpact(),
                                                                   maxEta                = NewTrackingCuts.maxEta(),
                                                                   Extrapolator          = InDetExtrapolator,
                                                                   RejectShortExtension  = NewTrackingCuts.rejectShortExtensions(),
                                                                   FinalRefit            = False,
                                                                   FinalStatistics       = False,
                                                                   OutputSegments        = False,
                                                                   InputSegmentsLocation = InDetKeys.TRT_Segments(),
                                                                   OutputTracksLocation  = self.__TRTSeededTracks)
         # InDetTRT_SeededTrackFinder.OutputLevel = VERBOSE
         topSequence += InDetTRT_SeededTrackFinder
         if (InDetFlags.doPrintConfigurables()):
            print InDetTRT_SeededTrackFinder
            
         #
         # ------------ Track truth.
         #
         if not InDetFlags.doSGDeletion():
            if InDetFlags.doTruth():
               #
               # set up the truth info for this container
               #
               include ("InDetRecExample/ConfiguredInDetTrackTruth.py")
               InDetTracksTruth = ConfiguredInDetTrackTruth(self.__TRTSeededTracks,
                                                            self.__TRTSeededTracks+"DetailedTruth",
                                                            self.__TRTSeededTracks+"TruthCollection")
               #
               # add final output for statistics
               #
               TrackCollectionKeys      += [ InDetTracksTruth.Tracks() ]
               TrackCollectionTruthKeys += [ InDetTracksTruth.TracksTruth() ]
            else:
               TrackCollectionKeys      += [ self.__TRTSeededTracks ]
               
         # --- output track collection
         self.__BackTrackingTracks = self.__TRTSeededTracks

      # ------------------------------------------------------------
      #
      # --- Resolve back tracking tracks ? 
      #
      # ------------------------------------------------------------

      if InDetFlags.doResolveBackTracks():
         #
         # --- set up special Scoring Tool for TRT seeded tracks
         #
         if InDetFlags.doCosmics():
            from InDetTrackScoringTools.InDetTrackScoringToolsConf import InDet__InDetCosmicScoringTool
            InDetTRT_SeededScoringTool = InDet__InDetCosmicScoringTool(name                 = 'InDetCosmicScoringTool_TRT',
                                                                       nWeightedClustersMin = 0,
                                                                       minTRTHits           = NewTrackingCuts.minSecondaryTRTonTrk(),
                                                                       SummaryTool          = InDetTrackSummaryTool)
         else:
            from InDetTrackScoringTools.InDetTrackScoringToolsConf import InDet__InDetAmbiScoringTool
            InDetTRT_SeededScoringTool = InDet__InDetAmbiScoringTool(name                    = 'InDetTRT_SeededScoringTool',
                                                                     Extrapolator            = InDetExtrapolator,
                                                                     DriftCircleCutTool      = InDetTRTDriftCircleCut,
                                                                     SummaryTool             = InDetTrackSummaryTool,
                                                                     useTRT_AmbigFcn         = InDetFlags.doNewTracking(),     # full search => use NewT
                                                                     useAmbigFcn             = not InDetFlags.doNewTracking(), # full search => use NewT
                                                                     minPt                   = NewTrackingCuts.minSecondaryPt(),
                                                                     maxRPhiImp              = NewTrackingCuts.maxSecondaryImpact(),
                                                                     maxZImp                 = NewTrackingCuts.maxZImpact(),
                                                                     maxEta                  = NewTrackingCuts.maxEta(),
                                                                     minSiClusters           = NewTrackingCuts.minSecondaryClusters(),
                                                                     maxSiHoles              = NewTrackingCuts.maxSecondaryHoles(),
                                                                     maxPixelHoles           = NewTrackingCuts.maxSecondaryPixelHoles(),
                                                                     maxSCTHoles             = NewTrackingCuts.maxSecondarySCTHoles(),
                                                                     maxDoubleHoles          = NewTrackingCuts.maxSecondaryDoubleHoles(),
                                                                     usePixel                = NewTrackingCuts.usePixel(),
                                                                     useSCT                  = NewTrackingCuts.useSCT(),
                                                                     minTRTonTrk             = NewTrackingCuts.minSecondaryTRTonTrk(),
                                                                     minTRTPrecisionFraction = NewTrackingCuts.minSecondaryTRTPrecFrac())
         # InDetTRT_SeededScoringTool.OutputLevel = DEBUG
         ToolSvc += InDetTRT_SeededScoringTool
         if (InDetFlags.doPrintConfigurables()):
            print InDetTRT_SeededScoringTool
      
         #
         # --- Load selection tool
         #
         from InDetAmbiTrackSelectionTool.InDetAmbiTrackSelectionToolConf import InDet__InDetAmbiTrackSelectionTool
         InDetTRT_SeededAmbiTrackSelectionTool = InDet__InDetAmbiTrackSelectionTool(name                = 'InDetTRT_SeededAmbiTrackSelectionTool',
                                                                                    AssociationTool     =  InDetPrdAssociationTool,
                                                                                    DriftCircleCutTool  =  InDetTRTDriftCircleCut,
                                                                                    minScoreShareTracks = -1., # off !
                                                                                    minHits             = NewTrackingCuts.minSecondaryClusters(),
                                                                                    minNotShared        = NewTrackingCuts.minSecondarySiNotShared(),
                                                                                    maxShared           = NewTrackingCuts.maxSecondaryShared(),
                                                                                    minTRTHits          = NewTrackingCuts.minSecondaryTRTonTrk(),
                                                                                    UseParameterization = NewTrackingCuts.useParameterizedTRTCuts(),
                                                                                    Cosmics             = InDetFlags.doCosmics(),
                                                                                    doPixelSplitting    = InDetFlags.doPixelClusterSplitting())
      
         # InDetTRT_SeededAmbiTrackSelectionTool.OutputLevel = DEBUG
         ToolSvc += InDetTRT_SeededAmbiTrackSelectionTool
         if (InDetFlags.doPrintConfigurables()):
            print InDetTRT_SeededAmbiTrackSelectionTool

         #
         # --- load Ambiguity Processor
         #
         from TrkAmbiguityProcessor.TrkAmbiguityProcessorConf import Trk__SimpleAmbiguityProcessorTool
         InDetTRT_SeededAmbiguityProcessor = Trk__SimpleAmbiguityProcessorTool(name               = 'InDetTRT_SeededAmbiguityProcessor',
                                                                               Fitter             = InDetTrackFitter,          
                                                                               SelectionTool      = InDetTRT_SeededAmbiTrackSelectionTool,
                                                                               RefitPrds          = not InDetFlags.refitROT(),
                                                                               SuppressTrackFit   = False,
                                                                               SuppressHoleSearch = False,
                                                                               ScoringTool        = InDetTRT_SeededScoringTool)
         # InDetTRT_SeededAmbiguityProcessor.OutputLevel = DEBUG
         if InDetFlags.materialInteractions():
            InDetTRT_SeededAmbiguityProcessor.MatEffects = InDetFlags.materialInteractionsType()
         else:
            InDetTRT_SeededAmbiguityProcessor.MatEffects = 0
         #
         ToolSvc += InDetTRT_SeededAmbiguityProcessor
         if (InDetFlags.doPrintConfigurables()):
            print InDetTRT_SeededAmbiguityProcessor

         #
         # --- load the algorithm
         #
         self.__ResolvedTRTSeededTracks = InDetKeys.ResolvedTRTSeededTracks() 
         #
         from TrkAmbiguitySolver.TrkAmbiguitySolverConf import Trk__TrkAmbiguitySolver
         InDetTRT_SeededAmbiguitySolver = Trk__TrkAmbiguitySolver(name               = 'InDetTRT_SeededAmbiguitySolver',
                                                                  TrackInput         = [ self.__TRTSeededTracks ],
                                                                  TrackOutput        = self.__ResolvedTRTSeededTracks,
                                                                  AmbiguityProcessor = InDetTRT_SeededAmbiguityProcessor)
         topSequence += InDetTRT_SeededAmbiguitySolver
         if (InDetFlags.doPrintConfigurables()):
            print InDetTRT_SeededAmbiguitySolver

         # --- Delete (non-resloved) TRT seeded tracks
         from InDetRecExample.ConfiguredInDetSGDeletion import InDetSGDeletionAlg
         InDetSGDeletionAlg(key = InDetKeys.TRTSeededTracks())
         
         #
         # ------------ Track truth.
         #
         if not InDetFlags.doSGDeletion():
            if InDetFlags.doTruth():
               #
               # set up the truth info for this container
               #
               include ("InDetRecExample/ConfiguredInDetTrackTruth.py")
               InDetTracksTruth = ConfiguredInDetTrackTruth(self.__ResolvedTRTSeededTracks,
                                                            self.__ResolvedTRTSeededTracks+"DetailedTruth",
                                                            self.__ResolvedTRTSeededTracks+"TruthCollection")
               #
               # add final output for statistics
               #
               TrackCollectionKeys      += [ InDetTracksTruth.Tracks() ]
               TrackCollectionTruthKeys += [ InDetTracksTruth.TracksTruth() ]
            else:
               TrackCollectionKeys      += [ self.__ResolvedTRTSeededTracks ]
               
         # --- output track collection
         self.__BackTrackingTracks = self.__ResolvedTRTSeededTracks