|
| 1 | +from __future__ import print_function |
| 2 | +import FWCore.ParameterSet.Config as cms |
| 3 | +import FWCore.ParameterSet.VarParsing as VarParsing |
| 4 | + |
| 5 | +import Configuration.Geometry.defaultPhase2ConditionsEra_cff as _settings |
| 6 | +################################################################### |
| 7 | +# Setup 'standard' options |
| 8 | +################################################################### |
| 9 | +options = VarParsing.VarParsing() |
| 10 | +options.register('Scenario', |
| 11 | + _settings.DEFAULT_VERSION, # default value |
| 12 | + VarParsing.VarParsing.multiplicity.singleton, # singleton or list |
| 13 | + VarParsing.VarParsing.varType.string, # string, int, or float |
| 14 | + "geometry version to use") |
| 15 | +options.parseArguments() |
| 16 | + |
| 17 | +################################################################### |
| 18 | +# get Global Tag and ERA |
| 19 | +################################################################### |
| 20 | +GLOBAL_TAG, ERA = _settings.get_era_and_conditions(options.Scenario) |
| 21 | +process = cms.Process("Alignment", ERA) |
| 22 | + |
| 23 | +process.load("Configuration.StandardSequences.MagneticField_cff") # B-field map |
| 24 | +if(options.Scenario == _settings.DEFAULT_VERSION): |
| 25 | + print("Loading default scenario: ", _settings.DEFAULT_VERSION) |
| 26 | + process.load('Configuration.Geometry.GeometryExtended2026DefaultReco_cff') |
| 27 | +else: |
| 28 | + process.load('Configuration.Geometry.GeometryExtended'+options.Scenario+'Reco_cff') |
| 29 | +process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") # Global tag |
| 30 | + |
| 31 | + |
| 32 | +################################################################################ |
| 33 | +# parameters to configure: |
| 34 | +from Configuration.AlCa.GlobalTag import GlobalTag |
| 35 | +process.GlobalTag = GlobalTag(process.GlobalTag,GLOBAL_TAG) |
| 36 | + |
| 37 | +process.load("Alignment.TrackerAlignment.createIdealTkAlRecords_cfi") |
| 38 | +process.createIdealTkAlRecords.alignToGlobalTag = False |
| 39 | +################################################################################ |
| 40 | + |
| 41 | +usedGlobalTag = process.GlobalTag.globaltag.value() |
| 42 | +print("Using Global Tag:", usedGlobalTag) |
| 43 | + |
| 44 | +from CondCore.CondDB.CondDB_cfi import * |
| 45 | +process.PoolDBOutputService = cms.Service("PoolDBOutputService", |
| 46 | + CondDB, |
| 47 | + timetype = cms.untracked.string("runnumber"), |
| 48 | + toPut = cms.VPSet( |
| 49 | + cms.PSet( |
| 50 | + record = cms.string("TrackerAlignmentRcd"), |
| 51 | + tag = cms.string("Alignments") |
| 52 | + ), |
| 53 | + cms.PSet( |
| 54 | + record = cms.string("TrackerAlignmentErrorExtendedRcd"), |
| 55 | + tag = cms.string("AlignmentErrorsExtended") |
| 56 | + ), |
| 57 | + cms.PSet( |
| 58 | + record = cms.string("TrackerSurfaceDeformationRcd"), |
| 59 | + tag = cms.string("AlignmentSurfaceDeformations") |
| 60 | + ), |
| 61 | + ) |
| 62 | +) |
| 63 | +process.PoolDBOutputService.connect = \ |
| 64 | + ("sqlite_file:tracker_alignment_payloads_"+ |
| 65 | + options.Scenario+("_reference.db" |
| 66 | + if process.createIdealTkAlRecords.createReferenceRcd |
| 67 | + else "_fromIdealGeometry.db")) |
| 68 | + |
| 69 | +process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(1)) |
| 70 | +process.source = cms.Source("EmptySource") |
| 71 | + |
| 72 | +process.p = cms.Path(process.createIdealTkAlRecords) |
0 commit comments