def __init__(self,name="MooSegmentFinder",**kwargs): kwargs.setdefault( "SegmentCombiner", "MuonCurvedSegmentCombiner" ) kwargs.setdefault( "SegmentCombinationCleaner", "MuonSegmentCombinationCleanerTool" ) if( muonStandaloneFlags.reconstructionMode() == 'collisions'): kwargs.setdefault( "HoughPatternFinder", "MuonLayerHoughTool" ) else: kwargs.setdefault( "HoughPatternFinder", "MuonHoughPatternFinderTool" ) kwargs.setdefault( "MdtSegmentMaker", "MuonPatternSegmentMaker" ) kwargs.setdefault( "DoSegmentCombinations", False ) kwargs.setdefault( "DoSegmentCombinationCleaning", False ) kwargs.setdefault( "DoCscSegments", muonRecFlags.doCSCs() ) kwargs.setdefault( "DoMdtSegments", muonRecFlags.doMDTs() ) if muonRecFlags.doCSCs(): kwargs.setdefault( "Csc2dSegmentMaker","Csc2dSegmentMaker" ) kwargs.setdefault( "Csc4dSegmentMaker", "Csc4dSegmentMaker" ) else: kwargs.setdefault( "Csc2dSegmentMaker", None ) kwargs.setdefault( "Csc4dSegmentMaker", None ) if muonStandaloneFlags.printSummary(): kwargs.setdefault( "DoSummary", True ) self.applyUserDefaults(kwargs,name) # set some defaults # call the base class ctor super(MooSegmentCombinationFinder,self).__init__(name,**kwargs)
def getMuonCalibAlg(eventTag): global topSequence, beamFlags try: return topSequence.MuonCalibAlg except AttributeError: from MuonCalibAlgs.MuonCalibAlgsConf import MuonCalib__MuonCalibAlg MuonCalibAlg = MuonCalib__MuonCalibAlg( "MuonCalibAlg", doMDTs=muonRecFlags.doMDTs(), doCSCs=muonRecFlags.doCSCs(), doRPCs=muonRecFlags.doRPCs(), doTGCs=(muonRecFlags.doTGCs() and muonRecFlags.calibNtupleRawTGC()), doTGCCoinData=(muonRecFlags.doTGCs() and muonRecFlags.calibNtupleRawTGC()), doTruth=rec.doTruth(), DoPrdSelect=muonRecFlags.doPrdSelect( ), # optional cutting away of PRD hits to simulate dead channels NtupleName=muonRecFlags.calibNtupleOutput( ), # set the name of the output calibration ntuple EventTag=eventTag) if beamFlags.beamType == 'singlebeam' or beamFlags.beamType == 'cosmics': MuonCalibAlg.addTriggerTag = False else: MuonCalibAlg.addTriggerTag = rec.doTrigger() MuonCalibAlg.doTruth = rec.doTruth() topSequence += MuonCalibAlg return topSequence.MuonCalibAlg
def __init__(self, name="MuPatHitTool", **kwargs): self.applyUserDefaults(kwargs, name) if not muonRecFlags.doCSCs(): # overwrite whatever is set kwargs["CscRotCreator"] = None super(MuPatHitTool, self).__init__(name, **kwargs) getPublicTool("ResidualPullCalculator")
def MuonRefitTool(name,**kwargs): if not muonRecFlags.doCSCs(): kwargs["CscRotCreator"] = None # To activate the tuning of meas. errors using alignment constants from DB # kwargs.setdefault("AlignmentErrorTool", getPublicTool("MuonAlignmentErrorTool")) # kwargs.setdefault("DeweightBEE", False) # kwargs.setdefault("DeweightEE", False) if conddb.dbdata == 'COMP200' or conddb.dbmc == 'COMP200' or 'HLT' in globalflags.ConditionsTag() or conddb.isOnline : kwargs["AlignmentErrorTool"] = None return CfgMgr.Muon__MuonRefitTool(name,**kwargs)
def __init__(self,name="MuonCurvedSegmentCombiner",**kwargs): self.applyUserDefaults(kwargs,name) if (beamFlags.beamType() == 'singlebeam' or beamFlags.beamType() == 'cosmics'): kwargs.setdefault( "MissedHitsCut", 100 ) kwargs.setdefault( "AddUnassociatedMiddleEndcapSegments", False ) elif globalflags.DataSource() == 'data': #collisions-data or simulation first data kwargs.setdefault( "MissedHitsCut", 100 ) else: kwargs.setdefault( "MissedHitsCut", 4 ) kwargs.setdefault("DoCosmics", muonStandaloneFlags.reconstructionMode() != 'collisions' ) kwargs.setdefault( "AddAll2DCscs", False ) kwargs.setdefault( "UseCscSegments", muonRecFlags.doCSCs() ) kwargs.setdefault( "AddUnassociatedMiddleEndcapSegments", True ) super(MuonCurvedSegmentCombiner,self).__init__(name,**kwargs)
def configure(self,keys=None): super(MuonStandalone,self).configure(keys) if not self.isEnabled(): return print " configuring MuonStandalone: flags ", muonStandaloneFlags from AthenaCommon.BeamFlags import jobproperties beamFlags = jobproperties.Beam SegmentLocation = "MuonSegments" if muonStandaloneFlags.segmentOrigin == 'TruthTracking': SegmentLocation = "ThirdChainSegments" if muonRecFlags.doNSWNewThirdChain(): getPublicTool("MuonLayerHoughTool") self.addAlg( CfgMgr.MuonLayerHoughAlg( "MuonLayerHoughAlg", PrintSummary = muonStandaloneFlags.printSummary() ) ) if not muonStandaloneFlags.patternsOnly(): SegmentFinder = getPublicTool("MuonClusterSegmentFinderTool") Cleaner = getPublicToolClone("MuonTrackCleaner_seg","MuonTrackCleaner") Cleaner.PullCut = 3 Cleaner.PullCutPhi = 3 SegmentFinder.TrackCleaner = Cleaner # for test purposes allow parallel running of truth segment finding and new segment finder MuonSegmentFinderAlg = CfgMgr.MuonSegmentFinderAlg( "MuonSegmentMaker",SegmentCollectionName=SegmentLocation, MuonPatternCalibration = getPublicTool("MuonPatternCalibration"), MuonPatternSegmentMaker = getPublicTool("MuonPatternSegmentMaker"), MuonTruthSummaryTool = None, PrintSummary = muonStandaloneFlags.printSummary() ) if( muonRecFlags.doCSCs() ): getPublicTool("CscSegmentUtilTool") getPublicTool("Csc2dSegmentMaker") getPublicTool("Csc4dSegmentMaker") else: MuonSegmentFinderAlg.Csc2dSegmentMaker = None MuonSegmentFinderAlg.Csc4dSegmentMaker = None self.addAlg( MuonSegmentFinderAlg ) else: getPublicTool("MuonLayerHoughTool") self.addAlg( CfgMgr.MooSegmentFinderAlg( "MuonSegmentMaker", SegmentFinder = getPublicToolClone("MuonSegmentFinder","MooSegmentFinder", DoSummary=muonStandaloneFlags.printSummary()), MuonSegmentOutputLocation = SegmentLocation, UseCSC = muonRecFlags.doCSCs(), UseMDT = muonRecFlags.doMDTs(), UseRPC = muonRecFlags.doRPCs(), UseTGC = muonRecFlags.doTGCs(), UseTGCPriorBC = muonRecFlags.doTGCs() and muonRecFlags.useTGCPriorNextBC(), UseTGCNextBC = muonRecFlags.doTGCs() and muonRecFlags.useTGCPriorNextBC(), doTGCClust = muonRecFlags.doTGCClusterSegmentFinding(), doRPCClust = muonRecFlags.doRPCClusterSegmentFinding() )) self.addAlg( CfgMgr.MooSegmentFinderAlg( "MuonSegmentMaker_NCB", SegmentFinder = getPublicToolClone("MooSegmentFinder_NCB","MuonSegmentFinder", DoSummary=False, Csc2dSegmentMaker = getPublicToolClone("Csc2dSegmentMaker_NCB","Csc2dSegmentMaker", segmentTool = getPublicToolClone("CscSegmentUtilTool_NCB", "CscSegmentUtilTool", TightenChi2 = False, IPconstraint=False)), Csc4dSegmentMaker = getPublicToolClone("Csc4dSegmentMaker_NCB","Csc4dSegmentMaker", segmentTool = getPublicTool("CscSegmentUtilTool_NCB")), DoMdtSegments=False,DoSegmentCombinations=False,DoSegmentCombinationCleaning=False), MuonPatternCombinationLocation = "NCB_MuonHoughPatternCombinations", MuonSegmentOutputLocation = "NCB_MuonSegments", MuonSegmentCombinationOutputLocation = "NCB_MooreSegmentCombinations", UseCSC = muonRecFlags.doCSCs(), UseMDT = False, UseRPC = False, UseTGC = False, UseTGCPriorBC = False, UseTGCNextBC = False, doTGCClust = False, doRPCClust = False) ) self.addAlg( CfgMgr.xAODMaker__MuonSegmentCnvAlg("MuonSegmentCnvAlg") ) self.addAlg( CfgMgr.xAODMaker__MuonSegmentCnvAlg("MuonSegmentCnvAlg_NCB",SegmentContainerName="NCB_MuonSegments",xAODContainerName="NCB_MuonSegments") ) if muonStandaloneFlags.doSegmentsOnly(): return # Tracks builder # # add the algorithm (which uses the MuonTrackSteering) # TrackBuilder = CfgMgr.MuPatTrackBuilder("MuPatTrackBuilder", TrackSteering = getPublicTool("MuonTrackSteering") ) self.addAlg( TrackBuilder ) self.registerOutputKey("MuonSpectrometerTracks", self.MuPatTrackBuilder, "SpectrometerTrackOutputLocation") self.registerInputKey ("MuonSegments", self.MuPatTrackBuilder, "MuonSegmentCollection" ) if muonStandaloneFlags.createTrackParticles() and DetFlags.ID_on(): from xAODTrackingCnv.xAODTrackingCnvConf import xAODMaker__TrackParticleCnvAlg xAODTrackParticleCnvAlg = xAODMaker__TrackParticleCnvAlg( name = "MuonStandaloneTrackParticleCnvAlg", TrackParticleCreator = getPublicTool("MuonParticleCreatorTool"), TrackContainerName = "MuonSpectrometerTracks", xAODTrackParticlesFromTracksContainerName = "MuonSpectrometerTrackParticles", ConvertTrackParticles = False, ConvertTracks = True ) self.addAlg( xAODTrackParticleCnvAlg )
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration # MDT Calibration tools/services are defined in MuonCnvExample/python/MuonCalibConfig.py # For backwards compatibility, they are instantiated here, but this whole module # will be obsolete as soon as all clients have moved to the ConfiguredFactory and all C++ declares the Calib Services & Tools from AthenaCommon.Logging import logging logging.getLogger().info("Importing %s", __name__) from AthenaCommon.CfgGetter import getPublicTool, getService from MuonRecFlags import muonRecFlags muonRecFlags.setDefaults() if muonRecFlags.doCSCs(): CscCalibTool = getPublicTool("CscCalibTool") if muonRecFlags.doMDTs(): MdtDbTool = getPublicTool("MdtCalibDbTool") MdtCalibDbSvc = getService("MdtCalibrationDbSvc") MdtCalibSvc = getService("MdtCalibrationSvc")