Esempio n. 1
0
def setupMuonCalib():
    global topSequence, ToolSvc
    if not rec.doMuon() or not DetFlags.Muon_on():
        logMuon.warning(
            "Not setting up requested Muon Calibration because Muons are off")
        return

    logMuon.info("Setting up Muon Calibration")
    try:
        from MuonCnvExample.MuonCalibFlags import muonCalibFlags
        muonCalibFlags.setDefaults()

        configs = getCalibConfigs()
        #
        # MuonSegmentToCalibSegment
        #
        calibConfig = muonRec.allConfigs()[0].getCalibConfig(
        )  #muonRec.getConfig(muonCalibFlags.EventTag()).getCalibConfig()
        MuonSegmentToCalibSegment = getMuonSegmentToCalibSegment()
        #
        # MuonCalibAlg
        #
        MuonCalibAlg = getMuonCalibAlg(muonCalibFlags.EventTag())

        from MdtCalibTools.MdtCalibToolsConf import MuonCalib__MdtCalibTool
        MuonCalibTool = MuonCalib__MdtCalibTool()
        calibMode = muonCalibFlags.Mode()
        if calibMode == 'regionNtuple':
            from MdtCalibTools.MdtCalibToolsConf import MuonCalib__MdtCalibNtupleMakerTool
            MdtCalibTool = MuonCalib__MdtCalibNtupleMakerTool()
        else:
            raise RuntimeError("Unknown Muon Calibration Mode: %r" % calibMode)

        ToolSvc += MdtCalibTool
        MuonCalibTool.MdtCalibTool = MdtCalibTool

        ToolSvc += MuonCalibTool
        MuonCalibAlg.MuonCalibTool = MuonCalibTool

    except:
        from AthenaCommon.Resilience import treatException
        treatException(
            "Problem in MuonCalib - Muon Calibration configuration probably incomplete"
        )
Esempio n. 2
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"
        )
Esempio n. 3
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:
Esempio n. 4
0
from RecExConfig.RecFlags import rec
from RecExConfig.RecAlgsFlags import recAlgs

#AOD list, also added to the ESD
IsoAODESList = []

if rec.doWriteAOD() or rec.doWriteESD():
    if rec.doMuon() or rec.doEgamma():
        IsoAODESList += ["xAOD::EventShape#TopoClusterIsoCentralEventShape"]
        IsoAODESList += [
            "xAOD::EventShapeAuxInfo#TopoClusterIsoCentralEventShapeAux."
        ]
        IsoAODESList += ["xAOD::EventShape#TopoClusterIsoForwardEventShape"]
        IsoAODESList += [
            "xAOD::EventShapeAuxInfo#TopoClusterIsoForwardEventShapeAux."
        ]
        IsoAODESList += [
            "xAOD::EventShape#TopoClusterIsoVeryForwardEventShape"
        ]
        IsoAODESList += [
            "xAOD::EventShapeAuxInfo#TopoClusterIsoVeryForwardEventShapeAux."
        ]
        if recAlgs.doEFlow():
            IsoAODESList += [
                "xAOD::EventShape#ParticleFlowIsoCentralEventShape"
            ]
            IsoAODESList += [
                "xAOD::EventShapeAuxInfo#ParticleFlowIsoCentralEventShapeAux."
            ]
            IsoAODESList += [
                "xAOD::EventShape#ParticleFlowIsoForwardEventShape"
Esempio n. 5
0
    IsolationBuilder,
    name="IsolationBuilder",
    CaloCellIsolationTool=CaloIsolationTool,
    CaloTopoIsolationTool=CaloIsolationTool,
    PFlowIsolationTool=CaloIsolationTool,
    TrackIsolationTool=TrackIsolationTool,
    FeIsoTypes=[] if not rec.doEgamma() else IsoTypesFe,
    FeCorTypes=IsoCorFe,
    FeCorTypesExtra=IsoCorFeExtra,
    ElIsoTypes=[] if not rec.doEgamma() else IsoTypes,
    ElCorTypes=IsoCorEg,
    ElCorTypesExtra=IsoCorEgExtra,
    PhIsoTypes=[] if not rec.doEgamma() else IsoTypes,
    PhCorTypes=IsoCorEg,
    PhCorTypesExtra=IsoCorEgExtra,
    MuIsoTypes=IsoTypes if rec.doMuon() and muonRecFlags.doMuonIso() else [],
    MuCorTypes=IsoCorMu,
    MuCorTypesExtra=IsoCorMuExtra)

from RecExConfig.Configured import Configured


class isoGetter(Configured):
    def configure(self):
        mlog = logging.getLogger('isoGetter.py::configure:')
        mlog.info('entering')

        # configure iso here:
        try:
            self._isoBuilderHandle = isoBuilder()
        except Exception:
Esempio n. 6
0
                          and not jobproperties.CaloRecFlags.Enabled()):
    DQMonFlags.doCaloMon = False
    DQMonFlags.doTileMon = False
    DQMonFlags.doLArMon = False

if (not rec.doInDet()) or (rec.readRDO()
                           and not jobproperties.InDetJobProperties.Enabled()):
    DQMonFlags.doPixelMon = False
    DQMonFlags.doSCTMon = False
    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()):
Esempio n. 7
0
if not hasattr(ServiceMgr, 'THistSvc'):
    from GaudiSvc.GaudiSvcConf import THistSvc
    ServiceMgr += THistSvc()

for filename in tf.NtupleProductionFlags.FileNames():
    ServiceMgr.THistSvc.Output += [
        filename + " DATAFILE=\'" + filename + "\' OPT=\'RECREATE\'"
    ]

# MinBias
if tf.NtupleProductionFlags.SliceTuples.doSlice("MinBias"):
    include("TrigMinBiasNtuple/TrigMinBiasNtuple_jo.py")
    pass

# Muon
if tf.NtupleProductionFlags.SliceTuples.doSlice("Muon") and rec.doMuon():
    include("TrigMuonNtuple/TrigMuonNtuple_jo.py")
    pass

# Tau
if tf.NtupleProductionFlags.SliceTuples.doSlice("Tau") and rec.doTau():
    include("TrigTauPerformAthena/TrigTauNtuple_jo.py")
    pass

# Egamma
if tf.NtupleProductionFlags.SliceTuples.doSlice("EGamma") and rec.doEgamma():
    include("TrigEgammaNtuple/TrigEgammaNtuple_jo.py")
    pass

#L1Calo
if tf.NtupleProductionFlags.SliceTuples.doSlice("L1Calo"):
Esempio n. 8
0
        [isoPar.neflowisol20, isoPar.neflowisol30, isoPar.neflowisol40])
    IsoCorEg.append([isoPar.coreCone, isoPar.pileupCorrection])
    IsoCorMu.append([isoPar.coreCone, isoPar.pileupCorrection])

from IsolationAlgs.IsolationAlgsConf import IsolationBuilder
isoBuilder = AlgFactory(IsolationBuilder,
                        name="IsolationBuilder",
                        CaloCellIsolationTool=CaloIsolationTool,
                        CaloTopoIsolationTool=CaloIsolationTool,
                        PFlowIsolationTool=CaloIsolationTool,
                        TrackIsolationTool=TrackIsolationTool,
                        FeIsoTypes=[[]] if not rec.doEgamma() else IsoTypesFe,
                        FeCorTypes=IsoCorFe,
                        EgIsoTypes=[[]] if not rec.doEgamma() else IsoTypes,
                        EgCorTypes=IsoCorEg,
                        MuIsoTypes=[[]] if not rec.doMuon() else IsoTypes,
                        MuCorTypes=IsoCorMu,
                        LeakageTool=None,
                        OutputLevel=3)

from RecExConfig.Configured import Configured


class isoGetter(Configured):
    def configure(self):
        mlog = logging.getLogger('isoGetter.py::configure:')
        mlog.info('entering')

        # configure iso here:
        try:
            self._isoBuilderHandle = isoBuilder()
Esempio n. 9
0
    def sync_DetFlags(self,technologies="MDT,RPC,CSC,TGC,sTGC,Micromegas"):
        self.setDefaults()
        global rec
        from AthenaCommon.DetFlags import DetFlags
        # if Muons off, then do nothing
        if not DetFlags.Muon_on() or not rec.doMuon(): return

        flagsOn = []
        flagsOff = [ 'readRIOBS' ] # we don't store RIO (=PRD) on bytestream ???
        # Reading RDO
        if rec.readRDO():
            if muonRecFlags.makePRDs():
                flagsOn.append( 'makeRIO' )
            else:
                flagsOff.append( 'makeRIO' )
            if globalflags.InputFormat == 'pool'      :
                flagsOn.append( 'readRDOPool' )
                flagsOff.append( 'readRDOBS' )
            elif globalflags.InputFormat == 'bytestream':
                flagsOn.append( 'readRDOBS'   )
                flagsOff.append( 'readRDOPool' )
        else: # not reading RDO

            flagsOff.append( 'makeRIO' )

        # Reading ESD
        if rec.readESD():
            flagsOn.append( 'readRIOPool' )
        else:
            flagsOff.append( 'readRIOPool' )

        # Writing RDO Pool
        if rec.doWriteRDO():
            flagsOn.append( 'writeRDOPool' )
        else:
            flagsOff.append( 'writeRDOPool' )

        # Writing RDO bystream
        if rec.doWriteBS() :
            flagsOn.append( 'writeBS' )
        else:
            flagsOff.append( 'writeBS' )

        # Writing ESD
        if rec.doWriteESD():
            flagsOn.append( 'writeRIOPool' )
        else:
            flagsOff.append( 'writeRIOPool' )

        # Digitization on-the-fly
        if self.doDigitization():
            flagsOn.append( 'digitize' )
            try:
                flagsOn.remove( 'readRDOPool' )
            except ValueError: # not in list
                pass
            try:
                flagsOn.remove( 'readRDOBS' )
            except ValueError: # not in list
                pass
            flagsOff.append( 'readRDOPool' )
            flagsOff.append( 'readRDOBS'   )
            # very special case for normal Rome production (inspired by RecExCommon_DetFlags.py)
            if 'readRIOPool' not in flagsOn:
                flagsOn.append( 'readRIOPool' )
                try:
                    flagsOff.remove( 'readRIOPool' )
                except ValueError: # not in list
                    pass
            if not rec.doWriteRDO() and 'makeRIO' not in flagsOn:
                flagsOn.append( 'makeRIO' )
                try:
                    flagsOff.remove( 'makeRIO' )
                except ValueError: #not in list
                    pass
                    
        else:
            flagsOff.append( 'digitize')


        # do sync per technology for selected flags
        MDT_on = self.doMDTs()
        RPC_on = self.doRPCs()
        CSC_on = self.doCSCs()
        TGC_on = self.doTGCs()
        sTGC_on = self.dosTGCs()
        Micromegas_on = self.doMicromegas()
        techList = technologies.split(',')
        for f in flagsOn:
            for tech in techList:
                setOn = eval(tech+'_on')
                isOn = eval("DetFlags.%s.%s_on()" % (f,tech))
                if setOn:
                    if not isOn:
                        cmd = "DetFlags.%s.%s_setOn()" % (f,tech)
                        logMuon.info(cmd)
                        exec(cmd)
                else: # set off
                    if isOn:
                        cmd = "DetFlags.%s.%s_setOff()" % (f,tech)
                        logMuon.info(cmd)
                        exec(cmd)

        # Turn off Muon flags (row in DetFlags printout)
        for f in flagsOff:
            isOn = eval("DetFlags.%s.Muon_on()" % f)
            if isOn:
                cmd = "DetFlags.%s.Muon_setOff()" % f
                logMuon.info(cmd)
                exec(cmd)
Esempio n. 10
0
def DCMathT0FitSegmentMaker(name='DCMathT0FitSegmentMaker',extraFlags=None,**kwargs):
    if extraFlags is None: extraFlags = ExtraFlags()    
    extraFlags.setFlagDefault('doSegmentT0Fit',True)
    return DCMathSegmentMaker(name,extraFlags,**kwargs)



# end of factory function DCMathSegmentMaker

def MuonLayerHoughTool(name='MuonLayerHoughTool',extraFlags=None,**kwargs):
    kwargs.setdefault("DoTruth", rec.doTruth() )
    return CfgMgr.Muon__MuonLayerHoughTool(name,**kwargs)



if DetFlags.detdescr.Muon_on() and rec.doMuon():
    # until all clients explicitly get their tools and services, load some explicitly
    getPublicTool("ResidualPullCalculator")
    getPublicTool("MuonHoughPatternTool")
    getPublicTool("MuonCombinePatternTool")
    getPublicTool("MuonPhiHitSelector")
    getPublicTool("MuonEDMPrinterTool")
    getPublicTool("MuonSegmentMomentum")
    getPublicTool("MuonClusterOnTrackCreator")
    getPublicTool("CscClusterOnTrackCreator")
    getPublicTool("CscBroadClusterOnTrackCreator")
    getPublicTool("MdtDriftCircleOnTrackCreator")
    getPublicTool("MdtTubeHitOnTrackCreator")
        
    #getService("SomeService")
Esempio n. 11
0
    def setDefaults(self):
        global globalflags

        from MuonRecExample.MuonRecUtils import setJobPropertyDefault as setDefault

        # as long as rec.Commissioning is alive, sync the default to it
        # in case of BS->RDO, RDO->RDO, RDO->BS, BS->BS: don't run RIO (i.e RDO->PRD)
        setDefault(self.makePRDs, rec.readRDO() and not rec.doWriteRDO() and not rec.doWriteBS())
        setDefault(self.doStandalone,True)
        setDefault(self.doDigitization,False)
        setDefault(self.doCalib,False)
        setDefault(self.applyResilience,athenaCommonFlags.AllowIgnoreConfigError())
        setDefault(self.doSegmentsOnly,False)
        setDefault(self.doMDTs,True)
        setDefault(self.doRPCs,True)
        setDefault(self.doTGCs,True)
        setDefault(self.doCSCs,True)
        setDefault(self.dosTGCs,True)
        setDefault(self.doMicromegas,True)
        setDefault(self.doMSVertex,True)
        setDefault(self.useWireSagCorrections,False)
        setDefault(self.enableErrorTuning,True)
        setDefault(self.useLooseErrorTuning,False)
        setDefault(self.useAlignmentCorrections,DetFlags.detdescr.Muon_on() and rec.doMuon())
        setDefault(self.writeSDOs, rec.doWriteESD() and globalflags.DataSource != 'data')
        setDefault(self.useTGCPriorNextBC,True)
        setDefault(self.doMuonIso,True)

        if beamFlags.beamType == 'cosmics' or beamFlags.beamType == 'singlebeam':
            setDefault(self.doSegmentT0Fit,True)
        else:
            setDefault(self.doSegmentT0Fit,False)
            
        setDefault(self.doPrdSelect,False)

        # Default for MuonCalibration ntuple
        setDefault(self.calibMuonStandalone, muonRecFlags.doStandalone() or rec.readESD() )
        try:
            from MuonCnvExample.MuonCalibFlags import muonCalibFlags
        except ImportError:
            from AthenaCommon.Resilience import treatException
            treatException("Could not load MuonCalibFlags. Switching off calibration ntuple")
            self.doCalib = False
            self.doCalibNtuple = False
        else:
               
            doTracks = self.calibMuonStandalone()
            # chose a default
            if not muonCalibFlags.Mode.statusOn:
                if doTracks:
                    muonCalibFlags.Mode = 'trackNtuple'
                else:
                    muonCalibFlags.Mode = 'ntuple'

            if muonCalibFlags.Mode == 'trackNtuple' and doTracks:
                setDefault(self.doCalibNtuple,self.doCalib())
                setDefault(self.calibNtupleSegments,True)
                setDefault(self.calibNtupleTracks,True)
                if rec.doTrigger: setDefault(self.calibNtupleTrigger,True)
                else: setDefault(self.calibNtupleTrigger,False)
            elif muonCalibFlags.Mode == 'ntuple' or (muonCalibFlags.Mode == 'trackNtuple' and not doTracks):
                setDefault(self.doCalibNtuple,self.doCalib())
                setDefault(self.calibNtupleSegments,True)
                setDefault(self.calibNtupleTracks,False)
                if rec.doTrigger: setDefault(self.calibNtupleTrigger,True)
                else: setDefault(self.calibNtupleTrigger,False)
            else:
                setDefault(self.doCalibNtuple,False)
                setDefault(self.calibNtupleSegments,False)
                setDefault(self.calibNtupleTracks,False)
                setDefault(self.calibNtupleTrigger,False)
if (not rec.doCalo()) or (rec.readRDO() and not jobproperties.CaloRecFlags.Enabled()):
   DQMonFlags.doCaloMon=False
   DQMonFlags.doTileMon=False
   DQMonFlags.doLArMon=False

if (not rec.doInDet()) or (rec.readRDO() and not jobproperties.InDetJobProperties.Enabled()):
   DQMonFlags.doPixelMon=False
   DQMonFlags.doSCTMon=False
   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()):
Esempio n. 13
0
    #ToolSvc += DQTGlobalWFinderTool;
    #ManagedAthenaGlobalMon.AthenaMonTools += [ DQTGlobalWFinderTool ];

    # Import BackgroundMon tool

    if DQMonFlags.useTrigger():

        from DataQualityTools.DataQualityToolsConf import DQTBackgroundMon
        DQTBackgroundMon = DQTBackgroundMon(
            name='DQTBackgroundMon',
            histoPathBase="/GLOBAL/DQTBackgroundMon",
            doOfflineHists=isOffline,
            doOnlineHists=isOnline,
            doRunCosmics=isCosmics,
            doRunBeam=isBeam,
            doMuons=rec.doMuon(),
            doTrigger=rec.doTrigger())

        ToolSvc += DQTBackgroundMon
        ManagedAthenaGlobalMon.AthenaMonTools += [DQTBackgroundMon]

    # Default values
    MinSCTHits = 5
    MinPtCut = 4000

    #For now, to increase statistics in cosmics data taking
    if athenaCommonFlags.isOnline == True:
        MinSCTHits = 0
        MinPtCut = 500

    # Import MuonID tool
Esempio n. 14
0
                CBNTAA_VxPrimary.useTrkTrack = False
                CBNTAA_VxPrimary.McEventCollectionName = "GEN_AOD"
            except Exception:
                logCBNT_config.warning("CBNTAA_VxPrimary undefined")

    protectedInclude("CBNT_Particle/CBNT_Particle_jobOptions.py")

#if rec.doLArg() or rec.doTile():
#    protectedInclude ("CaloRec/CaloRec_CBNT_jobOptions.py")
#    #FIXME
#    #try:
#    #    CBNT_LArCell.Enable=False
#    #except Exception:
#    #    pass

if rec.doMuon():
    protectedInclude("MuonRecExample/MuonCBNT_jobOptions.py")

if ((DetFlags.haveRIO.Muon_on() and
     (JetRecFlagsOK and jobproperties.JetRecFlags.Enabled())
     and recAlgs.doMuonSpShower()) or rec.readESD()):
    protectedInclude("MuonSpShowerBuilderAlgs/CBNTAA_MuonSpShower.py")

#
# Jet
#

if rec.readAOD() or rec.readESD() or (JetRecFlagsOK
                                      and jobproperties.JetRecFlags.Enabled()):
    try:
        from JetRec.CBNTJets import schedule_standard_CBNTJets
Esempio n. 15
0
    if rec.readESD():
        rec.doHist = False

    if athenaCommonFlags.isOnline():
        rec.doWriteTAG = False
        rec.doWriteTAGCOM = False
        rec.doWriteESD = False
        rec.doDetStatus = False
        rec.doHist = False

    #--------------------------------------------------------------
    # Internal flags for each subsystem
    #--------------------------------------------------------------

    # MuDet
    if rec.doMuon() and rec.doESD():

        from MuonRecExample.MuonRecFlags import muonRecFlags
        from MuonCnvExample.MuonCalibFlags import muonCalibFlags

    from AthenaMonitoring.DQMonFlags import DQMonFlags
    if rec.doESD() and DQMonFlags.doCTPMon() and rec.doTrigger():
        include("TrigT1CTMonitoring/CTPFlags.py")

    # FIXME obsolete flags (should be removed)!!!
    # ------------------------------------
    # import GlobalFlags from RecExCommon
    # ------------------------------------
    # new flag
    rec.Commissioning = True
    rec.ScopingLevel = 4
Esempio n. 16
0
include.block('RecBackgroundAlgs/RecBackground_jobOptions.py')

from RecExConfig.RecFlags import rec
from AthenaCommon.DetFlags import DetFlags
if rec.doInDet() and rec.doMuon() and rec.doCalo() and \
    DetFlags.detdescr.Muon_on() and DetFlags.detdescr.Calo_on() and DetFlags.detdescr.ID_on() :
    from RecBackgroundAlgs.RecBackgroundAlgsConf import BeamBackgroundFiller
    BeamBackgroundFiller = BeamBackgroundFiller()
    topSequence += BeamBackgroundFiller

    from BCM_BackgroundAlgs.BCM_BackgroundAlgsConf import BcmCollisionTimeAlg
    BcmCollisionTimeAlg = BcmCollisionTimeAlg()
    topSequence += BcmCollisionTimeAlg

    from RecBackgroundAlgs.RecBackgroundAlgsConf import BackgroundWordFiller
    BackgroundWordFiller = BackgroundWordFiller()
    topSequence += BackgroundWordFiller
Esempio n. 17
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"]
Esempio n. 18
0
# --- Muon Alignment Monitoring
MuonDQADetFlags.doMuonTrkAlignMon = False

# --- MuonPhysics Monitoring options
MuonDQADetFlags.doMuonPhysMon = False

from RecExConfig.RecFlags import rec
MuonDQADetFlags.doMuTrkMon = rec.doInDet()

# --- HighLvl Muon Monitoring options
#MuonDQADetFlags.doMuonTrkPhysMon = rec.doMuon()

#MuonDQADetFlags.doMuonTrkPhysMon = True
#
if recFlags.doInDet() and recFlags.doMuon():
    MuonDQADetFlags.doMuonTrkPhysMon = True
    MuonDQADetFlags.doMuonCbTrkAlignMon = False
else:
    MuonDQADetFlags.doMuonTrkPhysMon = False
    MuonDQADetFlags.doMuonCbTrkAlignMon = False

#----------------------#
# Muon raw monitoring  #
#----------------------#
MuonRawMon=False
MuonESDMon=False
if DQMonFlags.monManEnvironment() == 'online':
    MuonRawMon=True
    MuonESDMon=True
elif DQMonFlags.monManEnvironment() == 'tier0Raw':
Esempio n. 19
0
#Customisation
CustomCuts = [[3.0, 400, 'TightPrimary'], [3.0, 500, 'TightPrimary'],
              [3.0, 800, 'TightPrimary'], [3.0, 1200, 'TightPrimary'],
              [3.0, 1000, 'Loose'], [1.5, 1000, 'TightPrimary'],
              [5.0, 1000, 'TightPrimary']]
for icut in CustomCuts:

    CustomType = icut[2] + 'z0' + str(int(10 * icut[0])) + 'Pt' + str(
        icut[1]) + 'MeV'
    print 'Building track isolation tool for type ', CustomType
    TrackIsolationCustom = xAOD__TrackIsolationTool(name='TrackIsolationTool' +
                                                    CustomType)
    TrackIsolationCustom.TrackSelectionTool.maxZ0SinTheta = float(icut[0])
    TrackIsolationCustom.TrackSelectionTool.minPt = float(icut[1])
    TrackIsolationCustom.TrackSelectionTool.CutLevel = icut[2]
    ToolSvc += TrackIsolationCustom
    isoBuilderCustom = IsolationBuilder(
        name="IsolationBuilder" + CustomType,
        CaloCellIsolationTool=None,
        CaloTopoIsolationTool=None,
        PFlowIsolationTool=None,
        TrackIsolationTool=TrackIsolationCustom,
        EgIsoTypes=[[]] if not rec.doEgamma() else ptconeList,
        MuIsoTypes=[[]] if not rec.doMuon() else ptconeList,
        CustomConfgurationName=CustomType,
        OutputLevel=3)
    topSequence.insert(index, isoBuilderCustom)

##  --postInclude 'RecJobTransforms/UseFrontier.py' RAWtoESD:'IsolationAlgs/CustomTrackIsoGetter.py'