Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-12-01 23:40:05

0001 #! /usr/bin/env cmsRun
0002 # Author: Marco Musich (May 2020)
0003 import os, shlex, shutil, getpass
0004 
0005 ###################################################################
0006 # Set default phase-2 settings
0007 ###################################################################
0008 import Configuration.Geometry.defaultPhase2ConditionsEra_cff as _settings
0009 _PH2_GLOBAL_TAG, _PH2_ERA = _settings.get_era_and_conditions(_settings.DEFAULT_VERSION)
0010 
0011 import FWCore.ParameterSet.Config as cms
0012 process = cms.Process("TEST", _PH2_ERA)
0013 
0014 ###################################################################
0015 # Messages
0016 ###################################################################
0017 process.load('FWCore.MessageService.MessageLogger_cfi')   
0018 process.MessageLogger.cerr.enable = False
0019 process.MessageLogger.SiPhase2OuterTrackerLorentzAngleWriter=dict()  
0020 process.MessageLogger.SiPhase2OuterTrackerLorentzAngle=dict()
0021 process.MessageLogger.cout = cms.untracked.PSet(
0022     enable    = cms.untracked.bool(True),
0023     enableStatistics = cms.untracked.bool(True),
0024     threshold = cms.untracked.string("INFO"),
0025     default   = cms.untracked.PSet(limit = cms.untracked.int32(0)),                       
0026     FwkReport = cms.untracked.PSet(limit = cms.untracked.int32(-1),
0027                                    reportEvery = cms.untracked.int32(1000)
0028                                    ),                                                      
0029   SiPhase2OuterTrackerLorentzAngleWriter = cms.untracked.PSet( limit = cms.untracked.int32(-1)),
0030   SiPhase2OuterTrackerLorentzAngle = cms.untracked.PSet( limit = cms.untracked.int32(-1)),
0031 )
0032 
0033 tag = 'SiPhase2OuterTrackerLorentzAngle_T33'
0034 suffix = 'v0'
0035 outfile = tag+'_'+suffix+'.db'
0036 outdb = 'sqlite_file:'+outfile
0037 
0038 if os.path.exists(outfile):
0039   oldfile = outfile.replace(".db","_old.db")
0040   print(">>> Backing up locally existing '%s' -> '%s'"%(outfile,oldfile))
0041   shutil.move(outfile,oldfile)
0042 
0043 process.load("CondCore.CondDB.CondDB_cfi")
0044 process.CondDB.connect = cms.string(outdb)
0045 
0046 process.load('Configuration.Geometry.GeometryExtendedRun4DefaultReco_cff')
0047 process.load('Configuration.Geometry.GeometryExtendedRun4Default_cff')
0048 
0049 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
0050 from Configuration.AlCa.GlobalTag import GlobalTag
0051 process.GlobalTag = GlobalTag(process.GlobalTag, _PH2_GLOBAL_TAG)
0052 process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(1) )
0053 
0054 process.source = cms.Source("EmptyIOVSource",
0055     lastValue = cms.uint64(1),
0056     timetype = cms.string('Run'),
0057     firstValue = cms.uint64(1),
0058     interval = cms.uint64(1)
0059 )
0060 
0061 process.PoolDBOutputService = cms.Service("PoolDBOutputService",
0062     process.CondDB,
0063     timetype = cms.untracked.string('Run'),
0064     toPut = cms.VPSet(cms.PSet(
0065         record = cms.string('SiPhase2OuterTrackerLorentzAngleRcd'),
0066         tag = cms.string(tag)
0067     ))
0068 )
0069 
0070 process.LAPayload = cms.EDAnalyzer("SiPhase2OuterTrackerLorentzAngleWriter")
0071 process.LAPayload.tag = cms.string(tag)
0072 
0073 process.p = cms.Path(process.LAPayload)
0074