Пример #1
0
            from egammaRec.CBNT_egammaGetter import CBNT_egammaSofteGetter
            CBNT_egammaSofteGetter()

            from egammaRec.CBNT_egammaGetter import CBNT_egammaAODGetter
            CBNT_egammaAODGetter()

        from egammaRec.CBNT_egammaGetter import CBNT_egammaPhotonAODGetter
        CBNT_egammaPhotonAODGetter()

        if rec.doTruth():
            from egammaRec.CBNT_egTruthGetter import CBNT_egTruthGetter
            CBNT_egTruthGetter()
    except Exception:
        treatException("Could not load CBNT_egamma. Switched off !")

if rec.doMuonCombined() or rec.readESD() or rec.readAOD():
    protectedInclude("MuonCombinedRecExample/MuonCombined_CBNT_jobOptions.py")

if recAlgs.doMissingET() or rec.readESD() or rec.readAOD():
    protectedInclude("MissingET/MissingET_CBNT_jobOptions.py")

#if recAlgs.doObjMissingET() or rec.readESD() or rec.readAOD():
#        protectedInclude ("ObjMissingET/ObjMissingET_CBNT_jobOptions.py")

#if recAlgs.doMissingETSig() or rec.readESD() or rec.readAOD() :
#        protectedInclude ("MissingETSig/MissingETSig_CBNT_jobOptions.py")

## #comment out until statuscode is fixed
# not supported anymore
## if recAlgs.doEFlow() or rec.readESD():
##          protectedInclude ("eflowRec/jobOptions_CBNT_eflow.py")
Пример #2
0
        treatException("Cannot include CaloExtensionBuilder !")

#
# functionality : electron photon identification
#
#
pdr.flag_domain('egamma')
if rec.doEgamma():
    protectedInclude("egammaRec/egammaRec_jobOptions.py")
AODFix_postEgammaRec()

#
# functionality : Muon combined reconstruction
#
pdr.flag_domain('muoncomb')
if rec.doMuonCombined() and DetFlags.Muon_on() and DetFlags.ID_on():
    try:
        include("MuonCombinedRecExample/MuonCombinedRec_config.py")
    except Exception:
        treatException(
            "Could not set up combined muon reconstruction. Switched off !")
        rec.doMuonCombined = False

#
#  functionality : add cells crossed by high pt ID tracks
#
if rec.doESD() and recAlgs.doTrackParticleCellAssociation() and DetFlags.ID_on(
) and DetFlags.Muon_on() and DetFlags.Calo_on():
    from AthenaCommon.CfgGetter import getPublicTool
    getPublicTool("MuonCombinedInDetDetailedTrackSelectorTool")
    from TrkExTools.AtlasExtrapolator import AtlasExtrapolator
Пример #3
0
def setupMuonCalibNtuple():
    global topSequence, muonRecFlags, beamFlags, ToolSvc, rec, DetFlags
    if not rec.doMuon() or not DetFlags.Muon_on():
        logMuon.warning(
            "Not setting up requested Muon Calibration Ntuple because Muons are off"
        )
        return

    logMuon.info("Setting up Muon Calibration Ntuple")
    try:
        configs = getCalibConfigs()
        # MuonSegmentToCalibSegment is only needed if we want segments
        if muonRecFlags.calibNtupleSegments and muonRecFlags.calibMuonStandalone:
            MuonSegmentToCalibSegment = getMuonSegmentToCalibSegment()

        # MuonCalibAlg is always needed
        eventTag = "UNKNOWN"
        if (muonRecFlags.calibNtupleSegments or muonRecFlags.calibNtupleTracks
            ) and muonRecFlags.calibMuonStandalone:
            if len(configs) >= 1:
                eventTag = configs[0]["eventTag"]
        elif muonRecFlags.calibNtupleTrigger:
            eventTag = "TRIG"
        else:
            eventTag = "HITS"

        MuonCalibAlg = getMuonCalibAlg(eventTag)
        # configure for writing ntuple
        from MuonCalibTools.MuonCalibToolsConf import MuonCalib__PatternNtupleMaker
        MuonCalibTool = MuonCalib__PatternNtupleMaker(
            "MuonCalibPatternNtupleMaker")
        MuonCalibTool.FillTruth = rec.doTruth()
        MuonCalibTool.DoRawTGC = (muonRecFlags.doTGCs()
                                  and muonRecFlags.calibNtupleRawTGC())
        ToolSvc += MuonCalibTool
        MuonCalibAlg.MuonCalibTool = MuonCalibTool

        # MuonCalibExtraTree only if we want to write tracks
        if muonRecFlags.calibNtupleTracks:
            MuonCalibTool.DelayFinish = True
            from MuonCalibExtraTreeAlg.MuonCalibExtraTreeAlgConf import MuonCalib__MuonCalibExtraTreeAlg
            MuonCalibExtraTreeAlg = MuonCalib__MuonCalibExtraTreeAlg(
                "MuonCalibExtraTreeAlg",
                NtupleName="PatternNtupleMaker",
            )
            segmentOnTrackSelector = None
            if hasattr(topSequence, "MuonSegmentToCalibSegment"):
                from MuonCalibExtraTreeAlg.MuonCalibExtraTreeAlgConf import MuonCalib__SegmentOnTrackSelector
                segmentOnTrackSelector = MuonCalib__SegmentOnTrackSelector()
                segmentOnTrackSelector.PattternLocation = "PatternsForCalibration"
                ToolSvc += segmentOnTrackSelector
                MuonCalibExtraTreeAlg.SegmentOnTrackSelector = segmentOnTrackSelector
            if not rec.doMuonCombined():
                tool_nr = 0
                from MuonCalibExtraTreeAlg.MuonCalibExtraTreeAlgConf import MuonCalib__ExtraTreeTrackFillerTool
                resPullCalc = getPublicTool("ResidualPullCalculator")
                for config in configs:
                    trackDumpTool = MuonCalib__ExtraTreeTrackFillerTool(
                        "ExtraTreeTrackFillerTool" + str(tool_nr))
                    trackDumpTool.TrackCollectionKey = config['tracksKey']
                    trackDumpTool.SegmentAuthors = [config['segmentAuthor']]
                    trackDumpTool.TrackAuthor = config['trackAuthor']
                    trackDumpTool.PullCalculator = resPullCalc
                    ToolSvc += trackDumpTool
                    MuonCalibExtraTreeAlg.TrackFillerTools.append(
                        trackDumpTool)
                    tool_nr += 1
            # configure needed tools

            # add to topSequence
            topSequence += MuonCalibExtraTreeAlg

        # MuonCalibExtraTreeTriggerAlg only if trigger is available
        if muonRecFlags.calibNtupleTrigger:  # and DetFlags.detdescr.LVL1_on() and DetFlags.haveRDO.LVL1_on():
            # protect against running without AtlasTrigger project
            doMuCTPI = True
            if doMuCTPI:
                try:
                    from TrigT1RPCRecRoiSvc import TrigT1RPCRecRoiConfig
                    from TrigT1TGCRecRoiSvc import TrigT1TGCRecRoiConfig
                except ImportError:
                    logMuon.warning(
                        "MuonCalibExtraTreeTriggerAlg.doMuCTPI = False because AtlasTrigger is not available"
                    )
                    doMuCTPI = False

            # delay writing of MuonCalibAlg
            MuonCalibTool.DelayFinish = True
            # also delay MuonCalibExtraTreeAlg if it is running
            try:
                topSequence.MuonCalibExtraTreeAlg.DelayFinish = True
            except AttributeError:
                pass

            from MuonCalibExtraTreeAlg.MuonCalibExtraTreeAlgConf import MuonCalib__MuonCalibExtraTreeTriggerAlg
            topSequence += MuonCalib__MuonCalibExtraTreeTriggerAlg(
                'MuonCalibExtraTreeTriggerAlg',
                doMuCTPI=doMuCTPI,
                doLVL1Calo=rec.doTile() or rec.doLArg()
                or DetFlags.haveRDO.Calo_on(),
                doMBTS=rec.doTile() or DetFlags.haveRDO.Tile_on())

    except:
        from AthenaCommon.Resilience import treatException
        treatException(
            "Problem in MuonCalib - Muon Calibration Ntuple configuration probably incomplete"
        )
Пример #4
0
from AthenaCommon.BeamFlags import jobproperties
if jobproperties.Beam.beamType == 'cosmics':
    jetFlags.useVertices = False

# Skip pflow if we are not using tracks.
print myname + "Initial usePFlow: " + sflagstat(jetFlags.usePFlow)
if not jetFlags.usePFlow.statusOn:
    jetFlags.usePFlow = jetFlags.useTracks()
print myname + "Final usePFlow: " + sflagstat(jetFlags.usePFlow)

# Skip use of muon segments if not built.
# No action if someone has already set the flag.
print myname + "Initial use muon segments: " + sflagstat(
    jetFlags.useMuonSegments)
if not jetFlags.useMuonSegments.statusOn:
    jetFlags.useMuonSegments = rec.doMuon() and rec.doMuonCombined()
print myname + "  Final use muon segments: " + sflagstat(
    jetFlags.useMuonSegments)

# Use rec flag to control BTagging.
# No. Disable this unit we get support from Btagging to do this.
# No action if someone has already set the flag.
print myname + "Initial use Btagging: " + str(jetFlags.useBTagging)
print myname + "     rec do BTagging: " + str(rec.doBTagging())
if not jetFlags.useBTagging.statusOn:
    #jetFlags.useBTagging = rec.doBTagging()
    jetFlags.useBTagging = False
print myname + "  Final use Btagging: " + str(jetFlags.useBTagging)

# The following can be used to exclude tools from reconstruction.
if 0:
Пример #5
0
    DQMonFlags.doTRTElectronMon = False
    DQMonFlags.doInDetGlobalMon = False
    DQMonFlags.doInDetAlignMon = False
    DQMonFlags.doInDetPerfMon = False

if (not rec.doMuon()) or (rec.readRDO()
                          and not jobproperties.MuonRec.Enabled()):
    DQMonFlags.doMuonRawMon = False
    DQMonFlags.doMuonSegmentMon = False
    DQMonFlags.doMuonTrackMon = False
    DQMonFlags.doMuonAlignMon = False
    DQMonFlags.doMuonPhysicsMon = False
    DQMonFlags.doMuonTrkPhysMon = False
    DQMonFlags.doMuonCombinedMon = False

if (not rec.doMuonCombined()) or (rec.readRDO() and
                                  not jobproperties.MuonCombinedRec.Enabled()):
    DQMonFlags.doMuonCombinedMon = False

if (not rec.doEgamma()) or (rec.readRDO()
                            and not jobproperties.egammaRecFlags.Enabled()):
    DQMonFlags.doEgammaMon = False

#if (not rec.doJetRec()) or (rec.readRDO() and not jobproperties.JetRecFlags.Enabled()):
if (not rec.doJetMissingETTag()
        or (rec.readRDO() and not jobproperties.JetRecFlags.Enabled())):
    DQMonFlags.doJetMon = False
    DQMonFlags.doMissingEtMon = False
    DQMonFlags.doJetTagMon = False

#if (not rec.doTau()) or (rec.readRDO() and not jobproperties.TauRecFlags.Enabled()):
Пример #6
0
# Disable usage of vertices in pflow jets, if we are using cosmic data.
from AthenaCommon.BeamFlags import jobproperties
if jobproperties.Beam.beamType == 'cosmics':
  jetFlags.useVertices = False

# Skip pflow if we are not using tracks.
print myname + "Initial usePFlow: " + sflagstat(jetFlags.usePFlow)
if not jetFlags.usePFlow.statusOn:
  jetFlags.usePFlow = jetFlags.useTracks()
print myname + "Final usePFlow: " + sflagstat(jetFlags.usePFlow)

# Skip use of muon segments if not built.
# No action if someone has already set the flag.
print myname + "Initial use muon segments: " + sflagstat(jetFlags.useMuonSegments)
if not jetFlags.useMuonSegments.statusOn:
  jetFlags.useMuonSegments = rec.doMuon() and rec.doMuonCombined()
print myname + "  Final use muon segments: " + sflagstat(jetFlags.useMuonSegments)

# Use rec flag to control BTagging.
# No. Disable this unit we get support from Btagging to do this.
# No action if someone has already set the flag.
print myname + "Initial use Btagging: " + str(jetFlags.useBTagging)
print myname + "     rec do BTagging: " + str(rec.doBTagging())
if not jetFlags.useBTagging.statusOn:
  #jetFlags.useBTagging = rec.doBTagging()
  jetFlags.useBTagging = False
print myname + "  Final use Btagging: " + str(jetFlags.useBTagging)

# The following can be used to exclude tools from reconstruction.
if 0:
  jetFlags.skipTools = ["comshapes"]
Пример #7
0
#
# functionality : electron photon identification
#
#

pdr.flag_domain('egamma')
if rec.doEgamma():
    protectedInclude( "egammaRec/egammaRec_jobOptions.py" )
AODFix_postEgammaRec()


#
# functionality : Muon combined reconstruction
#
pdr.flag_domain('muoncomb')
if rec.doMuonCombined() and DetFlags.Muon_on() and DetFlags.ID_on():
    try:
        include ("MuonCombinedRecExample/MuonCombinedRec_config.py")
    except Exception:
        treatException("Could not set up combined muon reconstruction. Switched off !")
        rec.doMuonCombined = False

#
#  functionality : add cells crossed by high pt ID tracks 
#
if rec.doESD() and recAlgs.doTrackParticleCellAssociation():
    from AthenaCommon.CfgGetter import getPublicTool
    getPublicTool("MuonCombinedInDetDetailedTrackSelectorTool")
    topSequence += CfgMgr.TrackParticleCellAssociationAlg("TrackParticleCellAssociationAlg")

#
   DQMonFlags.doTRTMon=False
   DQMonFlags.doTRTElectronMon=False
   DQMonFlags.doInDetGlobalMon=False
   DQMonFlags.doInDetAlignMon=False
   DQMonFlags.doInDetPerfMon=False

if (not rec.doMuon()) or (rec.readRDO() and not jobproperties.MuonRec.Enabled()):
   DQMonFlags.doMuonRawMon=False
   DQMonFlags.doMuonSegmentMon=False
   DQMonFlags.doMuonTrackMon=False
   DQMonFlags.doMuonAlignMon=False
   DQMonFlags.doMuonPhysicsMon=False
   DQMonFlags.doMuonTrkPhysMon=False
   DQMonFlags.doMuonCombinedMon=False

if (not rec.doMuonCombined()) or (rec.readRDO() and not jobproperties.MuonCombinedRec.Enabled()):
   DQMonFlags.doMuonCombinedMon=False

if (not rec.doEgamma()) or (rec.readRDO() and not jobproperties.egammaRecFlags.Enabled()):
   DQMonFlags.doEgammaMon=False

#if (not rec.doJetRec()) or (rec.readRDO() and not jobproperties.JetRecFlags.Enabled()):
if (not rec.doJetMissingETTag() or (rec.readRDO() and not jobproperties.JetRecFlags.Enabled())):
   DQMonFlags.doJetMon=False
   DQMonFlags.doMissingEtMon=False
   DQMonFlags.doJetTagMon=False

#if (not rec.doTau()) or (rec.readRDO() and not jobproperties.TauRecFlags.Enabled()):
if (not rec.doTau()):
   DQMonFlags.doTauMon=False