conddb.addMarkup("/TRT/Calib/MC/RT", "<forceRunNumber>295000</forceRunNumber>")
conddb.blockFolder("/TRT/Calib/MC/T0")
conddb.addFolderWithTag("TRT_OFL",
                        "/TRT/Calib/MC/T0",
                        "TrtCalibT0-R2-MC-run2-scenario1_03-00",
                        force=True,
                        forceData=True)
conddb.addMarkup("/TRT/Calib/MC/T0", "<forceRunNumber>295000</forceRunNumber>")
#conddb.blockFolder("/TRT/Calib/MCerrors2d")
#conddb.addFolder("","<dbConnection>sqlite://;schema=mycool.db;dbname=OFLP200</dbConnection> /TRT/Calib/MCerrors2d" + "<tag> TrtCalibMCErrors2d-IOVdep-2Dfit-00-00 </tag>" , force=True)
#conddb.blockFolder("/TRT/Calib/MCslopes")
#conddb.addFolder("","<dbConnection>sqlite://;schema=mycool.db;dbname=OFLP200</dbConnection> /TRT/Calib/MCslopes" + "<tag> TrtCalibMCSlopes-mc_25ns-2Dfit-00-00 </tag>" , force=True)
from TRT_ConditionsServices.TRT_ConditionsServicesConf import TRT_CalDbSvc
TRTMCCalibDBSvc = TRT_CalDbSvc(name="TRTMCCalibDBSvc",
                               RtFolderName="/TRT/Calib/MC/RT",
                               T0FolderName="/TRT/Calib/MC/T0",
                               ErrorSlopeFolderName="/TRT/Calib/slopes",
                               ErrorFolderName="/TRT/Calib/errors2d")
#TRTMCCalibDBSvc=TRT_CalDbSvc(name="TRTMCCalibDBSvc",RtFolderName="/TRT/Calib/MC/RT",T0FolderName="/TRT/Calib/MC/T0",ErrorFolderName="/TRT/Calib/MCerrors2d") #,ErrorSlopeFolderName="/TRT/Calib/MCslopes"
ServiceMgr += TRTMCCalibDBSvc

#This would add another trtdriftfuntiontool, using the new trtcaldb:
#from TRT_DriftFunctionTool.TRT_DriftFunctionToolConf import TRT_DriftFunctionTool
#InDetTRT_MCDriftFunctionTool = TRT_DriftFunctionTool(name="InDetTRT_MCDriftFunctionTool",TRTCalDbTool=TRTMCCalibDBSvc)
#ToolSvc += InDetTRT_MCDriftFunctionTool
#but instead we'll just add the new trtcaldb to the existing trtdriftfunctiontool:
ToolSvc.InDetTRT_DriftFunctionTool.IsOverlay = True
ToolSvc.InDetTRT_DriftFunctionTool.TRTCalDbTool2 = TRTMCCalibDBSvc

if "EOJT_noLorentz" in globals():
    print "EOJT_noLorentz found in globals(), so not doing Lorentz corrections"
示例#2
0
## Other settings
# Prefix for decoration, if any
prefixName = ""

## More fine-tuning available for each tool/alg below (default value shown)

#################
### Setup tools
#################
if dumpTrtInfo:
    from TRT_ConditionsServices.TRT_ConditionsServicesConf import TRT_StrawNeighbourSvc
    TRTStrawNeighbourSvc = TRT_StrawNeighbourSvc()
    ServiceMgr += TRTStrawNeighbourSvc

    from TRT_ConditionsServices.TRT_ConditionsServicesConf import TRT_CalDbSvc
    TRTCalibDBSvc = TRT_CalDbSvc()
    ServiceMgr += TRTCalibDBSvc

    from TRT_ToT_Tools.TRT_ToT_ToolsConf import TRT_ToT_dEdx
    TRT_dEdx_Tool = TRT_ToT_dEdx(name="NCBTRT_ToT_dEdx")
    ToolSvc += TRT_dEdx_Tool

#Setup charge->ToT back-conversion to restore ToT info as well
if dumpPixInfo:
    from AthenaCommon.AlgSequence import AlgSequence
    topSequence = AlgSequence()
    from PixelCalibAlgs.PixelCalibAlgsConf import PixelChargeToTConversion
    PixelChargeToTConversionSetter = PixelChargeToTConversion(
        name="NCBPixelChargeToTConversionSetter")
    topSequence += PixelChargeToTConversionSetter
    if (printIdTrkDxAODConf):
    if not conddb.folderRequested('/TRT/Calib/slopes'):
        conddb.addFolderSplitOnline("TRT", "/TRT/Onl/Calib/slopes",
                                    "/TRT/Calib/slopes")

    if not conddb.folderRequested('/TRT/Calib/ToTCalib'):
        conddb.addFolderSplitOnline("TRT", "/TRT/Onl/Calib/ToTCalib",
                                    "/TRT/Calib/ToTCalib")
#        conddb.addFolder("TRT_OFL","/TRT/Calib/ToTCalib")

    if not conddb.folderRequested('/TRT/Calib/HTCalib'):
        conddb.addFolderSplitOnline("TRT", "/TRT/Onl/Calib/HTCalib",
                                    "/TRT/Calib/HTCalib")

    # Calibration DB Service
    from TRT_ConditionsServices.TRT_ConditionsServicesConf import TRT_CalDbSvc
    InDetTRTCalDbSvc = TRT_CalDbSvc()
    ServiceMgr += InDetTRTCalDbSvc
    if (InDetFlags.doPrintConfigurables()):
        print InDetTRTCalDbSvc

    # Dead/Noisy Straw Lists
    if not conddb.folderRequested('/TRT/Cond/Status'):
        conddb.addFolderSplitOnline("TRT", "/TRT/Onl/Cond/Status",
                                    "/TRT/Cond/Status")
    if not conddb.folderRequested('/TRT/Cond/StatusPermanent'):
        conddb.addFolderSplitOnline("TRT", "/TRT/Onl/Cond/StatusPermanent",
                                    "/TRT/Cond/StatusPermanent")
    # Argon straw list
    if not conddb.folderRequested('/TRT/Cond/StatusHT'):
        conddb.addFolderSplitOnline("TRT", "/TRT/Onl/Cond/StatusHT",
                                    "/TRT/Cond/StatusHT")
示例#4
0
if loadInDetRec_Options["beamSpotTag"] and not Cosmics:
    conddb.addOverride('/Indet/Beampos',loadInDetRec_Options["beamSpotTag"])

if loadInDetRec_Options["lorentzAngleTag"]:
    conddb.addOverride('/PIXEL/LorentzAngleScale',loadInDetRec_Options["lorentzAngleTag"])
  
from AthenaCommon.AppMgr import ToolSvc
from TrkRIO_OnTrackCreator.TrkRIO_OnTrackCreatorConf import Trk__RIO_OnTrackErrorScalingTool
InDetRotErrorScalingTool = Trk__RIO_OnTrackErrorScalingTool( name        = 'RIO_OnTrackErrorScalingTool',
                                                             OutputLevel = INFO )
ToolSvc += InDetRotErrorScalingTool
#print InDetRotErrorScalingTool

  
# Correct TRT calibration for cosmics
if loadInDetRec_Options["TRTCalibTextFile"] and Cosmics:
  from AthenaCommon.AppMgr import ToolSvc
  from TRT_ConditionsServices.TRT_ConditionsServicesConf import TRT_CalDbSvc
  TRTCalibDBSvc=TRT_CalDbSvc()
  ServiceMgr+=TRTCalibDBSvc
  
  conddb.blockFolder("/TRT/Calib/RT" )
  conddb.blockFolder("/TRT/Calib/T0" )
  TRTCalibDBSvc.calibTextFile = loadInDetRec_Options["TRTCalibTextFile"]

if loadInDetRec_Options["TRTCalibT0TagCos"]:
  conddb.addOverride('/TRT/Calib/T0',loadInDetRec_Options["TRTCalibT0TagCos"])
if loadInDetRec_Options["TRTCalibRtTagCos"]:
  conddb.addOverride('/TRT/Calib/RT',loadInDetRec_Options["TRTCalibRtTagCos"])

    def createSvc(self):

        #
        # Load necessary conditions folders
        #

        # Calibration constants
        from IOVDbSvc.CondDB import conddb

        if not self._isMC:
            #only needed for data
            if not (conddb.folderRequested('/TRT/Onl/ROD/Compress')):
                conddb.addFolder("TRT_ONL", "/TRT/Onl/ROD/Compress")

        if not (conddb.folderRequested('/TRT/Calib/RT')
                or conddb.folderRequested('/TRT/Onl/Calib/RT')):
            conddb.addFolderSplitOnline('TRT', '/TRT/Onl/Calib/RT',
                                        '/TRT/Calib/RT')
        if not (conddb.folderRequested('/TRT/Calib/T0')
                or conddb.folderRequested('/TRT/Onl/Calib/T0')):
            conddb.addFolderSplitOnline('TRT', '/TRT/Onl/Calib/T0',
                                        '/TRT/Calib/T0')

        if not (conddb.folderRequested('/TRT/Calib/errors')
                or conddb.folderRequested('/TRT/Onl/Calib/errors')):
            conddb.addFolderSplitOnline("TRT", "/TRT/Onl/Calib/errors",
                                        "/TRT/Calib/errors")
            # not needed anymore conddb.addOverride('/TRT/Onl/Calib/errors','TrtCalibErrorsOnl-ErrorVal-00-00')

        if not (conddb.folderRequested('/TRT/Calib/ToTCalib')
                or conddb.folderRequested('/TRT/Onl/Calib/ToTCalib')):
            conddb.addFolderSplitOnline("TRT", "/TRT/Onl/Calib/ToTCalib",
                                        "/TRT/Calib/ToTCalib")

        if not (conddb.folderRequested('/TRT/Calib/HTCalib')
                or conddb.folderRequested('/TRT/Onl/Calib/HTCalib')):
            conddb.addFolderSplitOnline("TRT", "/TRT/Onl/Calib/HTCalib",
                                        "/TRT/Calib/HTCalib")

        # Calibration DB Service
        from AthenaCommon.AppMgr import ServiceMgr
        from TRT_ConditionsServices.TRT_ConditionsServicesConf import TRT_CalDbSvc
        #InDetTRTCalDbSvc = TRT_CalDbSvc(self.instanceName('TRT_CalDbSvc'))    #
        InDetTRTCalDbSvc = TRT_CalDbSvc('TRT_CalDbSvc')
        ServiceMgr += InDetTRTCalDbSvc
        if self._print:
            print InDetTRTCalDbSvc

        # Dead/Noisy Straw Lists
        if not (conddb.folderRequested('/TRT/Cond/Status')
                or conddb.folderRequested('/TRT/Onl/Cond/Status')):
            conddb.addFolderSplitOnline("TRT", "/TRT/Onl/Cond/Status",
                                        "/TRT/Cond/Status")
        #there used to be an additional tag here!
        #conddb.addFolder("TRT","/TRT/Cond/StatusPermanent<tag>TrtStrawStatusPermanent-01</tag>")
        if not (conddb.folderRequested('/TRT/Cond/StatusPermanent')
                or conddb.folderRequested('/TRT/Onl/Cond/StatusPermanent')):
            conddb.addFolderSplitOnline("TRT", "/TRT/Onl/Cond/StatusPermanent",
                                        "/TRT/Cond/StatusPermanent")

        #high threshold capabilities
        if not (conddb.folderRequested('/TRT/Cond/StatusHT')
                or conddb.folderRequested('/TRT/Onl/Cond/StatusHT')):
            conddb.addFolderSplitOnline("TRT", "/TRT/Onl/Cond/StatusHT",
                                        "/TRT/Cond/StatusHT")

        # DCS Data Folders
        from AthenaCommon.GlobalFlags import globalflags
        if (globalflags.InputFormat() == 'bytestream'
                and globalflags.DataSource() == 'data'):
            if self.useDCS and not self.onlineMode:
                if not conddb.folderRequested(
                        '/TRT/DCS/HV/BARREL <cache>600</cache>'):
                    conddb.addFolder('DCS_OFL',
                                     "/TRT/DCS/HV/BARREL <cache>600</cache>")
                if not conddb.folderRequested(
                        '/TRT/DCS/HV/ENDCAPA <cache>600</cache>'):
                    conddb.addFolder('DCS_OFL',
                                     "/TRT/DCS/HV/ENDCAPA <cache>600</cache>")
                if not conddb.folderRequested(
                        '/TRT/DCS/HV/ENDCAPC <cache>600</cache>'):
                    conddb.addFolder('DCS_OFL',
                                     "/TRT/DCS/HV/ENDCAPC <cache>600</cache>")

        # TRT PID tools
        if not (conddb.folderRequested('/TRT/Calib/PID')
                or conddb.folderRequested('/TRT/Onl/Calib/PID')):
            conddb.addFolderSplitOnline("TRT", "/TRT/Onl/Calib/PID",
                                        "/TRT/Calib/PID")
        if not (conddb.folderRequested('/TRT/Calib/PIDver_New')
                or conddb.folderRequested('/TRT/Onl/Calib/PIDver_New')):
            conddb.addFolderSplitOnline("TRT", "/TRT/Onl/Calib/PIDver_New",
                                        "/TRT/Calib/PIDver_New")
        if not (conddb.folderRequested('/TRT/Calib/PID_RToTver_New')
                or conddb.folderRequested('/TRT/Onl/Calib/PID_RToTver_New')):
            conddb.addFolderSplitOnline("TRT",
                                        "/TRT/Onl/Calib/PID_RToTver_New",
                                        "/TRT/Calib/PID_RToTver_New")

        #
        # Load and Configure TRT Conditions Services
        #
        InDetTRTConditionsServices = []

        # Dead/Noisy Straw Service
        from TRT_ConditionsServices.TRT_ConditionsServicesConf import TRT_StrawStatusSummarySvc
        InDetTRTStrawStatusSummarySvc = \
            TRT_StrawStatusSummarySvc(name=self.instanceName("InDetTRTStrawStatusSummarySvc"))
        ServiceMgr += InDetTRTStrawStatusSummarySvc
        InDetTRTConditionsServices.append(InDetTRTStrawStatusSummarySvc)

        if self._print:
            print InDetTRTStrawStatusSummarySvc

        # Services which only run on raw data
        if (globalflags.InputFormat() == 'bytestream'
                and globalflags.DataSource() == 'data'):

            # Hardware Mapping Service
            from TRT_ConditionsServices.TRT_ConditionsServicesConf import TRT_HWMappingSvc
            InDetTRT_HWMappingSvc = TRT_HWMappingSvc(
                name=self.instanceName("InDetTRT_HWMappingSvc"))
            ServiceMgr += InDetTRT_HWMappingSvc
            if self._print:
                print InDetTRT_HWMappingSvc

            # DCS Conditions Service
            if self.useDCS and not self.onlineMode:
                from TRT_ConditionsServices.TRT_ConditionsServicesConf import TRT_DCS_ConditionsSvc
                InDetTRT_DCS_ConditionsSvc = TRT_DCS_ConditionsSvc(
                    name=self.instanceName("InDetTRT_DCS_ConditionsSvc"),
                    HWMapSvc=InDetTRT_HWMappingSvc,
                    #OutputLevel = VERBOSE,
                    EventInfoKey="ByteStreamEventInfo",
                    DoIOVChecking=True,
                    IOVmaxLength=7 * 24 * 60 * 60,
                    #FallBackOnCOOLChanName = False,
                )
                ServiceMgr += InDetTRT_DCS_ConditionsSvc
                if self._print:
                    print InDetTRT_DCS_ConditionsSvc
                InDetTRTConditionsServices.append(InDetTRT_DCS_ConditionsSvc)

        # TRT Conditions Summary Service
        from TRT_ConditionsServices.TRT_ConditionsServicesConf import TRT_ConditionsSummarySvc
        InDetTRTConditionsSummaryService = TRT_ConditionsSummarySvc(
            name=self.instanceName("InDetTRTConditionsSummaryService"),
            ServiceList=InDetTRTConditionsServices,
        )
        ServiceMgr += InDetTRTConditionsSummaryService
        if self._print:
            print InDetTRTConditionsSummaryService

        from TRT_RecoConditionsServices.TRT_RecoConditionsServicesConf import TRT_ActiveFractionSvc
        InDetTRT_ActiveFractionSvc = TRT_ActiveFractionSvc(
            name=self.instanceName("InDetTRTActiveFractionSvc"),
            #missing link to TRTSummarySvc
        )
        ServiceMgr += InDetTRT_ActiveFractionSvc
# Number of events to be processed (default is 10)
theApp.EvtMax = -1
#ServiceMgr.EventSelector.SkipEvents = 2
#ServiceMgr.StoreGateSvc.Dump = True

if not doReadBS:
    ServiceMgr.PoolSvc.AttemptCatalogPatch = True
    ServiceMgr.EventSelector.InputCollections = [
        "data12_8TeV.00208485.express_express.recon.ESD.f472._lb0055._SFO-ALL._0001.1"
    ]

from AthenaCommon.AppMgr import ToolSvc

from TRT_ConditionsServices.TRT_ConditionsServicesConf import TRT_CalDbSvc
TRTCalibDBSvc = TRT_CalDbSvc()
ServiceMgr += TRTCalibDBSvc

from TRT_DriftFunctionTool.TRT_DriftFunctionToolConf import TRT_DriftFunctionTool
InDetTRT_DriftFunctionTool = TRT_DriftFunctionTool(
    name="InDetTRT_DriftFunctionTool", TRTCalDbTool=TRTCalibDBSvc)

ToolSvc += InDetTRT_DriftFunctionTool
print InDetTRT_DriftFunctionTool

from TRT_ConditionsServices.TRT_ConditionsServicesConf import TRT_StrawNeighbourSvc
TRTStrawNeighbourSvc = TRT_StrawNeighbourSvc()
ServiceMgr += TRTStrawNeighbourSvc

from TRT_CalibTools.TRT_CalibToolsConf import FitTool
TRTCalFitTool = FitTool(name='TRTCalFitTool')