Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:45:18

0001 # last update on $Date: 2010/09/10 13:33:44 $ by $Author: mussgill $
0002 
0003 import FWCore.ParameterSet.Config as cms
0004 
0005 process = cms.Process("Alignment")
0006 
0007 process.options = cms.untracked.PSet(
0008     Rethrow = cms.untracked.vstring("ProductNotFound") # do not accept this exception
0009     )
0010 
0011 # initialize  MessageLogger
0012 process.load("FWCore.MessageService.MessageLogger_cfi")
0013 process.MessageLogger.files.alignment = cms.untracked.PSet(
0014     DEBUG = cms.untracked.PSet(
0015         limit = cms.untracked.int32(-1)
0016         ),
0017     INFO = cms.untracked.PSet(
0018         limit = cms.untracked.int32(5),
0019         reportEvery = cms.untracked.int32(5)
0020         ),
0021     WARNING = cms.untracked.PSet(
0022         limit = cms.untracked.int32(10)
0023         ),
0024     ERROR = cms.untracked.PSet(
0025         limit = cms.untracked.int32(-1)
0026         ),
0027     Alignment = cms.untracked.PSet(
0028         limit = cms.untracked.int32(-1),
0029         reportEvery = cms.untracked.int32(1)
0030         ),
0031     enableStatistics = cms.untracked.bool(True)
0032     )
0033 process.MessageLogger.cerr.enable = cms.untracked.bool(False)
0034 
0035 
0036 
0037 # initialize magnetic field
0038 process.load("Configuration.StandardSequences.MagneticField_cff")
0039 #process.load("Configuration.StandardSequences.MagneticField_0T_cff")
0040 
0041 # geometry
0042 process.load("Configuration.Geometry.GeometryRecoDB_cff")
0043 #del process.CaloTopologyBuilder etc. to speed up...???
0044 
0045 process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
0046 process.GlobalTag.globaltag = 'MC_310_V1::All' # take your favourite
0047 #    # if alignment constants not from global tag, add this
0048 #from CondCore.DBCommon.CondDBSetup_cfi import *
0049 #process.trackerAlignment = cms.ESSource(
0050 #    "PoolDBESSource",
0051 #    CondDBSetup,
0052 #    connect = cms.string("frontier://FrontierProd/CMS_COND_31X_ALIGNMENT"),
0053 ##    connect = cms.string("frontier://FrontierPrep/CMS_COND_ALIGNMENT"),
0054 #    toGet = cms.VPSet(cms.PSet(record = cms.string("TrackerAlignmentRcd"),
0055 #                               tag = cms.string("TrackerIdealGeometry210_mc")
0056 #                               ),
0057 #                      cms.PSet(record = cms.string("TrackerAlignmentErrorExtendedRcd"),
0058 #                               tag = cms.string("TrackerIdealGeometryErrors210_mc")
0059 #                               )
0060 #                      )
0061 #    )
0062 #process.es_prefer_trackerAlignment = cms.ESPrefer("PoolDBESSource", "trackerAlignment")
0063 ## might help for double es_prefer: del process.es_prefer_GlobalTag
0064 
0065 process.load("RecoVertex.BeamSpotProducer.BeamSpot_cfi")
0066 
0067 # track selection for alignment
0068 process.load("Alignment.CommonAlignmentProducer.AlignmentTrackSelector_cfi")
0069 process.AlignmentTrackSelector.src = 'ALCARECOTkAlZMuMu' #'ALCARECOTkAlMuonIsolated' #MinBias' #'generalTracks' # adjust to input file
0070 process.AlignmentTrackSelector.ptMin = 8.
0071 process.AlignmentTrackSelector.etaMin = -5.
0072 process.AlignmentTrackSelector.etaMax = 5.
0073 process.AlignmentTrackSelector.nHitMin = 9
0074 process.AlignmentTrackSelector.chi2nMax = 50.
0075 # some further possibilities
0076 #process.AlignmentTrackSelector.applyNHighestPt = True
0077 #process.AlignmentTrackSelector.nHighestPt = 2
0078 #process.AlignmentTrackSelector.applyChargeCheck = True
0079 #process.AlignmentTrackSelector.minHitChargeStrip = 50.
0080 # needs RECO files:
0081 #process.AlignmentTrackSelector.applyIsolationCut = True 
0082 #process.AlignmentTrackSelector.minHitIsolation = 0.8
0083 
0084 
0085 # refitting
0086 process.load("RecoTracker.TrackProducer.TrackRefitters_cff")
0087 # In the following use
0088 # TrackRefitter (normal tracks), TrackRefitterP5 (cosmics) or TrackRefitterBHM (beam halo)
0089 process.TrackRefitter.src = 'AlignmentTrackSelector'
0090 process.TrackRefitter.TrajectoryInEvent = True
0091 # beam halo propagation needs larger phi changes going from one TEC to another
0092 #process.MaterialPropagator.MaxDPhi = 1000.
0093 # the following for refitting with analytical propagator (maybe for CRUZET?)
0094 #process.load("TrackingTools.KalmanUpdators.KFUpdatorESProducer_cfi")
0095 #process.load("TrackingTools.KalmanUpdators.Chi2MeasurementEstimatorESProducer_cfi")
0096 #process.load("TrackingTools.TrackFitters.KFTrajectoryFitter_cfi")
0097 #process.load("TrackingTools.TrackFitters.KFTrajectorySmoother_cfi")
0098 #process.load("TrackingTools.TrackFitters.KFFittingSmoother_cfi")
0099 #process.load("TrackingTools.GeomPropagators.AnalyticalPropagator_cfi")
0100 #process.load("TrackingTools.KalmanUpdators.Chi2MeasurementEstimatorESProducer_cfi")
0101 #process.TrackRefitter.Propagator = "AnalyticalPropagator"
0102 #process.KFTrajectoryFitter.Propagator = "AnalyticalPropagator"
0103 #process.KFTrajectorySmoother.Propagator = "AnalyticalPropagator"
0104 ## Not to loose hits/tracks, we might want to open the allowed chi^2 contribution for single hits:
0105 ##process.Chi2MeasurementEstimator.MaxChi2 = 50. # untested, default 30
0106 #process.load("RecoLocalTracker.SiStripRecHitConverter.StripCPEfromTrackAngle_cfi")
0107 #process.load("RecoLocalTracker.SiStripRecHitConverter.SiStripRecHitMatcher_cfi")
0108 #process.load("RecoTracker.TransientTrackingRecHit.TransientTrackingRecHitBuilder_cfi")
0109 ## end refitting with analytical propagator
0110 
0111 
0112 # Alignment producer
0113 process.load("Alignment.CommonAlignmentProducer.AlignmentProducer_cff")
0114 
0115 process.AlignmentProducer.ParameterBuilder.parameterTypes = [
0116     #'BeamSpotSelector,BeamSpot',
0117     'SelectorRigid,RigidBody',
0118     #'SelectorBowed,BowedSurface',     # for full fletched alignment
0119     #'Selector2Bowed,TwoBowedSurfaces' # for full fletched alignment
0120     ]
0121 process.AlignmentProducer.ParameterBuilder.BeamSpotSelector = cms.PSet(
0122     alignParams = cms.vstring(
0123          'ExtrasBeamSpot,ffff'
0124          )
0125     )
0126 
0127 process.AlignmentProducer.ParameterBuilder.SelectorRigid = cms.PSet(
0128     alignParams = cms.vstring(
0129         # very simple scenario for testing
0130         # 6 parameters for larger structures
0131         # 'PixelHalfBarrels,ffffff',
0132         # 'PXEndCaps,111111',
0133         # 'TrackerTOBHalfBarrel,111111',
0134         # 'TrackerTIBHalfBarrel,111111',
0135         # 'TrackerTECEndcap,ffffff',
0136         # 'TrackerTIDEndcap,ffffff'
0137         #
0138         # for hierarchical approach
0139          'PixelHalfBarrels,111111',
0140          'PXEndCaps,111111',
0141          'TrackerTIBHalfBarrel,111111',
0142          'TrackerTIDEndcap,111111', 
0143          'TrackerTOBHalfBarrel,111111',
0144          'TrackerTECEndcap,111111'
0145          # full fletched hierarchical with rigid body only:
0146 #         ,'TrackerTPBModule,111111',
0147 #        'TrackerTPEModule,111001',
0148 #        'TrackerTIBModuleUnit,101111',
0149 #        'TrackerTIDModuleUnit,101111',
0150 #        'TrackerTECModuleUnit,101111,tecSingleSens'
0151 #         ,'TrackerTOBModuleUnit,101111',
0152         )
0153     )
0154 process.AlignmentProducer.ParameterBuilder.SelectorBowed = cms.PSet(
0155     alignParams = cms.vstring(
0156         'TrackerTPBModule,111111 111',
0157         'TrackerTPEModule,111001 000', # could do with rigid body...
0158         'TrackerTIBModuleUnit,101111 111',
0159         'TrackerTIDModuleUnit,101111 111',
0160         'TrackerTECModuleUnit,101111 111,tecSingleSens'
0161         ),
0162     tecSingleSens = cms.PSet(tecDetId = cms.PSet(ringRanges = cms.vint32(1,4)))
0163     )
0164 process.AlignmentProducer.ParameterBuilder.Selector2Bowed = cms.PSet(
0165     alignParams = cms.vstring(
0166         'TrackerTOBModuleUnit,101111 111 101111 111',
0167         'TrackerTECModuleUnit,101111 111 101111 111,tecDoubleSens'
0168         ),
0169     tecDoubleSens = cms.PSet(tecDetId = cms.PSet(ringRanges = cms.vint32(5,7)))
0170     )
0171 
0172 #process.AlignmentProducer.doMuon = True # to align muon system
0173 process.AlignmentProducer.doMisalignmentScenario = False #True
0174 # If the above is true, you might want to choose the scenario:
0175 #from Alignment.TrackerAlignment.Scenarios_cff import *
0176 #process.AlignmentProducer.MisalignmentScenario = TrackerSurveyLASOnlyScenario
0177 process.AlignmentProducer.applyDbAlignment = False # neither globalTag nor trackerAlignment
0178 
0179 # assign by reference (i.e. could change MillePedeAlignmentAlgorithm as well):
0180 process.AlignmentProducer.algoConfig = process.MillePedeAlignmentAlgorithm
0181 
0182 #from Alignment.MillePedeAlignmentAlgorithm.PresigmaScenarios_cff import *
0183 #process.AlignmentProducer.algoConfig.pedeSteerer.Presigmas.extend(TrackerShortTermPresigmas.Presigmas)
0184 process.AlignmentProducer.algoConfig.mode = 'full' # 'pede' # 'mille' # 'pedeSteer'
0185 process.AlignmentProducer.algoConfig.binaryFile = 'milleBinaryISN.dat'
0186 process.AlignmentProducer.algoConfig.treeFile = 'treeFileISN.root'
0187 
0188 #process.AlignmentProducer.algoConfig.TrajectoryFactory = process.TwoBodyDecayTrajectoryFactory # BzeroReferenceTrajectoryFactory
0189 #process.AlignmentProducer.algoConfig.TrajectoryFactory.PropagationDirection = 'oppositeToMomentum'
0190 process.AlignmentProducer.algoConfig.TrajectoryFactory.MaterialEffects = 'BrokenLinesCoarse' #'BreakPoints' #'Combined', ## or "MultipleScattering" or "EnergyLoss" or "None"
0191 process.AlignmentProducer.algoConfig.TrajectoryFactory.UseBeamSpot = False
0192 
0193 # ...OR TwoBodyDecayTrajectoryFactory OR ...
0194 #process.AlignmentProducer.algoConfig.max2Dcorrelation = 2. # to switch off
0195 ##default is sparsGMRES                                    <method>  n(iter)  Delta(F)
0196 #process.AlignmentProducer.algoConfig.pedeSteerer.method = 'inversion  9  0.8'
0197 #process.AlignmentProducer.algoConfig.pedeSteerer.options = cms.vstring(
0198 #   'entries 100',
0199 #   'chisqcut  20.0  4.5' # ,'outlierdownweighting 3' #,'dwfractioncut 0.1'
0200 #)
0201 #process.AlignmentProducer.algoConfig.pedeSteerer.pedeCommand = '/afs/cern.ch/user/f/flucke/cms/pede/MillepedeII/pede_1GB'
0202 
0203 
0204 process.source = cms.Source("PoolSource",
0205     skipEvents = cms.untracked.uint32(0),
0206     fileNames = cms.untracked.vstring(
0207         #'/store/relval/CMSSW_3_0_0_pre2/RelValTTbar/ALCARECO/STARTUP_V7_StreamALCARECOTkAlMinBias_v2/0001/580E7A0F-1DB4-DD11-8AA8-001617DBD224.root'
0208         # <== is a relval from CMSSW_3_0_0_pre2.
0209         #"file:aFile.root" #"rfio:/castor/cern.ch/cms/store/..."
0210         #'/store/mc/Summer09/MinBias/ALCARECO/MC_31X_V3_StreamTkAlMinBias-v2/0005/C2F77DDA-0292-DE11-BD6B-001731A2870D.root'
0211         # <== from /MinBias/Summer09-MC_31X_V3_StreamTkAlMinBias-v2/ALCARECO
0212         '/store/mc/Summer09/Zmumu/ALCARECO/MC_31X_V3_7TeV_StreamTkAlZMuMu-v1/0000/FACBA5D7-B1A2-DE11-AE4A-001E4F3F28D8.root'
0213         # <== /Zmumu/Summer09-MC_31X_V3_7TeV_StreamTkAlZMuMu-v1/ALCARECO
0214         #'file:/tmp/flucke/Summer09_Zmumu_ALCARECO_MC_31X_V3_7TeV_StreamTkAlZMuMu-v1_0000_FACBA5D7-B1A2-DE11-AE4A-001E4F3F28D8.root'
0215 
0216     )
0217                             )
0218 process.maxEvents = cms.untracked.PSet(
0219     input = cms.untracked.int32(100)
0220     )
0221 
0222 process.p = cms.Path(process.offlineBeamSpot*process.AlignmentTrackSelector*process.TrackRefitter)
0223 # overwrite for pede job:
0224 #process.source = cms.Source("EmptySource")
0225 #process.dump = cms.EDAnalyzer("EventContentAnalyzer")
0226 #process.p = cms.Path(process.dump)
0227 
0228 # all fits/refits with 'StripCPEgeometric' - but take about TTRHBuilder used ibn (re)fit
0229 # (works until 'StripCPEgeometric' gets default...)
0230 #process.load("RecoLocalTracker.SiStripRecHitConverter.StripCPEgeometric_cfi")
0231 #process.TTRHBuilderAngleAndTemplate.StripCPE = 'StripCPEgeometric'
0232 
0233 #--- SAVE ALIGNMENT CONSTANTS TO DB --------------------------------
0234 # Default in MPS is saving as alignment_MP.db. Uncomment next line not to save them.
0235 # For a standalone (non-MPS) run, uncomment also the PoolDBOutputService part.
0236 #process.AlignmentProducer.saveToDB = True
0237 #process.AlignmentProducer.saveDeformationsToDB = True
0238 ##process.AlignmentProducer.saveApeToDB = True # no sense: Millepede does not set it!
0239 #from CondCore.DBCommon.CondDBSetup_cfi import *
0240 #process.PoolDBOutputService = cms.Service(
0241 #    "PoolDBOutputService",
0242 #    CondDBSetup,
0243 #    timetype = cms.untracked.string('runnumber'),
0244 #    connect = cms.string('sqlite_file:TkAlignment.db'),
0245 #    toPut = cms.VPSet(cms.PSet(
0246 #      record = cms.string('TrackerAlignmentRcd'),
0247 #      tag = cms.string('testTagAlignment')
0248 #    ),
0249 #    #                  cms.PSet(
0250 #    #  record = cms.string('TrackerAlignmentErrorExtendedRcd'),
0251 #    #  tag = cms.string('testTagAPE') # needed is saveApeToDB = True
0252 #    #),
0253 #                      cms.PSet(
0254 #      record = cms.string('TrackerSurfaceDeformationRcd'),
0255 #      tag = cms.string('testTagDeformation')
0256 #    )                      
0257 #                      )
0258 #    )
0259 # MPS needs next line as placeholder for pede _cfg.py:
0260 #MILLEPEDEBLOCK
0261