Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-11-06 06:06:10

0001 from __future__ import print_function
0002 import FWCore.ParameterSet.Config as cms
0003 import FWCore.ParameterSet.VarParsing as VarParsing
0004 
0005 import Configuration.Geometry.defaultPhase2ConditionsEra_cff as _settings
0006 ###################################################################
0007 # Setup 'standard' options
0008 ###################################################################
0009 options = VarParsing.VarParsing()
0010 options.register('Scenario',
0011                  _settings.DEFAULT_VERSION, # default value
0012                  VarParsing.VarParsing.multiplicity.singleton, # singleton or list
0013                  VarParsing.VarParsing.varType.string, # string, int, or float
0014                  "geometry version to use")
0015 options.parseArguments()
0016 
0017 ###################################################################
0018 # get Global Tag and ERA
0019 ###################################################################
0020 GLOBAL_TAG, ERA = _settings.get_era_and_conditions(options.Scenario)
0021 process = cms.Process("Alignment", ERA)
0022 
0023 process.load("Configuration.StandardSequences.MagneticField_cff") # B-field map
0024 if(options.Scenario == _settings.DEFAULT_VERSION):
0025     print("Loading default scenario: ", _settings.DEFAULT_VERSION)
0026     process.load('Configuration.Geometry.GeometryExtendedRun4DefaultReco_cff')
0027 else:
0028     process.load('Configuration.Geometry.GeometryExtended'+options.Scenario+'Reco_cff')    
0029 process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") # Global tag
0030 
0031 
0032 ################################################################################
0033 # parameters to configure:
0034 from Configuration.AlCa.GlobalTag import GlobalTag
0035 process.GlobalTag = GlobalTag(process.GlobalTag,GLOBAL_TAG)
0036 
0037 process.load("Alignment.TrackerAlignment.createIdealTkAlRecords_cfi")
0038 process.createIdealTkAlRecords.alignToGlobalTag = False
0039 ################################################################################
0040 
0041 usedGlobalTag = process.GlobalTag.globaltag.value()
0042 print("Using Global Tag:", usedGlobalTag)
0043 
0044 from CondCore.CondDB.CondDB_cfi import *
0045 process.PoolDBOutputService = cms.Service("PoolDBOutputService",
0046     CondDB,
0047     timetype = cms.untracked.string("runnumber"),
0048     toPut = cms.VPSet(
0049         cms.PSet(
0050             record = cms.string("TrackerAlignmentRcd"),
0051             tag = cms.string("Alignments")
0052         ),
0053         cms.PSet(
0054             record = cms.string("TrackerAlignmentErrorExtendedRcd"),
0055             tag = cms.string("AlignmentErrorsExtended")
0056         ),
0057         cms.PSet(
0058             record = cms.string("TrackerSurfaceDeformationRcd"),
0059             tag = cms.string("AlignmentSurfaceDeformations")
0060         ),
0061     )
0062 )
0063 process.PoolDBOutputService.connect = \
0064     ("sqlite_file:tracker_alignment_payloads_"+
0065      options.Scenario+("_reference.db"
0066                     if process.createIdealTkAlRecords.createReferenceRcd
0067                     else "_fromIdealGeometry.db"))
0068 
0069 process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(1))
0070 process.source = cms.Source("EmptySource")
0071 
0072 process.p = cms.Path(process.createIdealTkAlRecords)