Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 11:57:19

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 process = cms.Process("Demo")
0004 
0005 ####################################################################
0006 ## Message Logger
0007 ####################################################################
0008 process.load("FWCore.MessageLogger.MessageLogger_cfi")
0009 process.MessageLogger.cerr = cms.untracked.PSet(enable = cms.untracked.bool(False))
0010 process.MessageLogger.cout = cms.untracked.PSet(INFO = cms.untracked.PSet(
0011     reportEvery = cms.untracked.int32(1000) # every 100th only
0012 #    limit = cms.untracked.int32(10)       # or limit to 10 printouts...
0013     ))
0014 
0015 
0016 process.MessageLogger.cout.enableStatistics = cms.untracked.bool(True)
0017 process.options = cms.untracked.PSet(
0018         Rethrow = cms.untracked.vstring("ProductNotFound") # make this exception fatal
0019         #    , fileMode  =  cms.untracked.string('FULLMERGE') # any file order (default): caches all lumi/run products (memory!)
0020         #    , fileMode  =  cms.untracked.string('MERGE') # needs files sorted in run and within run in lumi sections (hard to achieve)
0021             , fileMode  =  cms.untracked.string('NOMERGE') # needs files sorted in run, caches lumi
0022             )
0023 #process.options = cms.untracked.PSet(
0024 #    Rethrow = cms.untracked.vstring("ProductNotFound") # make this exception fatal
0025 #    )
0026 
0027 #########################################################################
0028 ## Conditions
0029 #########################################################################
0030 process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
0031 process.GlobalTag.connect = "frontier://FrontierProd/CMS_COND_31X_GLOBALTAG"
0032 process.GlobalTag.globaltag = "MC_31X_V9::All"
0033 
0034 
0035 ##################################################################
0036 ## Geometry
0037 ##################################################################
0038 process.load("Configuration.Geometry.GeometryDB_cff")
0039 
0040 
0041 ###############################################################
0042 ## Magnetic Field
0043 ###############################################################
0044 
0045 process.load("Configuration.StandardSequences.MagneticField_cff")
0046 # for 0 T:
0047 #process.load("Configuration.StandardSequences.MagneticField_0T_cff")
0048 
0049 #####################################################################
0050 ## BeamSpot from database (i.e. GlobalTag), needed for Refitter
0051 #####################################################################
0052 process.load("RecoVertex.BeamSpotProducer.BeamSpot_cfi")
0053 
0054 #####################################################################
0055 ## Load DBSetup (if needed)
0056 ####################################################################
0057 from CalibTracker.Configuration.Common.PoolDBESSource_cfi import poolDBESSource
0058 ##
0059 ##include private db object
0060 ##
0061 import CalibTracker.Configuration.Common.PoolDBESSource_cfi
0062 process.myTrackerAlignment = CalibTracker.Configuration.Common.PoolDBESSource_cfi.poolDBESSource.clone(
0063     connect = cms.string ('frontier://FrontierProd/CMS_COND_31X_FROM21X'),
0064     toGet = cms.VPSet(cms.PSet(
0065     record = cms.string('TrackerAlignmentRcd'),
0066 #    tag = cms.string('TrackerIdealGeometry210_mc')#IDEAL
0067     tag = cms.string('Tracker_Geometry_v5_offline')#SHMm
0068   ))
0069 )
0070 process.es_prefer_trackerAlignment = cms.ESPrefer("PoolDBESSource","myTrackerAlignment")
0071 
0072 ############################################################################
0073 # APE always zero:
0074 ###########################################################################
0075 process.myTrackerAlignmentErr = poolDBESSource.clone(
0076     connect = cms.string('frontier://FrontierProd/CMS_COND_31X_FROM21X'),
0077     toGet = cms.VPSet(
0078       cms.PSet(
0079        record = cms.string('TrackerAlignmentErrorExtendedRcd'),
0080         tag = cms.string('TrackerIdealGeometryErrors210_mc')
0081        )
0082       )
0083    )
0084 process.es_prefer_trackerAlignmentErr = cms.ESPrefer("PoolDBESSource","myTrackerAlignmentErr")
0085 
0086 #######################################################################
0087 ## Input File(s)
0088 #######################################################################
0089 process.source = cms.Source("PoolSource",
0090     fileNames = cms.untracked.vstring(
0091         '/store/express/BeamCommissioning09/StreamExpress/ALCARECO/v2/000/123/596/E640526B-3AE2-DE11-AAC3-000423D94990.root',
0092         '/store/express/BeamCommissioning09/StreamExpress/ALCARECO/v2/000/123/596/CED18FDD-34E2-DE11-BA11-000423D9A2AE.root',
0093         '/store/express/BeamCommissioning09/StreamExpress/ALCARECO/v2/000/123/596/CC81BA78-4DE2-DE11-8988-000423D6A6F4.root',
0094         '/store/express/BeamCommissioning09/StreamExpress/ALCARECO/v2/000/123/596/CA9B4219-3AE2-DE11-802D-0019B9F72CE5.root',
0095         '/store/express/BeamCommissioning09/StreamExpress/ALCARECO/v2/000/123/596/BAF9885B-3BE2-DE11-8913-001D09F29114.root',
0096         '/store/express/BeamCommissioning09/StreamExpress/ALCARECO/v2/000/123/596/BA4F0900-39E2-DE11-ABC7-000423D9A2AE.root',
0097         '/store/express/BeamCommissioning09/StreamExpress/ALCARECO/v2/000/123/596/B27878C8-49E2-DE11-807A-001D09F2915A.root',
0098         '/store/express/BeamCommissioning09/StreamExpress/ALCARECO/v2/000/123/596/9AF18106-42E2-DE11-83CB-001D09F27067.root',
0099         '/store/express/BeamCommissioning09/StreamExpress/ALCARECO/v2/000/123/596/9453CF7A-42E2-DE11-87D6-0019B9F72BAA.root',
0100         '/store/express/BeamCommissioning09/StreamExpress/ALCARECO/v2/000/123/596/8C3A3DD9-32E2-DE11-80F9-001617E30D12.root',
0101         '/store/express/BeamCommissioning09/StreamExpress/ALCARECO/v2/000/123/596/848CB8C6-3EE2-DE11-8622-001D09F241B9.root',
0102         '/store/express/BeamCommissioning09/StreamExpress/ALCARECO/v2/000/123/596/82A4D042-3FE2-DE11-93FA-001617C3B65A.root',
0103         '/store/express/BeamCommissioning09/StreamExpress/ALCARECO/v2/000/123/596/6A9C296C-4BE2-DE11-902C-000423D99614.root',
0104         '/store/express/BeamCommissioning09/StreamExpress/ALCARECO/v2/000/123/596/5039D8E0-36E2-DE11-BDCA-000423D987FC.root',
0105         '/store/express/BeamCommissioning09/StreamExpress/ALCARECO/v2/000/123/596/44B26111-47E2-DE11-9D27-001D09F28D54.root',
0106         '/store/express/BeamCommissioning09/StreamExpress/ALCARECO/v2/000/123/596/32BB8713-3CE2-DE11-9DD6-001617C3B79A.root',
0107         '/store/express/BeamCommissioning09/StreamExpress/ALCARECO/v2/000/123/596/26B6B47B-44E2-DE11-9C12-001D09F2545B.root',
0108         '/store/express/BeamCommissioning09/StreamExpress/ALCARECO/v2/000/123/596/18454E8A-43E2-DE11-87F6-0030486780B8.root',
0109         '/store/express/BeamCommissioning09/StreamExpress/ALCARECO/v2/000/123/596/0C1678BF-47E2-DE11-854A-0019B9F72D71.root',
0110         '/store/express/BeamCommissioning09/StreamExpress/ALCARECO/v2/000/123/596/02E3D234-37E2-DE11-8E73-001617C3B5F4.root'
0111     )
0112 )
0113 #####################################################################
0114 ## Input source manipulation
0115 ###################################################################
0116 ## set first run
0117 #process.source.firstRun = cms.untracked.uint32(67534)
0118 #process.source.lastRun = cms.untracked.uint32(67647)
0119 ## Maximum number of Events
0120 process.maxEvents = cms.untracked.PSet(
0121    input = cms.untracked.int32(1001)
0122 )
0123 
0124 ## select sped
0125 #process.load("AuxCode.RunNumberFilter.RunNumberFilter_cfi")
0126 #process.RunNumberFilter.doRunSelection = True
0127 #process.RunNumberFilter.selectedRunNumber = 66748
0128 
0129 
0130 ###################################################################
0131 ## Load and Configure TrackRefitter
0132 ##First refit with applying geometry set above
0133 ##Second refit after the track selection
0134 ###################################################################
0135 # refitting
0136 process.load("RecoTracker.TrackProducer.TrackRefitters_cff")
0137 
0138 process.TrackRefitter1 = process.TrackRefitter.clone(
0139     src = 'ALCARECOTkAlMinBias',
0140     TrajectoryInEvent = True,
0141     TTRHBuilder = "WithAngleAndTemplate", #"WithTrackAngle"
0142     NavigationSchool = ''
0143 )
0144 
0145 process.TrackRefitterForOfflineValidation = process.TrackRefitter1.clone(
0146     src = 'AlignmentTrackSelector',
0147 )
0148 
0149 #######################################################################
0150 ##TRACKER TRACK HIT FILTER
0151 ##First remove 'bad' hits from track
0152 ##Second run track producer on filtered hits
0153 ######################################################################
0154 # TrackerTrackHitFilter takes as input the tracks/trajectories coming out from TrackRefitter1
0155 process.load("RecoTracker.FinalTrackSelectors.TrackerTrackHitFilter_cff")
0156 process.TrackerTrackHitFilter.src = 'TrackRefitter1'
0157 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
0158 process.TrackerTrackHitFilter.minimumHits = 8
0159 process.TrackerTrackHitFilter.commands = cms.vstring("keep PXB","keep PXE","keep TIB","keep TID","keep TOB","keep TEC")
0160 process.TrackerTrackHitFilter.detsToIgnore = [
0161       # see https://hypernews.cern.ch/HyperNews/CMS/get/tracker-performance/484.html
0162     # TIB / TID
0163     #369136710, 369136714, 402668822,
0164     # TOB
0165     #436310989, 436310990, 436299301, 436299302,
0166     # TEC
0167     #470340521, 470063045, 470063046, 470114669, 470114670, 470161093, 470161094, 470164333, 470164334, 470312005, 470312006, 470312009, 470067405, 470067406, 470128813
0168 ]
0169 process.TrackerTrackHitFilter.replaceWithInactiveHits = True
0170 process.TrackerTrackHitFilter.stripAllInvalidHits = False
0171 process.TrackerTrackHitFilter.rejectBadStoNHits = True
0172 process.TrackerTrackHitFilter.StoNcommands = cms.vstring("ALL 14.0")
0173 process.TrackerTrackHitFilter.rejectLowAngleHits= True
0174 process.TrackerTrackHitFilter.TrackAngleCut= 0.35 # in rads, starting from the module surface
0175 process.TrackerTrackHitFilter.usePixelQualityFlag= True
0176 
0177 ################################################################################################
0178 #TRACK PRODUCER
0179 #now we give the TrackCandidate coming out of the TrackerTrackHitFilter to the track producer
0180 ################################################################################################
0181 import RecoTracker.TrackProducer.CTFFinalFitWithMaterial_cff   #TrackRefitters_cff
0182 process.HitFilteredTracks = RecoTracker.TrackProducer.CTFFinalFitWithMaterial_cff.ctfWithMaterialTracks.clone(
0183     src = 'TrackerTrackHitFilter',
0184     #TrajectoryInEvent = True
0185     TTRHBuilder = "WithAngleAndTemplate"
0186 )
0187 
0188 ###############################################################
0189 ## Load and Configure track selection for alignment
0190 ###############################################################
0191 process.load("Alignment.CommonAlignmentProducer.AlignmentTrackSelector_cfi")
0192 process.AlignmentTrackSelector.src ='HitFilteredTracks' #'TrackRefitter1'
0193 process.AlignmentTrackSelector.applyBasicCuts = True
0194 process.AlignmentTrackSelector.ptMin   = 1.5
0195 process.AlignmentTrackSelector.pMin   = 0.
0196 process.AlignmentTrackSelector.nHitMin =10
0197 process.AlignmentTrackSelector.nHitMin2D = 2
0198 process.AlignmentTrackSelector.chi2nMax = 100.
0199 #process.AlignmentTrackSelector.minHitsPerSubDet.inBPIX = 2
0200 
0201 #process.AlignmentTrackSelector.nHitsMinLowerPart = 0
0202 
0203 
0204 ###################################################################
0205 ## Load and Configure OfflineValidation and Output File
0206 ##################################################################
0207 #Offline Validation Parameters
0208 process.load("Alignment.OfflineValidation.TrackerOfflineValidation_Standalone_cff")
0209 #process.TrackerOfflineValidationStandalone.Tracks = 'TrackRefitter2'
0210 #process.TrackerOfflineValidationStandalone.trajectoryInput = 'TrackRefitter2'
0211 process.TrackerOfflineValidationStandalone.moduleLevelHistsTransient = True #False
0212 # Output File
0213 process.TFileService.fileName = '$TMPDIR/Validation_output.root'
0214 
0215 
0216 
0217 process.dump=cms.EDAnalyzer("EventContentAnalyzer")
0218 
0219 
0220 ##############################################################################
0221 ## PATH
0222 ##############################################################################
0223 process.p = cms.Path(process.offlineBeamSpot
0224                      *process.TrackRefitter1
0225                      *process.TrackerTrackHitFilter
0226                      *process.HitFilteredTracks 
0227                      *process.AlignmentTrackSelector
0228                      *process.TrackRefitterForOfflineValidation
0229                      *process.seqTrackerOfflineValidationStandalone
0230                      )