Example #1
0
    def setDefaults(self):
        # check on problematic global tags with no association of cabling map folders exist; in this case we use the old cabling  
        logMuon.debug("in setDefaults")
        problematic_tags = ['COMCOND-HLT[A-C]-00[01]-00', 'COMCOND-ES1C-00[01]-00', 'COMCOND-REPC-001', 'COMCOND-SIM-01-00']
        if any(re.match(tag,globalflags.ConditionsTag()) for tag in problematic_tags):
            # setting the values (not just the defaults)
            self.UseAlines = 'none'
            self.UseBlines = 'none'
            self.UseIlines = False
            self.UseAsBuilt = False
            logMuon.info("No good alignment constants associated to Conditions Tag %r: UseAlines=%r UseBlines=%r UseIlines=%r UseAsBuilt=%r",
                         globalflags.ConditionsTag(),self.UseAlines(), self.UseBlines(), self.UseIlines(), self.UseAsBuilt() )

        #
        # simulation, digitization and reconstruction 
        #
        # MDT
        elif globalflags.DataSource() == 'geant4': # MC reconstruction or digitization
            setDefault(self.UseAlines, 'none')
            setDefault(self.UseBlines, 'none')
            setDefault(self.UseIlines, False)
            setDefault(self.UseAsBuilt, False)
            logMuon.info("Running a reconstruction job on geant4 or a digitization job: UseAlines=%r UseBlines=%r UseIlines=%r UseAsBuilt=%r",
                         self.UseAlines(), self.UseBlines(), self.UseIlines(), self.UseAsBuilt())
        else:
            # here reconstruction or real data 
            setDefault(self.UseAlines, 'all')
            setDefault(self.UseBlines, 'all')
            setDefault(self.UseIlines, True)
            setDefault(self.UseAsBuilt, True)
            logMuon.info("Running a reconstruction job on data: UseAlines=%r UseBlines=%r UseIlines=%r UseAsBuilt=%r",
                         self.UseAlines(), self.UseBlines(), self.UseIlines(), self.UseAsBuilt())
Example #2
0
def GetApproximateFieldFromConditions():
    #Note that the values returned are not exact. They should be interpreted only as Field ON/OFF.
    #The values are set in line 26 at the beginning of this script
    #fullSolenoidCurrent is set to 7700.0
    #fullToroidCurrent is set to 20500.0
    logAutoConfiguration.info(
        "Trying to guess magnetic field status from conditionsTag")
    solenoidCurrent = None
    toroidCurrent = None
    from AthenaCommon.GlobalFlags import globalflags
    cond = globalflags.ConditionsTag()
    if cond.startswith('COMCOND-ES1CST-') or cond.startswith(
            'COMCOND-ES1SST-') or cond.startswith('COMCOND-ES1PST-'):
        solenoidCurrent = fullSolenoidCurrent
        toroidCurrent = fullToroidCurrent
    elif cond.startswith('COMCOND-ES1CS-') or cond.startswith(
            'COMCOND-ES1SS-') or cond.startswith('COMCOND-ES1PS-'):
        solenoidCurrent = fullSolenoidCurrent
        toroidCurrent = 0.0
    elif cond.startswith('COMCOND-ES1CT-') or cond.startswith(
            'COMCOND-ES1ST-') or cond.startswith('COMCOND-ES1PT-'):
        solenoidCurrent = 0.0
        toroidCurrent = fullToroidCurrent
    elif cond.startswith('COMCOND-ES1C-') or cond.startswith(
            'COMCOND-ES1S-') or cond.startswith('COMCOND-ES1P-'):
        solenoidCurrent = 0.0
        toroidCurrent = 0.0
    else:
        logAutoConfiguration.warning(
            "Don't know how to interpret magnetic field status from conditionsTag '%s'."
            % cond)
    return solenoidCurrent, toroidCurrent
Example #3
0
def ConfigureConditionsTag():
    if globalflags.ConditionsTag.is_locked():
        logAutoConfiguration.info("conditionsTag is locked to value: '%s'." %
                                  globalflags.ConditionsTag())
        return

    from PyUtils.MetaReaderPeeker import metadata
    if metadata['file_type'] == 'POOL' or metadata[
            'file_type'] == 'BS' and metadata['eventTypes'][
                0] == 'IS_SIMULATION':
        try:
            globalflags.ConditionsTag.set_Value_and_Lock(
                metadata['IOVDbGlobalTag'])
            logAutoConfiguration.info(
                "Auto-configured ConditionsTag '%s' from MetaReaderPeeker ",
                globalflags.ConditionsTag())
        except:
            logAutoConfiguration.error(
                "ConditionsTag could not be auto-configured no info stored in MetaReaderPeeker!!!"
            )
            #logAutoConfiguration.warning("Input simulated bs file does not contain bs_metadata with conditions_tag !")

            pass
        pass
    else:  #Regular data files
        try:
            year = int(rec.projectName()[4:6])
        except:
            logAutoConfiguration.warning(
                "Failed to extract year from project tag " +
                rec.projectName() + ". Guessing 2015")
            year = 15
        if (year < 14):  #Run1
            globalflags.ConditionsTag.set_Value_and_Lock(
                "COMCOND-BLKPA-RUN1-09")
            logAutoConfiguration.info(
                "Found run 1 input bytestream file, autoconfigure conditions tag to '%s'"
                % globalflags.ConditionsTag())
        else:
            globalflags.ConditionsTag.set_Value_and_Lock(
                "CONDBR2-BLKPA-2015-17")
            logAutoConfiguration.info(
                "Found run 2 input bytestream file, autoconfigure conditions tag to '%s'"
                % globalflags.ConditionsTag())
            pass
        pass
    return
Example #4
0
def ConfigureConditionsTag():
    if globalflags.ConditionsTag.is_locked():
        logAutoConfiguration.info("conditionsTag is locked to value: '%s'." %
                                  globalflags.ConditionsTag())
        return

    from RecExConfig.InputFilePeeker import inputFileSummary
    if inputFileSummary['file_type'] == 'pool' or inputFileSummary[
            'file_type'] == 'bs' and inputFileSummary['evt_type'][
                0] == 'IS_SIMULATION':
        try:
            globalflags.ConditionsTag.set_Value_and_Lock(
                inputFileSummary['conditions_tag'])
            logAutoConfiguration.info(
                "Auto-configured ConditionsTag '%s' from inputFileSummary ",
                globalflags.ConditionsTag())
        except:
            logAutoConfiguration.error(
                "ConditionsTag could not be auto-configured no info stored in inputFileSummary!!!"
            )
            #logAutoConfiguration.warning("Input simulated bs file does not contain bs_metadata with conditions_tag !")

            pass
        pass
    else:  #Regular data files
        try:
            year = int(rec.projectName()[4:6])
        except:
            logAutoConfiguration.warning(
                "Failed to extract year from project tag " + projectName +
                ". Guessing 2015")
            year = 15
        if (year < 14):  #Run1
            globalflags.ConditionsTag.set_Value_and_Lock(
                "COMCOND-BLKPA-RUN1-09")
            logAutoConfiguration.info(
                "Found run 1 input bytestream file, autoconfigure conditions tag to '%s'"
                % globalflags.ConditionsTag())
        else:
            globalflags.ConditionsTag.set_Value_and_Lock(
                "CONDBR2-BLKPA-2015-17")
            logAutoConfiguration.info(
                "Found run 2 input bytestream file, autoconfigure conditions tag to '%s'"
                % globalflags.ConditionsTag())
            pass
        pass
    return
Example #5
0
def CombinedMuonTrackBuilder( name='CombinedMuonTrackBuilder', **kwargs ):
    import MuonCombinedRecExample.CombinedMuonTrackSummary
    from AthenaCommon.AppMgr    import ToolSvc
    kwargs.setdefault("CaloEnergyParam"               , getPublicTool("MuidCaloEnergyToolParam") )
    kwargs.setdefault("CaloTSOS"                      , getPublicTool("MuidCaloTrackStateOnSurface") )
    kwargs.setdefault("CscRotCreator"                 , getPublicTool("CscClusterOnTrackCreator") )
    kwargs.setdefault("Fitter"                        , getPublicTool("iPatFitter") )
    kwargs.setdefault("SLFitter"                      , getPublicTool("iPatSLFitter") )
    kwargs.setdefault("MaterialAllocator"             , getPublicTool("MuidMaterialAllocator") )
    kwargs.setdefault("MdtRotCreator"                 , getPublicTool("MdtDriftCircleOnTrackCreator") )
    kwargs.setdefault("MuonHoleRecovery"              , getPublicTool("MuidSegmentRegionRecoveryTool") )
    kwargs.setdefault("Propagator"                    , getPublicTool("MuonCombinedPropagator") )
    kwargs.setdefault("SLPropagator"                  , getPublicTool("MuonCombinedPropagator") )
    kwargs.setdefault("CleanCombined"                 , True )
    kwargs.setdefault("CleanStandalone"               , True )
    kwargs.setdefault("BadFitChi2"                    , 2.5 )
    kwargs.setdefault("LargeMomentumError"            , 0.5 )
    kwargs.setdefault("LineMomentum"                  , muonStandaloneFlags.straightLineFitMomentum() )
    kwargs.setdefault("LowMomentum"                   , 10.*GeV )
    kwargs.setdefault("MinEnergy"                     , 0.3*GeV )
    kwargs.setdefault("PerigeeAtSpectrometerEntrance" , False )
    kwargs.setdefault("ReallocateMaterial"            , False )
    kwargs.setdefault("Vertex2DSigmaRPhi"             , 100.*mm )
    kwargs.setdefault("Vertex3DSigmaRPhi"             , 6.*mm )
    kwargs.setdefault("Vertex3DSigmaZ"                , 60.*mm)
    kwargs.setdefault("TrackSummaryTool"              , ToolSvc.CombinedMuonTrackSummary )
    kwargs.setdefault("UseCaloTG"                     , True ) #
    
    if beamFlags.beamType() == 'cosmics':
        kwargs.setdefault("MdtRotCreator" ,  "" )
        kwargs.setdefault("LowMomentum"   ,  1.5*GeV )
        kwargs.setdefault("ReallocateMaterial", False )
        kwargs.setdefault("Vertex2DSigmaRPhi" , 100.*mm )
        kwargs.setdefault("Vertex3DSigmaRPhi" , 100.*mm )
        kwargs.setdefault("Vertex3DSigmaZ"    ,  1.*meter )

    # configure tools for data reprocessing 
    if muonRecFlags.enableErrorTuning():
       # use alignment effects on track for all algorithms

       useAlignErrs = True
       if conddb.dbdata == 'COMP200' or conddb.dbmc == 'COMP200' or 'HLT' in globalflags.ConditionsTag() or conddb.isOnline :
            useAlignErrs = False

       kwargs.setdefault("MuonErrorOptimizer", getPublicToolClone("MuidErrorOptimisationTool",
                                                                  "MuonErrorOptimisationTool",
                                                                  PrepareForFit              = False,
                                                                  RecreateStartingParameters = False,
                                                                  RefitTool = getPublicToolClone("MuidRefitTool",
                                                                                                 "MuonRefitTool",
                                                                  				 AlignmentErrors = useAlignErrs,
                                                                                                 Fitter = getPublicTool("iPatFitter"))))


    if muonRecFlags.doSegmentT0Fit():
        kwargs.setdefault("MdtRotCreator"                 , "" )
    getPublicTool("MuonCaloParticleCreator")
    return CfgMgr.Rec__CombinedMuonTrackBuilder(name,**kwargs)
Example #6
0
def MuonRefitTool(name, **kwargs):
    # 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)
Example #7
0
def _resolve_db_tag(origDbTag):
    from AthenaCommon.GlobalFlags  import globalflags
    if origDbTag is not None:
        dbtag = origDbTag
    else:
        dbtag = globalflags.ConditionsTag()
        dbtag = dbtag if dbtag != '' else 'HEAD'
    print "RESOLVED AS TAG", dbtag
    return dbtag
Example #8
0
        persOutput = cfgRecExPers['streamAOD'].list()
        allInput = objKeyStore['inputFile'].list()
        diff = []
        for i in persOutput:
            if not i in allInput:
                diff += [i]
        if len(diff) > 0:
            print " (experimental) the following objects should be written in AOD according to RecExPers/share/OKS_streamAOD_fromESD.py"
            print "but are not in input ESD file.File probably need to be updated, or maybe this is not full reco", diff

    if rec.doWriteAOD() and rec.doESD():
        persOutput = cfgRecExPers['streamAOD'].list()
        schedOutput = objKeyStore['streamAOD'].list()
        diff = []
        for i in persOutput:
            if not i in schedOutput:
                diff += [i]
        if len(diff) > 0:
            print " (experimental) the following objects should be written in AOD according to RecExPers/share/OKS_streamAOD_fromESD.py"
            print "but are not in new streamAOD. File probably need to be updated, or maybe this is non full reco", diff
except Exception:
    print "Could not check cfgRecExpers"

from AthenaCommon.GlobalFlags import globalflags
from AthenaCommon.BeamFlags import jobproperties

print "TrfJobReport metaData_geometryVersion = %s" % globalflags.DetDescrVersion(
)
print "TrfJobReport metaData_conditionsTag = %s" % globalflags.ConditionsTag()
print "TrfJobReport metaData_BeamType = %s" % jobproperties.Beam.beamType()
Example #9
0
            printfunc(
                "but are not in input ESD file.File probably need to be updated, or maybe this is not full reco",
                diff)

    if rec.doWriteAOD() and rec.doESD():
        persOutput = cfgRecExPers['streamAOD'].list()
        schedOutput = objKeyStore['streamAOD'].list()
        diff = []
        for i in persOutput:
            if not i in schedOutput:
                diff += [i]
        if len(diff) > 0:
            printfunc(
                " (experimental) the following objects should be written in AOD according to RecExPers/share/OKS_streamAOD_fromESD.py"
            )
            printfunc(
                "but are not in new streamAOD. File probably need to be updated, or maybe this is non full reco",
                diff)
except Exception:
    printfunc("Could not check cfgRecExpers")

from AthenaCommon.GlobalFlags import globalflags
from AthenaCommon.BeamFlags import jobproperties

printfunc("TrfJobReport metaData_geometryVersion = %s" %
          globalflags.DetDescrVersion())
printfunc("TrfJobReport metaData_conditionsTag = %s" %
          globalflags.ConditionsTag())
printfunc("TrfJobReport metaData_BeamType = %s" %
          jobproperties.Beam.beamType())
Example #10
0
InDetFlags.doNewTracking.set_Value_and_Lock(True)
#InDetFlags.doSlimming.set_Value_and_Lock(False)
#InDetFlags.doSiSPSeededTrackFinder.set_Value_and_Lock(True)
InDetFlags.doPRDFormation.set_Value_and_Lock(True)

#print "PP PP PP PP   Config"
#InDetNewTrackingCuts      = ConfiguredNewTrackingCuts("Offline")
#InDetNewTrackingCuts.printInfo()

from AthenaCommon.GlobalFlags import globalflags
globalflags.ConditionsTag.set_Value_and_Lock('COMCOND-BLKPST-004-07')

#main jobOptions
include("RecExCommon/RecExCommon_topOptions.py")

print "PPPPP   " + globalflags.ConditionsTag()
conddb.setGlobalTag(globalflags.ConditionsTag())

if goodRunList != '' and 'goodRunListArray' in dir(
) and goodRunListArray != '':

    # add LumiBlockMetaDataTool to ToolSvc and configure
    from LumiBlockComps.LumiBlockCompsConf import LumiBlockMetaDataTool
    ToolSvc += LumiBlockMetaDataTool("LumiBlockMetaDataTool")
    LumiBlockMetaDataTool.calcLumi = False  # False by default
    LumiBlockMetaDataTool.storeXMLFiles = True
    LumiBlockMetaDataTool.applyDQCuts = True
    LumiBlockMetaDataTool.OutputLevel = INFO

    # add ToolSvc.LumiBlockMetaDataTool to MetaDataSvc
    from EventSelectorAthenaPool.EventSelectorAthenaPoolConf import MetaDataSvc
Example #11
0
        af = athFile.fopen(athenaCommonFlags.BSRDOInput()[0])
        _run_number = af.run_number[0]

    TriggerJobOpts.Modifiers._run_number = _run_number  # noqa, set by athenaHLT

    from RecExConfig.RecFlags import rec
    rec.RunNumber = _run_number
    del _run_number

ConfigFlags.Input.Format = 'BS' if globalflags.InputFormat == 'bytestream' else 'POOL'

# Set final Cond/Geo tag based on input file, command line or default
globalflags.DetDescrVersion = opt.setDetDescr or ConfigFlags.Trigger.OnlineGeoTag
ConfigFlags.GeoModel.AtlasVersion = globalflags.DetDescrVersion()
globalflags.ConditionsTag = opt.setGlobalTag or ConfigFlags.Trigger.OnlineCondTag
ConfigFlags.IOVDb.GlobalTag = globalflags.ConditionsTag()

# Other defaults
ConfigFlags.Beam.Type = jobproperties.Beam.beamType = 'collisions'
jobproperties.Beam.bunchSpacing = 25
globalflags.DatabaseInstance = 'CONDBR2' if opt.useCONDBR2 else 'COMP200'
ConfigFlags.IOVDb.DatabaseInstance = globalflags.DatabaseInstance()
athenaCommonFlags.isOnline.set_Value_and_Lock(opt.isOnline)

log.info('Configured the following global flags:')
globalflags.print_JobProperties()

# Set default doL1Sim option depending on input type (if not set explicitly)
if 'doL1Sim' not in globals():
    opt.doL1Sim = ConfigFlags.Input.isMC
    log.info('Setting default doL1Sim=%s because ConfigFlags.Input.isMC=%s',
Example #12
0
globalflags.DataSource = 'data'
globalflags.InputFormat = 'bytestream'
globalflags.ConditionsTag = ConditionsTag if ConditionsTag else 'COMCOND-ES1C-000-00'
del ConditionsTag

# auto config
try:  # recent switch from RecExCommon to RecExConfig
    from RecExConfig.AutoConfiguration import ConfigureFieldAndGeo
except:
    from RecExCommon.AutoConfiguration import ConfigureFieldAndGeo

ConfigureFieldAndGeo()

# database tag
from IOVDbSvc.CondDB import conddb
conddb.setGlobalTag(globalflags.ConditionsTag())

# setup detflags
import DetDescrCnvSvc.DetStoreConfig
from AthenaCommon.DetFlags import DetFlags
if doLAr: DetFlags.detdescr.LAr_setOn()
if doTile: DetFlags.detdescr.Tile_setOn()

# needed ....
from RecExConfig.RecFlags import rec
rec.doLArg = doLAr
rec.doTile = doTile
rec.doCalo = doLAr or doTile
rec.Commissioning = True

# setup geometry
Example #13
0
def CombinedMuonTrackBuilder( name='CombinedMuonTrackBuilder', **kwargs ):
    from AthenaCommon.AppMgr import ToolSvc
    kwargs.setdefault("CaloEnergyParam"               , getPublicTool("MuidCaloEnergyToolParam") )
    kwargs.setdefault("CaloTSOS"                      , getPublicTool("MuidCaloTrackStateOnSurface") )
    kwargs.setdefault("MaterialAllocator"             , getPublicTool("MuidMaterialAllocator") )
    kwargs.setdefault("MdtRotCreator"                 , getPublicTool("MdtDriftCircleOnTrackCreator") )
    kwargs.setdefault("CleanCombined"                 , True )
    kwargs.setdefault("CleanStandalone"               , True )
    kwargs.setdefault("BadFitChi2"                    , 2.5 )
    kwargs.setdefault("LargeMomentumError"            , 0.5 )
    kwargs.setdefault("LineMomentum"                  , muonStandaloneFlags.straightLineFitMomentum() )
    kwargs.setdefault("LowMomentum"                   , 10.*GeV )
    kwargs.setdefault("MinEnergy"                     , 0.3*GeV )
    kwargs.setdefault("PerigeeAtSpectrometerEntrance" , False )
    kwargs.setdefault("ReallocateMaterial"            , False )
    kwargs.setdefault("Vertex2DSigmaRPhi"             , 100.*mm )
    kwargs.setdefault("Vertex3DSigmaRPhi"             , 6.*mm )
    kwargs.setdefault("Vertex3DSigmaZ"                , 60.*mm)
    kwargs.setdefault("UseCaloTG"                     , True ) #
    kwargs.setdefault("CaloMaterialProvider"          , getPublicTool("MuonMaterialProviderTool"))
    kwargs.setdefault("TrackQuery"                    , getPrivateTool("MuonTrackQuery") )

    if TriggerFlags.MuonSlice.doTrigMuonConfig:
        kwargs.setdefault("MuonHoleRecovery"              , "" )
        trigTrackSummary = getPublicToolClone("TrigMuonTrackSummary", "MuonTrackSummaryTool")
        if DetFlags.detdescr.ID_on():
            from InDetTrigRecExample.InDetTrigConfigRecLoadTools import InDetTrigTrackSummaryHelperTool
            trigTrackSummary.InDetSummaryHelperTool = InDetTrigTrackSummaryHelperTool
            trigTrackSummary.doHolesInDet = True
        kwargs.setdefault("TrackSummaryTool"              , trigTrackSummary )

        kwargs.setdefault("Propagator"                    , ToolSvc.AtlasRungeKuttaPropagator)
        kwargs.setdefault("SLPropagator"                  , ToolSvc.AtlasRungeKuttaPropagator)

        #The trigger uses the iPatFitter in different sequences that do and do not include ID tracking
        #so using the same track summary tool as is used here to get it correct
        trackSummary = kwargs["TrackSummaryTool"]
        suffix = "MS"
        if "Trig" in trackSummary.name():
            suffix = "CB"
        kwargs.setdefault("Fitter"                        , getPublicToolClone("TrigiPatFitter_"+suffix, "iPatFitter", TrackSummaryTool=trackSummary) )
        kwargs.setdefault("SLFitter"                      , getPublicToolClone("TrigiPatSLFitter_"+suffix, "iPatSLFitter", TrackSummaryTool=trackSummary) )
        kwargs.setdefault("MuonErrorOptimizer", "")
        kwargs.setdefault("CscRotCreator"                 , "" )
        kwargs.setdefault("Cleaner"                       , getPrivateToolClone("TrigMuidTrackCleaner_"+suffix, "MuidTrackCleaner", Fitter=kwargs["Fitter"]) )
    else:
        import MuonCombinedRecExample.CombinedMuonTrackSummary
        kwargs.setdefault("MuonHoleRecovery"              , getPublicTool("MuidSegmentRegionRecoveryTool") )
        kwargs.setdefault("TrackSummaryTool"              , ToolSvc.CombinedMuonTrackSummary )
        kwargs.setdefault("Propagator"                    , getPublicTool("MuonCombinedPropagator") )
        kwargs.setdefault("SLPropagator"                  , getPublicTool("MuonCombinedPropagator") )
        kwargs.setdefault("Fitter"                        , getPublicTool("iPatFitter") )
        kwargs.setdefault("SLFitter"                      , getPublicTool("iPatSLFitter") )
        kwargs.setdefault("CscRotCreator"                 , (getPublicTool("CscClusterOnTrackCreator") if MuonGeometryFlags.hasCSC() else "") )
        kwargs.setdefault("Cleaner"                       , getPrivateTool("MuidTrackCleaner") )


    if beamFlags.beamType() == 'cosmics':
        kwargs.setdefault("MdtRotCreator" ,  "" )
        kwargs.setdefault("LowMomentum"   ,  1.5*GeV )
        kwargs.setdefault("ReallocateMaterial", False )
        kwargs.setdefault("Vertex2DSigmaRPhi" , 100.*mm )
        kwargs.setdefault("Vertex3DSigmaRPhi" , 100.*mm )
        kwargs.setdefault("Vertex3DSigmaZ"    ,  1.*meter )

    # configure tools for data reprocessing 
    if muonRecFlags.enableErrorTuning():
       # use alignment effects on track for all algorithms

       useAlignErrs = True
       if conddb.dbdata == 'COMP200' or conddb.dbmc == 'COMP200' or 'HLT' in globalflags.ConditionsTag() or conddb.isOnline or TriggerFlags.MuonSlice.doTrigMuonConfig:
            useAlignErrs = False

       kwargs.setdefault("MuonErrorOptimizer", getPublicToolClone("MuidErrorOptimisationTool",
                                                                  "MuonErrorOptimisationTool",
                                                                  PrepareForFit              = False,
                                                                  RecreateStartingParameters = False,
                                                                  RefitTool = getPublicToolClone("MuidRefitTool", "MuonRefitTool", AlignmentErrors = useAlignErrs, Fitter = getPublicTool("iPatFitter"))
                                                                  ))


    if muonRecFlags.doSegmentT0Fit():
        kwargs.setdefault("MdtRotCreator"                 , "" )
    getPublicTool("MuonCaloParticleCreator")
    return CfgMgr.Rec__CombinedMuonTrackBuilder(name,**kwargs)
Example #14
0
if not (muonAlignFlags.UseAlines == 'none'
        and muonAlignFlags.UseBlines == 'none'):
    MuonDetectorTool.UseConditionDb = 1
    # here define to what extent B-lines are enabled
    if muonAlignFlags.UseBlines == 'none':
        MuonDetectorTool.EnableMdtDeformations = 0
    elif muonAlignFlags.UseBlines == 'all':
        MuonDetectorTool.EnableMdtDeformations = 1
    elif muonAlignFlags.UseBlines == 'barrel':
        MuonDetectorTool.EnableMdtDeformations = 2
    elif muonAlignFlags.UseBlines == 'endcaps':
        MuonDetectorTool.EnableMdtDeformations = 3

# here define if I-lines (CSC internal alignment) are enabled
if muonAlignFlags.UseIlines:
    if 'HLT' in globalflags.ConditionsTag():
        logMuon.info(
            "Reading CSC I-Lines from layout - special configuration for COMP200 in HLT setup."
        )
        MuonDetectorTool.UseIlinesFromGM = True
        MuonDetectorTool.EnableCscInternalAlignment = False
    else:
        logMuon.info("Reading CSC I-Lines from conditions database.")
        conddb.addFolderSplitOnline('MUONALIGN',
                                    '/MUONALIGN/Onl/CSC/ILINES',
                                    '/MUONALIGN/CSC/ILINES',
                                    className='CondAttrListCollection')
        MuonDetectorTool.UseIlinesFromGM = False
        MuonDetectorTool.EnableCscInternalAlignment = True
        MuonAlignAlg.ParlineFolders += ["/MUONALIGN/CSC/ILINES"]
        MuonAlignAlg.ILinesFromCondDB = True
Example #15
0
elif testZmumu or testZprime:
    DetDescrVersion = "ATLAS-GEO-20-00-01"
    ConditionsTag = "OFLCOND-MC12-SDR-06"
elif testBug:
    DetDescrVersion = "ATLAS-GEO-14-00-00"
    ConditionsTag = 'OFLCOND-SDR-BS7T-02'
elif recFlags.readESD:
    DetDescrVersion = "ATLAS-GEO-10-00-01"
else:
    DetDescrVersion = "ATLAS-GEO-16-00-00"

from AthenaCommon.JobProperties import jobproperties
from AthenaCommon.GlobalFlags import globalflags
globalflags.DetDescrVersion = DetDescrVersion
globalflags.ConditionsTag = ConditionsTag
print globalflags.DetDescrVersion(), globalflags.ConditionsTag()

#--------------------------------------------------------------
# select detectors to be used for reconstruction
# uncomment appropriate line to turn pixel, SCT and/or TRT off)
#--------------------------------------------------------------
from AthenaCommon.DetFlags import DetFlags
if rec.readRDO:
    DetFlags.readRDOPool.ID_setOn()
#DetFlags.makeRIO.ID_setOn()

#--------------------------------------------------------------
# set appropriate configuration into AthenaCommon.globalflags
#--------------------------------------------------------------
if rec.readESD:
    globalflags.DataSource = 'data'
Example #16
0
import os, sys, string, commands
import pickle

from AthenaCommon.GlobalFlags import globalflags
from AthenaCommon.AthenaCommonFlags import jobproperties, athenaCommonFlags

onlinegoodies = {}

onlinegoodies['DataSource'] = globalflags.DataSource()
onlinegoodies['InputFormat'] = globalflags.InputFormat()
onlinegoodies['ConditionsTag'] = globalflags.ConditionsTag()
onlinegoodies['beamType'] = jobproperties.Beam.beamType()
onlinegoodies['DetDescrVersion'] = globalflags.DetDescrVersion()

file = open("globalflags.pickle", 'w')
pickle.dump(onlinegoodies, file)
file.close()
Example #17
0
msg.info(globalflags)

#--------------------------------------------------------------
# Set up conditions
#--------------------------------------------------------------
from RecExConfig.RecFlags import rec
rec.projectName.set_Value_and_Lock("data12_8TeV")

#--------------------------------------------------------------
# Load IOVDbSvc
#--------------------------------------------------------------
#include("IOVDbSvc/IOVDbSvc_jobOptions.py")
IOVDbSvc = Service("IOVDbSvc")
from IOVDbSvc.CondDB import conddb
conddb.dbdata = "COMP200"
IOVDbSvc.GlobalTag = globalflags.ConditionsTag()
IOVDbSvc.OutputLevel = DEBUG

#--------------------------------------------------------------
# Set Detector setup
#--------------------------------------------------------------
# --- switch on InnerDetector
from AthenaCommon.DetFlags import DetFlags
DetFlags.ID_setOff()
DetFlags.Calo_setOff()
DetFlags.Muon_setOff()
DetFlags.Truth_setOff()
DetFlags.LVL1_setOff()
DetFlags.SCT_setOn()

# ---- switch parts of ID off/on as follows
Example #18
0
    def setDefaults(self):
        # check on problematic global tags with no association of cabling map folders exist; in this case we use the old cabling
        problematic_tags_mdtrpc = [
            'COMCOND-00[0-6]', 'COMCOND-HLT[A-C]-00[0-1]',
            'COMCOND-MONC-00[0-1]', 'COMCOND-ES1C-00[0-1]',
            'COMCOND-REPC-00[0-4]', 'OFLCOND-CSC', 'OFLCOND-FDR'
        ]
        problematic_tags_tgc = [
            'COMCOND-00[0-5]', 'COMCOND-006-00', 'CMCCOND-CSC',
            'OFLCOND-FDR-02-0[4-6]', 'OFLCOND-FDR-02-10'
        ]

        # MDT
        #        if globalflags.InputFormat.is_bytestream() and globalflags.DataSource() == 'geant4':
        #            setDefault(self.MdtCablingMode, 'old')
        #        else:
        #            if any(re.match(tag,globalflags.ConditionsTag()) for tag in problematic_tags_mdtrpc):
        #                setDefault(self.MdtCablingMode, 'old')
        #            else:
        #                if globalflags.DataSource() == 'data' or DetFlags.digitize.MDT_on():
        #                    setDefault(self.MdtCablingMode, 'new')
        #                else:
        #                    setDefault(self.MdtCablingMode, 'auto')

        # RPC
        if globalflags.InputFormat.is_bytestream() and globalflags.DataSource(
        ) == 'geant4':
            setDefault(self.RpcCablingMode, 'sim')
        else:
            if any(
                    re.match(tag, globalflags.ConditionsTag())
                    for tag in problematic_tags_mdtrpc):
                setDefault(self.RpcCablingMode, 'old')
            else:
                if globalflags.DataSource(
                ) == 'data' or DetFlags.digitize.RPC_on():
                    setDefault(self.RpcCablingMode, 'new')
                else:
                    setDefault(self.RpcCablingMode, 'auto')


#        if globalflags.DataSource() == 'data':
#            # 2010Jan7th - move to new cabling also when the trigger (i.e. LVL1 emul. or HLT algorithms) is on
#            #if doTrigger==True  or any(re.match(tag,globalflags.ConditionsTag()) for tag in problematic_tags_mdtrpc):
#            if any(re.match(tag,globalflags.ConditionsTag()) for tag in problematic_tags_mdtrpc):
#                setDefault(self.RpcCablingMode, 'old')  # default is old when using trigger
##                if doTrigger:
##                    logMuon.info("RPC cabling: Setting to OLD because of trigger settings")
##                else:
#                logMuon.info("RPC cabling: Setting to OLD because of condition data tags not including RPC cabling maps")
#            else:
#                setDefault(self.RpcCablingMode, 'new')
#                logMuon.info("RPC cabling: Setting to NEW")
#        else:
#            setDefault(self.RpcCablingMode, 'sim')
#            logMuon.info("RPC cabling: Setting to SIM")

#TGC
        setDefault(self.TgcCablingMode, 'auto')

        # do not use the call-back for digitization job
        #use the call-back in the overlay job that has no bytestream data as input
        # and avoid access to Db for problematic tags

        if DetFlags.digitize.TGC_on() and not globalflags.isOverlay():
            if any(
                    re.match(tag, globalflags.ConditionsTag())
                    for tag in problematic_tags_tgc):
                setDefault(self.TgcCablingMode, 'old 12-fold')
            else:
                setDefault(self.TgcCablingMode, '12-fold')

        # avoid to use call-back if input is bytestream or data and avoid access to Db for problematic tags
        if globalflags.DataSource.is_data(
        ) or globalflags.InputFormat.is_bytestream():
            if any(
                    re.match(tag, globalflags.ConditionsTag())
                    for tag in problematic_tags_tgc):
                setDefault(self.TgcCablingMode, 'old 12-fold')
            else:
                setDefault(self.TgcCablingMode, '12-fold')

        # call-back works for RDO files only and avoid access to Db for problematic tags
        if self.TgcCablingMode() == 'auto' and not DetFlags.haveRDO.TGC_on():
            if any(
                    re.match(tag, globalflags.ConditionsTag())
                    for tag in problematic_tags_tgc):
                setDefault(self.TgcCablingMode, 'old 12-fold')
            else:
                setDefault(self.TgcCablingMode, '12-fold')
Example #19
0
  athenaCommonFlags.FilesInput = ["root://eosatlas//eos/atlas/atlascerngroupdisk/perf-idtracking/InDetRecExample/data10_cos.00151040.physics_IDCosmic.recon.ESD.f220/data10_cos.00151040.physics_IDCosmic.recon.ESD.f220._lb0002._0001.1"]

if doReadBS:
  # Since BS doesn't yet support xrootd need to set
  import os
  os.environ['STAGE_HOST']="castoratlast3"
  os.environ['STAGE_SVCCLASS']="atlascerngroupdisk"  
  athenaCommonFlags.FilesInput = ["root://eosatlas//eos/atlas/atlascerngroupdisk/proj-sit/tct/rec_input/tracking/data10_cos.00151040.physics_IDCosmic.merge.RAW._lb0002._0001.1"]

import AthenaPython.ConfigLib as apcl
cfg = apcl.AutoCfg(name = 'InDetRecExampleAutoConfig', input_files=athenaCommonFlags.FilesInput())
cfg.configure_job()

if doReadBS:
  from AthenaCommon.GlobalFlags import globalflags
  if len(globalflags.ConditionsTag())!=0:
    from IOVDbSvc.CondDB import conddb
    conddb.setGlobalTag(globalflags.ConditionsTag())

# request TrackingGeo tag  AtlasLayerMat_v18_ATLAS-GEO-16
# but there are only   AtlasLayerMat_v16_ATLAS-GEO-16
#                   or AtlasLayerMat_v18_ATLAS-R1-2010-01
# @TODO switch to more recent data file ?
conddb.addOverride('/GLOBAL/TrackingGeo/LayerMaterialV2','AtlasLayerMat_v19s0_ATLAS-R1-2010-01')
#conddb.addOverride('/GLOBAL/TrackingGeo/LayerMaterialV2','AtlasLayerMat_v16_ATLAS-GEO-16')
import MagFieldServices.SetupField

theApp.EvtMax = 50

#--------------------------------------------------------------
# Control
    MuonDetectorTool.UseConditionDb = 1
    MuonDetectorTool.TheMuonAlignmentTool = MGM_AlignmentDbTool
    # here define to what extent B-lines are enabled
    if muonAlignFlags.UseBlines == 'none':
        MuonDetectorTool.EnableMdtDeformations = 0
    elif muonAlignFlags.UseBlines == 'all':
        MuonDetectorTool.EnableMdtDeformations = 1
    elif muonAlignFlags.UseBlines == 'barrel':
        MuonDetectorTool.EnableMdtDeformations = 2
    elif muonAlignFlags.UseBlines == 'endcaps':
        MuonDetectorTool.EnableMdtDeformations = 3

# here define if I-lines (CSC internal alignment) are enabled
if muonAlignFlags.UseIlines:
    MuonDetectorTool.EnableCscInternalAlignment = True
    if conddb.dbdata == 'COMP200' and 'HLT' in globalflags.ConditionsTag():
        logMuon.info(
            "Reading CSC I-Lines from layout - special configuration for COMP200 in HLT setup."
        )
        MuonDetectorTool.UseIlinesFromGM = True
        MuonAlignmentDbTool.ILinesFromCondDB = False
    else:
        logMuon.info("Reading CSC I-Lines from conditions database.")
        conddb.addFolderSplitOnline('MUONALIGN', '/MUONALIGN/Onl/CSC/ILINES',
                                    '/MUONALIGN/CSC/ILINES')
        MuonAlignmentDbTool.ParlineFolders += ["/MUONALIGN/CSC/ILINES"]
        MuonDetectorTool.UseIlinesFromGM = False
        MuonAlignmentDbTool.ILinesFromCondDB = True

# here define if As-Built (MDT chamber alignment) are enabled
if muonAlignFlags.UseAsBuilt: