Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-08-06 04:43:02

0001 import sys
0002 FLOAT_MAX = 3.402823466E+38
0003 
0004 import FWCore.ParameterSet.VarParsing as VarParsing
0005 
0006 ####################################################################
0007 # Options
0008 ####################################################################
0009 options = VarParsing.VarParsing()
0010 options.register('dbFromEvent',
0011                  False, # default value
0012                  VarParsing.VarParsing.multiplicity.singleton, # singleton or list
0013                  VarParsing.VarParsing.varType.bool, # string, int, or float
0014                  "use the Event for reading the DB?")
0015 options.register('warningThreshold',
0016                  1., # default value
0017                  VarParsing.VarParsing.multiplicity.singleton, # singleton or list
0018                  VarParsing.VarParsing.varType.float, # string, int, or float
0019                  "threshold to emit a warning")
0020 options.register('errorThreshold',
0021                  3., # default value
0022                  VarParsing.VarParsing.multiplicity.singleton, # singleton or list
0023                  VarParsing.VarParsing.varType.float, # string, int, or float
0024                  "threshold to emit a warning")
0025 options.parseArguments()
0026 
0027 import FWCore.ParameterSet.Config as cms
0028 process = cms.Process("testBeamSpotCompatibility")
0029 
0030 ####################################################################
0031 # Load source
0032 ####################################################################
0033 readFiles = cms.untracked.vstring()
0034 readFiles.extend(['/store/data/Run2023D/HLTPhysics/ALCARECO/TkAlMinBias-PromptReco-v1/000/370/580/00000/acdddb09-046c-4375-82f3-678138106ac7.root'])
0035 process.source = cms.Source("PoolSource",
0036                             fileNames = readFiles ,
0037                             duplicateCheckMode = cms.untracked.string('checkAllFilesOpened')
0038                             )
0039 
0040 process.maxEvents = cms.untracked.PSet(
0041     input = cms.untracked.int32(1)
0042 )
0043 
0044 process.options = cms.untracked.PSet(
0045    wantSummary = cms.untracked.bool(False),
0046    Rethrow = cms.untracked.vstring("ProductNotFound"), # make this exception fatal
0047    fileMode  =  cms.untracked.string('NOMERGE') # no ordering needed, but calls endRun/beginRun etc. at file boundaries
0048 )
0049 
0050 ####################################################################
0051 # Load and configure Message Logger
0052 ####################################################################
0053 process.load("FWCore.MessageLogger.MessageLogger_cfi")
0054 process.MessageLogger.cerr.FwkReport.reportEvery = 1000
0055 
0056 process.load("RecoVertex.BeamSpotProducer.BeamSpot_cff")
0057 #from RecoVertex.BeamSpotProducer.BeamSpot_cfi import offlineBeamSpot
0058 #process.myOfflineBeamSpot = offlineBeamSpot.clone()
0059 
0060 ####################################################################
0061 # Load and configure refitting includes
0062 ####################################################################
0063 process.load("Configuration.Geometry.GeometryDB_cff")
0064 process.load('Configuration.StandardSequences.Services_cff')
0065 process.load("Configuration.StandardSequences.MagneticField_cff")
0066 process.load("TrackingTools.TransientTrack.TransientTrackBuilder_cfi")
0067 
0068 ####################################################################
0069 # Load and Configure TrackRefitter
0070 ####################################################################
0071 process.load("RecoTracker.TrackProducer.TrackRefitters_cff")
0072 import RecoTracker.TrackProducer.TrackRefitters_cff
0073 process.FinalTrackRefitter = RecoTracker.TrackProducer.TrackRefitter_cfi.TrackRefitter.clone()
0074 process.FinalTrackRefitter.src = "ALCARECOTkAlMinBias"
0075 process.FinalTrackRefitter.TrajectoryInEvent = True
0076 process.FinalTrackRefitter.NavigationSchool = ''
0077 process.FinalTrackRefitter.TTRHBuilder = "WithAngleAndTemplate"
0078 
0079 ####################################################################
0080 #Global tag
0081 ####################################################################
0082 process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
0083 from Configuration.AlCa.GlobalTag import GlobalTag
0084 process.GlobalTag = GlobalTag(process.GlobalTag, "140X_dataRun3_v4")  ## DO NOT CHANGE (it will change the behaviour of the test)!
0085 
0086 process.BeamSpotChecker = cms.EDAnalyzer("BeamSpotCompatibilityChecker",
0087                                          bsFromEvent = cms.InputTag("offlineBeamSpot::RECO"),  # source of the event beamspot (in the ALCARECO files)
0088                                          #bsFromEvent = cms.InputTag("offlineBeamSpot"),       # source of the event beamspot (in the ALCARECO files)
0089                                          bsFromDB = cms.InputTag("offlineBeamSpot"),         # source of the DB beamspot (from Global Tag) NOTE: only if dbFromEvent is True!
0090                                          dbFromEvent = cms.bool(options.dbFromEvent),          # take the DB beamspot from the event
0091                                          warningThr = cms.double(options.warningThreshold),    # significance threshold to emit a warning message
0092                                          errorThr = cms.double(options.errorThreshold),        # significance threshold to abort the job
0093                                          verbose = cms.untracked.bool(False)                   # verbose mode
0094                                          )
0095 
0096 process.p = cms.Path(
0097     #process.myOfflineBeamSpot*
0098     process.offlineBeamSpot*
0099     process.FinalTrackRefitter*
0100     process.BeamSpotChecker)
0101 
0102 print("Done")