Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-06-24 22:51:36

0001 # MillePedeAlignmentAlgorithm
0002 # ---------------------------
0003 
0004 import FWCore.ParameterSet.Config as cms
0005 
0006 from Alignment.ReferenceTrajectories.TrajectoryFactories_cff import *
0007 from Alignment.MillePedeAlignmentAlgorithm.MillePedeFileReader_cfi import *
0008 
0009 MillePedeAlignmentAlgorithm = cms.PSet(
0010     algoName = cms.string('MillePedeAlignmentAlgorithm'),
0011     mode = cms.untracked.string('full'), ## possible modes: full, mille, pede, pedeSteer, pedeRun, pedeRead
0012     fileDir = cms.untracked.string(''),
0013 
0014     # Where mille writes (and pede reads) derivatives, labels etc.
0015     binaryFile = cms.string('milleBinary.dat'),
0016     # Resulting and initial parameters, absolute (original) positions, result etc.
0017     treeFile = cms.string('treeFile.root'),
0018     # Must be empty if mille runs, otherwise for merging (pede) jobs should be parallel with each
0019     # other. Then 'treeFile' is merged result and 'binaryFile' should be empty.
0020     mergeBinaryFiles = cms.vstring(),
0021     mergeTreeFiles = cms.vstring(),
0022 
0023     monitorFile = cms.untracked.string('millePedeMonitor.root'), ## if empty: no monitoring...
0024 
0025     runAtPCL = cms.bool(False), # at the PCL the mille binaries are reset at lumi-section boundaries
0026     ignoreFirstIOVCheck = cms.untracked.bool(False), # flag to ignore check if data is prior to first IOV
0027     ignoreHitsWithoutGlobalDerivatives = cms.bool(False), # - if all alignables and calibration for a
0028                                                           #   hit are set to '0', the hit is ignored
0029                                                           # - has only an effect with non-GBL
0030                                                           #   material-effects description
0031     skipGlobalPositionRcdCheck = cms.bool(False), # since the change of the GlobalPositionRcd is
0032                                                   # mostly driven by changes of the muon system
0033                                                   # it is often safe to ignore this change for
0034                                                   # tracker alignment
0035 
0036     # PSet that allows to configure the pede labeler, i.e. select the actual
0037     # labeler plugin to use and parameters for the selected plugin
0038     pedeLabeler = cms.PSet(
0039       #plugin = cms.string('MomentumDependentPedeLabeler')
0040       #parameterInstances = cms.VPSet(
0041       #  cms.PSet(momentumRanges = cms.vstring('0.0:50.0','50.0:10000.0'),
0042       #           selector = cms.vstring('ExtrasBeamSpot,1111'))
0043       #  )
0044     ),
0045     
0046     pedeSteerer = cms.PSet(
0047         fileDir = cms.untracked.string(''),
0048         runDir = cms.untracked.string(''),
0049         steerFile = cms.string('pedeSteer'), ## beginning of steering file names
0050         steerFileDebug = cms.untracked.bool(False),
0051         # If MillePedeAlignmentAlgorithm.mode causes pede to run (e.g. 'full', 'pede' etc.),
0052         # the pede command line is constructed as:
0053         #    'pedeCommand' 'steerFile'Master.txt 
0054         # (and - if pedeDump is not empty - extended by: > 'pedeDump')
0055         # (MillePedeAlignmentAlgorithm.theDir is taken into account...)
0056         pedeCommand = cms.untracked.string('pede'),
0057 
0058         parameterSign = cms.untracked.int32(1), ## old pede versions (before May '07) need a sign flip
0059         pedeDump = cms.untracked.string('pede.dump'),
0060         method = cms.string('sparseMINRES 6  0.8'), ## "inversion  6  0.8" 
0061         options = cms.vstring('entries 50', # min. number of measurements (parameters with less will be skipped)
0062             # 'regularisation 1.0 0.01', # regularisation with default pre-sigma 0.01
0063             # "chisqcut  20.0  4.5", # simple chi^2 cut for outliers AND/OR ...
0064             # "outlierdownweighting 3", "dwfractioncut 0.1" #, # ... 3x Huber down weighting OR...
0065             'outlierdownweighting 5', 'dwfractioncut 0.2'),
0066 
0067         # Special selection of parameters to fix, use as reference coordinate system etc.
0068         # ------------------------------------------------------------------------------
0069         # All this is determined from what is given as 
0070         # AlignmentProducer.ParameterBuilder.Selector, cf. Twiki page SWGuideMillepedeIIAlgorithm.
0071         Presigmas = cms.VPSet(),
0072         minHieraConstrCoeff = cms.double(1.e-10), # min abs value of coeff. in hierarchy constr.
0073         minHieraParPerConstr = cms.uint32(1), # ignore hierarchy constraints with less params
0074         constrPrecision = cms.uint32(10), # precision for writing constraints to text file. Default is 6 and can be setup with constrPrecision = cms.uint32(0)
0075         # specify additional steering files
0076         additionalSteerFiles = cms.vstring(), # obsolete - can be given as entries in 'options'
0077         
0078         # Parameter vector for the systematic geometry deformations
0079         # Empty vector -> constraints are NOT applied (default)
0080         constraints = cms.VPSet()
0081     ),
0082 
0083     pedeReader = cms.PSet(
0084         readFile = cms.string('millepede.res'),
0085         # directory of 'readFile', if empty:
0086         # take from pedeSteerer (inheriting from MillePedeAlignmentAlgorithm)
0087         fileDir = cms.untracked.string('')
0088     ),
0089 
0090     # Array of PSet's like 'pedeReader' above to be applied before running mille,
0091     # i.e. for iterative running of Millepede without going via DB constants
0092     # (note: if 'fileDir' empty, the one from 'pedeSteerer' will be used...): 
0093     pedeReaderInputs = cms.VPSet(),
0094 
0095     TrajectoryFactory = BrokenLinesTrajectoryFactory,  # from TrajectoryFactories
0096     # BrokenLinesBzeroTrajectoryFactory
0097     # TwoBodyDecayReferenceTrajectoryFactory, # for this overwrite MaterialEffects for BL
0098     minNumHits = cms.uint32(7), ## minimum number of hits (with alignable parameters)
0099     max2Dcorrelation = cms.double(0.05), ## if correlation >5% 2D measurements in TID/TEC get diagonalized
0100     doubleBinary = cms.bool(False), ## create binary files with doubles instead of floats (GBL only)
0101 
0102     # Parameters for PXB survey steering
0103     surveyPixelBarrel = cms.PSet(
0104             doSurvey = cms.bool(False),
0105             infile = cms.FileInPath("Alignment/SurveyAnalysis/data/BPix_Survey_info_raw.txt"),
0106             doOutputOnStdout = cms.bool(False),
0107             # Settings for toy survey - produces a file with toy survey data according to given parameters
0108             doToySurvey = cms.bool(False),
0109             toySurveyFile = cms.untracked.string('toySurveyInfo.txt'),
0110             toySurveySeed = cms.uint32(12),
0111             toySurveyParameters = cms.VPSet(
0112                     # Position of photo in local frame (unit: pixels in photo)
0113                     cms.PSet(name = cms.string('a0'),    mean = cms.double(1800.), sigma = cms.double(150.)),
0114                     cms.PSet(name = cms.string('a1'),    mean = cms.double(2600.), sigma = cms.double(200.)),
0115                     # Scale of photo (unit: pixels per cm)
0116                     cms.PSet(name = cms.string('scale'), mean = cms.double(1150.), sigma = cms.double(50.)),
0117                     # Rotation of photo in local frame (unit: rads)
0118                     cms.PSet(name = cms.string('phi'),   mean = cms.double(0.), sigma = cms.double(0.0025)),
0119                     # Smearing of measurements in u and v coordinate (unit: pixels in photo)
0120                     cms.PSet(name = cms.string('u'),     mean = cms.double(0.), sigma = cms.double(0.175)),
0121                     cms.PSet(name = cms.string('v'),     mean = cms.double(0.), sigma = cms.double(0.175))
0122                     )
0123     ),
0124 
0125     #parameters used to read the pede files back for DQM and check on parameters
0126     MillePedeFileReader = cms.PSet(MillePedeFileReader),
0127 )
0128