예제 #1
0
    def setDefaults(self):
        global beamFlags, muonRecFlags, muonStandaloneFlags
        # set defaults of the flags that its using
        muonRecFlags.setDefaults()

        muonStandaloneFlags.setDefaults()

        from MuonRecExample.MuonRecUtils import setJobPropertyDefault as setDefault

        haveMuonTracks = muonRecFlags.doStandalone() and self.doAOD
        # This logic doesn't work - doAOD seems to be off with Vakho's standard test
        #        if not haveMuonTracks:
        #            if not muonRecFlags.doStandalone():
        #                print "turning off doxAOD because doStandalone is off"
        #            if not self.doAOD:
        #                print "turning off doxAOD because doAOD is off"
        #            setDefault(self.doxAOD,False)

        if beamFlags.beamType() == 'cosmics' or beamFlags.beamType(
        ) == 'singlebeam':
            # Algorithms for CaloMuonCollection
            setDefault(self.doCaloTrkMuId, self.doAOD())
            # Algorithms for MuGirlLowBetaCollection
            setDefault(self.doMuGirlLowBeta, self.doAOD())

        #else: # collisions
        # Algorithms for CaloMuonCollection
        #setDefault(self.doCaloTrkMuId,self.doAOD())
        # Algorithms for MuGirlLowBetaCollection
        #setDefault(self.doMuGirlLowBeta,self.doAOD())
        #setDefault(self.doMuGirl,self.doAOD())    # also for new MuonCollection

        if beamFlags.beamType() == 'cosmics':
            setDefault(self.doLArMuId, True)
        else:
            setDefault(self.doLArMuId, False)

        # tracking performance algorithms, take defaults from muonRecFlags
        setDefault(self.doTrackPerformance, muonRecFlags.doTrackPerformance())
        setDefault(self.TrackPerfDebugLevel,
                   muonRecFlags.TrackPerfDebugLevel())
        setDefault(self.TrackPerfSummaryLevel,
                   muonRecFlags.TrackPerfSummaryLevel())
    from AthenaCommon import CfgGetter
    topSequence.MuonTruthDecorationAlg.MCTruthClassifier = CfgGetter.getPublicTool(
        "MCTruthClassifier")

    try:
        from RecExConfig.InputFilePeeker import inputFileSummary
        truthStrategy = inputFileSummary['metadata']['/Simulation/Parameters'][
            'TruthStrategy']
        if truthStrategy in ['MC15', 'MC18', 'MC18LLP']:
            topSequence.MuonTruthDecorationAlg.BarcodeOffset = 10000000
    except:
        print "Failed to read /Simulation/Parameters/ metadata"
        pass

#load default tools:
if muonRecFlags.doStandalone() or muonRecFlags.doPseudoTracking():
    include("MuonRecExample/MuonRecLoadTools.py")

if muonRecFlags.doPseudoTracking():
    include("MuonRecExample/MuonTrackTruthCreation.py")

if muonRecFlags.doStandalone():
    #
    # Load reconstruction algorithms (MuonStandalone)
    #
    from MuonRecExample.MuonRec import muonRec

    if rec.doTruth():
        from MuonTruthAlgs.MuonTruthAlgsConf import MuonDetailedTrackTruthMaker
        from MuonTruthAlgs.MuonTruthAlgsConf import Muon__MuonSegmentTruthAssociationAlg
        from TrkTruthAlgs.TrkTruthAlgsConf import TrackTruthSelector
예제 #3
0
from MuonTrackPerformance.MuonTrackPerformanceConf import MuonTrackStatisticsAlg

MuonTrackStatistics = MuonTrackStatisticsAlg("MuonTrackStatistics")
MuonTrackStatistics.doTruth = True
MuonTrackStatistics.writeToFile = True  #False
MuonTrackStatistics.FileName = "trkSummary.txt"

#uncomment below to add a muon container to the summary
from MuonRecExample.MuonRecFlags import muonRecFlags

if muonRecFlags.doMoore():
    MuonTrackStatistics.TrackLocationList += ["MooreTracks"]
if muonRecFlags.doMuonboy():
    MuonTrackStatistics.TrackLocationList += ["ConvertedMBoyTracks"]
if muonRecFlags.doStandalone():
    MuonTrackStatistics.TrackLocationList += ["MuonSpectrometerTracks"]

#MuonTrackStatistics.TrackLocationList += ["ConvertedMuIdCBTracks"]
#MuonTrackStatistics.TrackLocationList += ["ConvertedStacoTracks"]
#MuonTrackStatistics.TrackLocationList += ["MuGirlRefittedTracks"]

if rec.doTruth():
    if muonRecFlags.doMoore():
        MuonTrackStatistics.TruthTrackLocationList += ["MooreTracksTruth"]
    if muonRecFlags.doMuonboy():
        MuonTrackStatistics.TruthTrackLocationList += [
            "ConvertedMBoyTracksTruth"
        ]
    if muonRecFlags.doStandalone():
        MuonTrackStatistics.TruthTrackLocationList += [