Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:46:19

0001 # Config file template to produce a treeFile.root usable as input for
0002 # .../CMSSW/Alignment/MillePedeAlignmentAlgorithm/macros/CompareMillePede.h
0003 # to compare two different geometries.
0004 #
0005 #GLOBALTAG  # without '::All'
0006 #RUNNUMBER
0007 #TREEFILE
0008 #LOGFILE
0009 
0010 import FWCore.ParameterSet.Config as cms
0011 
0012 process = cms.Process("Alignment")
0013 
0014 process.options = cms.untracked.PSet(
0015     Rethrow = cms.untracked.vstring("ProductNotFound") # do not accept this exception
0016     )
0017 
0018 # initialize magnetic field
0019 process.load("Configuration.StandardSequences.MagneticField_cff")
0020 # geometry
0021 process.load("Configuration.Geometry.GeometryRecoDB_cff")
0022 # global tag and other conditions
0023 process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
0024 # take your favourite global tag
0025 from Configuration.AlCa.GlobalTag import GlobalTag 
0026 process.GlobalTag = GlobalTag(process.GlobalTag, "GLOBALTAG")     
0027 usedGlobalTag = process.GlobalTag.globaltag.value()
0028 
0029 process.load("FWCore.MessageService.MessageLogger_cfi")
0030 process.MessageLogger.files.LOGFILE = cms.untracked.PSet(
0031     DEBUG = cms.untracked.PSet(
0032         limit = cms.untracked.int32(-1)
0033         ),
0034     INFO = cms.untracked.PSet(
0035         limit = cms.untracked.int32(5),
0036         reportEvery = cms.untracked.int32(5)
0037         ),
0038     WARNING = cms.untracked.PSet(
0039         limit = cms.untracked.int32(10)
0040         ),
0041     ERROR = cms.untracked.PSet(
0042         limit = cms.untracked.int32(-1)
0043         ),
0044     Alignment = cms.untracked.PSet(
0045         limit = cms.untracked.int32(-1),
0046         reportEvery = cms.untracked.int32(1)
0047         ),
0048     enableStatistics = cms.untracked.bool(True)
0049     )
0050 process.MessageLogger.cerr.enable = cms.untracked.bool(False)
0051 
0052 
0053 ## if alignment constants not from global tag, add this
0054 from CondCore.CondDB.CondDB_cfi import *
0055 CondDBReference = CondDB.clone(connect = cms.string('sqlite_file:remove_me.db'))
0056 
0057 # Alignment producer
0058 process.load("Alignment.CommonAlignmentProducer.AlignmentProducer_cff")
0059 
0060 process.AlignmentProducer.ParameterBuilder.Selector = cms.PSet(
0061     alignParams = cms.vstring(
0062         "PixelHalfBarrelDets,111111",
0063         "PXECDets,111111",
0064         #  'TrackerTIBModuleUnit,101111',
0065         #  'TrackerTIDModuleUnit,101111',
0066         'TrackerTOBModuleUnit,101111',
0067         #  'TrackerTECModuleUnit,101111'
0068         )
0069     )
0070 
0071 # explicitely specify run ranges to convince algorithm that multi-IOV input is fine
0072 process.AlignmentProducer.RunRangeSelection = [
0073     cms.PSet(
0074         RunRanges = cms.vstring("RUNNUMBER"),
0075         selector = process.AlignmentProducer.ParameterBuilder.Selector.alignParams
0076     )
0077 ] # end of process.AlignmentProducer.RunRangeSelection
0078 
0079 # enable alignable updates to convince algorithm that multi-IOV input is fine
0080 process.AlignmentProducer.enableAlignableUpdates = True
0081 
0082 process.AlignmentProducer.doMisalignmentScenario = False #True
0083 process.AlignmentProducer.applyDbAlignment = True # either globalTag or trackerAlignment
0084 process.AlignmentProducer.checkDbAlignmentValidity = False
0085 
0086 # assign by reference (i.e. could change MillePedeAlignmentAlgorithm as well):
0087 process.AlignmentProducer.algoConfig = process.MillePedeAlignmentAlgorithm
0088 
0089 process.AlignmentProducer.algoConfig.mode = 'pedeRead'
0090 process.AlignmentProducer.algoConfig.treeFile = 'TREEFILE'
0091 process.AlignmentProducer.algoConfig.pedeReader.readFile = 'FILE_MUST_NOT_EXIST.res'
0092 
0093 process.source = cms.Source("EmptySource",
0094                             firstRun = cms.untracked.uint32(RUNNUMBER) # choose your run!
0095                             )
0096 process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(1) )
0097 
0098 
0099 process.dump = cms.EDAnalyzer("EventContentAnalyzer")
0100 process.p = cms.Path(process.dump)
0101 
0102 process.AlignmentProducer.saveToDB = True # should not be needed, but is: otherwise AlignmentProducer does not  call relevant algorithm part
0103 process.PoolDBOutputService = cms.Service("PoolDBOutputService",
0104                                           CondDBReference,
0105                                           timetype = cms.untracked.string('runnumber'),
0106                                           toPut = cms.VPSet(cms.PSet(record = cms.string('TrackerAlignmentRcd'),
0107                                                                      tag = cms.string('dummyTagAlignment')
0108                                                                      )
0109                                                             )
0110                                           )