Exemplo n.º 1
0
import shutil, os
from LArCalibProcessing.extractFolderInfo import *

if 'dbname' not in dir():
  dbname="CONDBR2"

if 'sqliteIn' not in dir():
  sqliteIn="freshConstants.db"

if 'sqliteOut' not in dir():
  sqliteOut=sqliteIn+".out"

inputDB="sqlite://;schema="+sqliteIn+";dbname="+dbname
outputDB="sqlite://;schema="+sqliteOut+";dbname="+dbname

folderInfo=extractFolderInfo(inputDB)

#ccs="<channelSelection>3:238</channelSelection>"

if 'mergeFolders' not in dir():
  mergeFolders=["/LAR/ElecCalibOfl/OFC/PhysWave/RTM/5samples",
                "/LAR/ElecCalibOfl/Shape/RTM/5samples"
                ]

if 'fileName' not in dir():
  fileName="LArConditions"

shutil.copyfile(sqliteIn,sqliteOut)


    InputDBConnectionPhysWaveShift = DBConnectionCOOL

#if not "InputDBConnectionOFCBin" in dir():
#   InputDBConnectionOFCBin = DBConnectionCOOL

if not "InputDBConnectionShapeResidual" in dir():
    InputDBConnectionShapeResidual = DBConnectionCOOL

#Try to get IOV start from input physWave:
if not 'IOVBegin' in dir():
    IOVBegin = 0
    from LArCalibProcessing.extractFolderInfo import *
    folderinfo = extractFolderInfo(
        dbname=InputDBConnectionPhysWave,
        checkFolders=[
            LArCalib_Flags.LArPhysWaveFolder,
        ],
        selection="3:7,9:13,15:19,21:25,27:31,33:37"
    )  #Exclude FCAL channels that have infinete IOV
    print folderinfo
    if len(folderinfo) == 1:
        IOVBegin = folderinfo[0][4]
        print "IOVStart taken from input PhysWave:", IOVBegin
    else:
        print "Failed to extract IOV start of input PhysWave"
        pass
    pass

###########################################################################
# Print summary
###########################################################################
if doRamp:
    inputFolders += [LArCalib_Flags.LArRampFolder]

if doCW:
    inputFolders += [LArCalib_Flags.LArCaliWaveFolder]
elif doCWxtalk:
    inputFolders += [LArCalib_Flags.LArCaliWaveFolderXtlk]

from LArConditionsCommon.LArExtendedSubDetGrouping import LArExtendedSubDetGrouping
g = LArExtendedSubDetGrouping()
g.setWithCorr(False)  #ingore correction channels
sel = g.getChannelSelection(Partitions, Gains)
ccs = "<channelSelection>" + sel + "</channelSelection>"

from LArCalibProcessing.extractFolderInfo import *
folderInfo = extractFolderInfo(InputDB, globaltag, inputFolders, Runnumber,
                               sel)
if folderInfo is None:
    print "Failed to inspect database", InputDB
    sys.exit(-1)

print folderInfo
import AthenaCommon.AtlasUnixGeneratorJob  #use MC event selector

## get a handle to the default top-level algorithm sequence
from AthenaCommon.AlgSequence import AlgSequence
topSequence = AlgSequence()

from AthenaCommon.GlobalFlags import globalflags
globalflags.DataSource = "data"
globalflags.InputFormat = "bytestream"
Exemplo n.º 4
0
if 'sqliteOut' not in dir():
  sqliteOut=sqliteIn+".out"

inputDB="sqlite://;schema="+sqliteIn+";dbname="+dbname
outputDB="sqlite://;schema="+sqliteOut+";dbname="+dbname


if os.environ.has_key("CALIBMERGE_PEEKRUN"):
  peekrun=int(os.environ["CALIBMERGE_PEEKRUN"])
else:
  peekrun=2147483647

printfunc ("Peeking input database at run",peekrun)

folderInfo=extractFolderInfo(inputDB,runnumber=peekrun)

mergeFoldersRec=["/LAR/ElecCalibOfl/Pedestals/Pedestal",
                 "/LAR/ElecCalibOfl/Ramps/RampLinea",
                 "/LAR/ElecCalibOfl/MphysOverMcal/RTM",
                 "/LAR/ElecCalibOfl/OFC/PhysWave/RTM/5samples1phase",
                 "/LAR/ElecCalibOfl/Shape/RTM/5samples1phase"
                 ]

mergeFoldersCalib=["/LAR/ElecCalibOfl/AutoCorrs/AutoCorr",
                   "/LAR/ElecCalibOfl/AutoCorrs/PhysicsAutoCorr",
                   "/LAR/ElecCalibOfl/CaliPulseParams/RTM",
                   "/LAR/ElecCalibOfl/DetCellParams/RTM",
                   "/LAR/ElecCalibOfl/OFCBin/PhysWaveShifts",
                   #"/LAR/ElecCalibOfl/OFC/CaliWave",
                   #"/LAR/ElecCalibOfl/OFC/CaliWaveXtalkCorr"
print "Peeking input database at run",peekrun

if not "ShapeFolder" in dir():
  ShapeFolder="/LAR/ElecCalibOfl/Shape/RTM/5samples1phase"

if not 'ShapeResidualsFolder' in dir() :
  ShapeResidualsFolder  =  "/LAR/ElecCalibOfl/Shape/Residuals/5samples"


if 'ShapeResidualsTag' in dir() :
  shapeResidualTag="<tag>"+ShapeResidualsTag+"</tag>"
else:
  shapeResidualTag=""

folderInfo=extractFolderInfo(inputDB,checkFolders=[ShapeFolder,],runnumber=peekrun)
print folderInfo

import AthenaCommon.AtlasUnixGeneratorJob #use MC event selector

## get a handle to the default top-level algorithm sequence
from AthenaCommon.AlgSequence import AlgSequence 
topSequence = AlgSequence()

include("LArCalibProcessing/LArCalib_MinimalSetup.py")


theApp.EvtMax = 1
conddb.setGlobalTag("LARCALIB-000-02") #For id mapping and wave residuals

svcMgr.PoolSvc.CheckDictionary=True