Beispiel #1
0
def SCT_LorentzAngleCfg(flags,
                        name="SCT_SiLorentzAngleCondAlg",
                        forceUseDB=False,
                        forceUseGeoModel=False,
                        **kwargs):
    """Return configured ComponentAccumulator and tool for SCT_LorentzAngle

    SiLorentzAngleTool may be provided in kwargs
    """
    if forceUseDB and forceUseGeoModel:
        msg = Logging.logging.getLogger("SCT_LorentzAngleCfg")
        msg.error(
            "Setting is wrong: both forceUseDB and forceUseGeoModel cannot be True at the same time"
        )
    # construct with field services
    acc = MagneticFieldSvcCfg(flags)
    tool = kwargs.get("SiLorentzAngleTool", SCT_LorentzAngleToolCfg(flags))
    if not forceUseGeoModel:
        DCSkwargs = {}
        # For HLT
        if flags.Common.isOnline and not flags.Input.isMC:
            dcs_folder = "/SCT/HLT/DCS"
            DCSkwargs["dbInstance"] = "SCT"
            DCSkwargs["hvFolder"] = dcs_folder + "/HV"
            DCSkwargs["tempFolder"] = dcs_folder + "/MODTEMP"
            DCSkwargs["stateFolder"] = dcs_folder + "/CHANSTAT"
        DCSAcc = SCT_DCSConditionsCfg(flags, **DCSkwargs)
        SCAcc = SCT_SiliconConditionsCfg(
            flags, DCSConditionsTool=DCSAcc.popPrivateTools())
        acc.merge(DCSAcc)
        acc.merge(SCAcc)
    # set up SCTSiLorentzAngleCondAlg
    kwargs.setdefault("UseMagFieldCache", tool.UseMagFieldCache)
    kwargs.setdefault("UseMagFieldDcs", not flags.Common.isOnline)
    kwargs.setdefault("UseGeoModel", forceUseGeoModel)
    kwargs.setdefault("useSctDefaults", False)
    acc.addCondAlgo(SCTSiLorentzAngleCondAlg(name, **kwargs))
    acc.setPrivateTools(tool)
    return acc
Beispiel #2
0
def ActsExtrapolationToolCfg(configFlags, name="ActsExtrapolationTool"):
    result = ComponentAccumulator()

    acc = MagneticFieldSvcCfg(configFlags)
    result.merge(acc)

    acc, actsTrackingGeometryTool = ActsTrackingGeometryToolCfg(configFlags)
    result.merge(acc)

    Acts_ActsExtrapolationTool = CompFactory.ActsExtrapolationTool
    actsExtrapolationTool = Acts_ActsExtrapolationTool(name)
    result.addPublicTool(actsExtrapolationTool, primary=True)
    return result
Beispiel #3
0
def testCfg (configFlags):
    result = ComponentAccumulator()

    from MuonConfig.MuonGeometryConfig import MuonGeoModelCfg
    result.merge (MuonGeoModelCfg(configFlags))

    from MagFieldServices.MagFieldServicesConfig import MagneticFieldSvcCfg
    result.merge (MagneticFieldSvcCfg(configFlags, UseDCS = False))

    Muon__MdtRdoToPrepDataTool = CompFactory.Muon.MdtRdoToPrepDataTool
    result.addPublicTool (Muon__MdtRdoToPrepDataTool ('Muon__MdtRdoToPrepDataTool', OutputLevel = 1))
    
    result.addEventAlgo (TestAlg ('TestAlg'))
    return result
Beispiel #4
0
def DQTDetSynchMonAlgConfig(flags):
    from AthenaMonitoring import AthMonitorCfgHelper
    from AthenaConfiguration.ComponentFactory import CompFactory
    helper = AthMonitorCfgHelper(flags, 'DQTDetSynchMonAlgCfg')
    _DQTDetSynchMonAlgConfigCore(helper, CompFactory.DQTDetSynchMonAlg,
                                 flags.Common.isOnline, False)
    acc = helper.result()
    # RPC currently crashes, switch off
    acc.getEventAlgo('DQTDetSynchMonAlg').doRPC = False
    from MagFieldServices.MagFieldServicesConfig import MagneticFieldSvcCfg
    acc.merge(MagneticFieldSvcCfg(flags))
    from TileConditions.TileCablingSvcConfig import TileCablingSvcCfg
    acc.merge(TileCablingSvcCfg(flags))
    return acc
Beispiel #5
0
def testCfg(configFlags):
    result = ComponentAccumulator()

    from MuonConfig.MuonGeometryConfig import MuonGeoModelCfg
    result.merge(MuonGeoModelCfg(configFlags))

    from MagFieldServices.MagFieldServicesConfig import MagneticFieldSvcCfg
    result.merge(MagneticFieldSvcCfg(configFlags, UseDCS=False))

    MuonStationIntersectSvc = CompFactory.MuonStationIntersectSvc
    result.addService(
        MuonStationIntersectSvc('MuonStationIntersectSvc', OutputLevel=1))

    result.addEventAlgo(TestAlg('TestAlg'))
    return result
Beispiel #6
0
def testCfg(configFlags):
    result = ComponentAccumulator()

    from MuonConfig.MuonGeometryConfig import MuonGeoModelCfg
    result.merge(MuonGeoModelCfg(configFlags))

    from MagFieldServices.MagFieldServicesConfig import MagneticFieldSvcCfg
    result.merge(MagneticFieldSvcCfg(configFlags, UseDCS=False))

    TrigL2MuonSA__MdtDataPreparator = CompFactory.TrigL2MuonSA.MdtDataPreparator
    result.addPublicTool(
        TrigL2MuonSA__MdtDataPreparator('TrigL2MuonSA::MdtDataPreparator',
                                        OutputLevel=1))  # noqa: ATL900

    result.addEventAlgo(TestAlg('TestAlg'))
    return result
Beispiel #7
0
def MdtBytestreamDecodeCfg(flags, forTrigger=False):
    acc = ComponentAccumulator()

    # We need the MDT cabling to be setup
    from MuonConfig.MuonCablingConfig import MDTCablingConfigCfg
    acc.merge(MDTCablingConfigCfg(flags))

    # need the MagFieldSvc since MdtRdoToMdtPrepData.MdtRdoToMdtPrepDataTool.MdtCalibrationTool wants to retrieve it
    from MagFieldServices.MagFieldServicesConfig import MagneticFieldSvcCfg
    acc.merge(MagneticFieldSvcCfg(flags))

    # Make sure muon geometry is configured
    from MuonConfig.MuonGeometryConfig import MuonGeoModelCfg
    acc.merge(MuonGeoModelCfg(flags))

    # Setup the MDT ROD decoder
    MdtROD_Decoder = CompFactory.MdtROD_Decoder
    MDTRodDecoder = MdtROD_Decoder(name="MdtROD_Decoder")

    # RAW data provider tool needs ROB data provider service (should be another Config function?)
    ROBDataProviderSvc = CompFactory.ROBDataProviderSvc
    robDPSvc = ROBDataProviderSvc()
    acc.addService(robDPSvc)

    # Setup the RAW data provider tool
    keyName = flags.Overlay.BkgPrefix + "MDTCSM" if flags.Detector.OverlayMDT else "MDTCSM"
    Muon__MDT_RawDataProviderToolMT = CompFactory.Muon.MDT_RawDataProviderToolMT
    MuonMdtRawDataProviderTool = Muon__MDT_RawDataProviderToolMT(
        name="MDT_RawDataProviderToolMT",
        Decoder=MDTRodDecoder,
        RdoLocation=keyName)

    if forTrigger:
        MuonMdtRawDataProviderTool.CsmContainerCacheKey = MuonCacheNames.MdtCsmCache

    acc.addPublicTool(
        MuonMdtRawDataProviderTool
    )  # This should be removed, but now defined as PublicTool at MuFastSteering

    # Setup the RAW data provider algorithm
    Muon__MdtRawDataProvider = CompFactory.Muon.MdtRawDataProvider
    MdtRawDataProvider = Muon__MdtRawDataProvider(
        name="MdtRawDataProvider", ProviderTool=MuonMdtRawDataProviderTool)

    acc.addEventAlgo(MdtRawDataProvider, primary=True)

    return acc
Beispiel #8
0
def TrackingGeoCfg(inputFlags):
    result = ComponentAccumulator()

    from AtlasGeoModel.InDetGMConfig import InDetGeometryCfg
    result.merge(InDetGeometryCfg(inputFlags))

    # Something builds muon stations -- extrapolator?
    from MuonConfig.MuonGeometryConfig import MuonGeoModelCfg
    result.merge(MuonGeoModelCfg(inputFlags))

    from TrkConfig.AtlasTrackingGeometrySvcConfig import TrackingGeometrySvcCfg
    result.merge(TrackingGeometrySvcCfg(inputFlags))

    from MagFieldServices.MagFieldServicesConfig import MagneticFieldSvcCfg
    result.merge(MagneticFieldSvcCfg(inputFlags))

    return result
Beispiel #9
0
def MuonSTEP_PropagatorCfg(flags, name='MuonSTEP_Propagator', **kwargs):
    # Really there should be a central configuration for the STEP propagator. FIXME
    # In the old ConfigDb this was named MuonStraightLinePropagator (!)
    Trk__STEP_Propagator = CompFactory.Trk.STEP_Propagator
    from MagFieldServices.MagFieldServicesConfig import MagneticFieldSvcCfg
    result = ComponentAccumulator()

    acc = MagneticFieldSvcCfg(flags)
    result.merge(acc)

    kwargs.setdefault("Tolerance", 0.00001)
    kwargs.setdefault("MaterialEffects", True)
    kwargs.setdefault("IncludeBgradients", True)

    propagator = Trk__STEP_Propagator(name=name, **kwargs)
    result.setPrivateTools(propagator)
    return result
Beispiel #10
0
def MdtCalibrationToolCfg(flags, **kwargs):
    result = MdtCalibrationDbToolCfg(flags, **kwargs)
    mdt_calibibration_db_tool = result.getPrimary()

    kwargs.setdefault("CalibrationDbTool", mdt_calibibration_db_tool)
    kwargs.setdefault("DoSlewingCorrection",
                      flags.Muon.Calib.correctMdtRtForTimeSlewing)
    kwargs.setdefault("DoTemperatureCorrection",
                      flags.Muon.Calib.applyRtScaling)
    kwargs.setdefault("DoWireSagCorrection",
                      flags.Muon.Calib.correctMdtRtWireSag)
    kwargs.setdefault(
        "DoTofCorrection",
        flags.Beam.Type == 'collisions')  # No TOF correction if not collisions

    acc = MagneticFieldSvcCfg(flags)
    result.merge(acc)

    MdtCalibrationTool = CompFactory.MdtCalibrationTool
    mdt_calibration_tool = MdtCalibrationTool(**kwargs)
    result.setPrivateTools(mdt_calibration_tool)
    return result
Beispiel #11
0
def TRT_DigitizationBasicToolCfg(flags,
                                 name="TRT_DigitizationBasicTool",
                                 **kwargs):
    """Return ComponentAccumulator with common TRT digitization tool config"""
    acc = TRT_GeometryCfg(flags)
    acc.merge(MagneticFieldSvcCfg(flags))
    PartPropSvc = CompFactory.PartPropSvc
    acc.addService(PartPropSvc(InputFile="PDGTABLE.MeV"))
    if flags.Detector.Overlay and not flags.Input.isMC:
        acc.merge(
            addFolders(flags,
                       "/TRT/Cond/DigVers",
                       "TRT_OFL",
                       tag="TRTCondDigVers-Collisions-01",
                       db="OFLP200"))
    # default arguments
    kwargs.setdefault("PAI_Tool_Ar", TRT_PAI_Process_ArToolCfg(flags))
    kwargs.setdefault("PAI_Tool_Kr", TRT_PAI_Process_KrToolCfg(flags))
    kwargs.setdefault("PAI_Tool_Xe", TRT_PAI_Process_XeToolCfg(flags))
    kwargs.setdefault("Override_TrtRangeCutProperty",
                      flags.Digitization.TRTRangeCut)
    kwargs.setdefault("RandomSeedOffset", flags.Digitization.RandomSeedOffset)
    if not flags.Digitization.DoInnerDetectorNoise:
        kwargs.setdefault("Override_noiseInSimhits", 0)
        kwargs.setdefault("Override_noiseInUnhitStraws", 0)
    if flags.Beam.Type == "cosmics":
        kwargs.setdefault("PrintDigSettings", True)
        kwargs.setdefault("Override_cosmicFlag", 0)
        kwargs.setdefault("Override_doCosmicTimingPit", 1)
        kwargs.setdefault("Override_jitterTimeOffset", 0.)
        kwargs.setdefault("Override_timeCorrection", 0)
    if flags.Digitization.DoXingByXingPileUp:
        kwargs.setdefault("FirstXing", TRT_FirstXing())
        kwargs.setdefault("LastXing", TRT_LastXing())
    TRTDigitizationTool = CompFactory.TRTDigitizationTool
    tool = TRTDigitizationTool(name, **kwargs)
    acc.setPrivateTools(tool)
    return acc
Beispiel #12
0
def PrepareStandAloneBTagCfg(inputFlags):
    result = ComponentAccumulator()

    from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
    result.merge(PoolReadCfg(inputFlags))

    from TrkConfig.AtlasTrackingGeometrySvcConfig import TrackingGeometrySvcCfg
    acc = TrackingGeometrySvcCfg(inputFlags)
    result.merge(acc)

    from MuonConfig.MuonGeometryConfig import MuonGeoModelCfg
    result.merge(MuonGeoModelCfg(inputFlags))

    GeometryDBSvc = CompFactory.GeometryDBSvc
    result.addService(GeometryDBSvc("InDetGeometryDBSvc"))

    from PixelGeoModel.PixelGeoModelConfig import PixelGeometryCfg
    result.merge(PixelGeometryCfg(inputFlags))

    # get standard config for magnetic field - map and cache
    from MagFieldServices.MagFieldServicesConfig import MagneticFieldSvcCfg
    result.merge(MagneticFieldSvcCfg(inputFlags))

    from IOVDbSvc.IOVDbSvcConfig import addFolders, addFoldersSplitOnline

    #load folders needed for Run2 ID alignment
    result.merge(
        addFoldersSplitOnline(inputFlags,
                              "INDET",
                              "/Indet/Onl/Align",
                              "/Indet/Align",
                              className="AlignableTransformContainer"))
    result.merge(addFolders(inputFlags, ['/TRT/Align'], 'TRT_OFL'))

    #load folders needed for IBL
    result.merge(addFolders(inputFlags, ['/Indet/IBLDist'], 'INDET_OFL'))

    return result
Beispiel #13
0
def PFCfg(inputFlags, **kwargs):

    #This is monolithic for now.
    #Once a first complete example runs, this will be split into small modular chunks.
    #Some such items may be best placed elsewehere (e.g. put magnetic field setup in magnetic field git folder etc)
    result = ComponentAccumulator()

    StoreGateSvc = CompFactory.StoreGateSvc
    result.addService(StoreGateSvc("DetectorStore"))

    #Alias calibrated topoclusters, if they exist already, such that overwrite won't fial
    from SGComps.AddressRemappingConfig import InputRenameCfg
    result.merge(
        InputRenameCfg("xAOD::CaloClusterContainer", "CaloCalTopoClusters",
                       ""))

    #Setup up general geometry
    from AtlasGeoModel.InDetGMConfig import InDetGeometryCfg
    result.merge(InDetGeometryCfg(inputFlags))

    #Setup TRT conditions
    TRTAlignCondAlg = CompFactory.TRTAlignCondAlg
    result.addCondAlgo(
        TRTAlignCondAlg(name="TRTAlignCondAlg",
                        UseDynamicFolders=inputFlags.GeoModel.Align.Dynamic))

    #Setup Pixel conditions
    PixelAlignCondAlg = CompFactory.PixelAlignCondAlg
    result.addCondAlgo(
        PixelAlignCondAlg(
            name="PixelAlignCondAlg",
            UseDynamicAlignFolders=inputFlags.GeoModel.Align.Dynamic))

    PixelDetectorElementCondAlg = CompFactory.PixelDetectorElementCondAlg
    result.addCondAlgo(
        PixelDetectorElementCondAlg(name="PixelDetectorElementCondAlg"))

    #Setup SCT conditions
    SCT_AlignCondAlg = CompFactory.SCT_AlignCondAlg
    result.addCondAlgo(
        SCT_AlignCondAlg(
            name="SCT_AlignCondAlg",
            UseDynamicAlignFolders=inputFlags.GeoModel.Align.Dynamic))

    SCT_DetectorElementCondAlg = CompFactory.SCT_DetectorElementCondAlg
    result.addCondAlgo(
        SCT_DetectorElementCondAlg(name="SCT_DetectorElementCondAlg"))

    GeometryDBSvc = CompFactory.GeometryDBSvc
    result.addService(GeometryDBSvc("InDetGeometryDBSvc"))

    #from AthenaCommon import CfgGetter
    #result.getService("GeoModelSvc").DetectorTools += [ CfgGetter.getPrivateTool("PixelDetectorTool", checkType=True) ]
    #result.getService("GeoModelSvc").DetectorTools += [ CfgGetter.getPrivateTool("SCT_DetectorTool", checkType=True) ]

    #Setup TRT geometry
    TRT_DetectorTool = CompFactory.TRT_DetectorTool
    trtDetectorTool = TRT_DetectorTool()
    #These two lines fix ATLASRECTS-5053. I expect eventually we can remove them, once the underlying issue is fixed.
    trtDetectorTool.DoXenonArgonMixture = False
    trtDetectorTool.DoKryptonMixture = False
    result.getService("GeoModelSvc").DetectorTools += [trtDetectorTool]

    #Setup up material for inner detector
    InDetServMatTool = CompFactory.InDetServMatTool
    result.getService("GeoModelSvc").DetectorTools += [InDetServMatTool()]

    #Setup up tracking geometry
    from TrkConfig.AtlasTrackingGeometrySvcConfig import TrackingGeometrySvcCfg
    acc = TrackingGeometrySvcCfg(inputFlags)
    result.merge(acc)

    #load folders needed for Run2 ID alignment
    from IOVDbSvc.IOVDbSvcConfig import addFolders
    result.merge(addFolders(inputFlags, ['/TRT/Align'], 'TRT_OFL'))

    #Setup up muon geometry
    from MuonConfig.MuonGeometryConfig import MuonGeoModelCfg
    result.merge(MuonGeoModelCfg(inputFlags))

    #setup magnetic field service
    from MagFieldServices.MagFieldServicesConfig import MagneticFieldSvcCfg
    result.merge(MagneticFieldSvcCfg(inputFlags))

    #hard-code MC conditions tag needed for my ESD file - must be a better way? how to auto-configure?
    iovDbSvc = result.getService("IOVDbSvc")
    iovDbSvc.GlobalTag = "OFLCOND-MC16-SDR-20"

    #Configure topocluster algorithmsm, and associated conditions
    from CaloRec.CaloTopoClusterConfig import CaloTopoClusterCfg
    result.merge(CaloTopoClusterCfg(inputFlags, doLCCalib=True))

    from CaloRec.CaloTopoClusterConfig import caloTopoCoolFolderCfg
    result.merge(caloTopoCoolFolderCfg(inputFlags))

    from CaloTools.CaloNoiseCondAlgConfig import CaloNoiseCondAlgCfg
    result.merge(CaloNoiseCondAlgCfg(inputFlags, "totalNoise"))
    result.merge(CaloNoiseCondAlgCfg(inputFlags, "electronicNoise"))

    #Cache the track extrapolations
    from TrackToCalo.CaloExtensionBuilderAlgCfg import getCaloExtenstionBuilderAlgorithm
    result.addEventAlgo(getCaloExtenstionBuilderAlgorithm(inputFlags))

    #Configure the pflow algorithms
    PFLeptonSelector = CompFactory.PFLeptonSelector
    result.addEventAlgo(PFLeptonSelector("PFLeptonSelector"))

    from eflowRec.PFCfg import getPFTrackSelectorAlgorithm
    result.addEventAlgo(
        getPFTrackSelectorAlgorithm(inputFlags, "PFTrackSelector"))

    result.addEventAlgo(getOfflinePFAlgorithm(inputFlags))

    from eflowRec.PFCfg import getChargedPFOCreatorAlgorithm, getNeutralPFOCreatorAlgorithm
    result.addEventAlgo(getChargedPFOCreatorAlgorithm(inputFlags, ""))
    result.addEventAlgo(getNeutralPFOCreatorAlgorithm(inputFlags, ""))

    return result
Beispiel #14
0
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
from AthenaCommon import Logging
from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
from AthenaConfiguration.ComponentFactory import CompFactory

if __name__=="__main__":
    # Setting needed for the ComponentAccumulator to do its thing
    from AthenaCommon.Configurable import Configurable
    Configurable.configurableRun3Behavior=True
    
    # Set message levels
    from AthenaCommon import Constants
    msgLvl = "WARNING"
    from AthenaCommon.Logging import log
    log.setLevel(msgLvl)
    
    # Config flags steer the job at various levels
    from AthenaConfiguration.AllConfigFlags import ConfigFlags
    ConfigFlags.Input.isMC  = True
    ConfigFlags.Input.Files = ["/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/ASG/mc16_13TeV.410501.PowhegPythia8EvtGen_A14_ttbar_hdamp258p75_nonallhad.merge.AOD.e5458_s3126_r9364_r9315/AOD.11182705._000001.pool.root.1"]
    
    # Flags relating to multithreaded execution
    nthreads=0
    ConfigFlags.Concurrency.NumThreads =nthreads
    if nthreads>0:
    	ConfigFlags.Concurrency.NumThreads = 1
    	ConfigFlags.Concurrency.NumConcurrentEvents = 1
    ConfigFlags.MET.UseTracks = True
    ConfigFlags.MET.DoPFlow = True
    if ConfigFlags.Beam.Type == 'cosmics' or ConfigFlags.Beam.Type == 'singlebeam':# used to have " or not rec.doInDet()" on the end
Beispiel #15
0
def AtlasExtrapolatorCfg(flags, name='AtlasExtrapolator'):
    result = ComponentAccumulator()

    acc = MagneticFieldSvcCfg(flags)
    result.merge(acc)

    # get the correct TrackingGeometry setup
    from TrkConfig.AtlasTrackingGeometrySvcConfig import TrackingGeometrySvcCfg
    acc = TrackingGeometrySvcCfg(flags)
    geom_svc = acc.getPrimary()
    result.merge(acc)

    # PROPAGATOR DEFAULTS --------------------------------------------------------------------------------------

    AtlasPropagators = []

    RkPropagator = CompFactory.Trk.RungeKuttaPropagator
    AtlasRungeKuttaPropagator = RkPropagator(name='AtlasRungeKuttaPropagator')
    result.addPublicTool(AtlasRungeKuttaPropagator)  #TODO remove one day

    AtlasPropagators += [AtlasRungeKuttaPropagator]

    STEP_Propagator = CompFactory.Trk.STEP_Propagator
    AtlasSTEP_Propagator = STEP_Propagator(name='AtlasSTEP_Propagator')
    result.addPublicTool(AtlasSTEP_Propagator)  #TODO remove one day

    AtlasPropagators += [AtlasSTEP_Propagator]

    # UPDATOR DEFAULTS -----------------------------------------------------------------------------------------

    AtlasUpdators = []

    MaterialEffectsUpdator = CompFactory.Trk.MaterialEffectsUpdator
    AtlasMaterialEffectsUpdator = MaterialEffectsUpdator(
        name='AtlasMaterialEffectsUpdator')
    result.addPublicTool(AtlasMaterialEffectsUpdator)  #TODO remove one day

    AtlasUpdators += [AtlasMaterialEffectsUpdator]

    AtlasMaterialEffectsUpdatorLandau = MaterialEffectsUpdator(
        name='AtlasMaterialEffectsUpdatorLandau')
    AtlasMaterialEffectsUpdatorLandau.LandauMode = True
    result.addPublicTool(
        AtlasMaterialEffectsUpdatorLandau)  #TODO remove one day

    AtlasUpdators += [AtlasMaterialEffectsUpdatorLandau]

    # the UNIQUE NAVIGATOR ( === UNIQUE GEOMETRY) --------------------------------------------------------------
    Trk__Navigator = CompFactory.Trk.Navigator
    AtlasNavigator = Trk__Navigator(name='AtlasNavigator')
    AtlasNavigator.TrackingGeometrySvc = geom_svc
    result.addPublicTool(AtlasNavigator)  #TODO remove one day

    # CONFIGURE PROPAGATORS/UPDATORS ACCORDING TO GEOMETRY SIGNATURE

    AtlasSubPropagators = []
    AtlasSubUpdators = []

    # -------------------- set it depending on the geometry ----------------------------------------------------
    # default for Global is (Rk,Mat)
    AtlasSubPropagators += [AtlasRungeKuttaPropagator.name]
    AtlasSubUpdators += [AtlasMaterialEffectsUpdator.name]

    # default for ID is (Rk,Mat)
    AtlasSubPropagators += [AtlasRungeKuttaPropagator.name]
    AtlasSubUpdators += [AtlasMaterialEffectsUpdator.name]

    # default for BeamPipe is (STEP,Mat)
    AtlasSubPropagators += [AtlasSTEP_Propagator.name]
    AtlasSubUpdators += [AtlasMaterialEffectsUpdator.name]

    # default for Calo is (STEP,Mat)
    AtlasSubPropagators += [AtlasSTEP_Propagator.name]
    AtlasSubUpdators += [AtlasMaterialEffectsUpdator.name]

    # default for MS is (STEP,Mat)
    AtlasSubPropagators += [AtlasSTEP_Propagator.name]
    AtlasSubUpdators += [AtlasMaterialEffectsUpdator.name]

    # default for Cavern is (Rk,Mat)
    AtlasSubPropagators += [AtlasRungeKuttaPropagator.name]
    AtlasSubUpdators += [AtlasMaterialEffectsUpdator.name]

    # ----------------------------------------------------------------------------------------------------------

    # call the base class constructor
    Extrapolator = Trk__Extrapolator(name,\
                               Navigator = AtlasNavigator,\
                               MaterialEffectsUpdators = AtlasUpdators,\
                               Propagators = AtlasPropagators,\
                               SubPropagators = AtlasSubPropagators,\
                               SubMEUpdators = AtlasSubUpdators
                               )

    result.setPrivateTools(Extrapolator)

    return result
Beispiel #16
0
def MooTrackBuilderCfg(flags, name="MooTrackBuilderTemplate", **kwargs):
    Muon__MooTrackBuilder = CompFactory.Muon.MooTrackBuilder
    Trk__STEP_Propagator = CompFactory.Trk.STEP_Propagator
    from MuonConfig.MuonRIO_OnTrackCreatorConfig import MdtDriftCircleOnTrackCreatorCfg, TriggerChamberClusterOnTrackCreatorCfg
    from MuonConfig.MuonRecToolsConfig import MuonTrackToSegmentToolCfg
    from MagFieldServices.MagFieldServicesConfig import MagneticFieldSvcCfg

    # Based on this: https://gitlab.cern.ch/atlas/athena/blob/release/22.0.3/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MooreTools.py#L221
    # ignoring all the name_prefix stuff for the moment, since I'm not sure it's necessary any more.
    result = MooTrackFitterCfg(flags)
    moo_track_fitter = result.getPrimary()
    result.addPublicTool(moo_track_fitter)
    kwargs.setdefault("Fitter", moo_track_fitter)

    # Now setup SL fitter (MooSLTrackFitter as defined here:
    # https://gitlab.cern.ch/atlas/athena/blob/release/22.0.3/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonRecExampleConfigDb.py#L203)
    acc = MCTBFitterCfg(flags, name='MCTBSLFitter', StraightLine=True)
    mctbslfitter = acc.getPrimary()
    result.addPublicTool(mctbslfitter)
    result.merge(acc)

    # Just take the default configuration, as per https://gitlab.cern.ch/atlas/athena/blob/release/22.0.3/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonRecExampleConfigDb.py#L56
    # FIXME - this should be updated once there is a proper CA implementation for the STEP_Propagator
    prop = Trk__STEP_Propagator(name='MuonStraightLinePropagator')
    result.addPublicTool(prop)

    # TODO - check why Fitter and FitterPreFit are identical
    acc = MooTrackFitterCfg(flags,
                            name="MooSLTrackFitter",
                            Fitter=mctbslfitter,
                            FitterPreFit=mctbslfitter,
                            Propagator=prop,
                            ReducedChi2Cut=10.0,
                            SLFit=True)
    moo_sl_track_fitter = acc.getPrimary()
    result.addPublicTool(moo_sl_track_fitter)
    result.merge(acc)

    kwargs.setdefault("SLFitter", moo_sl_track_fitter)
    kwargs.setdefault(
        "RecalibrateMDTHitsOnTrack",
        ((not flags.Muon.doSegmentT0Fit) and flags.Beam.Type == 'collisions'))

    acc = MuonSeededSegmentFinderCfg(flags)
    muon_seeded_segment_finder = acc.getPrimary()
    result.addPublicTool(muon_seeded_segment_finder)
    result.merge(acc)
    kwargs.setdefault("SeededSegmentFinder", muon_seeded_segment_finder)

    acc = MdtDriftCircleOnTrackCreatorCfg(flags)
    mdt_dcot_creator = acc.getPrimary()
    kwargs.setdefault("MdtRotCreator", mdt_dcot_creator)
    result.merge(acc)

    acc = TriggerChamberClusterOnTrackCreatorCfg(flags)
    muon_comp_cluster_creator = acc.getPrimary()
    kwargs.setdefault("CompetingClustersCreator", muon_comp_cluster_creator)
    result.merge(acc)

    acc = MuonSTEP_PropagatorCfg(flags)
    muon_prop = acc.getPrimary()
    kwargs.setdefault("Propagator", muon_prop)
    result.merge(acc)

    acc = MuonChamberHoleRecoveryToolCfg(flags)
    hole_recovery_tool = acc.getPrimary()
    result.addPublicTool(hole_recovery_tool)
    result.merge(acc)
    kwargs.setdefault("HitRecoveryTool", hole_recovery_tool)
    kwargs.setdefault("ChamberHoleRecoveryTool",
                      hole_recovery_tool)  # FIXME? Remove duplicate from cxx?

    acc = MagneticFieldSvcCfg(flags)
    result.merge(acc)

    acc = MuonTrackToSegmentToolCfg(flags)
    track_to_segment_tool = acc.getPrimary()
    kwargs.setdefault("TrackToSegmentTool", track_to_segment_tool)
    result.merge(acc)

    kwargs.setdefault("Printer", MuonEDMPrinterTool(flags))

    # FIXME - remove ErrorOptimisationTool from cxx?
    # declareProperty("ErrorOptimisationTool","" );

    acc = MuPatCandidateToolCfg(flags)
    cand_tool = acc.getPrimary()
    result.merge(acc)
    kwargs.setdefault("CandidateTool", cand_tool)

    acc = MooCandidateMatchingToolCfg(flags)
    track_segment_matching_tool = acc.getPrimary()
    result.merge(acc)
    kwargs.setdefault("CandidateMatchingTool", track_segment_matching_tool)

    from MuonConfig.MuonRecToolsConfig import MuonTrackSummaryToolCfg
    acc = MuonTrackSummaryToolCfg(flags)
    track_summary = acc.getPrimary()
    result.merge(acc)
    kwargs.setdefault("TrackSummaryTool", track_summary)

    builder = Muon__MooTrackBuilder(name, **kwargs)
    result.setPrivateTools(builder)
    return result
Beispiel #17
0
def TrackSummaryToolWorkaround(flags):
    from AthenaConfiguration.ComponentFactory import CompFactory
    from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
    result = ComponentAccumulator()
    ############################## WORKAROUND (START) ##########################
    ############################## TO RUN TRACKSUMMARYTOOL #####################

    # Taken from InnerDetector/InDetDigitization/PixelDigitization/python/PixelDigitizationConfigNew.py
    from PixelConditionsAlgorithms.PixelConditionsConfig import PixelConfigCondAlgCfg
    result.merge(
        PixelConfigCondAlgCfg(flags,
                              UseCalibConditions=True,
                              UseDeadmapConditions=True,
                              UseDCSStateConditions=False,
                              UseDCSStatusConditions=False,
                              UseDCSHVConditions=True,
                              UseDCSTemperatureConditions=True,
                              UseTDAQConditions=False))

    from PixelConditionsTools.PixelConditionsSummaryConfig import PixelConditionsSummaryCfg
    InDetPixelConditionsSummaryTool = result.popToolsAndMerge(
        PixelConditionsSummaryCfg(flags))

    # Taken from Tracking/TrkConfig/python/AtlasExtrapolatorConfig.py
    # AtlasExtrapolatorConfig can give only private extrapolator. We need public extrapolator.
    from TrkConfig.AtlasTrackingGeometrySvcConfig import TrackingGeometrySvcCfg
    trackGeomCfg = TrackingGeometrySvcCfg(flags)
    geom_svc = trackGeomCfg.getPrimary()
    geom_svc.GeometryBuilder.Compactify = False  ######## To avoid crash ########
    result.merge(trackGeomCfg)
    from MagFieldServices.MagFieldServicesConfig import MagneticFieldSvcCfg
    result.merge(MagneticFieldSvcCfg(flags))
    AtlasNavigator = CompFactory.Trk.Navigator(name='AtlasNavigator')
    AtlasNavigator.TrackingGeometrySvc = geom_svc
    result.addPublicTool(AtlasNavigator)

    # Taken from InnerDetector/InDetExample/InDetRecExample/share/InDetRecLoadTools.py
    InDetPropagator = CompFactory.Trk.RungeKuttaPropagator(
        name='InDetPropagator')
    InDetPropagator.AccuracyParameter = 0.0001
    InDetPropagator.MaxStraightLineStep = .004
    result.addPublicTool(InDetPropagator)
    InDetMaterialUpdator = CompFactory.Trk.MaterialEffectsUpdator(
        name="InDetMaterialEffectsUpdator")
    result.addPublicTool(InDetMaterialUpdator)
    InDetSubPropagators = []
    InDetSubUpdators = []
    # -------------------- set it depending on the geometry ----------------------------------------------------
    # default for ID is (Rk,Mat)
    InDetSubPropagators += [InDetPropagator.name]
    InDetSubUpdators += [InDetMaterialUpdator.name]
    # default for Calo is (Rk,MatLandau)
    InDetSubPropagators += [InDetPropagator.name]
    InDetSubUpdators += [InDetMaterialUpdator.name]
    # default for MS is (STEP,Mat)
    #InDetSubPropagators += [ InDetStepPropagator.name ]
    InDetSubUpdators += [InDetMaterialUpdator.name]
    #from TrkExTools.TrkExToolsConf import Trk__Extrapolator
    InDetExtrapolator = CompFactory.Trk.Extrapolator(
        name='InDetExtrapolator',
        Propagators=[InDetPropagator],
        MaterialEffectsUpdators=[InDetMaterialUpdator],
        Navigator=AtlasNavigator,
        SubPropagators=InDetSubPropagators,
        SubMEUpdators=InDetSubUpdators)
    result.addPublicTool(InDetExtrapolator)
    InDetTestPixelLayerTool = CompFactory.InDet.InDetTestPixelLayerTool(
        name="InDetTestPixelLayerTool",
        PixelSummaryTool=InDetPixelConditionsSummaryTool,
        CheckActiveAreas=True,
        CheckDeadRegions=True,
        CheckDisabledFEs=True)
    result.addPublicTool(InDetTestPixelLayerTool)
    InDetBoundaryCheckTool = CompFactory.InDet.InDetBoundaryCheckTool(
        name="InDetBoundaryCheckTool",
        UsePixel=flags.Detector.GeometryPixel,
        UseSCT=flags.Detector.GeometrySCT,
        PixelLayerTool=InDetTestPixelLayerTool)
    result.addPublicTool(InDetBoundaryCheckTool)
    InDetHoleSearchTool = CompFactory.InDet.InDetTrackHoleSearchTool(
        name="InDetHoleSearchTool",
        Extrapolator=InDetExtrapolator,
        CountDeadModulesAfterLastHit=True,
        BoundaryCheckTool=InDetBoundaryCheckTool)
    result.addPublicTool(InDetHoleSearchTool)
    InDetPrdAssociationTool = CompFactory.InDet.InDetPRD_AssociationToolGangedPixels(
        name="InDetPrdAssociationTool",
        PixelClusterAmbiguitiesMapName="PixelClusterAmbiguitiesMap",
        SetupCorrect=True,
        addTRToutliers=True)
    result.addPublicTool(InDetPrdAssociationTool)
    InDetTrackSummaryHelperTool = CompFactory.InDet.InDetTrackSummaryHelperTool(
        name="InDetSummaryHelper",
        AssoTool=InDetPrdAssociationTool,
        PixelToTPIDTool=None,
        TestBLayerTool=None,
        RunningTIDE_Ambi=True,
        DoSharedHits=False,
        HoleSearch=InDetHoleSearchTool,
        usePixel=flags.Detector.GeometryPixel,
        useSCT=flags.Detector.GeometrySCT,
        useTRT=flags.Detector.GeometryTRT)
    InDetTrackSummaryTool = CompFactory.Trk.TrackSummaryTool(
        name="InDetTrackSummaryTool",
        InDetSummaryHelperTool=InDetTrackSummaryHelperTool,
        doSharedHits=False,
        doHolesInDet=True,
        TRT_ElectronPidTool=None,
        TRT_ToT_dEdxTool=None,
        PixelToTPIDTool=None)
    result.setPrivateTools(InDetTrackSummaryTool)
    ############################## WORKAROUND (END) ############################

    # To run job only with ID
    if hasattr(flags, "Detector") and hasattr(
            flags.Detector, "GeometryMuon") and hasattr(
                flags.Detector, "GeometryID"):
        TrkEventCnvSuperTool = CompFactory.Trk.EventCnvSuperTool(
            name="EventCnvSuperTool",
            DoMuons=flags.Detector.GeometryMuon,
            DoID=flags.Detector.GeometryID)
        result.addPublicTool(TrkEventCnvSuperTool)

    return result
Beispiel #18
0
def PixelLorentzAngleCfg(flags, name="PixelSiLorentzAngleCondAlg", **kwargs):
    """Return configured ComponentAccumulator and tool for PixelLorentzAngle

    SiLorentzAngleTool may be provided in kwargs
    """
    acc = MagneticFieldSvcCfg(flags)
    tool = kwargs.get("SiLorentzAngleTool", PixelLorentzAngleTool(flags))
    acc.merge(PixelDCSCondHVAlgCfg(flags))
    acc.merge(PixelDCSCondTempAlgCfg(flags))
    acc.merge(PixelDCSCondStateAlgCfg(flags))
    acc.merge(PixelDCSCondStatusAlgCfg(flags))
    SiPropAcc = PixelSiPropertiesCfg(flags)
    kwargs.setdefault("SiPropertiesTool", SiPropAcc.popPrivateTools())
    acc.merge(SiPropAcc)
    kwargs.setdefault("UseMagFieldCache", tool.UseMagFieldCache)
    kwargs.setdefault("UseMagFieldDcs", not flags.Common.isOnline)
    acc.addCondAlgo(PixelSiLorentzAngleCondAlg(name, **kwargs))
    acc.setPrivateTools(tool)
    return acc
Beispiel #19
0
def SCTHitEffMonAlgConfig(inputFlags):
    '''Function to configures some algorithms in the monitoring system.'''
    ### STEP 1 ###
    # Define one top-level monitoring algorithm. The new configuration
    # framework uses a component accumulator.
    from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
    result = ComponentAccumulator()

    # The following class will make a sequence, configure algorithms, and link
    # them to GenericMonitoringTools
    from AthenaMonitoring import AthMonitorCfgHelper
    helper = AthMonitorCfgHelper(inputFlags, 'SCTHitEffMonCfg')

    ### STEP 2 ###
    # Adding an algorithm to the helper. Here, we will use the example
    # algorithm in the AthenaMonitoring package. Just pass the type to the
    # helper. Then, the helper will instantiate an instance and set up the
    # base class configuration following the inputFlags. The returned object
    # is the algorithm.
    from AthenaConfiguration.ComponentFactory import CompFactory
    myMonAlg = helper.addAlgorithm(CompFactory.SCTHitEffMonAlg,
                                   'SCTHitEffMonAlg')
    # # If for some really obscure reason you need to instantiate an algorithm
    # # yourself, the AddAlgorithm method will still configure the base
    # # properties and add the algorithm to the monitoring sequence.
    # helper.AddAlgorithm(myExistingAlg)

    ### STEP 3 ###
    # Edit properties of a algorithm
    myMonAlg.TriggerChain = ''

    from LumiBlockComps.BunchCrossingCondAlgConfig import BunchCrossingCondAlgCfg
    result.merge(BunchCrossingCondAlgCfg(inputFlags))

    from MagFieldServices.MagFieldServicesConfig import MagneticFieldSvcCfg
    result.merge(MagneticFieldSvcCfg(inputFlags))

    ### STEP 4 ###
    # Add some tools. N.B. Do not use your own trigger decion tool. Use the
    # standard one that is included with AthMonitorAlgorithm.

    # set up geometry / conditions
    from AtlasGeoModel.InDetGMConfig import InDetGeometryCfg
    result.merge(InDetGeometryCfg(inputFlags))

    # Add a generic monitoring tool (a "group" in old language). The returned
    # object here is the standard GenericMonitoringTool.

    from ROOT import SCT_Monitoring as sctMon

    myMonGroup = [
        helper.addGroup(myMonAlg, "SCTHitEffMonitorEC", "SCT/SCTEC/"),
        helper.addGroup(myMonAlg, "SCTHitEffMonitorB", "SCT/SCTB/"),
        helper.addGroup(myMonAlg, "SCTHitEffMonitorEA", "SCT/SCTEA/"),
        helper.addGroup(myMonAlg, "SCTHitEffMonitor", "SCT/GENERAL/")
    ]

    ### STEP 5 ###
    # Configure histograms

    # Conversion of ROOT.vector of ROOT.TString to list of str
    subDetName = []
    for i in range(len(sctMon.subDetName)):
        subDetName.append(sctMon.subDetName[i].Data())

    mapName = ["m_eff_", "eff_", "p_eff_"]
    ineffmapName = ["ineffm_", "ineff_", "ineffp_"]

    sumEff = ["summaryeffm", "summaryeff", "summaryeffp"]
    sumEffTitle = [
        "Summary Module Efficiency in Endcap C",
        "Summary Module Efficiency in Barrel",
        "Summary Module Efficiency in Endcap A"
    ]

    limit = [sctMon.N_DISKS * 2, sctMon.N_BARRELS * 2, sctMon.N_DISKS * 2]

    # GENERAL
    myMonGroup[sctMon.GENERAL_INDEX].defineHistogram(
        varname="isub, eff;" + "SctTotalEff",
        type="TProfile",
        title="SCT Total Efficiency",
        path="eff",
        xbins=sctMon.N_REGIONS,
        xmin=0.,
        xmax=sctMon.N_REGIONS,
        xlabels=subDetName)

    myMonGroup[sctMon.GENERAL_INDEX].defineHistogram(
        varname="isub, eff;" + "SctTotalEffBCID",
        type="TProfile",
        title="SCT Total Efficiency for First BCID",
        path="eff",
        xbins=sctMon.N_REGIONS,
        xmin=0.,
        xmax=sctMon.N_REGIONS,
        xlabels=subDetName,
        cutmask="isFirstBCID")

    myMonGroup[sctMon.GENERAL_INDEX].defineHistogram(
        varname="sideHash, eff;" + "effHashCode",
        type="TProfile",
        title="Efficiency vs module Hash code" +
        ";Module Hash Code;Efficiency",
        path="eff",
        xbins=sctMon.n_mod[sctMon.GENERAL_INDEX] * 2,
        xmin=-0.5,
        xmax=sctMon.n_mod[sctMon.GENERAL_INDEX] * 2 - 0.5)

    myMonGroup[sctMon.GENERAL_INDEX].defineHistogram(
        varname="LumiBlock, eff;" + "effLumiBlock",
        type="TProfile",
        title="Efficiency vs Luminosity block" + ";;Efficiency",
        path="eff",
        xbins=sctMon.NBINS_LBs,
        xmin=0.5,
        xmax=sctMon.NBINS_LBs + 0.5)

    ### This histogram should be filled by post processing ###
    # myMonGroup[sctMon.GENERAL_INDEX].defineHistogram(varname= "eff;" + "SctEffDistribution",
    #                                                  type= "TH1F",
    #                                                  title= "SCT Efficiency Distribution"+";Efficiency;Links",
    #                                                  path="eff",
    #                                                  xbins= 500,
    #                                                  xmin=0.,
    #                                                  xmax=1.)

    # SCTEC, SCTB, SCTEA
    for isub in range(sctMon.N_REGIONS):
        profileLabels = range(limit[isub])
        for k in range(limit[isub]):
            profileLabels[k] = dedicatedTitle(k, isub)
        # Efficiency
        myMonGroup[isub].defineHistogram(
            varname="layerPlusHalfSide, eff;" + sumEff[isub],
            type="TProfile",
            title=sumEffTitle[isub] + ";;Efficiency",
            path="eff",
            xbins=2 * sctMon.n_layers[isub],
            xmin=0.,
            xmax=sctMon.n_layers[isub],
            xlabels=profileLabels)
        # Efficiency for first BCIDs
        myMonGroup[isub].defineHistogram(
            varname="layerPlusHalfSide, eff;" + sumEff[isub] + "BCID",
            type="TProfile",
            title=sumEffTitle[isub] + " for First BC" + ";;Efficiency",
            path="eff",
            xbins=2 * sctMon.n_layers[isub],
            xmin=0.,
            xmax=sctMon.n_layers[isub],
            xlabels=profileLabels,
            cutmask="isFirstBCID")
        # Efficiency as a function of LB
        myMonGroup[isub].defineHistogram(
            varname="LumiBlock, eff;" +
            "effLumiBlock",  #different names for fill
            type="TProfile",
            title="Efficiency vs Luminosity block in " +
            sctMon.subDetName[isub] + ";Luminosity block" + ";Efficiency",
            path="eff",
            xbins=sctMon.NBINS_LBs,
            xmin=0.5,
            xmax=sctMon.NBINS_LBs + 0.5)

        # Disks for SCTEC and SCTEA and layers for SCTB
        for layer_disk in range(sctMon.n_layers[isub]):
            for side in range(2):
                etaPhiSuffix = "_" + str(layer_disk) + "_" + str(side)
                effName = mapName[isub] + str(layer_disk) + "_" + str(side)
                ineffName = ineffmapName[isub] + str(layer_disk) + "_" + str(
                    side)
                # Efficiency
                myMonGroup[isub].defineHistogram(
                    varname="ieta" + etaPhiSuffix + ",iphi" + etaPhiSuffix +
                    ",eff;" + effName,
                    type="TProfile2D",
                    title="Hit efficiency of" + sctMon.layerName[isub].Data() +
                    str(layer_disk) + " / side " + str(side) + " in " +
                    subDetName[isub] +
                    ";Index in the direction of #eta;Index in the direction of #phi",
                    path="eff",
                    xbins=sctMon.n_etabins[isub],
                    xmin=sctMon.f_etabin[isub] - .5,
                    xmax=sctMon.l_etabin[isub] + .5,
                    ybins=sctMon.n_phibins[isub],
                    ymin=sctMon.f_phibin[isub] - .5,
                    ymax=sctMon.l_phibin[isub] + .5)
                # Efficiency for first BCIDs
                myMonGroup[isub].defineHistogram(
                    varname="ieta" + etaPhiSuffix + ",iphi" + etaPhiSuffix +
                    ",eff;" + effName + "_bcid",
                    type="TProfile2D",
                    title="Hit efficiency of" + sctMon.layerName[isub].Data() +
                    str(layer_disk) + " / side " + str(side) + " in " +
                    subDetName[isub] + " for first BCID" +
                    ";Index in the direction of #eta;Index in the direction of #phi",
                    path="eff",
                    xbins=sctMon.n_etabins[isub],
                    xmin=sctMon.f_etabin[isub] - .5,
                    xmax=sctMon.l_etabin[isub] + .5,
                    ybins=sctMon.n_phibins[isub],
                    ymin=sctMon.f_phibin[isub] - .5,
                    ymax=sctMon.l_phibin[isub] + .5,
                    cutmask="isFirstBCID")
                # Inefficiency
                myMonGroup[isub].defineHistogram(
                    varname="ieta" + etaPhiSuffix + ",iphi" + etaPhiSuffix +
                    ",ineff;" + ineffName,
                    type="TProfile2D",
                    title="Hit inefficiency of" +
                    sctMon.layerName[isub].Data() + str(layer_disk) +
                    " / side " + str(side) + " in " + subDetName[isub] +
                    ";Index in the direction of #eta;Index in the direction of #phi",
                    path="eff",
                    xbins=sctMon.n_etabins[isub],
                    xmin=sctMon.f_etabin[isub] - .5,
                    xmax=sctMon.l_etabin[isub] + .5,
                    ybins=sctMon.n_phibins[isub],
                    ymin=sctMon.f_phibin[isub] - .5,
                    ymax=sctMon.l_phibin[isub] + .5)

    # Merge with result object and return
    result.merge(helper.result())
    return result