File indexing completed on 2024-06-06 04:26:26
0001 import FWCore.ParameterSet.Config as cms
0002
0003 process = cms.Process('Analysis')
0004
0005 import FWCore.ParameterSet.VarParsing as VarParsing
0006
0007 options = VarParsing.VarParsing()
0008 options.register('unitTest',
0009 False,
0010 VarParsing.VarParsing.multiplicity.singleton,
0011 VarParsing.VarParsing.varType.bool,
0012 "is it a unit test?")
0013 options.register('maxEvents',
0014 -1,
0015 VarParsing.VarParsing.multiplicity.singleton,
0016 VarParsing.VarParsing.varType.int,
0017 "num. events to run")
0018 options.parseArguments()
0019
0020
0021
0022
0023 process.load('Configuration.StandardSequences.Services_cff')
0024 process.load('Configuration.StandardSequences.GeometryRecoDB_cff')
0025 process.load('Configuration.StandardSequences.MagneticField_AutoFromDBCurrent_cff')
0026 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
0027
0028
0029
0030
0031 from Configuration.AlCa.GlobalTag import GlobalTag
0032 process.GlobalTag = GlobalTag(process.GlobalTag, '140X_dataRun3_Prompt_v2', '')
0033
0034 process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32((10 if (options.unitTest) else options.maxEvents)))
0035
0036
0037
0038
0039 process.options.numberOfThreads = 8
0040
0041
0042
0043
0044 process.load('FWCore.MessageService.MessageLogger_cfi')
0045 process.MessageLogger.cerr.FwkReport.reportEvery = 1 if (options.unitTest) else 1000
0046
0047
0048
0049
0050 readFiles=[]
0051 if options.unitTest:
0052 readFiles = cms.untracked.vstring(['/store/data/Run2024D/HLTPhysics/ALCARECO/TkAlV0s-PromptReco-v1/000/380/933/00000/8d5dab35-8329-4648-a630-bab3497d725e.root'])
0053 else:
0054 import FWCore.Utilities.FileUtils as FileUtils
0055 filelist = FileUtils.loadListFromFile("fileList.txt")
0056 readFiles = cms.untracked.vstring( *filelist)
0057
0058 process.source = cms.Source("PoolSource",
0059 fileNames = readFiles
0060 )
0061
0062
0063
0064
0065 process.load("TrackingTools.TransientTrack.TransientTrackBuilder_cfi")
0066 process.load('TrackPropagation.SteppingHelixPropagator.SteppingHelixPropagatorOpposite_cfi')
0067 process.load('TrackPropagation.SteppingHelixPropagator.SteppingHelixPropagatorAlong_cfi')
0068 process.load('TrackingTools.TrackAssociator.DetIdAssociatorESProducer_cff')
0069
0070
0071
0072
0073 process.load("RecoVertex.BeamSpotProducer.BeamSpot_cff")
0074
0075
0076
0077
0078 process.load("RecoTracker.TrackProducer.TrackRefitters_cff")
0079 import RecoTracker.TrackProducer.TrackRefitters_cff
0080 process.k0shortRefitter = RecoTracker.TrackProducer.TrackRefitter_cfi.TrackRefitter.clone(
0081 src = "ALCARECOTkAlKShortTracks",
0082 TrajectoryInEvent = True,
0083 NavigationSchool = '',
0084 TTRHBuilder = "WithAngleAndTemplate")
0085
0086 process.lambdaRefitter = RecoTracker.TrackProducer.TrackRefitter_cfi.TrackRefitter.clone(
0087 src = "ALCARECOTkAlLambdaTracks",
0088 TrajectoryInEvent = True,
0089 NavigationSchool = '',
0090 TTRHBuilder = "WithAngleAndTemplate")
0091
0092 process.load("RecoVertex.V0Producer.generalV0Candidates_cfi")
0093 import RecoVertex.V0Producer.generalV0Candidates_cfi
0094 process.refittedKShorts = RecoVertex.V0Producer.generalV0Candidates_cfi.generalV0Candidates.clone(
0095
0096 doKShorts = True,
0097 doLambdas = False,
0098
0099 trackRecoAlgorithm = 'k0shortRefitter'
0100 )
0101
0102 process.refittedLambdas = RecoVertex.V0Producer.generalV0Candidates_cfi.generalV0Candidates.clone(
0103
0104 doKShorts = False,
0105 doLambdas = True,
0106
0107 trackRecoAlgorithm = 'lambdaRefitter'
0108 )
0109
0110
0111
0112
0113 process.TFileService = cms.Service("TFileService",fileName=cms.string("TkAlV0Analysis.root"))
0114
0115
0116
0117
0118 from DQM.TrackingMonitorSource.v0EventSelector_cfi import *
0119 process.KShortEventSelector = v0EventSelector.clone(
0120 vertexCompositeCandidates = "generalV0Candidates:Kshort"
0121 )
0122
0123 process.LambdaEventSelector = v0EventSelector.clone(
0124 vertexCompositeCandidates = "generalV0Candidates:Lambda"
0125 )
0126
0127
0128
0129
0130 process.seqTrackselRefitK0short = cms.Sequence(process.offlineBeamSpot*
0131
0132
0133 process.KShortEventSelector*
0134 process.k0shortRefitter*
0135 process.refittedKShorts)
0136
0137 process.seqTracksRefitLambda = cms.Sequence(process.offlineBeamSpot*
0138 process.LambdaEventSelector*
0139 process.lambdaRefitter*
0140 process.refittedLambdas)
0141
0142
0143
0144
0145 from Alignment.OfflineValidation.tkAlV0sAnalyzer_cfi import *
0146
0147 process.K0Analysis = tkAlV0sAnalyzer.clone(
0148 vertexCompositeCandidates = 'refittedKShorts:Kshort',
0149 tracks = 'k0shortRefitter',
0150 histoPSet = tkAlV0sAnalyzer.histoPSet.clone(
0151 massPSet = tkAlV0sAnalyzer.histoPSet.massPSet.clone(
0152 nbins = 100,
0153 xmin = 0.400,
0154 xmax = 0.600
0155 )
0156 )
0157 )
0158
0159 process.LambdaAnalysis = tkAlV0sAnalyzer.clone(
0160 vertexCompositeCandidates = 'refittedLambdas:Lambda',
0161 tracks = 'lambdaRefitter',
0162 histoPSet = tkAlV0sAnalyzer.histoPSet.clone(
0163 massPSet = tkAlV0sAnalyzer.histoPSet.massPSet.clone(
0164 nbins = 100,
0165 xmin = 1.07,
0166 xmax = 1.17
0167 )
0168 )
0169 )
0170
0171
0172
0173
0174 process.p1 = cms.Path(process.seqTrackselRefitK0short +
0175 process.K0Analysis)
0176
0177 process.p2 = cms.Path(process.seqTracksRefitLambda +
0178 process.LambdaAnalysis)