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
import FWCore.ParameterSet.Config as cms
process = cms.Process("Alignment")

process.load("Configuration.StandardSequences.MagneticField_cff") # B-field map
process.load("Configuration.Geometry.GeometryRecoDB_cff") # Ideal geometry and interface
process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") # Global tag
from Configuration.AlCa.GlobalTag import GlobalTag
process.load("Alignment.TrackerAlignment.createIdealTkAlRecords_cfi")

################################################################################
# parameters to configure:
process.GlobalTag = GlobalTag(process.GlobalTag, "auto:phase1_2017_design")

process.createIdealTkAlRecords.alignToGlobalTag = True
process.createIdealTkAlRecords.skipSubDetectors = cms.untracked.vstring("P1PXB", "P1PXEC")
################################################################################


usedGlobalTag = process.GlobalTag.globaltag.value()
print("Using Global Tag:", usedGlobalTag)

from CondCore.CondDB.CondDB_cfi import *
process.PoolDBOutputService = cms.Service("PoolDBOutputService",
    CondDB,
    timetype = cms.untracked.string("runnumber"),
    toPut = cms.VPSet(
        cms.PSet(
            record = cms.string("TrackerAlignmentRcd"),
            tag = cms.string("Alignments")
        ),
        cms.PSet(
            record = cms.string("TrackerAlignmentErrorExtendedRcd"),
            tag = cms.string("AlignmentErrorsExtended")
        ),
        cms.PSet(
            record = cms.string("TrackerSurfaceDeformationRcd"),
            tag = cms.string("AlignmentSurfaceDeformations")
        ),
    )
)
process.PoolDBOutputService.connect = \
    ("sqlite_file:tracker_alignment_payloads__pixel_ideal__strips_aligned_to_"+
     usedGlobalTag+("_reference.db"
                    if process.createIdealTkAlRecords.createReferenceRcd
                    else ".db"))

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