Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:44:23

0001 from __future__ import print_function
0002 import os
0003 
0004 import FWCore.ParameterSet.Config as cms
0005 
0006 
0007 
0008 
0009 ##
0010 ## Setup command line options
0011 ##
0012 import FWCore.ParameterSet.VarParsing as VarParsing
0013 import sys
0014 options = VarParsing.VarParsing ('standard')
0015 options.register('iterNumber', 0, VarParsing.VarParsing.multiplicity.singleton, VarParsing.VarParsing.varType.string, "Iteration number")
0016 options.register('setBaseline', False, VarParsing.VarParsing.multiplicity.singleton, VarParsing.VarParsing.varType.bool, "Set baseline")
0017 options.register('measurementName', "workingArea", VarParsing.VarParsing.multiplicity.singleton, VarParsing.VarParsing.varType.string, "Folder in which to store results")
0018 
0019 # get and parse the command line arguments
0020 options.parseArguments()
0021 
0022 print("Iteration number: ", options.iterNumber)
0023 print("Set baseline: ", options.setBaseline)
0024 
0025 
0026 
0027 if options.setBaseline:
0028     print("Set baseline mode, do not create APE DB-object")
0029     exit(0)
0030 
0031 
0032 ##
0033 ## Process definition
0034 ##
0035 process = cms.Process("APE")
0036 # we need conditions
0037 
0038 #;;;;;;;;;;;;;;;new line;;;;;;;;;;;;;;;
0039 process.load("Configuration.StandardSequences.Services_cff")
0040 process.load("Configuration.StandardSequences.MagneticField_cff")
0041 process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
0042 from Configuration.AlCa.GlobalTag import GlobalTag
0043 
0044 process.load("Configuration.Geometry.GeometryRecoDB_cff")
0045 
0046 # process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:run2_design', '')
0047 process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase1_2018_design', '')
0048 
0049 
0050 # Alignment producer
0051 process.load("Alignment.CommonAlignmentProducer.AlignmentProducer_cff")
0052 from Alignment.CommonAlignmentAlgorithm.ApeSettingAlgorithm_cfi import *
0053 process.AlignmentProducer.algoConfig = ApeSettingAlgorithm
0054 process.AlignmentProducer.saveApeToDB = True
0055 process.AlignmentProducer.algoConfig.readApeFromASCII = True
0056 process.AlignmentProducer.algoConfig.setComposites = False
0057 process.AlignmentProducer.algoConfig.readLocalNotGlobal = True
0058 # CAVEAT: Input file name has to start with a Package name...
0059 process.AlignmentProducer.algoConfig.apeASCIIReadFile = 'Alignment/APEEstimation/hists/'+options.measurementName+'/iter'+str(options.iterNumber)+'/allData_apeOutput.txt'
0060 process.AlignmentProducer.algoConfig.saveApeToASCII = False
0061 process.AlignmentProducer.algoConfig.saveComposites = False
0062 process.AlignmentProducer.algoConfig.apeASCIISaveFile = 'myLocalDump.txt'
0063         
0064 
0065 # to be refined...
0066 process.MessageLogger = cms.Service("MessageLogger",
0067     statistics = cms.untracked.vstring('cout', 'alignment'),
0068     categories = cms.untracked.vstring('Alignment'),
0069     cout = cms.untracked.PSet(
0070         threshold = cms.untracked.string('WARNING'),
0071         noLineBreaks = cms.untracked.bool(True)
0072     ),
0073     alignment = cms.untracked.PSet(
0074         INFO = cms.untracked.PSet(
0075             limit = cms.untracked.int32(0)
0076         ),
0077         noLineBreaks = cms.untracked.bool(True),
0078         DEBUG = cms.untracked.PSet(
0079             limit = cms.untracked.int32(0)
0080         ),
0081         WARNING = cms.untracked.PSet(
0082             limit = cms.untracked.int32(0)
0083         ),
0084         ERROR = cms.untracked.PSet(
0085             limit = cms.untracked.int32(0)
0086         ),
0087         threshold = cms.untracked.string('INFO'),
0088         Alignment = cms.untracked.PSet(
0089             limit = cms.untracked.int32(-1)
0090         )
0091     ),
0092     destinations = cms.untracked.vstring('cout',  ## .log automatically
0093         'alignment')
0094 )
0095 
0096 process.source = cms.Source("EmptySource")
0097 process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(1) )
0098 
0099 from CondCore.CondDB.CondDB_cfi import *
0100 CondDBAlignmentError = CondDB.clone(connect = cms.string('sqlite_file:'+os.environ['CMSSW_BASE']+'/src/Alignment/APEEstimation/hists/'+options.measurementName+'/apeObjects/apeIter'+str(options.iterNumber)+'.db'))
0101 process.PoolDBOutputService = cms.Service(
0102     "PoolDBOutputService",
0103     CondDBAlignmentError,
0104     timetype = cms.untracked.string('runnumber'),
0105     toPut = cms.VPSet(
0106         cms.PSet(
0107         record = cms.string('TrackerAlignmentErrorExtendedRcd'),
0108             tag = cms.string('APEs')
0109         )
0110     )
0111 )
0112 
0113 
0114