Пример #1
0
class egammaKeysDict:
  inputs = dict(
    Cluster  =      [ 'xAOD::CaloClusterContainer', 'LArClusterEM', '',''],
    TopoCluster =   [ 'xAOD::CaloClusterContainer', 'EMTopoCluster430', '','' ],
    TrackParticle = [ 'xAOD::TrackParticleContainer', '', '' ,'']
    )

  ShowerShapesSuppress = '-e033.-e011.-e333.-e335.-e337.-e377' 
  PhotonisemSupress = '.-isEMLoose.-isEMTight'
  ElectronisemSupress = '.-isEMLHLoose.-isEMLHTight.-isEMLHMedium.-isEMLoose.-isEMMultiLepton.-isEMMedium.-isEMTight'
  FwdElectronisemSupress = '-isEMTight.-isEMMedium.-isEMLoose'


  outputs = dict(
    Conversion =    [ 'xAOD::VertexContainer', 'GSFConversionVertices','-vxTrackAtVertex.' , ''],
    Cluster  =      [ 'xAOD::CaloClusterContainer', 'egammaClusters', '','' ],
    TopoSeededCluster  = [ 'xAOD::CaloClusterContainer', 'egammaTopoSeededClusters', '','-CellLink' ],
    Electron =      [ 'xAOD::ElectronContainer', 'Electrons', '',ShowerShapesSuppress+ElectronisemSupress ],
    EgammaRec =     [ 'egammaRecContainer', 'egammaRecCollection', '','' ],
    FwdElectron =   [ 'xAOD::ElectronContainer', 'ForwardElectrons', '',FwdElectronisemSupress ],
    FwdCluster  =   [ 'xAOD::CaloClusterContainer', 'ForwardElectronClusters','-SisterCluster','.-CellLink' ],
    Photon   =      [ 'xAOD::PhotonContainer', 'Photons', '',ShowerShapesSuppress+PhotonisemSupress ],
    TrackParticle = [ 'xAOD::TrackParticleContainer', 'GSFTrackParticles','-caloExtension.-cellAssociation.-perigeeExtrapEta.-perigeeExtrapPhi',''],
    Track         = [ 'TrackCollection', 'GSFTracks', '',''],
    Truth         = [ 'xAOD::TruthParticleContainer', 'egammaTruthParticles','-caloExtension','']
    )  
  #
  inputs['TrackParticle'][1] = InDetKeys.xAODTrackParticleContainer()
  #
  outputs['CellLink'] = ['CaloClusterCellLinkContainer', outputs['Cluster'][1] + '_links', '','']
  outputs['TopoSeededCellLink'] = ['CaloClusterCellLinkContainer', outputs['TopoSeededCluster'][1] + '_links', '','']
  outputs['FwdClusterCellLink'] = ['CaloClusterCellLinkContainer', outputs['FwdCluster'][1] + '_links', '','']
Пример #2
0
 def __init__(self, **kwargs):
     super(InDetPhysValDecoratorAlg.InDetPhysValDecoratorAlgDBM,self)\
                   .__init__(**_args( kwargs,
                                      name = self.__class__.__name__))
     # custom configuration below:
     from InDetRecExample.InDetKeys import InDetKeys
     self.TrackParticleContainerName = InDetKeys.DBMTrackParticles()
def toolNewJetFitterVxFinderFlip(name, useBTagFlagsDefaults = True, **options):
    """Sets up a NewJetFitterVxFinderFlip tool and returns it.

    The following options have BTaggingFlags defaults:

    OutputLevel                         default: BTaggingFlags.OutputLevel
    VxPrimaryContainer                  default: InDetKeys.PrimaryVertices()
    MaxNumDeleteIterations              default: 30
    VertexProbCut                       default: 0.001
    MaxClusteringIterations             default: 30
    VertexClusteringProbabilityCut      default: 0.005
    revertFromPositiveToNegativeTags    default: True

    input:             name: The name of the tool (should be unique).
      useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified.
                  **options: Python dictionary with options for the tool.
    output: The actual tool, which can then by added to ToolSvc via ToolSvc += output."""
    if useBTagFlagsDefaults:
        if not 'InDetKeys' in dir():
            from InDetRecExample.InDetKeys import InDetKeys
        defaults = { 'OutputLevel'                         : BTaggingFlags.OutputLevel,
                     'VxPrimaryContainer'                  : InDetKeys.PrimaryVertices(),
                     'MaxNumDeleteIterations'              : 30,
                     'VertexProbCut'                       : 0.001,
                     'MaxClusteringIterations'             : 30,
                     'VertexClusteringProbabilityCut'      : 0.005,
                     'revertFromPositiveToNegativeTags'    : True }
        for option in defaults:
            options.setdefault(option, defaults[option])
    options['name'] = name
    from InDetSecVxFinderTool.InDetSecVxFinderToolConf import InDet__InDetImprovedJetFitterVxFinder
    return InDet__InDetImprovedJetFitterVxFinder(**options)
Пример #4
0
def getInDetPhysValMonitoringToolDBM(**kwargs):
    from InDetRecExample.InDetKeys import InDetKeys
    kwargs = setDefaults(kwargs,
                         name='InDetPhysValMonitoringToolDBM',
                         SubFolder='DBM/',
                         TrackParticleContainerName=InDetKeys.DBMTracks(),
                         useTrackSelection=True)

    return getInDetPhysValMonitoringTool(**kwargs)
        def __init__(self, **kwargs):
            super(InDetPhysValMonitoringTool.InDetPhysValMonitoringToolDBM,self)\
                          .__init__(**_args( kwargs,
                                             name = self.__class__.__name__))

            # special parameters of the GSF InDetPhysValMonitoringTool
            from InDetRecExample.InDetKeys import InDetKeys
            self.TrackParticleContainerName = InDetKeys.DBMTracks()
            self.SubFolder = 'DBM/'
Пример #6
0
    def configure(self):
        mlog = logging.getLogger(
            'ThinInDetForwardTrackParticles.py::configure:')
        from InDetRecExample.InDetJobProperties import InDetFlags
        from InDetRecExample.InDetKeys import InDetKeys
        from RecExConfig.InputFilePeeker import inputFileSummary

        have_InDetForwardParticles = (
            inputFileSummary['eventdata_items']
            and any(InDetKeys.xAODForwardTrackParticleContainer() in elements
                    for elements in inputFileSummary['eventdata_items']))
        if not have_InDetForwardParticles and (
                not InDetFlags.doForwardTracks()
                or not InDetFlags.doParticleCreation()):
            mlog.error(
                "Not attempting to thin InDetForwardParticles, because the container %s does not seem to be available"
                % (InDetKeys.xAODForwardTrackParticleContainer()))
            return True

        mlog.info('entering')
        try:
            from ThinningUtils.ThinningUtilsConf import ThinInDetForwardTrackParticlesAlg
            theInDetFwdThinner = ThinInDetForwardTrackParticlesAlg(
                "ThinInDetForwardTrackParticlesAlg",
                ThinInDetForwardTrackParticles=True,
                StreamName='StreamAOD')
            print(theInDetFwdThinner)
        except Exception:
            import traceback
            mlog.error(
                "could not get handle to ThinInDetForwardTrackParticlesAlg")
            traceback.print_exc()
            return False
        mlog.info("now adding to topSequence")
        from AthenaCommon.AlgSequence import AlgSequence
        topSequence = AlgSequence()
        topSequence += theInDetFwdThinner
        return True
    def __init__(self,
                 InputCollections=None,
                 ResolvedTrackCollectionKey=None,
                 SiSPSeededTrackCollectionKey=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) and (
                NewTrackingCuts.mode() == "LowPt" or NewTrackingCuts.mode()
                == "VeryLowPt" or NewTrackingCuts.mode() == "LargeD0"
                or NewTrackingCuts.mode() == "LowPtLargeD0"
                or NewTrackingCuts.mode() == "DisplacedSoftPion"
                or NewTrackingCuts.mode() == "BeamGas"
                or NewTrackingCuts.mode() == "ForwardTracks"
                or NewTrackingCuts.mode() == "ForwardSLHCTracks"
                or NewTrackingCuts.mode() == "PixelPrdAssociation"
                or NewTrackingCuts.mode() == "VeryForwardSLHCTracks"
                or NewTrackingCuts.mode() == "SLHCConversionFinding"):
            usePrdAssociationTool = True
        else:
            usePrdAssociationTool = False

        #
        # --- get list of already associated hits (always do this, even if no other tracking ran before)
        #
        if usePrdAssociationTool:
            from InDetTrackPRD_Association.InDetTrackPRD_AssociationConf import InDet__InDetTrackPRD_Association
            InDetPRD_Association = InDet__InDetTrackPRD_Association(
                name='InDetPRD_Association' + NewTrackingCuts.extension(),
                AssociationTool=InDetPrdAssociationTool,
                TracksName=list(InputCollections))
            topSequence += InDetPRD_Association
            if (InDetFlags.doPrintConfigurables()):
                print InDetPRD_Association

        # ------------------------------------------------------------
        #
        # ----------- SiSPSeededTrackFinder
        #
        # ------------------------------------------------------------

        if InDetFlags.doSiSPSeededTrackFinder():
            #
            # --- Space points seeds maker, use different ones for cosmics and collisions
            #
            if NewTrackingCuts.mode() == "DBM":
                from SiSpacePointsSeedTool_xk.SiSpacePointsSeedTool_xkConf import InDet__SiSpacePointsSeedMaker_ATLxk as SiSpacePointsSeedMaker
            elif InDetFlags.doCosmics():
                from SiSpacePointsSeedTool_xk.SiSpacePointsSeedTool_xkConf import InDet__SiSpacePointsSeedMaker_Cosmic as SiSpacePointsSeedMaker
            elif InDetFlags.doHeavyIon():
                from SiSpacePointsSeedTool_xk.SiSpacePointsSeedTool_xkConf import InDet__SiSpacePointsSeedMaker_HeavyIon as SiSpacePointsSeedMaker
            elif NewTrackingCuts.mode() == "LowPt" or NewTrackingCuts.mode(
            ) == "VeryLowPt" or (NewTrackingCuts.mode() == "Pixel"
                                 and InDetFlags.doMinBias()):
                from SiSpacePointsSeedTool_xk.SiSpacePointsSeedTool_xkConf import InDet__SiSpacePointsSeedMaker_LowMomentum as SiSpacePointsSeedMaker
            elif NewTrackingCuts.mode() == "BeamGas":
                from SiSpacePointsSeedTool_xk.SiSpacePointsSeedTool_xkConf import InDet__SiSpacePointsSeedMaker_BeamGas as SiSpacePointsSeedMaker
            elif NewTrackingCuts.mode() == "SLHC" or NewTrackingCuts.mode(
            ) == "ForwardSLHCTracks" or NewTrackingCuts.mode(
            ) == "VeryForwardSLHCTracks":
                from SiSpacePointsSeedTool_xk.SiSpacePointsSeedTool_xkConf import InDet__SiSpacePointsSeedMaker_ITK as SiSpacePointsSeedMaker
            elif NewTrackingCuts.mode() == "DisplacedSoftPion":
                from SiSpacePointsSeedTool_xk.SiSpacePointsSeedTool_xkConf import InDet__SiSpacePointsSeedMaker_TrkSeeded as SiSpacePointsSeedMaker
            else:
                from SiSpacePointsSeedTool_xk.SiSpacePointsSeedTool_xkConf import InDet__SiSpacePointsSeedMaker_ATLxk as SiSpacePointsSeedMaker

            InDetSiSpacePointsSeedMaker = SiSpacePointsSeedMaker(
                name="InDetSpSeedsMaker" + NewTrackingCuts.extension(),
                pTmin=NewTrackingCuts.minPT(),
                maxdImpact=NewTrackingCuts.maxPrimaryImpact(),
                maxZ=NewTrackingCuts.maxZImpact(),
                minZ=-NewTrackingCuts.maxZImpact(),
                usePixel=NewTrackingCuts.usePixel(),
                SpacePointsPixelName=InDetKeys.PixelSpacePoints(),
                # useSCT                 = NewTrackingCuts.useSCT(),
                useSCT=(NewTrackingCuts.useSCT()
                        and NewTrackingCuts.useSCTSeeding()),
                SpacePointsSCTName=InDetKeys.SCT_SpacePoints(),
                # useOverlapSpCollection = NewTrackingCuts.useSCT(),
                useOverlapSpCollection=(NewTrackingCuts.useSCT()
                                        and NewTrackingCuts.useSCTSeeding()),
                SpacePointsOverlapName=InDetKeys.OverlapSpacePoints(),
                radMax=NewTrackingCuts.radMax(),
                RapidityCut=NewTrackingCuts.maxEta())

            if NewTrackingCuts.mode() == "Offline" or InDetFlags.doHeavyIon(
            ) or NewTrackingCuts.mode() == "ForwardTracks":
                InDetSiSpacePointsSeedMaker.maxdImpactPPS = NewTrackingCuts.maxdImpactPPSSeeds(
                )
                InDetSiSpacePointsSeedMaker.maxdImpactSSS = NewTrackingCuts.maxdImpactSSSSeeds(
                )
            if usePrdAssociationTool:
                # not all classes have that property !!!
                InDetSiSpacePointsSeedMaker.UseAssociationTool = True
                InDetSiSpacePointsSeedMaker.AssociationTool = InDetPrdAssociationTool
            if not InDetFlags.doCosmics():
                InDetSiSpacePointsSeedMaker.maxRadius1 = 0.75 * NewTrackingCuts.radMax(
                )
                InDetSiSpacePointsSeedMaker.maxRadius2 = NewTrackingCuts.radMax(
                )
                InDetSiSpacePointsSeedMaker.maxRadius3 = NewTrackingCuts.radMax(
                )
            if NewTrackingCuts.mode() == "LowPt" or NewTrackingCuts.mode(
            ) == "VeryLowPt" or (NewTrackingCuts.mode() == "Pixel"
                                 and InDetFlags.doMinBias()):
                try:
                    InDetSiSpacePointsSeedMaker.pTmax = NewTrackingCuts.maxPT()
                except:
                    pass
                InDetSiSpacePointsSeedMaker.mindRadius = 4.0
            if NewTrackingCuts.mode() == "SLHC" or NewTrackingCuts.mode(
            ) == "SLHCConversionFinding":
                InDetSiSpacePointsSeedMaker.minRadius1 = 0
                InDetSiSpacePointsSeedMaker.minRadius2 = 0
                InDetSiSpacePointsSeedMaker.minRadius3 = 0
                InDetSiSpacePointsSeedMaker.maxRadius1 = 1000. * Units.mm
                InDetSiSpacePointsSeedMaker.maxRadius2 = 1000. * Units.mm
                InDetSiSpacePointsSeedMaker.maxRadius3 = 1000. * Units.mm
            if NewTrackingCuts.mode(
            ) == "ForwardTracks" or NewTrackingCuts.mode(
            ) == "ForwardSLHCTracks" or NewTrackingCuts.mode(
            ) == "VeryForwardSLHCTracks":
                InDetSiSpacePointsSeedMaker.checkEta = True
                InDetSiSpacePointsSeedMaker.etaMin = NewTrackingCuts.minEta()
                InDetSiSpacePointsSeedMaker.etaMax = NewTrackingCuts.maxEta()
                InDetSiSpacePointsSeedMaker.RapidityCut = NewTrackingCuts.maxEta(
                )
            if NewTrackingCuts.mode() == "DBM":
                InDetSiSpacePointsSeedMaker.etaMin = NewTrackingCuts.minEta()
                InDetSiSpacePointsSeedMaker.etaMax = NewTrackingCuts.maxEta()
                InDetSiSpacePointsSeedMaker.useDBM = True
            if NewTrackingCuts.mode() == "PixelThreeLayer":
                InDetSiSpacePointsSeedMaker.SkipIBLcut = True
            if NewTrackingCuts.mode() == "DisplacedSoftPion":
                InDetSiSpacePointsSeedMaker.maxSeedsForSpacePoint = 50
                InDetSiSpacePointsSeedMaker.DeltaThetaRoISP = 0.8
                InDetSiSpacePointsSeedMaker.DeltaPhiRoISP = 0.8
                InDetSiSpacePointsSeedMaker.RoISeedTool = RoISeedTool

            #InDetSiSpacePointsSeedMaker.OutputLevel = VERBOSE
            ToolSvc += InDetSiSpacePointsSeedMaker
            if (InDetFlags.doPrintConfigurables()):
                print InDetSiSpacePointsSeedMaker

            #
            # --- Z-coordinates primary vertices finder (only for collisions)
            #
            if InDetFlags.useZvertexTool() and NewTrackingCuts.mode() != "DBM":
                from SiZvertexTool_xk.SiZvertexTool_xkConf import InDet__SiZvertexMaker_xk
                InDetZvertexMaker = InDet__SiZvertexMaker_xk(
                    name='InDetZvertexMaker' + NewTrackingCuts.extension(),
                    Zmax=NewTrackingCuts.maxZImpact(),
                    Zmin=-NewTrackingCuts.maxZImpact(),
                    minRatio=0.17)  # not default
                InDetZvertexMaker.SeedMakerTool = InDetSiSpacePointsSeedMaker

                if InDetFlags.doHeavyIon():
                    InDetZvertexMaker.HistSize = 2000
                    ###InDetZvertexMaker.minContent = 200
                    InDetZvertexMaker.minContent = 30

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

            else:
                InDetZvertexMaker = None

            #
            # --- SCT and Pixel detector elements road builder
            #
            from SiDetElementsRoadTool_xk.SiDetElementsRoadTool_xkConf import InDet__SiDetElementsRoadMaker_xk
            InDetSiDetElementsRoadMaker = InDet__SiDetElementsRoadMaker_xk(
                name='InDetSiRoadMaker' + NewTrackingCuts.extension(),
                PropagatorTool=InDetPatternPropagator,
                usePixel=NewTrackingCuts.usePixel(),
                PixManagerLocation=InDetKeys.PixelManager(),
                useSCT=NewTrackingCuts.useSCT(),
                SCTManagerLocation=InDetKeys.SCT_Manager(),
                RoadWidth=NewTrackingCuts.RoadWidth())
            #InDetSiDetElementsRoadMaker.OutputLevel = VERBOSE
            ToolSvc += InDetSiDetElementsRoadMaker
            if (InDetFlags.doPrintConfigurables()):
                print InDetSiDetElementsRoadMaker

            #
            # --- Local track finding using sdCaloSeededSSSpace point seed
            #

            useBremMode = NewTrackingCuts.mode(
            ) == "Offline" or NewTrackingCuts.mode(
            ) == "SLHC" or NewTrackingCuts.mode() == "DBM"
            from SiTrackMakerTool_xk.SiTrackMakerTool_xkConf import InDet__SiTrackMaker_xk as SiTrackMaker
            InDetSiTrackMaker = SiTrackMaker(
                name='InDetSiTrackMaker' + NewTrackingCuts.extension(),
                useSCT=NewTrackingCuts.useSCT(),
                usePixel=NewTrackingCuts.usePixel(),
                RoadTool=InDetSiDetElementsRoadMaker,
                CombinatorialTrackFinder=InDetSiComTrackFinder,
                pTmin=NewTrackingCuts.minPT(),
                pTminBrem=NewTrackingCuts.minPTBrem(),
                pTminSSS=InDetFlags.pT_SSScut(),
                nClustersMin=NewTrackingCuts.minClusters(),
                nHolesMax=NewTrackingCuts.nHolesMax(),
                nHolesGapMax=NewTrackingCuts.nHolesGapMax(),
                SeedsFilterLevel=NewTrackingCuts.seedFilterLevel(),
                Xi2max=NewTrackingCuts.Xi2max(),
                Xi2maxNoAdd=NewTrackingCuts.Xi2maxNoAdd(),
                nWeightedClustersMin=NewTrackingCuts.nWeightedClustersMin(),
                CosmicTrack=InDetFlags.doCosmics(),
                Xi2maxMultiTracks=NewTrackingCuts.Xi2max(),  # was 3.
                useSSSseedsFilter=InDetFlags.doSSSfilter(),
                doMultiTracksProd=True,
                useBremModel=InDetFlags.doBremRecovery() and
                useBremMode,  # only for NewTracking the brem is debugged !!!
                doCaloSeededBrem=InDetFlags.doCaloSeededBrem(),
                doHadCaloSeedSSS=InDetFlags.doHadCaloSeededSSS(),
                phiWidth=NewTrackingCuts.phiWidthBrem(),
                etaWidth=NewTrackingCuts.etaWidthBrem(),
                InputClusterContainerName=InDetKeys.CaloClusterROIContainer(
                ),  # "InDetCaloClusterROIs" 
                InputHadClusterContainerName=InDetKeys.
                HadCaloClusterROIContainer(),  # "InDetCaloClusterROIs" 
                UseAssociationTool=usePrdAssociationTool)

            if NewTrackingCuts.mode() == "SLHC" or NewTrackingCuts.mode(
            ) == "ForwardSLHCTracks" or NewTrackingCuts.mode(
            ) == "VeryForwardSLHCTracks":
                InDetSiTrackMaker.ITKGeometry = True

            if NewTrackingCuts.mode() == "DBM":
                InDetSiTrackMaker.MagneticFieldMode = "NoField"
                InDetSiTrackMaker.useBremModel = False
                InDetSiTrackMaker.doMultiTracksProd = False
                InDetSiTrackMaker.TrackPatternRecoInfo = 'SiSPSeededFinder'
                InDetSiTrackMaker.pTminSSS = -1
                InDetSiTrackMaker.CosmicTrack = False
                InDetSiTrackMaker.useSSSseedsFilter = False
                InDetSiTrackMaker.doCaloSeededBrem = False
                InDetSiTrackMaker.doHadCaloSeedSSS = False
                InDetSiTrackMaker.UseAssociationTool = False

            elif InDetFlags.doCosmics():
                InDetSiTrackMaker.TrackPatternRecoInfo = 'SiSpacePointsSeedMaker_Cosmic'

            elif InDetFlags.doHeavyIon():
                InDetSiTrackMaker.TrackPatternRecoInfo = 'SiSpacePointsSeedMaker_HeavyIon'

            elif NewTrackingCuts.mode() == "LowPt":
                InDetSiTrackMaker.TrackPatternRecoInfo = 'SiSpacePointsSeedMaker_LowMomentum'

            elif NewTrackingCuts.mode() == "VeryLowPt" or (
                    NewTrackingCuts.mode() == "Pixel"
                    and InDetFlags.doMinBias()):
                InDetSiTrackMaker.TrackPatternRecoInfo = 'SiSpacePointsSeedMaker_VeryLowMomentum'

            elif NewTrackingCuts.mode() == "BeamGas":
                InDetSiTrackMaker.TrackPatternRecoInfo = 'SiSpacePointsSeedMaker_BeamGas'

            elif NewTrackingCuts.mode() == "ForwardTracks":
                InDetSiTrackMaker.TrackPatternRecoInfo = 'SiSpacePointsSeedMaker_ForwardTracks'

            elif NewTrackingCuts.mode() == "ForwardSLHCTracks":
                InDetSiTrackMaker.TrackPatternRecoInfo = 'SiSpacePointsSeedMaker_ForwardSLHCTracks'

            elif NewTrackingCuts.mode() == "VeryForwardSLHCTracks":
                InDetSiTrackMaker.TrackPatternRecoInfo = 'SiSpacePointsSeedMaker_VeryForwardSLHCTracks'

            elif NewTrackingCuts.mode() == "SLHCConversionFinding":
                InDetSiTrackMaker.TrackPatternRecoInfo = 'SiSpacePointsSeedMaker_SLHCConversionTracks'

            elif NewTrackingCuts.mode() == "LargeD0" or NewTrackingCuts.mode(
            ) == "LowPtLargeD0" or NewTrackingCuts.mode(
            ) == "DisplacedSoftPion":
                InDetSiTrackMaker.TrackPatternRecoInfo = 'SiSpacePointsSeedMaker_LargeD0'

            elif NewTrackingCuts.mode() == "PixelThreeLayer":
                InDetSiTrackMaker.CombinatorialTrackFinder = InDetSiComTrackFinderThreeLayerTracking

            else:
                InDetSiTrackMaker.TrackPatternRecoInfo = 'SiSPSeededFinder'

            if InDetFlags.doStoreTrackSeeds():
                InDetSiTrackMaker.SeedSegmentsWrite = True
                InDetSiTrackMaker.SeedToTrackConversion = InDet_SeedToTrackConversion
            #InDetSiTrackMaker.OutputLevel = VERBOSE
            ToolSvc += InDetSiTrackMaker
            if (InDetFlags.doPrintConfigurables()):
                print InDetSiTrackMaker
            #
            # set output track collection name
        #
            self.__SiTrackCollection = SiSPSeededTrackCollectionKey
            #
            # --- Setup Track finder using space points seeds
            #

            from SiSPSeededTrackFinder.SiSPSeededTrackFinderConf import InDet__SiSPSeededTrackFinder

            if NewTrackingCuts.mode(
            ) == "ForwardSLHCTracks" or NewTrackingCuts.mode(
            ) == "ForwardTracks":

                InDetSiSPSeededTrackFinder = InDet__SiSPSeededTrackFinder(
                    name='InDetSiSpTrackFinder' + NewTrackingCuts.extension(),
                    TrackTool=InDetSiTrackMaker,
                    TracksLocation=self.__SiTrackCollection,
                    SeedsTool=InDetSiSpacePointsSeedMaker,
                    useZvertexTool=InDetFlags.useZvertexTool(),
                    ZvertexTool=InDetZvertexMaker,
                    useNewStrategy=False,
                    useMBTSTimeDiff=InDetFlags.useMBTSTimeDiff(),
                    useZBoundFinding=False)
                if InDetFlags.doHeavyIon():
                    InDetSiSPSeededTrackFinder.FreeClustersCut = 2  #Heavy Ion optimization from Igor

            else:
                InDetSiSPSeededTrackFinder = InDet__SiSPSeededTrackFinder(
                    name='InDetSiSpTrackFinder' + NewTrackingCuts.extension(),
                    TrackTool=InDetSiTrackMaker,
                    TracksLocation=self.__SiTrackCollection,
                    SeedsTool=InDetSiSpacePointsSeedMaker,
                    useZvertexTool=InDetFlags.useZvertexTool()
                    and NewTrackingCuts.mode() != "DBM",
                    ZvertexTool=InDetZvertexMaker,
                    useNewStrategy=InDetFlags.useNewSiSPSeededTF()
                    and NewTrackingCuts.mode() != "DBM",
                    useMBTSTimeDiff=InDetFlags.useMBTSTimeDiff(),
                    useZBoundFinding=NewTrackingCuts.doZBoundary()
                    and NewTrackingCuts.mode() != "DBM")

                if InDetFlags.doHeavyIon():
                    InDetSiSPSeededTrackFinder.FreeClustersCut = 2  #Heavy Ion optimization from Igor

            #InDetSiSPSeededTrackFinder.OutputLevel =VERBOSE
            topSequence += InDetSiSPSeededTrackFinder
            if (InDetFlags.doPrintConfigurables()):
                print InDetSiSPSeededTrackFinder

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

        # ------------------------------------------------------------
        #
        # ---------- Ambiguity solving
        #
        # ------------------------------------------------------------

        if InDetFlags.doAmbiSolving():
            #
            # --- load InnerDetector TrackSelectionTool
            #

            prob1 = InDetFlags.pixelClusterSplitProb1()
            prob2 = InDetFlags.pixelClusterSplitProb2()
            nhitsToAllowSplitting = 9

            if geoFlags.Run() == 1:
                prob1 = InDetFlags.pixelClusterSplitProb1_run1()
                prob2 = InDetFlags.pixelClusterSplitProb2_run1()
                nhitsToAllowSplitting = 8

            if InDetFlags.doTIDE_Ambi() and not (
                    NewTrackingCuts.mode() == "ForwardSLHCTracks"
                    or NewTrackingCuts.mode() == "ForwardTracks"
                    or NewTrackingCuts.mode() == "DBM"):
                from InDetAmbiTrackSelectionTool.InDetAmbiTrackSelectionToolConf import InDet__InDetDenseEnvAmbiTrackSelectionTool as AmbiTrackSelectionTool
            else:
                from InDetAmbiTrackSelectionTool.InDetAmbiTrackSelectionToolConf import InDet__InDetAmbiTrackSelectionTool as AmbiTrackSelectionTool
            InDetAmbiTrackSelectionTool = AmbiTrackSelectionTool(
                name='InDetAmbiTrackSelectionTool' +
                NewTrackingCuts.extension(),
                AssociationTool=InDetPrdAssociationTool,
                DriftCircleCutTool=InDetTRTDriftCircleCut,
                minHits=NewTrackingCuts.minClusters(),
                minNotShared=NewTrackingCuts.minSiNotShared(),
                maxShared=NewTrackingCuts.maxShared(),
                minTRTHits=0,  # used for Si only tracking !!!
                sharedProbCut=0.10,
                UseParameterization=False,
                Cosmics=InDetFlags.doCosmics(),
                doPixelSplitting=InDetFlags.doPixelClusterSplitting()
                and NewTrackingCuts.mode != "DBM")
            if InDetFlags.doTIDE_Ambi() and not (
                    NewTrackingCuts.mode() == "ForwardSLHCTracks"
                    or NewTrackingCuts.mode() == "ForwardTracks"
                    or NewTrackingCuts.mode() == "DBM"):
                InDetAmbiTrackSelectionTool.sharedProbCut = prob1
                InDetAmbiTrackSelectionTool.sharedProbCut2 = prob2
                InDetAmbiTrackSelectionTool.minSiHitsToAllowSplitting = nhitsToAllowSplitting
                InDetAmbiTrackSelectionTool.minUniqueSCTHits = 4
                InDetAmbiTrackSelectionTool.minTrackChi2ForSharedHits = 3
                InDetAmbiTrackSelectionTool.InputHadClusterContainerName = InDetKeys.HadCaloClusterROIContainer(
                )
                InDetAmbiTrackSelectionTool.doHadCaloSeed = False  #Only split in cluster in region of interest
                InDetAmbiTrackSelectionTool.minPtSplit = InDetFlags.pixelClusterSplitMinPt(
                )  #Only allow split clusters on track withe pt greater than this MeV
                InDetAmbiTrackSelectionTool.phiWidth = 0.2  #Split cluster ROI size
                InDetAmbiTrackSelectionTool.etaWidth = 0.2  #Split cluster ROI size
                InDetAmbiTrackSelectionTool.InputEmClusterContainerName = InDetKeys.CaloClusterROIContainer(
                )
                InDetAmbiTrackSelectionTool.doEmCaloSeed = False  #Only split in cluster in region of interest
                InDetAmbiTrackSelectionTool.minPtConv = 10000  #Only allow split clusters on track withe pt greater than this MeV
                InDetAmbiTrackSelectionTool.phiWidthEM = 0.05  #Split cluster ROI size
                InDetAmbiTrackSelectionTool.etaWidthEM = 0.05  #Split cluster ROI size

            if NewTrackingCuts.mode() == "DBM":
                InDetAmbiTrackSelectionTool.Cosmics = False
                InDetAmbiTrackSelectionTool.UseParameterization = False
                InDetAmbiTrackSelectionTool.doPixelSplitting = False
                InDetAmbiTrackSelectionTool.maxShared = 1000
                InDetAmbiTrackSelectionTool.maxTracksPerSharedPRD = 2
                InDetAmbiTrackSelectionTool.minHits = 0
                InDetAmbiTrackSelectionTool.minNotShared = 0
                InDetAmbiTrackSelectionTool.minScoreShareTracks = 0.0
                InDetAmbiTrackSelectionTool.minTRTHits = 0
                InDetAmbiTrackSelectionTool.sharedProbCut = 0.1
            if InDetFlags.doTIDE_AmbiTrackMonitoring(
            ) and InDetFlags.doTIDE_Ambi() and not (
                    NewTrackingCuts.mode() == "ForwardSLHCTracks"
                    or NewTrackingCuts.mode() == "ForwardTracks"
                    or NewTrackingCuts.mode() == "PixelPrdAssociation"
                    or NewTrackingCuts.mode() == "DBM"
                    or NewTrackingCuts.mode() == "PixelFourLayer"
                    or NewTrackingCuts.mode() == "PixelThreeLayer"):
                InDetAmbiTrackSelectionTool.ObserverTool = TrackObserverTool  #observerTool
                InDetAmbiTrackSelectionTool.MonitorAmbiguitySolving = True

            # if NewTrackingCuts.mode() == "ForwardTracks":
            #    InDetAmbiTrackSelectionTool.OutputLevel = VERBOSE

            ToolSvc += InDetAmbiTrackSelectionTool
            if (InDetFlags.doPrintConfigurables()):
                print InDetAmbiTrackSelectionTool
            #
            # --- set up different Scoring Tool for collisions and cosmics
            #
            if InDetFlags.doCosmics() and NewTrackingCuts.mode() != "DBM":
                from InDetTrackScoringTools.InDetTrackScoringToolsConf import InDet__InDetCosmicScoringTool
                InDetAmbiScoringTool = InDet__InDetCosmicScoringTool(
                    name='InDetCosmicsScoringTool' +
                    NewTrackingCuts.extension(),
                    nWeightedClustersMin=NewTrackingCuts.nWeightedClustersMin(
                    ),
                    minTRTHits=0,
                    SummaryTool=InDetTrackSummaryTool)
            else:
                from InDetTrackScoringTools.InDetTrackScoringToolsConf import InDet__InDetAmbiScoringTool
                InDetAmbiScoringTool = InDet__InDetAmbiScoringTool(
                    name='InDetAmbiScoringTool' + NewTrackingCuts.extension(),
                    Extrapolator=InDetExtrapolator,
                    SummaryTool=InDetTrackSummaryTool,
                    DriftCircleCutTool=InDetTRTDriftCircleCut,
                    useAmbigFcn=True,  # this is NewTracking
                    useTRT_AmbigFcn=False,
                    minPt=NewTrackingCuts.minPT(),
                    maxRPhiImp=NewTrackingCuts.maxPrimaryImpact(),
                    maxZImp=NewTrackingCuts.maxZImpact(),
                    maxEta=NewTrackingCuts.maxEta(),
                    minSiClusters=NewTrackingCuts.minClusters(),
                    minPixel=NewTrackingCuts.minPixel(),
                    maxSiHoles=NewTrackingCuts.maxHoles(),
                    maxPixelHoles=NewTrackingCuts.maxPixelHoles(),
                    maxSCTHoles=NewTrackingCuts.maxSCTHoles(),
                    maxDoubleHoles=NewTrackingCuts.maxDoubleHoles(),
                    usePixel=NewTrackingCuts.usePixel(),
                    useSCT=NewTrackingCuts.useSCT(),
                    InputEmClusterContainerName=InDetKeys.
                    CaloClusterROIContainer(),
                    doEmCaloSeed=True and InDetFlags.doCaloSeededBrem(),
                    minTRTonTrk=0,
                    minTRTPrecisionFraction=0)
                # allow for some overlap for low-pt tracking
                #if InDetFlags.doLowPt() and not NewTrackingCuts.mode() == "LowPt":
                #   InDetAmbiScoringTool.minPt = NewTrackingCuts.minPT()-100.*Units.MeV

            # if NewTrackingCuts.mode() == "ForwardTracks":
            #   InDetAmbiScoringTool.OutputLevel = VERBOSE

            ToolSvc += InDetAmbiScoringTool
            if (InDetFlags.doPrintConfigurables()):
                print InDetAmbiScoringTool
            #
            # --- load Ambiguity Processor
            #
            useBremMode = NewTrackingCuts.mode(
            ) == "Offline" or NewTrackingCuts.mode() == "SLHC"

            if InDetFlags.doTIDE_Ambi() and not (
                    NewTrackingCuts.mode() == "ForwardSLHCTracks"
                    or NewTrackingCuts.mode() == "ForwardTracks"
                    or NewTrackingCuts.mode() == "DBM"):
                from TrkAmbiguityProcessor.TrkAmbiguityProcessorConf import Trk__DenseEnvironmentsAmbiguityProcessorTool as ProcessorTool
                use_low_pt_fitter = True if NewTrackingCuts.mode(
                ) == "LowPt" or NewTrackingCuts.mode() == "VeryLowPt" or (
                    NewTrackingCuts.mode() == "Pixel"
                    and InDetFlags.doMinBias()) else False
                fitter_list = [(InDetTrackFitter if not use_low_pt_fitter else
                                InDetTrackFitterLowPt)]
                if InDetFlags.doRefitInvalidCov():
                    from AthenaCommon import CfgGetter
                    fitter_list.append(CfgGetter.getPublicTool('KalmanFitter'))
                    fitter_list.append(
                        CfgGetter.getPublicTool('ReferenceKalmanFitter'))

                InDetAmbiguityProcessor = ProcessorTool(
                    name='InDetAmbiguityProcessor' +
                    NewTrackingCuts.extension(),
                    Fitter=fitter_list,
                    ScoringTool=InDetAmbiScoringTool,
                    SelectionTool=InDetAmbiTrackSelectionTool,
                    SuppressHoleSearch=False,
                    tryBremFit=InDetFlags.doBremRecovery() and useBremMode
                    and NewTrackingCuts.mode() != "DBM",
                    caloSeededBrem=InDetFlags.doCaloSeededBrem()
                    and NewTrackingCuts.mode() != "DBM",
                    pTminBrem=NewTrackingCuts.minPTBrem(),
                    RefitPrds=True,
                    RejectTracksWithInvalidCov=InDetFlags.doRejectInvalidCov())
            else:
                from TrkAmbiguityProcessor.TrkAmbiguityProcessorConf import Trk__SimpleAmbiguityProcessorTool as ProcessorTool
                InDetAmbiguityProcessor = ProcessorTool(
                    name='InDetAmbiguityProcessor' +
                    NewTrackingCuts.extension(),
                    Fitter=InDetTrackFitter,
                    ScoringTool=InDetAmbiScoringTool,
                    SelectionTool=InDetAmbiTrackSelectionTool,
                    SuppressHoleSearch=False,
                    tryBremFit=InDetFlags.doBremRecovery() and useBremMode
                    and NewTrackingCuts.mode() != "DBM",
                    caloSeededBrem=InDetFlags.doCaloSeededBrem()
                    and NewTrackingCuts.mode() != "DBM",
                    pTminBrem=NewTrackingCuts.minPTBrem(),
                    RefitPrds=True)

            if InDetFlags.doTIDE_Ambi() and not (
                    NewTrackingCuts.mode() == "ForwardSLHCTracks"
                    or NewTrackingCuts.mode() == "ForwardTracks"
                    or NewTrackingCuts.mode() == "DBM"):
                InDetAmbiguityProcessor.SplitProbTool = NnPixelClusterSplitProbTool
                InDetAmbiguityProcessor.sharedProbCut = prob1
                InDetAmbiguityProcessor.sharedProbCut2 = prob2
                InDetAmbiguityProcessor.SplitClusterAmbiguityMap = InDetKeys.SplitClusterAmbiguityMap(
                )
                if InDetFlags.doTIDE_RescalePixelCovariances():
                    InDetAmbiguityProcessor.applydRcorrection = True

            if NewTrackingCuts.mode() == "Pixel" or NewTrackingCuts.mode(
            ) == "DBM":
                InDetAmbiguityProcessor.SuppressHoleSearch = True
            if NewTrackingCuts.mode() == "LowPt" or NewTrackingCuts.mode(
            ) == "VeryLowPt" or (NewTrackingCuts.mode() == "Pixel"
                                 and InDetFlags.doMinBias()):
                if InDetAmbiguityProcessor.getName().find('Dense'):
                    pass
                else:
                    InDetAmbiguityProcessor.Fitter = InDetTrackFitterLowPt

            if InDetFlags.materialInteractions():
                InDetAmbiguityProcessor.MatEffects = InDetFlags.materialInteractionsType(
                )
            else:
                InDetAmbiguityProcessor.MatEffects = 0

            # if NewTrackingCuts.mode() == "ForwardTracks":
            #    InDetAmbiguityProcessor.OutputLevel = VERBOSE

            if InDetFlags.doTIDE_AmbiTrackMonitoring(
            ) and InDetFlags.doTIDE_Ambi() and not (
                    NewTrackingCuts.mode() == "ForwardSLHCTracks"
                    or NewTrackingCuts.mode() == "ForwardTracks"
                    or NewTrackingCuts.mode() == "PixelPrdAssociation"
                    or NewTrackingCuts.mode() == "DBM"
                    or NewTrackingCuts.mode() == "PixelFourLayer"
                    or NewTrackingCuts.mode() == "PixelThreeLayer"):
                InDetAmbiguityProcessor.ObserverTool = TrackObserverTool  #observerTool
                InDetAmbiguityProcessor.MonitorAmbiguitySolving = True

            ToolSvc += InDetAmbiguityProcessor
            if (InDetFlags.doPrintConfigurables()):
                print InDetAmbiguityProcessor
            #
            # --- set input and output collection
            #
            InputTrackCollection = self.__SiTrackCollection
            self.__SiTrackCollection = ResolvedTrackCollectionKey
            #
            # --- configure Ambiguity solver
            #
            from TrkAmbiguitySolver.TrkAmbiguitySolverConf import Trk__TrkAmbiguitySolver
            InDetAmbiguitySolver = Trk__TrkAmbiguitySolver(
                name='InDetAmbiguitySolver' + NewTrackingCuts.extension(),
                TrackInput=[InputTrackCollection],
                TrackOutput=self.__SiTrackCollection,
                AmbiguityProcessor=InDetAmbiguityProcessor)
            topSequence += InDetAmbiguitySolver
            if (InDetFlags.doPrintConfigurables()):
                print InDetAmbiguitySolver

            #
            # --- Delete Silicon Sp-Seeded tracks
            #
            from InDetRecExample.ConfiguredInDetSGDeletion import InDetSGDeletionAlg
            InDetSGDeletionAlg(key=SiSPSeededTrackCollectionKey)

            if ((NewTrackingCuts.mode() in ["Pixel", "SCT"])
                    or not InDetFlags.doSGDeletion()):
                if InDetFlags.doTruth():
                    #
                    # set up the truth info for this container
                    #
                    include("InDetRecExample/ConfiguredInDetTrackTruth.py")
                    InDetTracksTruth = ConfiguredInDetTrackTruth(
                        self.__SiTrackCollection,
                        self.__SiTrackCollection + "DetailedTruth",
                        self.__SiTrackCollection + "TruthCollection")
                    #
                    # add final output for statistics
                    #
                    TrackCollectionKeys += [InDetTracksTruth.Tracks()]
                    TrackCollectionTruthKeys += [
                        InDetTracksTruth.TracksTruth()
                    ]
                else:
                    TrackCollectionKeys += [self.__SiTrackCollection]
Пример #8
0
def getDBMTrackDecorators(**kwargs):
    from InDetRecExample.InDetKeys import InDetKeys
    return getTrackDecorators(
        TrackParticleContainerName=InDetKeys.DBMTrackParticles())
Пример #9
0
def makeInDetAlgs(whichSignature='',
                  separateTrackParticleCreator='',
                  rois='EMViewRoIs',
                  doFTF=True,
                  viewVerifier='IDViewDataVerifier'):
    #If signature specified add suffix to the algorithms
    signature = whichSignature if whichSignature else ''
    if signature != "" and separateTrackParticleCreator == "":
        separateTrackParticleCreator = signature

    if signature == "":
        raise ValueError('makeInDetAlgs() No signature specified')

    #Global keys/names for Trigger collections
    from .InDetTrigCollectionKeys import TrigPixelKeys, TrigSCTKeys
    from InDetRecExample.InDetKeys import InDetKeys
    from TrigInDetConfig.TrigInDetConfig import InDetCacheNames
    from AthenaCommon.GlobalFlags import globalflags

    viewAlgs = []

    ViewDataVerifier = None
    if viewVerifier:
        import AthenaCommon.CfgMgr as CfgMgr
        ViewDataVerifier = CfgMgr.AthViews__ViewDataVerifier(viewVerifier +
                                                             signature)
        ViewDataVerifier.DataObjects = [
            ('InDet::PixelClusterContainerCache',
             InDetCacheNames.Pixel_ClusterKey),
            ('PixelRDO_Cache', InDetCacheNames.PixRDOCacheKey),
            ('InDet::SCT_ClusterContainerCache',
             InDetCacheNames.SCT_ClusterKey),
            ('SCT_RDO_Cache', InDetCacheNames.SCTRDOCacheKey),
            ('SpacePointCache', InDetCacheNames.SpacePointCachePix),
            ('SpacePointCache', InDetCacheNames.SpacePointCacheSCT),
            ('IDCInDetBSErrContainer_Cache', InDetCacheNames.SCTBSErrCacheKey),
            ('IDCInDetBSErrContainer_Cache',
             InDetCacheNames.SCTFlaggedCondCacheKey),
            ('xAOD::EventInfo', 'StoreGateSvc+EventInfo'),
            ('TagInfo', 'DetectorStore+ProcessingTags')
        ]

        viewAlgs.append(ViewDataVerifier)

        # Load RDOs if we aren't loading bytestream
        from AthenaCommon.AlgSequence import AlgSequence
        topSequence = AlgSequence()

        topSequence.SGInputLoader.Load += [('TagInfo',
                                            'DetectorStore+ProcessingTags')]

        if not globalflags.InputFormat.is_bytestream():
            ViewDataVerifier.DataObjects += [
                ('PixelRDO_Container', InDetKeys.PixelRDOs()),
                ('SCT_RDO_Container', InDetKeys.SCT_RDOs()),
                ('IDCInDetBSErrContainer', InDetKeys.SCT_ByteStreamErrs())
            ]
            topSequence.SGInputLoader.Load += [
                ('PixelRDO_Container', InDetKeys.PixelRDOs()),
                ('SCT_RDO_Container', InDetKeys.SCT_RDOs()),
                ('IDCInDetBSErrContainer', InDetKeys.SCT_ByteStreamErrs())
            ]

    from InDetTrigRecExample.InDetTrigFlags import InDetTrigFlags
    from AthenaCommon.AppMgr import ToolSvc

    #Only add raw data decoders if we're running over raw data
    if globalflags.InputFormat.is_bytestream():
        #Pixel

        from PixelRawDataByteStreamCnv.PixelRawDataByteStreamCnvConf import PixelRodDecoder
        InDetPixelRodDecoder = PixelRodDecoder(name="InDetPixelRodDecoder_" +
                                               signature)
        # Disable duplcated pixel check for data15 because duplication mechanism was used.
        from RecExConfig.RecFlags import rec
        if len(rec.projectName()) >= 6 and rec.projectName()[:6] == "data15":
            InDetPixelRodDecoder.CheckDuplicatedPixel = False
        ToolSvc += InDetPixelRodDecoder

        from PixelRawDataByteStreamCnv.PixelRawDataByteStreamCnvConf import PixelRawDataProviderTool
        InDetPixelRawDataProviderTool = PixelRawDataProviderTool(
            name="InDetPixelRawDataProviderTool_" + signature,
            Decoder=InDetPixelRodDecoder,
            checkLVL1ID=False)
        ToolSvc += InDetPixelRawDataProviderTool

        if (InDetTrigFlags.doPrintConfigurables()):
            print(InDetPixelRawDataProviderTool)  # noqa: ATL901

        # load the PixelRawDataProvider
        from PixelRawDataByteStreamCnv.PixelRawDataByteStreamCnvConf import PixelRawDataProvider
        InDetPixelRawDataProvider = PixelRawDataProvider(
            name="InDetPixelRawDataProvider_" + signature,
            RDOKey=InDetKeys.PixelRDOs(),
            ProviderTool=InDetPixelRawDataProviderTool,
        )
        InDetPixelRawDataProvider.isRoI_Seeded = True
        InDetPixelRawDataProvider.RoIs = rois
        InDetPixelRawDataProvider.RDOCacheKey = InDetCacheNames.PixRDOCacheKey

        viewAlgs.append(InDetPixelRawDataProvider)

        if (InDetTrigFlags.doPrintConfigurables()):
            print(InDetPixelRawDataProvider)  # noqa: ATL901

        #SCT
        from SCT_RawDataByteStreamCnv.SCT_RawDataByteStreamCnvConf import SCT_RodDecoder
        InDetSCTRodDecoder = SCT_RodDecoder(name="InDetSCTRodDecoder_" +
                                            signature)
        ToolSvc += InDetSCTRodDecoder

        from SCT_RawDataByteStreamCnv.SCT_RawDataByteStreamCnvConf import SCTRawDataProviderTool
        InDetSCTRawDataProviderTool = SCTRawDataProviderTool(
            name="InDetSCTRawDataProviderTool_" + signature,
            Decoder=InDetSCTRodDecoder)
        ToolSvc += InDetSCTRawDataProviderTool
        if (InDetTrigFlags.doPrintConfigurables()):
            print(InDetSCTRawDataProviderTool)  # noqa: ATL901

        # load the SCTRawDataProvider
        from SCT_RawDataByteStreamCnv.SCT_RawDataByteStreamCnvConf import SCTRawDataProvider
        InDetSCTRawDataProvider = SCTRawDataProvider(
            name="InDetSCTRawDataProvider_" + signature,
            RDOKey=InDetKeys.SCT_RDOs(),
            ProviderTool=InDetSCTRawDataProviderTool)
        InDetSCTRawDataProvider.isRoI_Seeded = True
        InDetSCTRawDataProvider.RoIs = rois
        InDetSCTRawDataProvider.RDOCacheKey = InDetCacheNames.SCTRDOCacheKey
        InDetSCTRawDataProvider.BSErrCacheKey = InDetCacheNames.SCTBSErrCacheKey

        from RegionSelector.RegSelToolConfig import makeRegSelTool_SCT
        InDetSCTRawDataProvider.RegSelTool = makeRegSelTool_SCT()

        viewAlgs.append(InDetSCTRawDataProvider)

        # load the SCTEventFlagWriter
        from SCT_RawDataByteStreamCnv.SCT_RawDataByteStreamCnvConf import SCTEventFlagWriter
        InDetSCTEventFlagWriter = SCTEventFlagWriter(
            name="InDetSCTEventFlagWriter_" + signature)

        viewAlgs.append(InDetSCTEventFlagWriter)

    #Pixel clusterisation
    from InDetTrigRecExample.InDetTrigConfigRecLoadTools import TrigPixelLorentzAngleTool, TrigSCTLorentzAngleTool

    from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelConfigCondAlg
    PixelConfigCondAlg.UseCalibConditions = False

    from SiClusterizationTool.SiClusterizationToolConf import InDet__ClusterMakerTool
    InDetClusterMakerTool = InDet__ClusterMakerTool(
        name="InDetClusterMakerTool_" + signature,
        SCTLorentzAngleTool=TrigSCTLorentzAngleTool,
        PixelLorentzAngleTool=TrigPixelLorentzAngleTool)

    ToolSvc += InDetClusterMakerTool

    from SiClusterizationTool.SiClusterizationToolConf import InDet__MergedPixelsTool
    InDetMergedPixelsTool = InDet__MergedPixelsTool(
        name="InDetMergedPixelsTool_" + signature,
        globalPosAlg=InDetClusterMakerTool,
        MinimalSplitSize=0,
        MaximalSplitSize=49,
        MinimalSplitProbability=0,
        DoIBLSplitting=True,
    )
    # Enable duplcated RDO check for data15 because duplication mechanism was used.
    from RecExConfig.RecFlags import rec
    if len(rec.projectName()) >= 6 and rec.projectName()[:6] == "data15":
        InDetMergedPixelsTool.CheckDuplicatedRDO = True
    ToolSvc += InDetMergedPixelsTool

    from SiClusterizationTool.SiClusterizationToolConf import InDet__PixelGangedAmbiguitiesFinder
    InDetPixelGangedAmbiguitiesFinder = InDet__PixelGangedAmbiguitiesFinder(
        name="InDetPixelGangedAmbiguitiesFinder_" + signature)
    ToolSvc += InDetPixelGangedAmbiguitiesFinder

    from InDetPrepRawDataFormation.InDetPrepRawDataFormationConf import InDet__PixelClusterization
    InDetPixelClusterization = InDet__PixelClusterization(
        name="InDetPixelClusterization_" + signature,
        clusteringTool=InDetMergedPixelsTool,
        gangedAmbiguitiesFinder=InDetPixelGangedAmbiguitiesFinder,
        DataObjectName=InDetKeys.PixelRDOs(),
        AmbiguitiesMap=TrigPixelKeys.PixelClusterAmbiguitiesMap,
        ClustersName=TrigPixelKeys.Clusters)

    InDetPixelClusterization.isRoI_Seeded = True
    InDetPixelClusterization.RoIs = rois
    InDetPixelClusterization.ClusterContainerCacheKey = InDetCacheNames.Pixel_ClusterKey

    viewAlgs.append(InDetPixelClusterization)

    # Create SCT_ConditionsSummaryTool
    from SCT_ConditionsTools.SCT_ConditionsSummaryToolSetup import SCT_ConditionsSummaryToolSetup
    sct_ConditionsSummaryToolSetup = SCT_ConditionsSummaryToolSetup(
        "InDetSCT_ConditionsSummaryTool_" + signature)
    sct_ConditionsSummaryToolSetup.setup()
    InDetSCT_ConditionsSummaryTool = sct_ConditionsSummaryToolSetup.getTool(
    )  # noqa: F841
    sct_ConditionsSummaryToolSetupWithoutFlagged = SCT_ConditionsSummaryToolSetup(
        "InDetSCT_ConditionsSummaryToolWithoutFlagged_" + signature)
    sct_ConditionsSummaryToolSetupWithoutFlagged.setup()
    InDetSCT_ConditionsSummaryToolWithoutFlagged = sct_ConditionsSummaryToolSetupWithoutFlagged.getTool(
    )

    # Add conditions tools to SCT_ConditionsSummaryTool
    from SCT_ConditionsTools.SCT_ConfigurationConditionsToolSetup import SCT_ConfigurationConditionsToolSetup
    sct_ConfigurationConditionsToolSetup = SCT_ConfigurationConditionsToolSetup(
    )
    sct_ConfigurationConditionsToolSetup.setToolName(
        "InDetSCT_ConfigurationConditionsTool_" + signature)
    sct_ConfigurationConditionsToolSetup.setup()
    InDetSCT_ConditionsSummaryToolWithoutFlagged.ConditionsTools.append(
        sct_ConfigurationConditionsToolSetup.getTool().getFullName())

    from SCT_ConditionsTools.SCT_ReadCalibDataToolSetup import SCT_ReadCalibDataToolSetup
    sct_ReadCalibDataToolSetup = SCT_ReadCalibDataToolSetup()
    sct_ReadCalibDataToolSetup.setToolName("InDetSCT_ReadCalibDataTool_" +
                                           signature)
    sct_ReadCalibDataToolSetup.setup()
    InDetSCT_ConditionsSummaryToolWithoutFlagged.ConditionsTools.append(
        sct_ReadCalibDataToolSetup.getTool().getFullName())

    from SCT_ConditionsTools.SCT_ByteStreamErrorsToolSetup import SCT_ByteStreamErrorsToolSetup
    sct_ByteStreamErrorsToolSetup = SCT_ByteStreamErrorsToolSetup()
    sct_ByteStreamErrorsToolSetup.setToolName("InDetSCT_BSErrorTool_" +
                                              signature)
    sct_ByteStreamErrorsToolSetup.setConfigTool(
        sct_ConfigurationConditionsToolSetup.getTool())
    sct_ByteStreamErrorsToolSetup.setup()
    InDetSCT_ConditionsSummaryToolWithoutFlagged.ConditionsTools.append(
        sct_ByteStreamErrorsToolSetup.getTool().getFullName())

    if (InDetTrigFlags.doPrintConfigurables()):
        print(InDetSCT_ConditionsSummaryToolWithoutFlagged)

    #
    # --- SCT_ClusteringTool
    #
    from SiClusterizationTool.SiClusterizationToolConf import InDet__SCT_ClusteringTool
    InDetSCT_ClusteringTool = InDet__SCT_ClusteringTool(
        name="InDetSCT_ClusteringTool_" + signature,
        globalPosAlg=InDetClusterMakerTool,
        conditionsTool=InDetSCT_ConditionsSummaryToolWithoutFlagged)
    if InDetTrigFlags.doSCTIntimeHits():
        if InDetTrigFlags.InDet25nsec():
            InDetSCT_ClusteringTool.timeBins = "01X"
        else:
            InDetSCT_ClusteringTool.timeBins = "X1X"

    #
    # --- SCT_Clusterization algorithm
    #

    from InDetPrepRawDataFormation.InDetPrepRawDataFormationConf import InDet__SCT_Clusterization
    InDetSCT_Clusterization = InDet__SCT_Clusterization(
        name="InDetSCT_Clusterization_" + signature,
        clusteringTool=InDetSCT_ClusteringTool,
        # ChannelStatus         = InDetSCT_ChannelStatusAlg,
        DataObjectName=InDetKeys.SCT_RDOs(),
        ClustersName=TrigSCTKeys.Clusters,
        #Adding the suffix to flagged conditions
        SCT_FlaggedCondData="SCT_FlaggedCondData_TRIG",
        conditionsTool=InDetSCT_ConditionsSummaryToolWithoutFlagged)
    InDetSCT_Clusterization.isRoI_Seeded = True
    InDetSCT_Clusterization.RoIs = rois
    InDetSCT_Clusterization.ClusterContainerCacheKey = InDetCacheNames.SCT_ClusterKey
    InDetSCT_Clusterization.FlaggedCondCacheKey = InDetCacheNames.SCTFlaggedCondCacheKey

    from RegionSelector.RegSelToolConfig import makeRegSelTool_SCT
    InDetSCT_Clusterization.RegSelTool = makeRegSelTool_SCT()

    viewAlgs.append(InDetSCT_Clusterization)

    #Space points and FTF

    from SiSpacePointTool.SiSpacePointToolConf import InDet__SiSpacePointMakerTool
    InDetSiSpacePointMakerTool = InDet__SiSpacePointMakerTool(
        name="InDetSiSpacePointMakerTool_" + signature)

    from AthenaCommon.DetFlags import DetFlags
    from SiSpacePointFormation.SiSpacePointFormationConf import InDet__SiTrackerSpacePointFinder
    from SiSpacePointFormation.InDetOnlineMonitor import InDetMonitoringTool
    InDetSiTrackerSpacePointFinder = InDet__SiTrackerSpacePointFinder(
        name="InDetSiTrackerSpacePointFinder_" + signature,
        SiSpacePointMakerTool=InDetSiSpacePointMakerTool,
        PixelsClustersName=TrigPixelKeys.Clusters,
        SpacePointsPixelName=TrigPixelKeys.SpacePoints,
        SCT_ClustersName=TrigSCTKeys.Clusters,
        SpacePointsSCTName=TrigSCTKeys.SpacePoints,
        SpacePointsOverlapName=InDetKeys.OverlapSpacePoints(),
        ProcessPixels=DetFlags.haveRIO.pixel_on(),
        ProcessSCTs=DetFlags.haveRIO.SCT_on(),
        ProcessOverlaps=DetFlags.haveRIO.SCT_on(),
        SpacePointCacheSCT=InDetCacheNames.SpacePointCacheSCT,
        SpacePointCachePix=InDetCacheNames.SpacePointCachePix,
        monTool=InDetMonitoringTool())

    viewAlgs.append(InDetSiTrackerSpacePointFinder)

    # Condition algorithm for SiTrackerSpacePointFinder
    if InDetSiTrackerSpacePointFinder.ProcessSCTs:
        from AthenaCommon.AlgSequence import AthSequencer
        condSeq = AthSequencer("AthCondSeq")
        if not hasattr(condSeq, "InDetSiElementPropertiesTableCondAlg"):
            # Setup alignment folders and conditions algorithms
            from SiSpacePointFormation.SiSpacePointFormationConf import InDet__SiElementPropertiesTableCondAlg
            condSeq += InDet__SiElementPropertiesTableCondAlg(
                name="InDetSiElementPropertiesTableCondAlg")

    #FIXME have a flag for now set for True( as most cases call FTF) but potentially separate
    if doFTF:
        from TrigFastTrackFinder.TrigFastTrackFinder_Config import TrigFastTrackFinderBase
        theFTF = TrigFastTrackFinderBase(
            "TrigFastTrackFinder_" + whichSignature, whichSignature)
        theFTF.RoIs = rois
        theFTF.TracksName = "TrigFastTrackFinder_Tracks_" + separateTrackParticleCreator

        #the following doCloneRemoval modification should be set up in the InDetTrigSliceSettings once legacy trigger not needed
        if whichSignature == "Electron":
            theFTF.doCloneRemoval = True

        viewAlgs.append(theFTF)

        from TrigInDetConf.TrigInDetPostTools import InDetTrigParticleCreatorToolFTF
        from TrigEDMConfig.TriggerEDMRun3 import recordable
        from InDetTrigParticleCreation.InDetTrigParticleCreationConf import InDet__TrigTrackingxAODCnvMT

        trackCollection = "HLT_IDTrack_" + separateTrackParticleCreator + "_FTF"

        theTrackParticleCreatorAlg = InDet__TrigTrackingxAODCnvMT(
            name="InDetTrigTrackParticleCreatorAlg" + whichSignature,
            TrackName="TrigFastTrackFinder_Tracks_" +
            separateTrackParticleCreator,
            ParticleCreatorTool=InDetTrigParticleCreatorToolFTF)

        if separateTrackParticleCreator == "BeamSpot":
            theTrackParticleCreatorAlg.TrackParticlesName = trackCollection
        else:
            theTrackParticleCreatorAlg.TrackParticlesName = recordable(
                trackCollection)
        viewAlgs.append(theTrackParticleCreatorAlg)

    return viewAlgs, ViewDataVerifier
Пример #10
0
#if InDetFlags.doVertexFinding():
#  InDetKeys.xAODVertexContainer = "RefitPrimaryVertices" 

if readESD and not redoPatternRecoAndTracking:
  InDetKeys.UnslimmedTracks              = 'Tracks'
  InDetKeys.UnslimmedTracksTruth         = 'TrackTruthCollection'

# Set container names
if doWriteESD:
  InDetKeys.OutputESDFileName = "InDetRecESD_new.root"

if doWriteAOD:
  InDetKeys.OutputAODFileName = "InDetRecAOD_new.root"  

print "Printing InDetKeys"
InDetKeys.lockAllExceptAlias()
InDetKeys.print_JobProperties()

#--------------------------------------------------------------
# enable statistics for reading ESD testing
#--------------------------------------------------------------

InDetFlags.doStatistics   = doInDetRecStatistics
TrackCollectionKeys        = [InDetKeys.Tracks()]
TrackCollectionTruthKeys   = [InDetKeys.TracksTruth()]

# Uncomment to use medical image seeding
# InDetFlags.primaryVertexSetup = "MedImgMultiFinding"
  
#--------------------------------------------------------------
# load master joboptions file
Пример #11
0
def VertexGroupD3PD(alg=None,
                    file=VertexD3PDAnalysisKeys.D3PDFileName(),
                    treeName=VertexD3PDAnalysisKeys.D3PDTreeName(),
                    **kw):

    print '[TrackD3PDMaker.VertexGroupD3PD] Vertex group D3PD settings:'
    print 'VertexD3PDAnalysisFlags'
    print VertexD3PDAnalysisFlags
    print 'VertexD3PDAnalysisKeys'
    print VertexD3PDAnalysisKeys

    if not alg:
        ## Create a new algorithm
        from OutputStreamAthenaPool.MultipleStreamManager import MSMgr
        alg = MSMgr.NewRootStream(treeName, file)

    ## General event information (custom options prefix: 'ei_')
    if VertexD3PDAnalysisFlags.useEventInfo():
        from EventCommonD3PDMaker.EventInfoD3PDObject import EventInfoD3PDObject
        alg += EventInfoD3PDObject(**_args('ei_', kw, level=0, prefix='ei_'))

    ## Trigger information (custom options prefix: 'trig_')
    if VertexD3PDAnalysisFlags.useTrigger():
        from TriggerJobOpts.TriggerConfigGetter import TriggerConfigGetter
        cfg = TriggerConfigGetter("ReadPool")
        from TriggerD3PDMaker.defineTriggerBits import defineTriggerBits
        from TriggerD3PDMaker.TrigConfMetadata import addTrigConfMetadata
        from TriggerD3PDMaker.TrigDecisionD3PDObject import TrigDecisionD3PDObject
        alg += TrigDecisionD3PDObject(**_args('trig_', kw, level=2))
        addTrigConfMetadata(alg)
    if VertexD3PDAnalysisFlags.useTriggerRaw():
        from TriggerJobOpts.TriggerConfigGetter import TriggerConfigGetter
        cfg = TriggerConfigGetter("ReadPool")
        from TriggerD3PDMaker.defineTriggerBits import defineTriggerBits
        from TriggerD3PDMaker.TrigConfMetadata import addTrigConfMetadata
        #Setup custom D3PD object with raw trigger info only (e.g. calibration_vdM streams)
        from D3PDMakerCoreComps.D3PDObject import make_Void_D3PDObject
        import TriggerD3PDMaker
        TrigDecisionD3PDObjectRaw = make_Void_D3PDObject(
            "trigRaw_",
            "TrigDecisionD3PDObjectRaw",
            default_name="TrigDecisionFillerRaw")
        if not VertexD3PDAnalysisFlags.useTrigger():
            TrigDecisionD3PDObjectRaw.defineBlock(
                0,
                "TriggerRawInfo",
                TriggerD3PDMaker.TrigDecisionFillerTool,
                SaveLVL1Raw=True,
                SaveHLTRaw=True,
                SaveBGCode=True)
        else:
            TrigDecisionD3PDObjectRaw.defineBlock(
                0,
                "TriggerRawInfo",
                TriggerD3PDMaker.TrigDecisionFillerTool,
                SaveHLTRaw=True,
                SaveBGCode=True)
        #Finally add object to algorithms
        alg += TrigDecisionD3PDObjectRaw(**_args('trig_', kw, level=0))
        if not VertexD3PDAnalysisFlags.useTrigger():
            #unless we've already added it, add meta-data as well
            addTrigConfMetadata(alg)

    ## Beam background information (custom options prefix: 'bkg_')
    if VertexD3PDAnalysisFlags.useBackgroundWord():
        from BackgroundD3PDMaker.BackgroundWordD3PDObject import BackgroundWordD3PDObject
        alg += BackgroundWordD3PDObject(**_args('bkg_', kw, level=0))

    ## Tracks and V0 information (custom options prefix: 'trk_', and 'v0_')
    if VertexD3PDAnalysisFlags.useTracks():
        labelDefaultVtx = VertexD3PDAnalysisKeys.LabelDefaultVtx()
        prefixDefaultVtx = labelDefaultVtx + '_'  #Add trailing '_'

        import TrackD3PDMaker
        from TrackD3PDMaker.TrackD3PDMakerFlags import TrackD3PDFlags
        from TrackD3PDMaker.TrackD3PDObject import TrackD3PDObject
        from D3PDMakerConfig.D3PDMakerFlags import D3PDMakerFlags
        from TruthD3PDMaker.TruthD3PDMakerFlags import TruthD3PDFlags
        from TruthD3PDMaker.TruthD3PDMakerKeys import TruthD3PDKeys
        VtxD3PD_Track_Exclude = ['vx_weight']
        TrackD3PDMaker.PerigeeUnbiasedIPAtPVFillerTool.DoBiased = False  #Switch off biased perigee
        TrackParticleD3PDObjectForVertex = TrackD3PDObject(
            _label='trk',
            _prefix='trk_',
            _sgkey=D3PDMakerFlags.TrackSGKey(),
            _object_name='TrackParticleD3PDObjectForVertex',
            typeName='Rec::TrackParticleContainer',
            vertexTarget=labelDefaultVtx,
            vertexPrefix=prefixDefaultVtx,
            vertexSGKey='VxPrimaryCandidate',
            truthTarget=TruthD3PDFlags.GenParticleAssocLabel(),
            truthPrefix=TruthD3PDKeys.GenParticlePrefix(),
            detailedTruthPrefix='',  # 'mc_detailed_'
            SGKeyForTruth=D3PDMakerFlags.TrackSGKey(),
            truthMapKey='TrackParticleTruthCollection',
            detailedTruthMapKey='',  #'DetailedTrackTruth'
            flags=TrackD3PDFlags)
        alg += TrackParticleD3PDObjectForVertex(
            **_args('trk_', kw, level=8, exclude=VtxD3PD_Track_Exclude))

    if VertexD3PDAnalysisFlags.useSecondaryVertex():
        from TrackD3PDMaker.V0D3PDObject import V0D3PDObject
        alg += V0D3PDObject(**_args('v0_', kw, level=10))

    ## Store beamspot information (custom option perfix: 'bs_')
    if VertexD3PDAnalysisFlags.useBeamspot():
        from TrackD3PDMaker.BeamSpotD3PDObject import BeamSpotD3PDObject
        alg += BeamSpotD3PDObject(**_args('bs_', kw, level=0))

    ## Store vertex information (custom options prefix: 'vtx_' or 'vtx' for BuildVertexD3PDObject)
    from TrackD3PDMaker.VertexD3PDObject import PrimaryVertexD3PDObject
    from TrackD3PDMaker.VertexD3PDObject import BuildVertexD3PDObject
    from InDetRecExample.InDetKeys import InDetKeys
    from InDetRecExample.InDetJobProperties import InDetFlags
    #First dump existing content
    labelDefaultVtx = VertexD3PDAnalysisKeys.LabelDefaultVtx()
    prefixDefaultVtx = labelDefaultVtx + '_'  #Add trailing '_'
    VtxDefaultD3PDObj = BuildVertexD3PDObject(
        **_args('vtx',
                kw,
                _prefix=prefixDefaultVtx,
                _label=labelDefaultVtx,
                _sgkey=InDetKeys.PrimaryVertices(),
                trackTarget='trk',
                trackPrefix='trk_',
                trackType='Rec::TrackParticleContainer'))
    alg += VtxDefaultD3PDObj(**_args('vtx_', kw, level=10))
    #Then also dump the other vertex collections
    if VertexD3PDAnalysisFlags.useAllVertexCollections:
        #Use non BC and split collections (sorry, no customization of parameters here)
        if not InDetFlags.doSplitVertexFindingForMonitoring():
            #raise NameError('Requesting split vertices but algorith has not run!')
            #pass
            print(
                '[TrackD3PDMaker.VertexGroupD3PD] WARNING: Requested split vertices, but algorithm has not run! Skipped.'
            )
        else:
            SplitPrimaryVertexD3PDObject = BuildVertexD3PDObject(
                _prefix='vxsplit_',
                _label='vxsplit',
                _sgkey=InDetKeys.PrimaryVerticesSplitStream(),
                trackTarget='trk',
                trackPrefix='trk_',
                trackType='Rec::TrackParticleContainer')
            alg += SplitPrimaryVertexD3PDObject(8)

        #Then store also non beamspot constrained ones
        if not InDetFlags.doVertexFindingForMonitoring():
            #raise NameError('Requesting NBC vertices but algorith has not run!')
            #pass
            print(
                '[TrackD3PDMaker.VertexGroupD3PD] WARNING: Requested non beamspot constrained vertices, but algorithm has not run! Skipped.'
            )
        else:
            NoBeamConstraintPrimaryVertexD3PDObject = BuildVertexD3PDObject(
                _prefix='vxnbc_',
                _label='vxnbc',
                _sgkey=InDetKeys.PrimaryVerticesWithoutBeamConstraint(),
                trackTarget='trk',
                trackPrefix='trk_',
                trackType='Rec::TrackParticleContainer')
            alg += NoBeamConstraintPrimaryVertexD3PDObject(8)

    ## Store truth-level information (custom options prefix: 'tuthVtx_', 'truthEvt_', 'truthPart_')
    if VertexD3PDAnalysisFlags.useTruth():
        from TruthD3PDAnalysis.TruthD3PDAnalysisConf import D3PD__GenObjectsFilterTool
        trackGenObjectsFilterTool = D3PD__GenObjectsFilterTool(
            "trackGenObjectsFilterTool")
        from AthenaCommon.AppMgr import ToolSvc
        ToolSvc += trackGenObjectsFilterTool

        if (VertexD3PDAnalysisFlags.filterTightTruth()):
            trackGenObjectsFilterTool.SelectTruthTracks = True
            trackGenObjectsFilterTool.PtMin = VertexD3PDAnalysisKeys.TruthTrackCutPtMin(
            )
            trackGenObjectsFilterTool.EtaMax = VertexD3PDAnalysisKeys.TruthTrackCutEtaMax(
            )
            trackGenObjectsFilterTool.RemoveEmptyEvents = True
            trackGenObjectsFilterTool.RemoveDummyEvents = True
            trackGenObjectsFilterTool.RemoveInTimePileUp = False
            trackGenObjectsFilterTool.Remove2BCPileUp = True
            trackGenObjectsFilterTool.Remove800nsPileUp = True
            trackGenObjectsFilterTool.RemoveCavernBkg = False
            trackGenObjectsFilterTool.AddOnlyFirstVertex = VertexD3PDAnalysisKeys.TruthAddOnlyFirstVertex(
            )
        else:
            #Use a more inclusive truth policy
            trackGenObjectsFilterTool.SelectTruthTracks = False
            trackGenObjectsFilterTool.PtMin = VertexD3PDAnalysisKeys.TruthTrackCutPtMin(
            )
            trackGenObjectsFilterTool.EtaMax = VertexD3PDAnalysisKeys.TruthTrackCutEtaMax(
            )
            trackGenObjectsFilterTool.RemoveEmptyEvents = True
            trackGenObjectsFilterTool.RemoveDummyEvents = True
            trackGenObjectsFilterTool.AddOnlyFirstVertex = VertexD3PDAnalysisKeys.TruthAddOnlyFirstVertex(
            )

        from TruthD3PDMaker.GenEventD3PDObject import GenEventD3PDObject
        alg += GenEventD3PDObject(
            **_args('truthEvt_',
                    kw,
                    level=10,
                    filter=trackGenObjectsFilterTool,
                    pileup_CollectionGetterRegistry=alg.name() +
                    '_CollectionGetterRegistry'))

        from TruthD3PDMaker.GenVertexD3PDObject import GenVertexD3PDObject
        alg += GenVertexD3PDObject(**_args(
            'truthVtx_', kw, level=1, filter=trackGenObjectsFilterTool))

        from TruthD3PDMaker.GenParticleD3PDObject import GenParticleD3PDObject
        alg += GenParticleD3PDObject(**_args(
            'truthPart_', kw, level=10, filter=trackGenObjectsFilterTool))

        from TruthD3PDMaker.GenParticleD3PDObject import GenTruthTrackD3PDObject
        alg += GenTruthTrackD3PDObject(**_args('truthTrack_', kw, level=0))

    ## Dump higher level objects
    # Missing Energy (custom options prefix with VertexD3PDAnalysisKeys.MetCollections+'_')
    if VertexD3PDAnalysisFlags.useMET():
        for MET in VertexD3PDAnalysisKeys.MetCollections():
            VtxD3PD_Met_Key = MET
            VtxD3PD_Met_Prefix = MET.replace('_', '') + '_'
            VtxD3PD_Met_Level = 0  #Only basic info
            VtxD3PD_Met_Exclude = ['MET_Regions', 'L1_', 'L2_', 'EF_']
            from MissingETD3PDMaker.MissingETD3PDObject import RefFinalMETD3PDObject
            VtxD3PD_Met_Obj = RefFinalMETD3PDObject(
                **_args(MET + '_',
                        kw,
                        level=VtxD3PD_Met_Level,
                        sgkey=VtxD3PD_Met_Key,
                        prefix=VtxD3PD_Met_Prefix,
                        exclude=VtxD3PD_Met_Exclude))
            alg += VtxD3PD_Met_Obj

    #Muons (custom options prefix VtxD3PD_Muon_Prefix -- see below [e.g. muid_, staco_, ...])
    if VertexD3PDAnalysisFlags.useMuons():
        from MuonD3PDMaker.MuonD3PDObject import MuonD3PDObject
        for Muon in VertexD3PDAnalysisKeys.MuonCollections():
            VtxD3PD_Muon_Key = Muon
            VtxD3PD_Muon_Prefix = Muon + '_'
            if VtxD3PD_Muon_Key == 'MuidMuonCollection':
                VtxD3PD_Muon_Prefix = 'muid_'
            elif VtxD3PD_Muon_Key == 'StacoMuonCollection':
                VtxD3PD_Muon_Prefix = 'staco_'

            VtxD3PD_Muon_Level = 0  #Only basic info
            VtxD3PD_Muon_Exclude = [
                'EFCBInfo', 'EFMGInfo', 'EFMEInfo', 'L2CBInfo', 'L1Info',
                'L1_', 'L2_', 'EF_'
            ]
            VtxD3PD_Muon_Obj = MuonD3PDObject(
                **_args(VtxD3PD_Muon_Prefix,
                        kw,
                        level=VtxD3PD_Muon_Level,
                        sgkey=VtxD3PD_Muon_Key,
                        prefix=VtxD3PD_Muon_Prefix,
                        allowMissing=True,
                        exclude=VtxD3PD_Muon_Exclude))
            alg += VtxD3PD_Muon_Obj

    #Electrons (custom options prefix: 'el_')
    if VertexD3PDAnalysisFlags.useElectrons():
        from egammaD3PDMaker.ElectronD3PDObject import ElectronD3PDObject
        alg += ElectronD3PDObject(**_args('el_', kw, prefix='el_', level=0))

    #Photons (custom options prefix: 'ph_')
    if VertexD3PDAnalysisFlags.usePhotons():
        from egammaD3PDMaker.PhotonD3PDObject import PhotonD3PDObject
        alg += PhotonD3PDObject(**_args('ph_', kw, prefix='ph_', level=0))

    #Jets, JVF, b-jets (custom options prefix: 'jet_')
    if VertexD3PDAnalysisFlags.useJets():
        from JetD3PDMaker.JetD3PDObject import JetD3PDObject
        from JetTagD3PDMaker.JetTagD3PDMakerKeys import JetTagD3PDKeys
        from JetTagD3PDMaker.AddBTagD3PDInfo import addBTagInfoToJetObject
        addBTagInfoToJetObject(JetD3PDObject, btagLevelOffset=0)
        VtxD3PD_Jet_Include = [
            'Kinematics', 'JetVertexFraction', 'JVtx', 'EMFraction',
            'TrueFlavorComponents',
            JetTagD3PDKeys.BTagWeightsBlockName()
        ]
        for JET in VertexD3PDAnalysisKeys.JetCollections():
            VtxD3PD_Jet_Prefix = JET.replace('_', '') + '_'
            if len(VertexD3PDAnalysisKeys.JetCollections()) == 1:
                #only 1 element, simplify prefix
                VtxD3PD_Jet_Prefix = 'jet_'
            alg += JetD3PDObject(**_args('jet_',
                                         kw,
                                         sgkey=JET,
                                         prefix=VtxD3PD_Jet_Prefix,
                                         level=0,
                                         include=VtxD3PD_Jet_Include))

    #Taus
    if VertexD3PDAnalysisFlags.useTaus():
        from TauD3PDMaker.TauD3PDObject import TauD3PDObject
        VtxD3PD_Tau_Include = ['TauPriVtx']
        alg += TauD3PDObject(**_args(
            'tau_', kw, prefix='tau_', level=0, include=VtxD3PD_Tau_Include))

    ## Return algorithm
    return alg
Пример #12
0
OutputLevel = INFO
doJiveXML = False
doVP1 = False
doAuditors = True
doEdmMonitor = False
doNameAuditor = False

from RecExConfig.RecFlags import rec
rec.Commissioning = True

from InDetRecExample.InDetJobProperties import InDetFlags
InDetFlags.disableInDetReco.set_Value_and_Lock(
    True)  # Do not run ID reconstruction

from InDetRecExample.InDetKeys import InDetKeys
if InDetFlags.doVertexFinding() and readAOD:
    InDetKeys.Tracks = InDetKeys.TrackParticles()
    print "InDetKeys.Tracks = " + InDetKeys.Tracks()

if readESD:
    InDetKeys.UnslimmedTracks = 'Tracks'
    InDetKeys.UnslimmedTracksTruth = 'TrackTruthCollection'
if readAOD:
    InDetKeys.McEventCollection = 'GEN_AOD'

TrackCollectionKeys = [InDetKeys.Tracks()]
TrackCollectionTruthKeys = [InDetKeys.TracksTruth()]

## Now include main job options for D3PD production (with IDRE)
include("InDetD3PDMaker/VertexGroupD3PD_jobOptions.py")
import D3PDMakerCoreComps
import EventCommonD3PDMaker
from D3PDMakerCoreComps.D3PDObject import D3PDObject

from InDetRecExample.InDetKeys import InDetKeys
#from TrackD3PDMaker.TrackD3PDMakerFlags import TrackD3PDFlags

## D3PD Maker alg
InDetTrackD3PDMaker = D3PDMakerCoreComps.MakerAlg('InDetTrackTree',
                                                   topSequence,
                                                   InDetKeys.trkD3PDFileName())

## Add blocks to the tree
from EventCommonD3PDMaker.EventInfoD3PDObject import EventInfoD3PDObject
InDetTrackD3PDMaker += EventInfoD3PDObject(0, prefix='ei_')
levelOfDetail = 8
if InDetFlags.doTruth():
   levelOfDetail = 10
   from TrackD3PDMaker.TruthTrackD3PDObject import TruthTrackD3PDObject
   InDetTrackD3PDMaker += TruthTrackD3PDObject(levelOfDetail)
   from TrackD3PDMaker.TruthVertexD3PDObject import TruthVertexD3PDObject
   InDetTrackD3PDMaker += TruthVertexD3PDObject(levelOfDetail)
if InDetFlags.doTriggerD3PD():
   from TriggerJobOpts.TriggerConfigGetter import TriggerConfigGetter
   cfg = TriggerConfigGetter("ReadPool")
   from TriggerD3PDMaker.defineTriggerBits import defineTriggerBits
   from TriggerD3PDMaker.TrigConfMetadata  import addTrigConfMetadata
   from TriggerD3PDMaker.TrigDecisionD3PDObject import TrigDecisionD3PDObject
   InDetTrackD3PDMaker += TrigDecisionD3PDObject(0)
   addTrigConfMetadata(InDetTrackD3PDMaker)
if InDetFlags.doTrkD3PD():
Пример #14
0
    def __init__(self,
                 extension="",
                 InputCollections=None,
                 NewTrackingCuts=None,
                 BarrelSegments=None,
                 EndcapSegments=None,
                 doPhase=False):

        from InDetRecExample.InDetJobProperties import InDetFlags
        from InDetRecExample.InDetKeys import InDetKeys
        from AthenaCommon.DetFlags import DetFlags

        import InDetRecExample.TrackingCommon as TrackingCommon
        #
        # 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
        #
        # --- get list of already associated hits (always do this, even if no other tracking ran before)
        #
        prefix = 'InDetSegment'
        suffix = extension
        if usePrdAssociationTool:
            InDetSegmentPRD_Association = TrackingCommon.getInDetTrackPRD_Association(
                namePrefix=prefix,
                nameSuffix=suffix,
                TracksName=list(InputCollections))
            topSequence += InDetSegmentPRD_Association
            if (InDetFlags.doPrintConfigurables()):
                printfunc(InDetSegmentPRD_Association)

        # ---------------------------------------------------------------
        #
        # --- now the main steering of the TRT segments finding
        #
        # ---------------------------------------------------------------

        if InDetFlags.doCosmics():
            #
            # --- cosmics barrel segments (use TRT track segements even for NewT)
            #

            if doPhase:
                from TRT_TrackSegmentsTool_xk.TRT_TrackSegmentsTool_xkConf import InDet__TRT_TrackSegmentsMaker_BarrelCosmics
                InDetTRT_TrackSegmentsMakerPhase = InDet__TRT_TrackSegmentsMaker_BarrelCosmics(
                    name='InDetTRTSegmentsMakerPhase' + extension,
                    TrtManagerLocation=InDetKeys.TRT_Manager(),
                    TRT_ClustersContainer=InDetKeys.
                    TRT_DriftCirclesUncalibrated(),
                    IsMagneticFieldOn=InDetFlags.solenoidOn())
                ToolSvc += InDetTRT_TrackSegmentsMakerPhase
                #InDetTRT_TrackSegmentsMakerPhase.OutputLevel = VERBOSE
                if (InDetFlags.doPrintConfigurables()):
                    printfunc(InDetTRT_TrackSegmentsMakerPhase)

            else:
                from TRT_TrackSegmentsTool_xk.TRT_TrackSegmentsTool_xkConf import InDet__TRT_TrackSegmentsMaker_BarrelCosmics
                InDetTRT_TrackSegmentsMaker = InDet__TRT_TrackSegmentsMaker_BarrelCosmics(
                    name='InDetTRTSegmentsMaker' + extension,
                    TrtManagerLocation=InDetKeys.TRT_Manager(),
                    TRT_ClustersContainer=InDetKeys.TRT_DriftCircles(),
                    IsMagneticFieldOn=InDetFlags.solenoidOn())

                ToolSvc += InDetTRT_TrackSegmentsMaker
                #InDetTRT_TrackSegmentsMaker.OutputLevel = VERBOSE
                if (InDetFlags.doPrintConfigurables()):
                    printfunc(InDetTRT_TrackSegmentsMaker)

        else:
            #
            # --- cut values
            #
            if extension == "_TRT":
                # TRT Subdetector segment finding
                MinNumberDCs = NewTrackingCuts.minTRTonly()
                pTmin = NewTrackingCuts.minPT()
                sharedFrac = NewTrackingCuts.maxTRTonlyShared()
            else:
                # TRT-only/back-tracking segment finding
                MinNumberDCs = NewTrackingCuts.minSecondaryTRTonTrk()
                pTmin = NewTrackingCuts.minSecondaryPt()
                sharedFrac = NewTrackingCuts.maxSecondaryTRTShared()
            #
            # --- offline version  of TRT segemnt making
            #
            from TRT_TrackSegmentsTool_xk.TRT_TrackSegmentsTool_xkConf import InDet__TRT_TrackSegmentsMaker_ATLxk
            InDetTRT_TrackSegmentsMaker = InDet__TRT_TrackSegmentsMaker_ATLxk(name                    = 'InDetTRT_SeedsMaker'+extension,
                                                                              TRT_ClustersContainer   = InDetKeys.TRT_DriftCircles(),
                                                                              PropagatorTool          = InDetPatternPropagator,
                                                                              TrackExtensionTool      = InDetTRTExtensionTool,
                                                                              PRDtoTrackMap           = prefix+'PRDtoTrackMap'+suffix \
                                                                                                          if usePrdAssociationTool else '',
                                                                              RemoveNoiseDriftCircles = InDetFlags.removeTRTNoise(),
                                                                              MinNumberDriftCircles   = MinNumberDCs,
                                                                              NumberMomentumChannel   = NewTrackingCuts.TRTSegFinderPtBins(),
                                                                              pTmin                   = pTmin,
                                                                              sharedFrac              = sharedFrac)
            ToolSvc += InDetTRT_TrackSegmentsMaker
            if (InDetFlags.doPrintConfigurables()):
                printfunc(InDetTRT_TrackSegmentsMaker)

            # Condition algorithm for InDet__TRT_TrackSegmentsMaker_ATLxk
            from AthenaCommon.AlgSequence import AthSequencer
            condSeq = AthSequencer("AthCondSeq")
            if not hasattr(condSeq,
                           "InDet__TRT_TrackSegmentsMakerCondAlg_ATLxk"):
                from TRT_TrackSegmentsTool_xk.TRT_TrackSegmentsTool_xkConf import InDet__TRT_TrackSegmentsMakerCondAlg_ATLxk
                InDetTRT_TrackSegmentsMakerCondAlg = InDet__TRT_TrackSegmentsMakerCondAlg_ATLxk(
                    name='InDetTRT_SeedsMakerCondAlg' + extension,
                    PropagatorTool=InDetPatternPropagator,
                    NumberMomentumChannel=NewTrackingCuts.TRTSegFinderPtBins(),
                    pTmin=pTmin)
                condSeq += InDetTRT_TrackSegmentsMakerCondAlg

        #
        # --- TRT track reconstruction
        #
        from TRT_TrackSegmentsFinder.TRT_TrackSegmentsFinderConf import InDet__TRT_TrackSegmentsFinder

        if doPhase:
            InDetTRT_TrackSegmentsFinderPhase = InDet__TRT_TrackSegmentsFinder(
                name='InDetTRT_TrackSegmentsFinderPhase' + extension,
                SegmentsMakerTool=InDetTRT_TrackSegmentsMakerPhase,
                SegmentsLocation=BarrelSegments)

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

        else:

            if InDetFlags.doCaloSeededTRTSegments(
            ) or NewTrackingCuts.RoISeededBackTracking():
                InDetTRT_TrackSegmentsFinder = InDet__TRT_TrackSegmentsFinder(
                    name='InDetTRT_TrackSegmentsFinder' + extension,
                    SegmentsMakerTool=InDetTRT_TrackSegmentsMaker,
                    SegmentsLocation=BarrelSegments,
                    useCaloSeeds=True,
                    CaloClusterEt=NewTrackingCuts.minRoIClusterEt(),
                    MinNumberDriftCircles=NewTrackingCuts.minSecondaryTRTonTrk(
                    ),
                    InputClusterContainerName=InDetKeys.
                    CaloClusterROIContainer())

            else:
                InDetTRT_TrackSegmentsFinder = InDet__TRT_TrackSegmentsFinder(
                    name='InDetTRT_TrackSegmentsFinder' + extension,
                    SegmentsMakerTool=InDetTRT_TrackSegmentsMaker,
                    SegmentsLocation=BarrelSegments,
                    InputClusterContainerName="")

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

        #
        # --- load TRT validation alg
        #
        if InDetFlags.doTruth() and not InDetFlags.doCosmics():
            from InDetSegmentDriftCircleAssValidation.InDetSegmentDriftCircleAssValidationConf import InDet__SegmentDriftCircleAssValidation
            InDetSegmentDriftCircleAssValidation = InDet__SegmentDriftCircleAssValidation(
                name="InDetSegmentDriftCircleAssValidation" + extension,
                OrigTracksLocation=BarrelSegments,
                TRT_DriftCirclesName=InDetKeys.TRT_DriftCircles(),
                pTmin=pTmin,
                Pseudorapidity=2.1,  # end of TRT
                RadiusMin=0.,
                RadiusMax=600.,
                MinNumberDCs=MinNumberDCs)
            topSequence += InDetSegmentDriftCircleAssValidation
            if (InDetFlags.doPrintConfigurables()):
                printfunc(InDetSegmentDriftCircleAssValidation)
    if len(runArgs.InDetBeamSpotExampleJobOption) > 0:
        print "Including: JobOption", runArgs.InDetBeamSpotExampleJobOption
        for i in runArgs.InDetBeamSpotExampleJobOption:
            include(i)
    else:
        print "No jobOption specified"
else:
    print "No jobOption specified"

#ToolSvc.InDetDetailedTrackSelectorTool.nHitSct = 0
#ToolSvc.InDetDetailedTrackSelectorTool.nHitSi  = 0

#include the fragment that makes the dpd files
include("InDetBeamSpotFinder/DPD_BeamSpotFragment.py")
print InDetFlags.doNtupleCreation()
print InDetKeys.trkValidationNtupleName()
print InDetFlags.doVtxNtuple()
#print XXX
print InDetFlags
print InputTrackCollection

#include("InDetRecExample/InDetRecConditionsAccess.py")
print "JW Detector summary"
print "DetFlags.haveRIO.pixel_on()", DetFlags.haveRIO.pixel_on()
print "InDetFlags.usePixelDCS()", InDetFlags.usePixelDCS()

print "InDetFlags.useSctDCS", InDetFlags.useSctDCS()
print "DetFlags.haveRIO.SCT_on", DetFlags.haveRIO.SCT_on()

print "DetFlags.haveRIO.TRT_on()", DetFlags.haveRIO.TRT_on()
print "InDetFlags.useTrtDCS", InDetFlags.useTrtDCS()
Пример #16
0
ToolSvc += InDetxAODParticleCreatorTool 
if InDetFlags.doPrintConfigurables(): 
    print InDetxAODParticleCreatorTool 

if (doCreation or doConversion):# or InDetFlags.useExistingTracksAsInput()) : <---- [XXX JDC Should we included this?
                                #                                                    problems appear when nothing should
                                #                                                    be done but
                                #                                                    useExistinTracksAsInput...
    # [XXX JDC: to deal with the MergedTracks case, the truth collections are
    #           defined in the InputTrackCollectionTruth variable. To be deprecated
    #           if finally there is no need of the special "MergedTrack" name
    if 'InputTrackCollectionTruth' not in dir():
        InputTrackCollectionTruth = InDetKeys.TracksTruth()
    from xAODTrackingCnv.xAODTrackingCnvConf import xAODMaker__TrackParticleCnvAlg 
    if not InDetFlags.doDBMstandalone(): 
        xAODTrackParticleCnvAlg = xAODMaker__TrackParticleCnvAlg(InDetKeys.xAODTrackParticleContainer()) 
        xAODTrackParticleCnvAlg.xAODContainerName = InDetKeys.xAODTrackParticleContainer() 
        xAODTrackParticleCnvAlg.xAODTrackParticlesFromTracksContainerName = InDetKeys.xAODTrackParticleContainer() 
        xAODTrackParticleCnvAlg.TrackContainerName = InputTrackCollection 
        xAODTrackParticleCnvAlg.TrackParticleCreator = InDetxAODParticleCreatorTool 
        xAODTrackParticleCnvAlg.AODContainerName = InDetKeys.TrackParticles() 
        xAODTrackParticleCnvAlg.AODTruthContainerName = InDetKeys.TrackParticlesTruth() 
        xAODTrackParticleCnvAlg.ConvertTrackParticles = doConversion 
        xAODTrackParticleCnvAlg.ConvertTracks = doCreation 
        xAODTrackParticleCnvAlg.AddTruthLink = InDetFlags.doTruth() 
        xAODTrackParticleCnvAlg.TrackTruthContainerName = InputTrackCollectionTruth
        xAODTrackParticleCnvAlg.PrintIDSummaryInfo = True 
        topSequence += xAODTrackParticleCnvAlg 
    if InDetFlags.doDBMstandalone() or InDetFlags.doDBM(): 
        xAODDBMTrackParticleCnvAlg = xAODMaker__TrackParticleCnvAlg(InDetKeys.xAODDBMTrackParticleContainer()) 
        xAODDBMTrackParticleCnvAlg.xAODContainerName = InDetKeys.xAODDBMTrackParticleContainer() 
Пример #17
0
                                    InDetFlags.doPrintConfigurables = True

                                    # --- activate (memory/cpu) monitoring
                                    #InDetFlags.doPerfMon = True

                                    # IMPORTANT NOTE: initialization of the flags and locking them is done in InDetRec_jobOptions.py!
                                    # This way RecExCommon just needs to import the properties without doing anything else!
                                    # DO NOT SET JOBPROPERTIES AFTER THIS LINE! The change will be ignored!

                                    # next section assures that keys are ok and nothing inconsistent is written out ...
                                    print "InDetRec_jobOptions: InDetKeys not set - setting to defaults"
                                    from InDetRecExample.InDetKeys import InDetKeys
                                    if InDetFlags.doVertexFinding():
                                        print "reDoPrimaryVertexing enabled: adjusting some StoreGate keys:"

                                        InDetKeys.PrimaryVertices = "New" + InDetKeys.PrimaryVertices(
                                        )
                                        print "InDetKeys.PrimaryVertices = " + InDetKeys.PrimaryVertices(
                                        )

                                        if readAOD:  # this one is mutally exclusive with useRefittedTrack.. and the doParticleCreation flag
                                            InDetKeys.Tracks = InDetKeys.TrackParticles(
                                            )
                                            print "InDetKeys.Tracks = " + InDetKeys.Tracks(
                                            )

                                            if InDetFlags.doParticleCreation():
                                                InDetKeys.TrackParticles = "New" + InDetKeys.TrackParticles(
                                                )
                                                InDetKeys.TrackParticlesTruth = "New" + InDetKeys.TrackParticlesTruth(
                                                )
                                                print "InDetKeys.TrackParticles      = " + InDetKeys.TrackParticles(
Пример #18
0
from InDetD3PDMaker.VertexD3PDAnalysisKeys import VertexD3PDAnalysisKeys

from D3PDMakerConfig.D3PDMakerFlags  import D3PDMakerFlags
from TrackD3PDMaker.TrackD3PDMakerFlags import TrackD3PDFlags

### Set flags of D3PD fillers, etc..
## First our own flags
# Set truth flag
VertexD3PDAnalysisFlags.useTruth = rec.doTruth()
# Set storegate collection names (where default may be wrong)
from InDetRecExample.InDetKeys import InDetKeys
if rec.readESD():
  InDetKeys.UnslimmedTracks              = 'Tracks'
  InDetKeys.UnslimmedTracksTruth         = 'TrackTruthCollection'
if rec.readAOD():
  InDetKeys.Tracks = InDetKeys.TrackParticles()
  InDetKeys.TracksTruth = InDetKeys.TrackParticlesTruth()
  #print "InDetKeys.Tracks = "+InDetKeys.Tracks()
  #print "InDetKeys.TracksTruth = "+InDetKeys.TracksTruth()  
  InDetKeys.McEventCollection = 'GEN_AOD'
#print D3PDMakerFlags

# Set default prefix for existing vertex collection
from InDetRecExample.InDetJobProperties import InDetFlags
if (not VertexD3PDAnalysisFlags.useAllVertexCollections()) and (not InDetFlags.useBeamConstraint()):
  #Assume we're dumping NBC vertices
  VertexD3PDAnalysisKeys.LabelDefaultVtx = 'vxnbc'

## Switch off trigger-related objects for other info D3PD dumpers (e.g. MET, Muons, ...)
D3PDMakerFlags.DoTrigger=False
Пример #19
0
        NnCollectionReadKey="PixelClusterNN",
        NnCollectionWithTrackReadKey="PixelClusterNNWithTrack")
    ToolSvc += NnClusterizationFactory

# Set up InDet__SiTrackerSpacePointFinder (alg)
# Taken from InDetRecExample/share/InDetRecPreProcessingSilicon.py
from SiSpacePointTool.SiSpacePointToolConf import InDet__SiSpacePointMakerTool

InDetSiSpacePointMakerTool = InDet__SiSpacePointMakerTool(
    name="InDetSiSpacePointMakerTool")
from SiSpacePointFormation.SiSpacePointFormationConf import InDet__SiTrackerSpacePointFinder

InDetSiTrackerSpacePointFinder = InDet__SiTrackerSpacePointFinder(
    name="InDetSiTrackerSpacePointFinder",
    SiSpacePointMakerTool=InDetSiSpacePointMakerTool,
    PixelsClustersName=InDetKeys.PixelClusters(),
    SCT_ClustersName=InDetKeys.SCT_Clusters(),
    SpacePointsPixelName=InDetKeys.PixelSpacePoints(),
    SpacePointsSCTName=InDetKeys.SCT_SpacePoints(),
    SpacePointsOverlapName=InDetKeys.OverlapSpacePoints(),
    ProcessPixels=DetFlags.haveRIO.pixel_on(),
    ProcessSCTs=DetFlags.haveRIO.SCT_on(),
    ProcessOverlaps=DetFlags.haveRIO.pixel_on() and DetFlags.haveRIO.SCT_on(),
    OverrideBeamSpot=not doBeamSpot)
if numThreads >= 2:
    InDetSiTrackerSpacePointFinder.Cardinality = numThreads
topSequence += InDetSiTrackerSpacePointFinder

# Set up ConfiguredNewTrackingCuts
# Taken from InDetRecExample/share/InDetRec_jobOptions.py
from InDetRecExample.ConfiguredNewTrackingCuts import ConfiguredNewTrackingCuts
Пример #20
0
      InDetESDList += ["TrackTruthCollection#"+InDetKeys.TRTTracks()+'TruthCollection']
      InDetESDList += ["DetailedTrackTruthCollection#"+InDetKeys.TRTTracks()+'DetailedTruth']
if InDetFlags.doPseudoTracking():
   InDetESDList+=["TrackCollection#"+InDetKeys.PseudoTracks()]
   if InDetFlags.doTruth():
      InDetESDList += ["TrackTruthCollection#"+InDetKeys.PseudoTracks()+'TruthCollection']
      InDetESDList += ["DetailedTrackTruthCollection#"+InDetKeys.PseudoTracks()+'DetailedTruth']

if InDetFlags.doDBMstandalone() or InDetFlags.doDBM(): 
   InDetESDList+=["TrackCollection#"+InDetKeys.DBMTracks()] 
   if InDetFlags.doTruth(): 
      InDetESDList += ["TrackTruthCollection#"+InDetKeys.DBMTracks()+'TruthCollection'] 
      InDetESDList += ["DetailedTrackTruthCollection#"+InDetKeys.DBMTracks()+'DetailedTruth'] 
   if InDetFlags.doxAOD(): 
      excludedAuxData = "-caloExtension.-cellAssociation.-clusterAssociation" 
      InDetESDList+=['xAOD::TrackParticleContainer#'+InDetKeys.xAODDBMTrackParticleContainer()] 
      InDetESDList+=['xAOD::TrackParticleAuxContainer#'+InDetKeys.xAODDBMTrackParticleContainer()+'Aux.' + excludedAuxData] 

# add the forward tracks for combined muon reconstruction
if InDetFlags.doForwardTracks():
   InDetESDList+=["TrackCollection#"+InDetKeys.ResolvedForwardTracks()]
   if InDetFlags.doTruth():
      InDetESDList += ["TrackTruthCollection#"+InDetKeys.ResolvedForwardTracks()+'TruthCollection']
      InDetESDList += ["DetailedTrackTruthCollection#"+InDetKeys.ResolvedForwardTracks()+'DetailedTruth']
if InDetFlags.doBeamGas():
   InDetESDList+=["TrackCollection#"+InDetBeamGasTRTExtension.ForwardTrackCollection()] #ExtendedHaloTracks
if InDetFlags.doBeamHalo():
   InDetESDList+=["TrackCollection#"+InDetRecHaloTRTExtension.ForwardTrackCollection()] #ExtendedBeamGasTracks 

if InDetFlags.doTrackSegmentsPixelPrdAssociation():
  InDetESDList+=["TrackCollection#"+InDetKeys.PixelPrdAssociationTracks()]
Пример #21
0
  InDetFlags.primaryVertexSetup = jobConfig['primaryVertexSetup']
if 'primaryVertexCutSetup' in jobConfig:
  InDetFlags.primaryVertexCutSetup = jobConfig['primaryVertexCutSetup']
if 'doPrimaryVertex3DFinding' in jobConfig:
    InDetFlags.doPrimaryVertex3DFinding = jobConfig['doPrimaryVertex3DFinding']

# --- activate (memory/cpu) monitoring
#InDetFlags.doPerfMon = True

# IMPORTANT NOTE: initialization of the flags and locking them is done in InDetRec_jobOptions.py!
# This way RecExCommon just needs to import the properties without doing anything else!
# DO NOT SET JOBPROPERTIES AFTER THIS LINE! The change will be ignored!

from InDetRecExample.InDetKeys import InDetKeys
if InDetFlags.doVertexFinding() and readAOD:
  InDetKeys.Tracks = InDetKeys.TrackParticles()
  if jobConfig['doPrintIndetConfig']:
    print "InDetKeys.Tracks = "+InDetKeys.Tracks()

if readESD and not redoPatternRecoAndTracking:
  InDetKeys.UnslimmedTracks              = 'Tracks'
  InDetKeys.UnslimmedTracksTruth         = 'TrackTruthCollection'

# Set outputfile properly, so that we get version tags included
# For the time being, we keep the patch for older releases
try:
  if doWriteESD:
    InDetKeys.OutputESDFileName = jobConfig['outputfile']
  if doWriteAOD:
    InDetKeys.OutputAODFileName = jobConfig['outputfile']
except:
Пример #22
0
from InDetConversionFinderTools.InDetConversionFinderToolsConf import InDet__VertexPointEstimator
VtxPointEstimator = InDet__VertexPointEstimator(
    name="VtxPointEstimator",
    MinDeltaR=[-10000., -10000., -10000.],
    MaxDeltaR=[10000., 10000., 10000.],
    MaxPhi=[10000., 10000., 10000.],
    MaxChi2OfVtxEstimation=2000.)
ToolSvc += VtxPointEstimator
print VtxPointEstimator

from InDetRecExample.InDetKeys import InDetKeys

from InDetAssociationTools.InDetAssociationToolsConf import InDet__InDetPRD_AssociationToolGangedPixels
InDetPrdAssociationTool = InDet__InDetPRD_AssociationToolGangedPixels(
    name="CascadeInDetPrdAssociationTool",
    PixelClusterAmbiguitiesMapName=InDetKeys.GangedPixelMap())
ToolSvc += InDetPrdAssociationTool
print InDetPrdAssociationTool

from InDetTrackSummaryHelperTool.InDetTrackSummaryHelperToolConf import InDet__InDetTrackSummaryHelperTool
InDetTrackSummaryHelperTool = InDet__InDetTrackSummaryHelperTool(
    name="CascInDetSummaryHelper",
    AssoTool=InDetPrdAssociationTool,
    DoSharedHits=False,
    HoleSearch=InDetHoleSearchTool,
    usePixel=DetFlags.haveRIO.pixel_on(),
    useSCT=DetFlags.haveRIO.SCT_on(),
    useTRT=DetFlags.haveRIO.TRT_on())
ToolSvc += InDetTrackSummaryHelperTool
print InDetTrackSummaryHelperTool
Пример #23
0
InDetFlags.doV0Finder = False
InDetFlags.doSimpleV0Finder = False
InDetFlags.doTrkNtuple = False
InDetFlags.doPixelTrkNtuple = False
InDetFlags.doSctTrkNtuple = False
InDetFlags.doTrtTrkNtuple = False
InDetFlags.doSctClusterNtuple = False
InDetFlags.doVtxNtuple = False
InDetFlags.doConvVtxNtuple = False
InDetFlags.doV0VtxNtuple = False
InDetFlags.doRefit = False
InDetFlags.doLowBetaFinder = False
InDetFlags.doPrintConfigurables = True

from InDetRecExample.InDetKeys import InDetKeys
InDetKeys.lockAllExceptAlias()
InDetKeys.print_JobProperties()

OutputLevel = INFO
doEdmMonitor = False
doJiveXML = False
doVP1 = False
doAuditors = False
doWriteESD = False
doWriteAOD = False

include("InDetRecExample/InDetRec_all.py")

from AthenaCommon.AlgSequence import AlgSequence
algSeq = AlgSequence()
Пример #24
0
InDetSecVxFitterTool = Trk__TrkVKalVrtFitter(
    name="InclusiveVxFitter",
    Extrapolator=ToolSvc.AtlasExtrapolator,
    IterationNumber=30,
    AtlasMagFieldSvc="AtlasFieldSvc")

ToolSvc += InDetSecVxFitterTool

#
# Add driving algorithm
#
from VrtSecDecay.VrtSecDecayConf import VKalVrtAthena__VrtSecDecay
VrtSecDecayFinder = VKalVrtAthena__VrtSecDecay(
    name="VrtSecDecayFinder",
    VertexFitterTool=InDetSecVxFitterTool,
    OutputVtxContainer=InDetKeys.xAODSecVertexDecayContainer(),
    ParentxAODContainer=InDetKeys.xAODPixelThreeLayerTrackParticleContainer(),
    ChildxAODContainer=InDetKeys.xAODTrackParticleContainer(),
    DoHitPatternMatching=False,
    DoAngularMatching=True,
    DoRadiusSorting=False,
    MaxVtxPerEvent=200,
    VtxQuality=10.0,
    VtxMinRadius=85.0,
    VtxMaxRadius=300.0,
    ParentPt=20000.0,
    ParentMinEta=0.1,
    ParentMaxEta=20.0,
    ChildMinPt=100.0,
    ChildMaxPt=1500.0,
    ChildBLayerHits=0,
Пример #25
0
InDetFlags.doConvVtxNtuple = False
InDetFlags.doV0VtxNtuple = False
InDetFlags.doRefit = doRefitTracks
InDetFlags.doLowBetaFinder = False
InDetFlags.doPrintConfigurables = True

# --- activate (memory/cpu) monitoring
#InDetFlags.doPerfMon = True

# IMPORTANT NOTE: initialization of the flags and locking them is done in InDetRec_jobOptions.py!
# This way RecExCommon just needs to import the properties without doing anything else!
# DO NOT SET JOBPROPERTIES AFTER THIS LINE! The change will be ignored!

from InDetRecExample.InDetKeys import InDetKeys
if InDetFlags.doVertexFinding() and readAOD:
    InDetKeys.Tracks = InDetKeys.TrackParticles()

# uncomment if you don't want to overwrite the original fits (e.g. for comparison)
# this would also require enabling "pass-through" output mode (see bottom of this file)
# or else manually adding the input collection to the output stream
#if InDetFlags.doVertexFinding():
#  InDetKeys.xAODVertexContainer = "RefitPrimaryVertices"

if readESD and not redoPatternRecoAndTracking:
    InDetKeys.UnslimmedTracks = 'Tracks'
    InDetKeys.UnslimmedTracksTruth = 'TrackTruthCollection'

# Set container names
if doWriteESD:
    InDetKeys.OutputESDFileName = "InDetRecESD_new.root"
Пример #26
0
from InDetRecExample.InDetKeys import InDetKeys

kwargsHitMonAlg = {
    'doOnline': True if athenaCommonFlags.isOnline() else
    False,  #Histograms for online (athenaPT) running
    'doModules': True if athenaCommonFlags.isOnline() else
    False,  #Turn on/off the sets of 1744 module histograms (for dqmf)
    'doLumiBlock': False if athenaCommonFlags.isOnline() else
    True,  #Turn on/off histograms stored for each lumi block
    'doLowOccupancy':
    False,  #Turn on/off histograms with binning for cosmics/single beam                    
    'doHighOccupancy':
    True,  #Turn on/off histograms with binning for collisions
    'doHeavyIonMon':
    InDetFlags.doHeavyIon(),  # Histogram modification for heavy ion monitoring
    'RDOName': InDetKeys.PixelRDOs()
}

kwargsClusMonAlg = {
    'doOnline': True if athenaCommonFlags.isOnline() else
    False,  #Histograms for online (athenaPT) running
    'doModules': True if athenaCommonFlags.isOnline() else
    False,  #Turn on/off the sets of 1744 module histograms (for dqmf)
    'doLumiBlock': False if athenaCommonFlags.isOnline() else
    True,  #Turn on/off histograms stored for each lumi block
    'doLowOccupancy':
    False,  #Turn on/off histograms with binning for cosmics/single beam
    'doHighOccupancy':
    True,  #Turn on/off histograms with binning for collisions
    'doHeavyIonMon':
    InDetFlags.doHeavyIon(),  # Histogram modification for heavy ion monitoring
Пример #27
0
    def __init__(self,
                 extension="",
                 InputCollections=None,
                 NewTrackingCuts=None,
                 BarrelSegments=None,
                 TrackCollectionKeys=[],
                 TrackCollectionTruthKeys=[]):

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

        # --- Always use PRD association tool (even if only 1 collection) to remove TRT
        #     segments with significant overlaping hits
        usePrdAssociationTool = True
        #usePrdAssociationTool = True if len(InputCollections) > 0 else False

        #
        # --- get list of already associated hits (always do this, even if no other tracking ran before)
        #
        if usePrdAssociationTool:
            from InDetTrackPRD_Association.InDetTrackPRD_AssociationConf import InDet__InDetTrackPRD_Association
            InDetTRTonly_PRD_Association = InDet__InDetTrackPRD_Association(
                name='InDetTRTonly_PRD_Association' + extension,
                AssociationTool=InDetPrdAssociationTool,
                TracksName=list(InputCollections))
            topSequence += InDetTRTonly_PRD_Association
            if (InDetFlags.doPrintConfigurables()):
                print InDetTRTonly_PRD_Association

        #
        # Cut values and output key for the TRT segments standalone TRT track finder
        #
        if extension == "_TRT":
            # TRT track segments
            pTmin = NewTrackingCuts.minPT()
            self.__TRTStandaloneTracks = InDetKeys.TRTTracks()
        else:
            # TRT standalone
            # pTmin                      = NewTrackingCuts.minSecondaryPt()
            pTmin = NewTrackingCuts.minTRTonlyPt(
            )  # new cut parameter to make it flexible...
            self.__TRTStandaloneTracks = InDetKeys.TRTTracks_NewT()

        #
        # --- set up special Scoring Tool for standalone TRT tracks
        #
        from InDetTrackScoringTools.InDetTrackScoringToolsConf import InDet__InDetTrtTrackScoringTool
        InDetTRT_StandaloneScoringTool = InDet__InDetTrtTrackScoringTool(
            name='InDetTRT_StandaloneScoringTool' + extension,
            SummaryTool=InDetTrackSummaryTool,
            DriftCircleCutTool=InDetTRTDriftCircleCut,
            useAmbigFcn=True,
            useSigmaChi2=False,
            PtMin=pTmin,
            minTRTonTrk=NewTrackingCuts.minTRTonly(),
            maxEta=2.1,
            UseParameterization=NewTrackingCuts.useTRTonlyParamCuts(),
            OldTransitionLogic=NewTrackingCuts.useTRTonlyOldLogic(),
            minTRTPrecisionFraction=NewTrackingCuts.minSecondaryTRTPrecFrac())
        # InDetTRT_StandaloneScoringTool.OutputLevel = VERBOSE
        ToolSvc += InDetTRT_StandaloneScoringTool
        if (InDetFlags.doPrintConfigurables()):
            print InDetTRT_StandaloneScoringTool

        #
        # set up TRT_SegmentToTrackTool
        #
        from TRT_SegmentToTrackTool.TRT_SegmentToTrackToolConf import InDet__TRT_SegmentToTrackTool
        InDetTRT_SegmentToTrackTool = InDet__TRT_SegmentToTrackTool(
            name='InDetTRT_SegmentToTrackTool' + extension,
            RefitterTool=InDetTrackFitterTRT,
            UseAssociationTool=usePrdAssociationTool,
            AssociationTool=InDetPrdAssociationTool,
            ScoringTool=InDetTRT_StandaloneScoringTool,
            Extrapolator=InDetExtrapolator,
            FinalRefit=True,
            MaxSharedHitsFraction=NewTrackingCuts.maxTRTonlyShared(),
            SuppressHoleSearch=True)
        ToolSvc += InDetTRT_SegmentToTrackTool
        if (InDetFlags.doPrintConfigurables()):
            print InDetTRT_SegmentToTrackTool

        if not InDetFlags.doCosmics():
            #
            # --- TRT standalone tracks algorithm
            #

            from TRT_StandaloneTrackFinder.TRT_StandaloneTrackFinderConf import InDet__TRT_StandaloneTrackFinder
            InDetTRT_StandaloneTrackFinder = InDet__TRT_StandaloneTrackFinder(
                name='InDetTRT_StandaloneTrackFinder' + extension,
                MinNumDriftCircles=NewTrackingCuts.minTRTonly(),
                MinPt=NewTrackingCuts.minTRTonlyPt(),
                InputSegmentsLocation=BarrelSegments,
                MaterialEffects=0,
                ResetPRD=True if extension == "_TRT" else False,
                OldTransitionLogic=NewTrackingCuts.useTRTonlyOldLogic(),
                OutputTracksLocation=self.__TRTStandaloneTracks,
                TRT_SegToTrackTool=InDetTRT_SegmentToTrackTool)
            #InDetTRT_StandaloneTrackFinder.OutputLevel = VERBOSE
            topSequence += InDetTRT_StandaloneTrackFinder
            if InDetFlags.doPrintConfigurables():
                print InDetTRT_StandaloneTrackFinder

            # --- Delete TRT segments for the subdetector pattern only (back-tracking has already run by this point)
            from InDetRecExample.ConfiguredInDetSGDeletion import InDetSGDeletionAlg
            InDetSGDeletionAlg(container="Trk::SegmentCollection#",
                               key=BarrelSegments)

        else:
            #
            # --- cosmics segment to track conversion for Barrel
            #

            from TRT_SegmentsToTrack.TRT_SegmentsToTrackConf import InDet__TRT_SegmentsToTrack
            InDetTrkSegmenttoTrk = InDet__TRT_SegmentsToTrack(
                name="InDetTRT_SegmentsToTrack_Barrel" + extension,
                InputSegmentsCollection=BarrelSegments,
                OutputTrackCollection=self.__TRTStandaloneTracks,
                TrackFitter=InDetTrackFitter,
                MinNHit=NewTrackingCuts.minTRTonly(),
                CombineTracks=False,
                OutputCombiCollection="",
                InputSCTCollection="",
                OutlierRemoval=True,
                MaterialEffects=False)
            #InDetTrkSegmenttoTrk.OutputLevel = VERBOSE
            topSequence += InDetTrkSegmenttoTrk
            if InDetFlags.doPrintConfigurables():
                print InDetTrkSegmenttoTrk

        #
        #
        # ------------ Track truth.
        #
        if (extension == "_TRT" or not InDetFlags.doSGDeletion()):
            if InDetFlags.doTruth():
                #
                # set up the truth info for this container
                #
                include("InDetRecExample/ConfiguredInDetTrackTruth.py")
                InDetTracksTruth = ConfiguredInDetTrackTruth(
                    self.__TRTStandaloneTracks,
                    self.__TRTStandaloneTracks + "DetailedTruth",
                    self.__TRTStandaloneTracks + "TruthCollection")
                #
                # add final output for statistics
                #
                TrackCollectionKeys += [InDetTracksTruth.Tracks()]
                TrackCollectionTruthKeys += [InDetTracksTruth.TracksTruth()]
            else:
                TrackCollectionKeys += [self.__TRTStandaloneTracks]
Пример #28
0
#+++++++++++++++++ Beginning of WriteInDetESD.py
# Writes out all InDet ESD Data
from InDetRecExample.InDetKeys import InDetKeys
InDetESDList = []

# Save full and zero-suppressed BCM rdos
# (the latter is needed to allow writting to AOD and the former will hopefully be removed in future):
if not InDetFlags.doDBMstandalone():
    InDetESDList += ["BCM_RDO_Container#" + InDetKeys.BCM_RDOs()]
    InDetESDList += ["BCM_RDO_Container#" + InDetKeys.BCM_CompactDOs()]

# In case of cosmics we save the RDOs as well
if InDetFlags.writeRDOs():
    InDetESDList += [
        'PixelRDO_Container#' + InDetKeys.PixelRDOs(),
        'SCT_RDO_Container#' + InDetKeys.SCT_RDOs(),
        'TRT_RDO_Container#' + InDetKeys.TRT_RDOs()
    ]

# write phase calculation into ESD
if InDetFlags.doTRTPhaseCalculation():
    InDetESDList += ['ComTime#TRT_Phase']

# Save PRD.
# ---------
from AthenaCommon.GlobalFlags import globalflags
if globalflags.DataSource == 'data' and InDetFlags.doHeavyIon():
    printfunc(
        "---- > Heavy Ions: No Pixel, SCT or TRT cluster output written for data"
    )
elif InDetFlags.writePRDs():
Пример #29
0
											
											if InDetFlags.doParticleCreation():
												InDetKeys.TrackParticles      = "New"+InDetKeys.TrackParticles()
												InDetKeys.TrackParticlesTruth = "New"+InDetKeys.TrackParticlesTruth()
												print "InDetKeys.TrackParticles      = "+InDetKeys.TrackParticles()
												print "InDetKeys.TrackParticlesTruth = "+InDetKeys.TrackParticlesTruth()
											else:
												InDetKeys.TrackParticles      = "Dummy"
												InDetKeys.TrackParticlesTruth = "Dummy"
												
												if InDetFlags.doConversions():
													InDetKeys.Conversions = "New"+InDetKeys.Conversions()
													InDetKeys.SecVertices = "New"+InDetKeys.SecVertices()
													
													print "Printing InDetKeys. Be aware that some might be adjusted lateron!"
													InDetKeys.print_JobProperties()
													
										                        # --------------------------------------------------------------
													# enable statistics for reading ESD testing
										                        # --------------------------------------------------------------
										      
													InDetFlags.doStatistics   = doInDetRecStatistics
													InDetKeys.StatNtupleName = "InDetRecStatistics.root"
													TrackCollectionKeys        = [InDetKeys.Tracks()]
													TrackCollectionTruthKeys   = [InDetKeys.TracksTruth()]
													
										                        # --------------------------------------------------------------
													# load master joboptions file
													# --------------------------------------------------------------

													include("InDetRecExample/InDetRec_all.py")
# Example
#Reco_tf.py --steering 'doRAWtoALL' --ignoreErrors 'True'  --inputBSFile /tmp/amorley/data16_13TeV.00310809.calibration_BeamSpot.merge.RAW/data16_13TeV.00310809.calibration_BeamSpot.merge.RAW._lb0743._SFO-ALL._0001.1 --outputAODFile /tmp/amorley/AOD.pool.root --conditionsTag all:CONDBR2-ES1PA-2016-03 --AMITag 'c1042' --autoConfiguration='everything' --maxEvents '-1' --preInclude 'all:InDetBeamSpotExample/preIncludeRecoForBeamspot.py' --postExec  'all:from IOVDbSvc.CondDB import conddb; conddb.addOverride("/Indet/AlignL1/ID" ,"IndetAlignL1ID-RUN2-BLK-UPD4-02"); conddb.addOverride("/Indet/AlignL2/PIX" ,"IndetAlignL2PIX-RUN2-BLK-UPD4-02"); conddb.addOverride("/Indet/AlignL2/SCT" ,"IndetAlignL2SCT-RUN2-BLK-UPD4-02"); conddb.addOverride("/Indet/AlignL3"     ,"IndetAlignL3-RUN2-BLK-UPD4-02"); conddb.addOverride("/Indet/IBLDist"     ,"InDetIBLDist-RUN2-BLK-UPD4-01"); conddb.addOverride("/TRT/AlignL1/TRT"   ,"TRTAlignL1-RUN2-BLK-UPD4-02"); conddb.addOverride("/TRT/AlignL2"       ,"TRTAlignL2-RUN2-BLK-UPD4-02");' --preExec  'all:from AtlasGeoModel.InDetGMJobProperties import GeometryFlags; GeometryFlags.useDynamicAlignFolders.set_Value_and_Lock(True); from RecExConfig.RecFlags import rec;rec.UserAlgs.set_Value_and_Lock("InDetBeamSpotFinder/BeamspotRefitVertex.py")' --postInclude 'all:BeamSpotFinder/postInclude.addSCTonlyToAODFile.py' --geometryVersion all:ATLAS-R2-2015-04-00-00 --maxEvents 10

from InDetRecExample.InDetKeys import InDetKeys
containerName = "SCTonlyVertex"
from InDetBeamSpotFinder.InDetBeamSpotFinderConf import RefitTracksAndVertex
thisRefitTracksAndVertex = RefitTracksAndVertex(
    name='RefitTracksAndVertex',
    TrackFitter=ToolSvc.InDetTrackFitter,
    VertexFitterTool=InDetVxFitterTool,
    VertexListInput=InDetKeys.xAODVertexContainer(),
    OutputVertexContainer=containerName)
#thisRefitTracksAndVertex.SelEtaMin = -0.8
#thisRefitTracksAndVertex.SelEtaMax =  0.8
#thisRefitTracksAndVertex.OutputLevel = 1

from RecExConfig.RecFlags import rec
topSequence += thisRefitTracksAndVertex
    InDetFlags.init()
    #
    if InDetFlags.Enabled():

        InDetFlags.printInfo()
        InDetFlags.print_JobProperties()

        from AthenaCommon.GlobalFlags import globalflags
        # rec flags are needed (e.g. for commissioning steering ...)
        from RecExConfig.RecFlags import rec

        #
        # ----------- import, lock and print InDetKeys
        #
        from InDetRecExample.InDetKeys import InDetKeys
        InDetKeys.lockAllExceptAlias()
        print "Printing InDetKeys"
        InDetKeys.print_JobProperties()

        #
        # --- setup of cut values for NewTracking
        #
        if (not 'InDetNewTrackingCuts' in dir()):
            print "InDetRec_jobOptions: InDetNewTrackingCuts not set before - import them now"
            from InDetRecExample.ConfiguredNewTrackingCuts import ConfiguredNewTrackingCuts
            if InDetFlags.doCosmics():
                InDetNewTrackingCuts = ConfiguredNewTrackingCuts("Cosmics")
            elif InDetFlags.doHeavyIon():
                InDetNewTrackingCuts = ConfiguredNewTrackingCuts("HeavyIon")
            elif InDetFlags.doSLHC():
                InDetNewTrackingCuts = ConfiguredNewTrackingCuts("SLHC")
Пример #32
0
        False,  #Turn on/off histograms displaying pixel occupancy.  VERY memory heavy!      
        doLumiBlock=False if athenaCommonFlags.isOnline() else
        True,  #Turn on/off histograms stored for each lumi block
        doTiming=True,  #Turn on/off histograms with BCID/timing information  
        doRDO=
        True,  #Turn on/off histograms with RDO/Hit  information                                 
        doErrors=
        True,  #Turn on/off histograms with ROD Error information                                 
        doSpacePoint=
        True,  #Turn on/off histograms with Spacepoint information                                 
        doCluster=True,  #Turn on/off histograms with Cluster information
        doTrack=
        False,  #Turn on/off histograms with Track information                                 
        doStatus=True,  #Turn on/off histograms with Module Status information
        doDCS=doDCS,
        RDOName=InDetKeys.PixelRDOs(),
        RODErrorName="pixel_error_summary",
        SpacePointName=InDetKeys.PixelSpacePoints(),
        ClusterName=InDetKeys.PixelClusters(),
        DetailsMod1=
        "D1A_B03_S2_M3",  #Give the 4 modules which you want to do detailed monitoring of                        
        DetailsMod2=
        "L0_B05_S2_M1A",  #Use the normal name like D1A_B03_S2_M4 or                                             
        DetailsMod3=
        "L1_B10_S1_M2C",  #L1_B10_S2_M2C and the code should be able to parse
        DetailsMod4="D2C_B01_S1_M6")

    InDetPixelMainsMon.TrackName = InDetKeys.PixelTracks(
    ) if InDetFlags.doTrackSegmentsPixel() else InDetKeys.Tracks()

    ##Other parameters
Пример #33
0
    def __init__(self,
                 Tracks=None,
                 DetailedTruth=None,
                 TracksTruth=None,
                 PixelClustersTruth=InDetKeys.PixelClustersTruth(),
                 SCT_ClustersTruth=InDetKeys.SCT_ClustersTruth(),
                 TRT_DriftCirclesTruth=InDetKeys.TRT_DriftCirclesTruth()):

        from InDetRecExample.InDetJobProperties import InDetFlags
        from AthenaCommon.DetFlags import DetFlags
        from InDetRecExample.InDetKeys import InDetKeys
        #
        # get ToolSvc and topSequence
        #
        from AthenaCommon.AppMgr import ToolSvc
        from AthenaCommon.AlgSequence import AlgSequence
        from RecExConfig.hideInput import hideInput
        topSequence = AlgSequence()
        #
        # --- Enable the detailed track truth
        #
        from InDetTruthAlgs.InDetTruthAlgsConf import InDet__InDetDetailedTrackTruthMaker
        hideInput('DetailedTrackTruthCollection', DetailedTruth)
        DetailedTruthMaker = InDet__InDetDetailedTrackTruthMaker(
            name=DetailedTruth + "Maker",
            TrackCollectionName=Tracks,
            DetailedTrackTruthName=DetailedTruth,
            TruthNamePixel=PixelClustersTruth,
            TruthNameSCT=SCT_ClustersTruth,
            TruthNameTRT=TRT_DriftCirclesTruth)

        # this is how the truth maker gets to know which detector is on ...
        if (not DetFlags.haveRIO.pixel_on()):
            DetailedTruthMaker.TruthNamePixel = ""
        if (not DetFlags.haveRIO.SCT_on()):
            DetailedTruthMaker.TruthNameSCT = ""
        # for cosmics, at the stage of SiPatternRecognition, the TRT truth information is not yet available
        if ((not DetFlags.haveRIO.TRT_on())
                or (InDetFlags.doCosmics() and
                    (DetailedTruth == "SiSPSeededTracksDetailedTruth"
                     or DetailedTruth == "ResolvedTracksDetailedTruth"))):
            DetailedTruthMaker.TruthNameTRT = ""

        #if Tracks == "Tracks":
        #    DetailedTruthMaker.OutputLevel = VERBOSE
        topSequence += DetailedTruthMaker
        if (InDetFlags.doPrintConfigurables()):
            printfunc(DetailedTruthMaker)
        #
        # --- Detailed to old TrackTruth
        #
        if InDetFlags.truthMatchStrategy() == 'TruthMatchRatio':
            from TrkTruthCreatorTools.TrkTruthCreatorToolsConf import Trk__TruthMatchRatio as InDetTruthMatchTool
        elif InDetFlags.truthMatchStrategy() == 'TruthMatchTanimoto':
            from TrkTruthCreatorTools.TrkTruthCreatorToolsConf import Trk__TruthMatchTanimoto as InDetTruthMatchTool
        else:
            printfunc(
                "ConfiguredInDetTrackTruth: error! InDetFlags.truthMatchStrategy must be TruthMatchRatio or TruthMatchTanimoto but is: "
                + InDetFlags.truthMatchStrategy())

        InDetTruthMatchSimilarityTool = InDetTruthMatchTool(
            name="InDetTruthMatchTool",
            WeightPixel=10.,
            WeightSCT=5.,
            WeightTRT=1.)

        # --- only add this once !!!
        if not hasattr(ToolSvc, "InDetTruthMatchTool"):
            ToolSvc += InDetTruthMatchSimilarityTool
            if (InDetFlags.doPrintConfigurables()):
                printfunc(InDetTruthMatchSimilarityTool)

        from TrkTruthAlgs.TrkTruthAlgsConf import TrackTruthSimilaritySelector
        InDetTruthSimilaritySelector = TrackTruthSimilaritySelector(
            name=TracksTruth + "Selector",
            DetailedTrackTruthName=DetailedTruth,
            OutputName=TracksTruth,
            TrackTruthSimilarityTool=InDetTruthMatchSimilarityTool)
        #if Tracks == "Tracks":
        #    InDetTruthSimilaritySelector.OutputLevel = VERBOSE
        topSequence += InDetTruthSimilaritySelector
        if (InDetFlags.doPrintConfigurables()):
            printfunc(InDetTruthSimilaritySelector)

        # --- remember imput
        self.__Tracks = Tracks
        self.__TracksTruth = TracksTruth
        self.__DetailedTruth = DetailedTruth
Пример #34
0
        printfunc(InDetPixelRodDecoder)
    #InDetPixelRodDecoder.OutputLevel = VERBOSE

    from PixelRawDataByteStreamCnv.PixelRawDataByteStreamCnvConf import PixelRawDataProviderTool
    InDetPixelRawDataProviderTool = PixelRawDataProviderTool(
        name="InDetPixelRawDataProviderTool", Decoder=InDetPixelRodDecoder)
    #ToolSvc += InDetPixelRawDataProviderTool
    if (InDetFlags.doPrintConfigurables()):
        printfunc(InDetPixelRawDataProviderTool)
    #InDetPixelRawDataProviderTool.OutputLevel = VERBOSE

    # load the PixelRawDataProvider
    from PixelRawDataByteStreamCnv.PixelRawDataByteStreamCnvConf import PixelRawDataProvider
    InDetPixelRawDataProvider = PixelRawDataProvider(
        name="InDetPixelRawDataProvider",
        RDOKey=InDetKeys.PixelRDOs(),
        ProviderTool=InDetPixelRawDataProviderTool)
    topSequence += InDetPixelRawDataProvider
    if (InDetFlags.doPrintConfigurables()):
        printfunc(InDetPixelRawDataProvider)
    #InDetPixelRawDataProvider.OutputLevel = VERBOSE

    #ServiceMgr.ByteStreamAddressProviderSvc.TypeNames += [ "PixelRDO_Container/"+InDetKeys.PixelRDOs() ]

if DetFlags.readRDOBS.SCT_on():
    from SCT_RawDataByteStreamCnv.SCT_RawDataByteStreamCnvConf import SCT_RodDecoder
    InDetSCTRodDecoder = SCT_RodDecoder(name="InDetSCTRodDecoder")
    if (InDetFlags.doPrintConfigurables()):
        printfunc(InDetSCTRodDecoder)
    #InDetSCTRodDecoder.OutputLevel = VERBOSE
#  InDetKeys.xAODVertexContainer = "RefitPrimaryVertices" 

if readESD and not redoPatternRecoAndTracking:
    InDetKeys.UnslimmedTracks              = 'Tracks'
    InDetKeys.UnslimmedTracksTruth         = 'TrackTruthCollection'
    InDetKeys.UnslimmedDetailedTracksTruth = 'DetailedTrackTruth'

# Set container names
if doWriteESD:
  InDetKeys.OutputESDFileName = "InDetRecESD_new.root"

if doWriteAOD:
  InDetKeys.OutputAODFileName = "InDetRecAOD_new.root"  

## JDC -- for the Vtx converter, although it should be removed eventually #####
InDetKeys.xAODTrackParticleContainer = InDetKeys.xAODLargeD0TrackParticleContainer()
## JDC -- #####

print "Printing InDetKeys"
InDetKeys.lockAllExceptAlias()
InDetKeys.print_JobProperties()

#--------------------------------------------------------------
# enable statistics for reading ESD testing
#--------------------------------------------------------------

InDetFlags.doStatistics   = doInDetRecStatistics
TrackCollectionKeys        = [InDetKeys.Tracks()]
TrackCollectionTruthKeys   = [InDetKeys.TracksTruth()]

# Uncomment to use medical image seeding