Esempio n. 1
0
    def __init__(self, useTimeInfo=True, usePhase=False):

        from InDetRecExample.InDetJobProperties import InDetFlags
        from AthenaCommon.DetFlags import DetFlags
        from AthenaCommon.GlobalFlags import globalflags
        from AthenaCommon.BeamFlags import jobproperties
        #
        # get ToolSvc and topSequence
        #
        from AthenaCommon.AppMgr import ToolSvc
        from AthenaCommon.AlgSequence import AlgSequence
        topSequence = AlgSequence()

        if InDetFlags.doPRDFormation() and DetFlags.makeRIO.TRT_on(
        ) and InDetFlags.doTRT_PRDFormation():

            #
            # --- setup naming of tools and algs
            #
            if useTimeInfo:
                prefix = "InDetTRT_"
                collection = InDetKeys.TRT_DriftCircles()
                if InDetFlags.doSplitReco():
                    collectionPU = InDetKeys.TRT_PU_DriftCircles()
            else:
                prefix = "InDetTRT_noTime_"
                collection = InDetKeys.TRT_DriftCirclesUncalibrated()
                if InDetFlags.doSplitReco():
                    collectionPU = InDetKeys.TRT_PU_DriftCirclesUncalibrated()
            #
            # --- TRT_DriftFunctionTool
            #
            from TRT_DriftFunctionTool.TRT_DriftFunctionToolConf import TRT_DriftFunctionTool
            InDetTRT_DriftFunctionTool = TRT_DriftFunctionTool(
                name=prefix + "DriftFunctionTool",
                TRTCalDbTool=InDetTRTCalDbSvc)
            # --- overwrite for uncalibrated DC production
            if (not useTimeInfo) or InDetFlags.noTRTTiming():
                InDetTRT_DriftFunctionTool.DummyMode = True
                InDetTRT_DriftFunctionTool.UniversalError = 1.15
            # --- overwrite for calibration of MC
            if usePhase and jobproperties.Beam.beamType(
            ) == 'cosmics' and globalflags.DataSource == "geant4":
                InDetTRT_DriftFunctionTool.AllowDigiVersionOverride = True
                InDetTRT_DriftFunctionTool.ForcedDigiVersion = 9

            ToolSvc += InDetTRT_DriftFunctionTool
            if (InDetFlags.doPrintConfigurables()):
                print InDetTRT_DriftFunctionTool
            #
            # --- TRT_DriftCircleTool
            #
            if usePhase:
                from TRT_DriftCircleTool.TRT_DriftCircleToolConf import InDet__TRT_DriftCircleToolCosmics as InDet__TRT_DriftCircleTool
            else:
                from TRT_DriftCircleTool.TRT_DriftCircleToolConf import InDet__TRT_DriftCircleTool

            #
            # set gating values for MC/DATA
            MinTrailingEdge = 11.0 * ns
            MaxDriftTime = 60.0 * ns
            LowGate = 14.0625 * ns  # 4.5*3.125 ns
            HighGate = 42.1875 * ns  # LowGate + 9*3.125 ns
            if InDetFlags.doCosmics():
                LowGate = 19.0 * ns
                HighGate = 44.0 * ns
            if globalflags.DataSource == 'data':
                MinTrailingEdge = 11.0 * ns
                MaxDriftTime = 60.0 * ns
                LowGate = 14.0625 * ns  # 4.5*3.125 ns
                HighGate = 42.1875 * ns  # LowGate + 9*3.125 ns
                if InDetFlags.doCosmics():
                    LowGate = 19.0 * ns
                    HighGate = 44.0 * ns

            InDetTRT_DriftCircleTool = InDet__TRT_DriftCircleTool(
                name=prefix + "DriftCircleTool",
                TRTDriftFunctionTool=InDetTRT_DriftFunctionTool,
                TrtDescrManageLocation=InDetKeys.TRT_Manager(),
                ConditionsSummaryTool=InDetTRTStrawStatusSummarySvc,
                #used to be InDetTRTConditionsSummaryService,
                UseConditionsStatus=True,
                UseConditionsHTStatus=True,
                SimpleOutOfTimePileupSupression=InDetFlags.doCosmics(),
                RejectIfFirstBit=False,  # fixes 50 nsec issue 
                MinTrailingEdge=MinTrailingEdge,
                MaxDriftTime=MaxDriftTime,
                ValidityGateSuppression=not InDetFlags.doCosmics(),
                LowGate=LowGate,
                HighGate=HighGate,
                MaskFirstHTBit=False,
                MaskMiddleHTBit=False,
                MaskLastHTBit=False,
                SimpleOutOfTimePileupSupressionArgon=InDetFlags.doCosmics(),
                RejectIfFirstBitArgon=False,  # fixes 50 nsec issue 
                MinTrailingEdgeArgon=MinTrailingEdge,
                MaxDriftTimeArgon=MaxDriftTime,
                ValidityGateSuppressionArgon=not InDetFlags.doCosmics(),
                LowGateArgon=LowGate,
                HighGateArgon=HighGate,
                MaskFirstHTBitArgon=False,
                MaskMiddleHTBitArgon=False,
                MaskLastHTBitArgon=False,
                useDriftTimeHTCorrection=True,
                useDriftTimeToTCorrection=True)  # reenable ToT

            from AthenaCommon.BeamFlags import jobproperties
            if InDetFlags.InDet25nsec() and jobproperties.Beam.beamType(
            ) == "collisions":
                InDetTRT_DriftCircleTool.ValidityGateSuppression = True
                InDetTRT_DriftCircleTool.SimpleOutOfTimePileupSupression = False
            if jobproperties.Beam.beamType() == "cosmics":
                InDetTRT_DriftCircleTool.SimpleOutOfTimePileupSupression = False


# --- overwrite for phase usage
            if usePhase:
                InDetTRT_DriftCircleTool.ComTimeName = "TRT_Phase"

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

            #
            # --- TRT_RIO_Maker Algorithm
            #
            from InDetPrepRawDataFormation.InDetPrepRawDataFormationConf import InDet__TRT_RIO_Maker
            InDetTRT_RIO_Maker = InDet__TRT_RIO_Maker(
                name=prefix + "RIO_Maker",
                TRT_DriftCircleTool=InDetTRT_DriftCircleTool,
                TrtDescrManageLocation=InDetKeys.TRT_Manager(),
                TRTRDOLocation=InDetKeys.TRT_RDOs(),
                TRTRIOLocation=collection)
            topSequence += InDetTRT_RIO_Maker
            if (InDetFlags.doPrintConfigurables()):
                print InDetTRT_RIO_Maker
            if InDetFlags.doSplitReco():
                InDetTRT_RIO_MakerPU = InDet__TRT_RIO_Maker(
                    name=prefix + "RIO_MakerPU",
                    TRT_DriftCircleTool=InDetTRT_DriftCircleTool,
                    TrtDescrManageLocation=InDetKeys.TRT_Manager(),
                    TRTRDOLocation=InDetKeys.TRT_PU_RDOs(),
                    TRTRIOLocation=collectionPU)
                topSequence += InDetTRT_RIO_MakerPU
                if (InDetFlags.doPrintConfigurables()):
                    print InDetTRT_RIO_MakerPU

            #
            #    Include alg to save the local occupancy inside xAOD::EventInfo
            #
            if InDetFlags.doTRTGlobalOccupancy():
                from TRT_ElectronPidTools.TRT_ElectronPidToolsConf import InDet__TRT_LocalOccupancy
                InDetTRT_LocalOccupancy = InDet__TRT_LocalOccupancy(
                    name="InDet_TRT_LocalOccupancy", isTrigger=False)

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

                from TRT_CalibAlgs.TRT_CalibAlgsConf import TRTOccupancyInclude
                TRTOccupancyInclude = TRTOccupancyInclude(
                    name=prefix + "TRTOccupancyInclude",
                    TRT_LocalOccupancyTool=InDetTRT_LocalOccupancy)

                topSequence += TRTOccupancyInclude
                if (InDetFlags.doPrintConfigurables()):
                    print TRTOccupancyInclude

            #
            # --- we need to do truth association if requested (not for uncalibrated hits in cosmics)
            #
            if InDetFlags.doTruth() and useTimeInfo:
                from InDetTruthAlgs.InDetTruthAlgsConf import InDet__PRD_MultiTruthMaker
                InDetPRD_MultiTruthMakerTRT = InDet__PRD_MultiTruthMaker(
                    name=prefix + "PRD_MultiTruthMaker",
                    PixelClusterContainerName="",
                    SCTClusterContainerName="",
                    TRTDriftCircleContainerName=InDetKeys.TRT_DriftCircles(),
                    SimDataMapNamePixel="",
                    SimDataMapNameSCT="",
                    SimDataMapNameTRT=InDetKeys.TRT_SDOs(),
                    TruthNamePixel="",
                    TruthNameSCT="",
                    TruthNameTRT=InDetKeys.TRT_DriftCirclesTruth())
                topSequence += InDetPRD_MultiTruthMakerTRT
                if (InDetFlags.doPrintConfigurables()):
                    print InDetPRD_MultiTruthMakerTRT

                if InDetFlags.doSplitReco():
                    InDetPRD_MultiTruthMakerTRTPU = InDet__PRD_MultiTruthMaker(
                        name=prefix + "PRD_MultiTruthMakerPU",
                        PixelClusterContainerName="",
                        SCTClusterContainerName="",
                        TRTDriftCircleContainerName=InDetKeys.
                        TRT_PU_DriftCircles(),
                        SimDataMapNamePixel="",
                        SimDataMapNameSCT="",
                        SimDataMapNameTRT=InDetKeys.TRT_PU_SDOs(),
                        TruthNamePixel="",
                        TruthNameSCT="",
                        TruthNameTRT=InDetKeys.TRT_PU_DriftCirclesTruth())
                    topSequence += InDetPRD_MultiTruthMakerTRTPU
                    if (InDetFlags.doPrintConfigurables()):
                        print InDetPRD_MultiTruthMakerTRTPU
##
## preInclude.FastTRT_Digi.py
##

from Digitization.DigitizationFlags import digitizationFlags
digitizationFlags.experimentalDigi += ['doFastTRT_Digi']

from TRT_ConditionsServices.TRT_ConditionsServicesConf import TRT_StrawStatusSummarySvc
InDetTRTStrawStatusSummarySvc = TRT_StrawStatusSummarySvc(
    name="InDetTRTStrawStatusSummarySvc")
ServiceMgr += InDetTRTStrawStatusSummarySvc

from TRT_ElectronPidTools.TRT_ElectronPidToolsConf import InDet__TRT_LocalOccupancy
InDetTRT_LocalOccupancy = InDet__TRT_LocalOccupancy(
    name="InDet_TRT_LocalOccupancy", isTrigger=False)
ToolSvc += InDetTRT_LocalOccupancy

from TRT_ElectronPidTools.TRT_ElectronPidToolsConf import InDet__TRT_ElectronPidToolRun2
InDetTRT_ElectronPidTool = InDet__TRT_ElectronPidToolRun2(
    name="InDetTRT_ElectronPidTool",
    TRT_LocalOccupancyTool=InDetTRT_LocalOccupancy,
    isData=(globalflags.DataSource == 'data'))
ToolSvc += InDetTRT_ElectronPidTool

##EOF
Esempio n. 3
0
    def __init__(self, useTimeInfo=True, usePhase=False):

        from InDetRecExample.InDetJobProperties import InDetFlags
        from AthenaCommon.DetFlags import DetFlags
        from AthenaCommon.GlobalFlags import globalflags
        from AthenaCommon.BeamFlags import jobproperties
        #
        # get ToolSvc and topSequence
        #
        from AthenaCommon.AppMgr import ToolSvc
        from AthenaCommon.AlgSequence import AlgSequence
        topSequence = AlgSequence()

        if InDetFlags.doPRDFormation() and DetFlags.makeRIO.TRT_on(
        ) and InDetFlags.doTRT_PRDFormation():

            #
            # --- setup naming of tools and algs
            #
            if useTimeInfo:
                prefix = "InDetTRT_"
                collection = InDetKeys.TRT_DriftCircles()
                if InDetFlags.doSplitReco():
                    collectionPU = InDetKeys.TRT_PU_DriftCircles()
            else:
                prefix = "InDetTRT_noTime_"
                collection = InDetKeys.TRT_DriftCirclesUncalibrated()
                if InDetFlags.doSplitReco():
                    collectionPU = InDetKeys.TRT_PU_DriftCirclesUncalibrated()
            # Calibration DB Service
            from TRT_ConditionsServices.TRT_ConditionsServicesConf import TRT_CalDbTool
            InDetTRTCalDbTool = TRT_CalDbTool(name="TRT_CalDbTool")

            #
            # --- TRT_DriftFunctionTool
            #

            from TRT_DriftFunctionTool.TRT_DriftFunctionToolConf import TRT_DriftFunctionTool
            InDetTRT_DriftFunctionTool = TRT_DriftFunctionTool(
                name=prefix + "DriftFunctionTool",
                TRTCalDbTool=InDetTRTCalDbTool)
            # --- overwrite for uncalibrated DC production
            if (not useTimeInfo) or InDetFlags.noTRTTiming():
                InDetTRT_DriftFunctionTool.DummyMode = True
                InDetTRT_DriftFunctionTool.UniversalError = 1.15

            # --- set Data/MC flag
            if (globalflags.DataSource != 'geant4'):
                InDetTRT_DriftFunctionTool.IsMC = False
            else:
                InDetTRT_DriftFunctionTool.IsMC = True

            # --- overwrite for calibration of MC
            if usePhase and jobproperties.Beam.beamType(
            ) == 'cosmics' and globalflags.DataSource == "geant4":
                InDetTRT_DriftFunctionTool.AllowDigiVersionOverride = True
                InDetTRT_DriftFunctionTool.ForcedDigiVersion = 9

            # --- set HT corrections
            InDetTRT_DriftFunctionTool.HTCorrectionBarrelXe = 1.5205
            InDetTRT_DriftFunctionTool.HTCorrectionEndcapXe = 1.2712
            InDetTRT_DriftFunctionTool.HTCorrectionBarrelAr = 1.5205
            InDetTRT_DriftFunctionTool.HTCorrectionEndcapAr = 1.2712

            # --- set ToT corrections
            InDetTRT_DriftFunctionTool.ToTCorrectionsBarrelXe = [
                0., 4.358121, 3.032195, 1.631892, 0.7408397, -0.004113,
                -0.613288, -0.73758, -0.623346, -0.561229, -0.29828, -0.21344,
                -0.322892, -0.386718, -0.534751, -0.874178, -1.231799,
                -1.503689, -1.896464, -2.385958
            ]
            InDetTRT_DriftFunctionTool.ToTCorrectionsEndcapXe = [
                0., 5.514777, 3.342712, 2.056626, 1.08293693, 0.3907979,
                -0.082819, -0.457485, -0.599706, -0.427493, -0.328962,
                -0.403399, -0.663656, -1.029428, -1.46008, -1.919092,
                -2.151582, -2.285481, -2.036822, -2.15805
            ]
            InDetTRT_DriftFunctionTool.ToTCorrectionsBarrelAr = [
                0., 4.358121, 3.032195, 1.631892, 0.7408397, -0.004113,
                -0.613288, -0.73758, -0.623346, -0.561229, -0.29828, -0.21344,
                -0.322892, -0.386718, -0.534751, -0.874178, -1.231799,
                -1.503689, -1.896464, -2.385958
            ]
            InDetTRT_DriftFunctionTool.ToTCorrectionsEndcapAr = [
                0., 5.514777, 3.342712, 2.056626, 1.08293693, 0.3907979,
                -0.082819, -0.457485, -0.599706, -0.427493, -0.328962,
                -0.403399, -0.663656, -1.029428, -1.46008, -1.919092,
                -2.151582, -2.285481, -2.036822, -2.15805
            ]
            # Second calibration DB Service in case pile-up and physics hits have different calibrations
            if DetFlags.overlay.TRT_on():
                InDetTRTCalDbTool2 = TRT_CalDbTool(name="TRT_CalDbTool2")
                InDetTRTCalDbTool2.RtFolderName = "/TRT/Calib/MC/RT"
                InDetTRTCalDbTool2.T0FolderName = "/TRT/Calib/MC/T0"
                InDetTRT_DriftFunctionTool.TRTCalDbTool2 = InDetTRTCalDbTool2
                InDetTRT_DriftFunctionTool.IsOverlay = True
                InDetTRT_DriftFunctionTool.IsMC = False

            ToolSvc += InDetTRT_DriftFunctionTool
            if (InDetFlags.doPrintConfigurables()):
                printfunc(InDetTRT_DriftFunctionTool)

            # Straw status DB Tool
            from TRT_ConditionsServices.TRT_ConditionsServicesConf import TRT_StrawStatusSummaryTool
            InDetTRTStrawStatusSummaryTool = TRT_StrawStatusSummaryTool(
                name="TRT_StrawStatusSummaryTool",
                isGEANT4=(globalflags.DataSource == 'geant4'))

            #
            # --- TRT_DriftCircleTool
            #
            if usePhase:
                from TRT_DriftCircleTool.TRT_DriftCircleToolConf import InDet__TRT_DriftCircleToolCosmics as InDet__TRT_DriftCircleTool
            else:
                from TRT_DriftCircleTool.TRT_DriftCircleToolConf import InDet__TRT_DriftCircleTool

            #
            # set gating values for MC/DATA
            MinTrailingEdge = 11.0 * ns
            MaxDriftTime = 60.0 * ns
            LowGate = 14.0625 * ns  # 4.5*3.125 ns
            HighGate = 42.1875 * ns  # LowGate + 9*3.125 ns
            LowGateArgon = LowGate
            HighGateArgon = HighGate

            if InDetFlags.doCosmics():
                LowGate = 19.0 * ns
                HighGate = 44.0 * ns
                LowGateArgon = 19.0 * ns
                HighGateArgon = 44.0 * ns

            if globalflags.DataSource == 'data':
                MinTrailingEdge = 11.0 * ns
                MaxDriftTime = 60.0 * ns
                LowGate = 17.1875 * ns
                HighGate = 45.3125 * ns
                LowGateArgon = 18.75 * ns
                HighGateArgon = 43.75 * ns
                if InDetFlags.doCosmics():
                    LowGate = 19.0 * ns
                    HighGate = 44.0 * ns
                    LowGateArgon = 19.0 * ns
                    HighGateArgon = 44.0 * ns

            InDetTRT_DriftCircleTool = InDet__TRT_DriftCircleTool(
                name=prefix + "DriftCircleTool",
                TRTDriftFunctionTool=InDetTRT_DriftFunctionTool,
                ConditionsSummaryTool=InDetTRTStrawStatusSummaryTool,
                UseConditionsStatus=True,
                UseConditionsHTStatus=True,
                SimpleOutOfTimePileupSupression=False,
                RejectIfFirstBit=False,  # fixes 50 nsec issue 
                MinTrailingEdge=MinTrailingEdge,
                MaxDriftTime=MaxDriftTime,
                ValidityGateSuppression=InDetFlags.InDet25nsec(),
                LowGate=LowGate,
                HighGate=HighGate,
                SimpleOutOfTimePileupSupressionArgon=False,
                RejectIfFirstBitArgon=False,  # fixes 50 nsec issue 
                MinTrailingEdgeArgon=MinTrailingEdge,
                MaxDriftTimeArgon=MaxDriftTime,
                ValidityGateSuppressionArgon=InDetFlags.InDet25nsec(),
                LowGateArgon=LowGate,
                HighGateArgon=HighGate,
                useDriftTimeHTCorrection=True,
                useDriftTimeToTCorrection=True)
            if not usePhase:
                from InDetRecExample import TrackingCommon
                InDetTRT_DriftCircleTool.LumiDataKey = TrackingCommon.getLumiCondDataKeyForTRTMuScaling(
                )

            ToolSvc += InDetTRT_DriftCircleTool
            if (InDetFlags.doPrintConfigurables()):
                printfunc(InDetTRT_DriftCircleTool)

            #
            # --- TRT_RIO_Maker Algorithm
            #
            from InDetPrepRawDataFormation.InDetPrepRawDataFormationConf import InDet__TRT_RIO_Maker
            InDetTRT_RIO_Maker = InDet__TRT_RIO_Maker(
                name=prefix + "RIO_Maker",
                TRT_DriftCircleTool=InDetTRT_DriftCircleTool,
                TrtDescrManageLocation=InDetKeys.TRT_Manager(),
                TRTRDOLocation=InDetKeys.TRT_RDOs(),
                TRTRIOLocation=collection)
            topSequence += InDetTRT_RIO_Maker
            if (InDetFlags.doPrintConfigurables()):
                printfunc(InDetTRT_RIO_Maker)
            if InDetFlags.doSplitReco():
                InDetTRT_RIO_MakerPU = InDet__TRT_RIO_Maker(
                    name=prefix + "RIO_MakerPU",
                    TRT_DriftCircleTool=InDetTRT_DriftCircleTool,
                    TrtDescrManageLocation=InDetKeys.TRT_Manager(),
                    TRTRDOLocation=InDetKeys.TRT_PU_RDOs(),
                    TRTRIOLocation=collectionPU)
                topSequence += InDetTRT_RIO_MakerPU
                if (InDetFlags.doPrintConfigurables()):
                    printfunc(InDetTRT_RIO_MakerPU)

            #
            #    Include alg to save the local occupancy inside xAOD::EventInfo
            #
            if InDetFlags.doTRTGlobalOccupancy():
                from TRT_ElectronPidTools.TRT_ElectronPidToolsConf import InDet__TRT_LocalOccupancy
                InDetTRT_LocalOccupancy = InDet__TRT_LocalOccupancy(
                    name="InDet_TRT_LocalOccupancy",
                    isTrigger=False,
                    TRTCalDbTool=InDetTRTCalDbTool,
                    TRTStrawStatusSummaryTool=InDetTRTStrawStatusSummaryTool)

                ToolSvc += InDetTRT_LocalOccupancy
                if (InDetFlags.doPrintConfigurables()):
                    printfunc(InDetTRT_LocalOccupancy)

                from TRT_CalibAlgs.TRT_CalibAlgsConf import TRTOccupancyInclude
                TRTOccupancyInclude = TRTOccupancyInclude(
                    name=prefix + "TRTOccupancyInclude",
                    TRT_LocalOccupancyTool=InDetTRT_LocalOccupancy)

                topSequence += TRTOccupancyInclude
                if (InDetFlags.doPrintConfigurables()):
                    printfunc(TRTOccupancyInclude)

            #
            # --- we need to do truth association if requested (not for uncalibrated hits in cosmics)
            #
            if InDetFlags.doTruth() and useTimeInfo:
                from InDetTruthAlgs.InDetTruthAlgsConf import InDet__PRD_MultiTruthMaker
                InDetPRD_MultiTruthMakerTRT = InDet__PRD_MultiTruthMaker(
                    name=prefix + "PRD_MultiTruthMaker",
                    PixelClusterContainerName="",
                    SCTClusterContainerName="",
                    TRTDriftCircleContainerName=InDetKeys.TRT_DriftCircles(),
                    SimDataMapNamePixel="",
                    SimDataMapNameSCT="",
                    SimDataMapNameTRT=InDetKeys.TRT_SDOs(),
                    TruthNamePixel="",
                    TruthNameSCT="",
                    TruthNameTRT=InDetKeys.TRT_DriftCirclesTruth())
                topSequence += InDetPRD_MultiTruthMakerTRT
                if (InDetFlags.doPrintConfigurables()):
                    printfunc(InDetPRD_MultiTruthMakerTRT)

                if InDetFlags.doSplitReco():
                    InDetPRD_MultiTruthMakerTRTPU = InDet__PRD_MultiTruthMaker(
                        name=prefix + "PRD_MultiTruthMakerPU",
                        PixelClusterContainerName="",
                        SCTClusterContainerName="",
                        TRTDriftCircleContainerName=InDetKeys.
                        TRT_PU_DriftCircles(),
                        SimDataMapNamePixel="",
                        SimDataMapNameSCT="",
                        SimDataMapNameTRT=InDetKeys.TRT_PU_SDOs(),
                        TruthNamePixel="",
                        TruthNameSCT="",
                        TruthNameTRT=InDetKeys.TRT_PU_DriftCirclesTruth())
                    topSequence += InDetPRD_MultiTruthMakerTRTPU
                    if (InDetFlags.doPrintConfigurables()):
                        printfunc(InDetPRD_MultiTruthMakerTRTPU)
Esempio n. 4
0
from Digitization.DigitizationFlags import digitizationFlags
digitizationFlags.experimentalDigi += ['doFastTRT_Digi']

# The TRT Services are replaced by private tools
from TRT_ConditionsServices.TRT_ConditionsServicesConf import TRT_StrawStatusSummaryTool
InDetTRTStrawStatusSummaryTool = TRT_StrawStatusSummaryTool( name = "InDetTRTStrawStatusSummaryTool",
                                                             isGEANT4=!(globalflags.DataSource == 'data') )
#ServiceMgr += InDetTRTStrawStatusSummarySvc

from TRT_ConditionsServices.TRT_ConditionsServicesConf import TRT_CalDbTool
                                            InDetTRTCalDbTool = TRT_CalDbTool(name = "TRT_CalDbTool")

from TRT_ElectronPidTools.TRT_ElectronPidToolsConf import InDet__TRT_LocalOccupancy
InDetTRT_LocalOccupancy = InDet__TRT_LocalOccupancy( name = "InDet_TRT_LocalOccupancy",
                                                     isTrigger = False,
                                                     TRTCalDbTool = InDetTRTCalDbTool,
                                                     TRTStrawStatusSummaryTool = InDetTRTStrawStatusSummaryTool )
ToolSvc += InDetTRT_LocalOccupancy

from TRT_ElectronPidTools.TRT_ElectronPidToolsConf import TRT_ToT_dEdx
InDetTRT_ToT_dEdx = TRT_ToT_dEdx( name = "InDet_TRT_ToT_dEdx",
                                  TRTStrawSummaryTool = InDetTRTStrawStatusSummaryTool,
                                  TRT_LocalOccupancyTool = InDetTRT_LocalOccupancy )                                      
ToolSvc += InDetTRT_ToT_dEdx

from TRT_ElectronPidTools.TRT_ElectronPidToolsConf import InDet__TRT_ElectronPidToolRun2
InDetTRT_ElectronPidTool = InDet__TRT_ElectronPidToolRun2( name = "InDetTRT_ElectronPidTool",
                                                           TRT_LocalOccupancyTool = InDetTRT_LocalOccupancy,
                                                           TRTStrawSummaryTool       = InDetTRTStrawStatusSummaryTool,
                                                           TRT_ToT_dEdx_Tool = InDetTrigTRT_ToT_dEdx,
                                                           isData = (globalflags.DataSource == 'data') )
Esempio n. 5
0
    def __init__(self, name="EMBremCollectionBuilder", **kw):
        mlog = logging.getLogger(name + '::__init__')
        mlog.info("entering")

        super(egammaBremCollectionBuilder, self).__init__(name, **kw)

        # do the configuration
        import egammaRec.EMCommonRefitter
        GSFBuildInDetExtrapolator = egammaExtrapolator()

        from egammaTrackTools.egammaTrackToolsConf import egammaTrkRefitterTool
        GSFRefitterTool = egammaTrkRefitterTool(
            name='GSFRefitterTool',
            FitterTool=egammaRec.EMCommonRefitter.GSFTrackFitter,
            useBeamSpot=False,
            ReintegrateOutliers=True)
        from AthenaCommon.AppMgr import ToolSvc
        ToolSvc += GSFRefitterTool

        # ----------- load association tool from Inner Detector to handle pixel ganged ambiguities
        #
        from InDetAssociationTools.InDetAssociationToolsConf import InDet__InDetPRD_AssociationToolGangedPixels
        GSFBuildInDetPrdAssociationTool = InDet__InDetPRD_AssociationToolGangedPixels(
            name="GSFBuildInDetPrdAssociationTool",
            PixelClusterAmbiguitiesMapName='PixelClusterAmbiguitiesMap')
        ToolSvc += GSFBuildInDetPrdAssociationTool
        #
        # ----------- Load SummaryTool
        #
        # Loading Configurable HoleSearchTool
        #
        from InDetTrackHoleSearch.InDetTrackHoleSearchConf import InDet__InDetTrackHoleSearchTool
        GSFBuildHoleSearchTool = InDet__InDetTrackHoleSearchTool(
            name="GSFBuildHoleSearchTool",
            Extrapolator=GSFBuildInDetExtrapolator,
            usePixel=DetFlags.haveRIO.pixel_on(),
            useSCT=DetFlags.haveRIO.SCT_on(),
            checkBadSCTChip=InDetFlags.checkDeadElementsOnTrack(),
            CountDeadModulesAfterLastHit=True)

        from AthenaCommon.AppMgr import ServiceMgr
        if (DetFlags.haveRIO.SCT_on()):
            from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_ConditionsSummarySvc
            InDetSCT_ConditionsSummarySvc = SCT_ConditionsSummarySvc(
                name="InDetSCT_ConditionsSummarySvc")
            ServiceMgr += InDetSCT_ConditionsSummarySvc
            GSFBuildHoleSearchTool.SctSummarySvc = ServiceMgr.InDetSCT_ConditionsSummarySvc
        else:
            GSFBuildHoleSearchTool.SctSummarySvc = None

        ToolSvc += GSFBuildHoleSearchTool
        #
        # Load BLayer tool
        #
        GSFBuildTestBLayerTool = None
        if DetFlags.haveRIO.pixel_on():
            from InDetTestBLayer.InDetTestBLayerConf import InDet__InDetTestBLayerTool
            from PixelConditionsServices.PixelConditionsServicesConf import PixelConditionsSummarySvc
            ServiceMgr += PixelConditionsSummarySvc()
            GSFBuildTestBLayerTool = InDet__InDetTestBLayerTool(
                name="GSFBuildTestBLayerTool",
                PixelSummarySvc=ServiceMgr.PixelConditionsSummarySvc,
                Extrapolator=GSFBuildInDetExtrapolator)
            ToolSvc += GSFBuildTestBLayerTool

        # Configurable version of TRT_ElectronPidTools
        #
        GSFBuildTRT_ElectronPidTool = None
        if DetFlags.haveRIO.TRT_on(
        ) and not InDetFlags.doSLHC() and not InDetFlags.doHighPileup():

            from TRT_ElectronPidTools.TRT_ElectronPidToolsConf import InDet__TRT_LocalOccupancy
            GSFBuildTRT_LocalOccupancy = InDet__TRT_LocalOccupancy(
                name="GSF_TRT_LocalOccupancy")
            ToolSvc += GSFBuildTRT_LocalOccupancy

            from TRT_ElectronPidTools.TRT_ElectronPidToolsConf import InDet__TRT_ElectronPidToolRun2
            GSFBuildTRT_ElectronPidTool = InDet__TRT_ElectronPidToolRun2(
                name="GSFBuildTRT_ElectronPidTool",
                TRT_LocalOccupancyTool=GSFBuildTRT_LocalOccupancy,
                isData=(globalflags.DataSource == 'data'))

            ToolSvc += GSFBuildTRT_ElectronPidTool

        #
        # Configurable version of PixelToTPIDTOol
        #
        GSFBuildPixelToTPIDTool = None
        if DetFlags.haveRIO.pixel_on():
            from PixelToTPIDTool.PixelToTPIDToolConf import InDet__PixelToTPIDTool
            GSFBuildPixelToTPIDTool = InDet__PixelToTPIDTool(
                name="GSFBuildPixelToTPIDTool")
            GSFBuildPixelToTPIDTool.ReadFromCOOL = True
            ToolSvc += GSFBuildPixelToTPIDTool
        #
        # Configrable version of loading the InDetTrackSummaryHelperTool
        #
        from InDetTrackSummaryHelperTool.InDetTrackSummaryHelperToolConf import InDet__InDetTrackSummaryHelperTool
        GSFBuildTrackSummaryHelperTool = InDet__InDetTrackSummaryHelperTool(
            name="GSFBuildTrackSummaryHelperTool",
            AssoTool=GSFBuildInDetPrdAssociationTool,
            PixelToTPIDTool=GSFBuildPixelToTPIDTool,
            TestBLayerTool=GSFBuildTestBLayerTool,
            DoSharedHits=False,
            HoleSearch=GSFBuildHoleSearchTool,
            usePixel=DetFlags.haveRIO.pixel_on(),
            useSCT=DetFlags.haveRIO.SCT_on(),
            useTRT=DetFlags.haveRIO.TRT_on())
        ToolSvc += GSFBuildTrackSummaryHelperTool
        #
        # Configurable version of TrkTrackSummaryTool: no TRT_PID tool needed here (no shared hits)
        #
        from TrkTrackSummaryTool.TrkTrackSummaryToolConf import Trk__TrackSummaryTool
        GSFBuildInDetTrackSummaryTool = Trk__TrackSummaryTool(
            name="GSFBuildInDetTrackSummaryTool",
            InDetSummaryHelperTool=GSFBuildTrackSummaryHelperTool,
            doSharedHits=False,
            InDetHoleSearchTool=GSFBuildHoleSearchTool,
            TRT_ElectronPidTool=GSFBuildTRT_ElectronPidTool,
            PixelToTPIDTool=GSFBuildPixelToTPIDTool)
        ToolSvc += GSFBuildInDetTrackSummaryTool
        #
        # --- load patricle creator tool
        #
        from TrkParticleCreator.TrkParticleCreatorConf import Trk__TrackParticleCreatorTool
        GSFBuildInDetParticleCreatorTool = Trk__TrackParticleCreatorTool(
            name="GSFBuildInDetParticleCreatorTool",
            KeepParameters=True,
            Extrapolator=GSFBuildInDetExtrapolator,
            TrackSummaryTool=GSFBuildInDetTrackSummaryTool,
            UseTrackSummaryTool=False,
            ForceTrackSummaryUpdate=False)
        ToolSvc += GSFBuildInDetParticleCreatorTool
        #
        # --- do track slimming
        #
        from TrkTrackSlimmingTool.TrkTrackSlimmingToolConf import Trk__TrackSlimmingTool as ConfigurableTrackSlimmingTool
        GSFBuildInDetTrkSlimmingTool = ConfigurableTrackSlimmingTool(
            name="GSFBuildInDetTrackSlimmingTool",
            KeepParameters=False,
            KeepOutliers=True)
        ToolSvc += GSFBuildInDetTrkSlimmingTool

        # do the configuration
        self.ClusterContainerName = "LArClusterEM"
        from InDetRecExample.InDetKeys import InDetKeys
        self.TrackParticleContainerName = InDetKeys.xAODTrackParticleContainer(
        )
        self.OutputTrkPartContainerName = "GSFTrackParticles"
        self.OutputTrackContainerName = "GSFTracks"
        self.TrackRefitTool = GSFRefitterTool
        self.TrackParticleCreatorTool = GSFBuildInDetParticleCreatorTool
        self.TrackSlimmingTool = GSFBuildInDetTrkSlimmingTool
        self.TrackSummaryTool = GSFBuildInDetTrackSummaryTool

        # do the configuration (from old EMBremCollectionBuilderBase)
        self.minNoSiHits = 4
        self.broadDeltaEta = 0.1  # this is multiplied by 2 for the Candidate Match , so +- 0.2 in eta
        self.broadDeltaPhi = 0.15  # this is multiplied by 2 for the Candidate Match , so +- 0.3 in phi
        self.narrowDeltaEta = 0.05
        #These have to be relaxed enough for the conversions
        self.narrowDeltaPhi = 0.05
        self.narrowDeltaPhiBrem = 0.20  #Dominated by the needs of assymetric conversions
        self.narrowDeltaPhiRescale = 0.05
        self.narrowDeltaPhiRescaleBrem = 0.1