Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #-- Common selection based on CRUZET 2015 Setup mp1553
0002 
0003 import FWCore.ParameterSet.Config as cms
0004 #from Configuration.AlCa.autoCond import *
0005 
0006 process = cms.Process("Alignment")
0007 
0008 
0009 
0010 process.options = cms.untracked.PSet(
0011     Rethrow = cms.untracked.vstring("ProductNotFound"), # do not accept this exception
0012     wantSummary = cms.untracked.bool(True)
0013     )
0014 
0015 # initialize  MessageLogger
0016 process.load("FWCore.MessageService.MessageLogger_cfi")
0017 
0018 process.MessageLogger.files.alignment = cms.untracked.PSet(
0019     DEBUG = cms.untracked.PSet(
0020         limit = cms.untracked.int32(-1)
0021         ),
0022     INFO = cms.untracked.PSet(
0023         limit = cms.untracked.int32(-1)
0024         ),
0025     WARNING = cms.untracked.PSet(
0026         limit = cms.untracked.int32(10)
0027         ),
0028     ERROR = cms.untracked.PSet(
0029         limit = cms.untracked.int32(-1)
0030         ),
0031     Alignment = cms.untracked.PSet(
0032         limit = cms.untracked.int32(-1),
0033         ),
0034     enableStatistics = cms.untracked.bool(True)
0035     )
0036 
0037    
0038 process.MessageLogger.cerr.enable = cms.untracked.bool(False)
0039 process.options   = cms.untracked.PSet( wantSummary = cms.untracked.bool(True) )
0040 
0041 
0042 #-- Magnetic field
0043 process.load('Configuration.StandardSequences.MagneticField_cff')
0044 #process.load("Configuration/StandardSequences/MagneticField_38T_cff") ## FOR 3.8T
0045 #process.load("Configuration.StandardSequences.MagneticField_0T_cff")  ## FOR 0T
0046 
0047 #-- Load geometry
0048 process.load("Configuration.Geometry.GeometryRecoDB_cff")
0049 
0050 #-- Global Tag
0051 process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
0052 process.GlobalTag.connect = "frontier://FrontierProd/CMS_CONDITIONS"
0053 process.GlobalTag.globaltag = "GR_P_V56"
0054 
0055 #-- initialize beam spot
0056 process.load("RecoVertex.BeamSpotProducer.BeamSpot_cfi")
0057 
0058 #-- Set APEs to ZERO
0059 import CalibTracker.Configuration.Common.PoolDBESSource_cfi
0060 process.conditionsInTrackerAlignmentErrorRcd = CalibTracker.Configuration.Common.PoolDBESSource_cfi.poolDBESSource.clone(
0061     connect = cms.string('frontier://FrontierProd/CMS_CONDITIONS'),
0062     toGet = cms.VPSet(
0063         cms.PSet(
0064             record = cms.string('TrackerAlignmentErrorExtendedRcd'),
0065             tag = cms.string('TrackerIdealGeometryErrorsExtended210_mc')
0066             )
0067         )
0068     )
0069 process.prefer_conditionsInTrackerAlignmentErrorRcd = cms.ESPrefer("PoolDBESSource", "conditionsInTrackerAlignmentErrorRcd")
0070 
0071 #-- Load Local Alignment Object
0072 #process.GlobalTag.toGet = cms.VPSet(
0073 #    cms.PSet(record = cms.string("TrackerAlignmentRcd"),
0074 #             tag = cms.string("testTag"),
0075 #             connect = cms.untracked.string("sqlite_file:/afs/cern.ch/work/c/chmartin/private/Alignment/pp3.8T_2015_Alignment/Local_DB/TkAlignment.db")
0076 #             )
0077 #    )
0078         
0079 #-- AlignmentTrackSelector
0080 import Alignment.CommonAlignmentProducer.AlignmentTrackSelector_cfi
0081 process.HighPuritySelector = Alignment.CommonAlignmentProducer.AlignmentTrackSelector_cfi.AlignmentTrackSelector.clone(
0082     applyBasicCuts = True,
0083     #filter = True,
0084     src = 'ALCARECOTkAlMinBias',
0085     trackQualities = ["highPurity"],
0086     pMin = 4.,
0087     )
0088 
0089 process.load("Alignment.CommonAlignmentProducer.AlignmentTrackSelector_cfi")
0090 process.AlignmentTrackSelector.src = 'HitFilteredTracks' # adjust to input file
0091 process.AlignmentTrackSelector.applyBasicCuts = True
0092 process.AlignmentTrackSelector.pMin = 8.
0093 process.AlignmentTrackSelector.ptMin = 1.0
0094 process.AlignmentTrackSelector.etaMin = -999.
0095 process.AlignmentTrackSelector.etaMax = 999.
0096 process.AlignmentTrackSelector.nHitMin = 8
0097 process.AlignmentTrackSelector.nHitMin2D = 2
0098 process.AlignmentTrackSelector.chi2nMax = 9999.
0099 process.AlignmentTrackSelector.applyMultiplicityFilter = False 
0100 process.AlignmentTrackSelector.maxMultiplicity = 1
0101 process.AlignmentTrackSelector.applyNHighestPt = False
0102 process.AlignmentTrackSelector.nHighestPt = 1
0103 process.AlignmentTrackSelector.seedOnlyFrom = 0
0104 process.AlignmentTrackSelector.applyIsolationCut = False
0105 process.AlignmentTrackSelector.minHitIsolation = 0.8
0106 process.AlignmentTrackSelector.applyChargeCheck = False
0107 process.AlignmentTrackSelector.minHitChargeStrip = 30.
0108 #Special option for PCL
0109 process.AlignmentTrackSelector.minHitsPerSubDet.inPIXEL = 2
0110 
0111 
0112 #-- new track hit filter
0113 # TrackerTrackHitFilter takes as input the tracks/trajectories coming out from TrackRefitter1
0114 process.load("RecoTracker.FinalTrackSelectors.TrackerTrackHitFilter_cff")
0115 process.TrackerTrackHitFilter.src = 'TrackRefitter1'
0116 process.TrackerTrackHitFilter.useTrajectories= True  # this is needed only if you require some selections; but it will work even if you don't ask for them
0117 process.TrackerTrackHitFilter.minimumHits = 8
0118 process.TrackerTrackHitFilter.replaceWithInactiveHits = True
0119 process.TrackerTrackHitFilter.rejectBadStoNHits = True
0120 process.TrackerTrackHitFilter.commands = cms.vstring("keep PXB","keep PXE","keep TIB","keep TID","keep TOB","keep TEC")#,"drop TID stereo","drop TEC stereo")
0121 process.TrackerTrackHitFilter.stripAllInvalidHits = False
0122 process.TrackerTrackHitFilter.StoNcommands = cms.vstring("ALL 18.0")
0123 process.TrackerTrackHitFilter.rejectLowAngleHits = True
0124 process.TrackerTrackHitFilter.TrackAngleCut = 0.17# in rads, starting from the module surface; .35 for cosmcics ok, .17 for collision tracks
0125 process.TrackerTrackHitFilter.usePixelQualityFlag = True #False
0126 
0127 #-- TrackFitter
0128 import RecoTracker.TrackProducer.CTFFinalFitWithMaterial_cff
0129 process.HitFilteredTracks = RecoTracker.TrackProducer.CTFFinalFitWithMaterial_cff.ctfWithMaterialTracks.clone(
0130         src = 'TrackerTrackHitFilter',
0131         TrajectoryInEvent = True,
0132         TTRHBuilder = 'WithAngleAndTemplate', #should already be default
0133         NavigationSchool = cms.string('')
0134 )
0135     
0136 #-- Alignment producer
0137 process.load("Alignment.CommonAlignmentProducer.AlignmentProducerAsAnalyzer_cff")
0138 process.AlignmentProducer.ParameterBuilder.Selector = cms.PSet(
0139     alignParams = cms.vstring(
0140         "PixelHalfBarrels,111111",
0141         "PXECHalfCylinders,111111",
0142         )
0143     )
0144 
0145 process.AlignmentProducer.doMisalignmentScenario = False #True
0146 
0147 
0148 process.AlignmentProducer.checkDbAlignmentValidity = False
0149 process.AlignmentProducer.applyDbAlignment = True
0150 process.AlignmentProducer.tjTkAssociationMapTag = 'TrackRefitter2'
0151 
0152 process.AlignmentProducer.algoConfig = process.MillePedeAlignmentAlgorithm
0153 process.AlignmentProducer.algoConfig.mode = 'full'
0154 process.AlignmentProducer.algoConfig.mergeBinaryFiles = cms.vstring()
0155 process.AlignmentProducer.algoConfig.binaryFile = 'milleBinary_40.dat'
0156 process.AlignmentProducer.algoConfig.TrajectoryFactory = cms.PSet(
0157       #process.BrokenLinesBzeroTrajectoryFactory
0158       process.BrokenLinesTrajectoryFactory 
0159       )
0160 process.AlignmentProducer.algoConfig.pedeSteerer.pedeCommand = 'pede'
0161 process.AlignmentProducer.algoConfig.pedeSteerer.method = 'inversion  5  0.8'
0162 process.AlignmentProducer.algoConfig.pedeSteerer.options = cms.vstring(
0163     #'regularisation 1.0 0.05', # non-stated pre-sigma 50 mrad or 500 mum 
0164      'entries 500',
0165      'chisqcut  30.0  4.5', #,
0166      'threads 1 1' #, 
0167      #'outlierdownweighting 3','dwfractioncut 0.1'
0168      #'outlierdownweighting 5','dwfractioncut 0.2'
0169     )
0170 
0171 #-- TrackRefitter
0172 process.load("RecoTracker.TrackProducer.TrackRefitters_cff")
0173 process.TrackRefitter1 = RecoTracker.TrackProducer.TrackRefitter_cfi.TrackRefitter.clone(
0174     src ='HighPuritySelector',#'ALCARECOTkAlMinBias',
0175     NavigationSchool = cms.string(''),
0176     TrajectoryInEvent = True,
0177     TTRHBuilder = "WithAngleAndTemplate" #default
0178     )
0179 
0180 process.TrackRefitter2 = process.TrackRefitter1.clone(
0181     src = 'AlignmentTrackSelector',
0182 #    TTRHBuilder = 'WithTrackAngle'
0183     )
0184     
0185 process.source = cms.Source("PoolSource",
0186         skipEvents = cms.untracked.uint32(0),
0187         fileNames = cms.untracked.vstring(
0188             '/store/express/Run2015B/StreamExpress/ALCARECO/TkAlMinBias-Express-v1/000/251/718/00000/426E4511-292A-E511-9FB8-02163E0133E0.root'
0189     ),
0190 #    lumisToSkip = cms.untracked.VLuminosityBlockRange('251718:1-251718:20'),
0191 )
0192 
0193 
0194 #process.maxEvents = cms.untracked.PSet(
0195 #    input = cms.untracked.int32(20000)
0196 #) 
0197 
0198 #process.dump = cms.EDAnalyzer("EventContentAnalyzer")                                                         
0199 #process.p  = cms.Path(process.dump) 
0200 
0201 
0202 process.p = cms.Path(process.HighPuritySelector
0203              *process.offlineBeamSpot
0204                      *process.TrackRefitter1
0205                      *process.TrackerTrackHitFilter
0206                      *process.HitFilteredTracks
0207                      *process.AlignmentTrackSelector
0208                      *process.TrackRefitter2
0209                      *process.AlignmentProducer
0210                      )
0211 process.AlignmentProducer.saveToDB = True
0212 from CondCore.DBCommon.CondDBSetup_cfi import *
0213 process.PoolDBOutputService = cms.Service(
0214         "PoolDBOutputService",
0215             CondDBSetup,
0216             connect = cms.string('sqlite_file:TkAlignment.db'),
0217             toPut = cms.VPSet(cms.PSet(
0218                 record = cms.string('TrackerAlignmentRcd'),
0219                 tag = cms.string('testTag')
0220             )#,
0221                               #     #                  cms.PSet(
0222                               #     #  record = cms.string('TrackerAlignmentErrorRcd'),
0223                               #     #  tag = cms.string('testTagAPE') # needed is saveApeToDB = True
0224                               #     #)
0225                                                      )
0226             )                     
0227                      
0228 # MPS needs next line as placeholder for pede _cfg.py:
0229 #MILLEPEDEBLOCK