Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:02:44

0001 from __future__ import print_function
0002 import FWCore.ParameterSet.Config as cms
0003 
0004 process = cms.Process('test')
0005 
0006 import sys
0007 if len(sys.argv) > 2:
0008     startrun = sys.argv[1]
0009     subdir = sys.argv[2]+"/"
0010 else:
0011     print("not able to run")
0012     exit()
0013 
0014 
0015 process.source = cms.Source("EmptyIOVSource",
0016     timetype = cms.string('runnumber'),
0017     firstValue = cms.uint64(int(startrun)),
0018     lastValue  = cms.uint64(int(startrun)),
0019     interval = cms.uint64(1)
0020 )
0021 
0022 # load the alignment xml file
0023 process.load("CalibPPS.ESProducers.ctppsRPAlignmentCorrectionsDataESSourceXML_cfi")
0024 #process.ctppsRPAlignmentCorrectionsDataESSourceXML.XMLFile = cms.string("CondFormats/PPSObjects/xml/sample_alignment_corrections.xml")
0025 process.ctppsRPAlignmentCorrectionsDataESSourceXML.RealFiles = cms.vstring(
0026     "CondFormats/PPSObjects/xml/sample_alignment_corrections.xml"
0027     #"CondTools/CTPPS/test/RPixGeometryCorrections.xml",
0028     #"CondTools/CTPPS/test/"+subdir+"real_alignment_iov"+startrun+".xml"
0029     )
0030 process.ctppsRPAlignmentCorrectionsDataESSourceXML.MeasuredFiles = cms.vstring("CondFormats/PPSObjects/xml/sample_alignment_corrections.xml")
0031 process.ctppsRPAlignmentCorrectionsDataESSourceXML.MisalignedFiles = cms.vstring("CondFormats/PPSObjects/xml/sample_alignment_corrections.xml")
0032 
0033 
0034 #Database output service
0035 process.load("CondCore.CondDB.CondDB_cfi")
0036 # output database (in this case local sqlite file)
0037 process.CondDB.connect = 'sqlite_file:CTPPSRPRealAlignment_table.db'
0038 
0039 
0040 process.PoolDBOutputService = cms.Service("PoolDBOutputService",
0041     process.CondDB,
0042     timetype = cms.untracked.string('runnumber'),
0043     toPut = cms.VPSet(
0044     cms.PSet(
0045         record = cms.string('RPRealAlignmentRecord'),
0046         tag = cms.string('CTPPSRPAlignment_real_table'),
0047     )
0048   )
0049 )
0050 
0051 
0052 # print the mapping and analysis mask
0053 process.writeCTPPSRPAlignments = cms.EDAnalyzer("CTPPSRPAlignmentInfoAnalyzer",
0054     cms.PSet(
0055         iov = cms.uint64(int(startrun)),
0056         record = cms.string("RPRealAlignmentRecord")
0057     )
0058 )
0059 
0060 process.path = cms.Path(
0061   process.writeCTPPSRPAlignments
0062 )