Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
import FWCore.ParameterSet.Config as cms

process = cms.Process("write")
process.load("CondCore.CondDB.CondDB_cfi")

process.maxEvents = cms.untracked.PSet(
    input = cms.untracked.int32(1)
)
process.source = cms.Source("EmptySource")

process.PoolDBOutputService = cms.Service("PoolDBOutputService",
    process.CondDBSetup,
    # Writing to oracle needs the following shell variable setting (in zsh):
    # export CORAL_AUTH_PATH=/afs/cern.ch/cms/DB/conddb
    # string connect = "oracle://cms_orcoff_int2r/CMS_COND_ALIGNMENT"
    timetype = cms.untracked.string('runnumber'),
    connect = cms.string('sqlite_file:output.db'),
    # untracked uint32 authenticationMethod = 1
    toPut = cms.VPSet(cms.PSet(
        record = cms.string('GlobalPositionRcd'),
        tag = cms.string('IdealGeometry')
    ))
)

process.GlobalPositionRcdWrite = cms.EDAnalyzer("GlobalPositionRcdWrite",

    # setting 'useEulerAngles' to 'True' lets the module interpret the angles
    # 'alpha', 'beta' and 'gamma' as Euler angles. This is the original behavior
    # of the module. If 'useEulerAngles' is 'False' the angles 'alpha', 'beta'
    # and 'gamma' are interpreted as rotations around the X, Y and Z axes,
    # respectively.
    useEulerAngles = cms.bool(False),

    tracker = cms.PSet(
        y = cms.double(0.0),
        x = cms.double(0.0),
        z = cms.double(0.0),
        alpha = cms.double(0.0),
        beta = cms.double(0.0),
        gamma = cms.double(0.0)
    ),
    muon = cms.PSet(
        y = cms.double(0.0),
        x = cms.double(0.0),
        z = cms.double(0.0),
        alpha = cms.double(0.0),
        beta = cms.double(0.0),
        gamma = cms.double(0.0)
    ),
    ecal = cms.PSet(
        y = cms.double(0.0),
        x = cms.double(0.0),
        z = cms.double(0.0),
        alpha = cms.double(0.0),
        beta = cms.double(0.0),
        gamma = cms.double(0.0)
    ),
    hcal = cms.PSet(
        y = cms.double(0.0),
        x = cms.double(0.0),
        z = cms.double(0.0),
        alpha = cms.double(0.0),
        beta = cms.double(0.0),
        gamma = cms.double(0.0)
    ),
    calo = cms.PSet(
        y = cms.double(0.0),
        x = cms.double(0.0),
        z = cms.double(0.0),
        alpha = cms.double(0.0),
        beta = cms.double(0.0),
        gamma = cms.double(0.0)
    )
)

process.p = cms.Path(process.GlobalPositionRcdWrite)
process.CondDBSetup.DBParameters.messageLevel = 2