File indexing completed on 2024-04-06 12:21:11
0001
0002 import FWCore.ParameterSet.Config as cms
0003 process = cms.Process("L1TMuonEmulation")
0004 import os
0005 import sys
0006 import re
0007 from os import listdir
0008 from os.path import isfile, join
0009
0010
0011 process.load("FWCore.MessageLogger.MessageLogger_cfi")
0012
0013 verbose = True
0014
0015
0016 version = 'ExtraplMB1nadMB2FloatQualand_Eta_t17_v12_test_valueP1Scale'
0017
0018
0019
0020 runDebug = "INFO"
0021 useExtraploationAlgo = True
0022
0023
0024 if verbose:
0025 process.MessageLogger = cms.Service("MessageLogger",
0026
0027 destinations = cms.untracked.vstring(
0028
0029
0030
0031
0032 'omtfEventPrint'
0033 ),
0034 categories = cms.untracked.vstring( 'OMTFReconstruction', 'l1tOmtfEventPrint', 'l1MuonAnalyzerOmtf'),
0035 omtfEventPrint = cms.untracked.PSet(
0036 filename = cms.untracked.string('log_MuonOverlap_newPats_t' + version),
0037 extension = cms.untracked.string('.txt'),
0038 threshold = cms.untracked.string(runDebug),
0039 default = cms.untracked.PSet( limit = cms.untracked.int32(0) ),
0040
0041
0042 l1tOmtfEventPrint = cms.untracked.PSet( limit = cms.untracked.int32(1000000000) ),
0043 OMTFReconstruction = cms.untracked.PSet( limit = cms.untracked.int32(1000000000) ),
0044 l1MuonAnalyzerOmtf = cms.untracked.PSet( limit = cms.untracked.int32(1000000000) ),
0045 ),
0046 debugModules = cms.untracked.vstring('L1MuonAnalyzerOmtf', 'simOmtfDigis')
0047
0048 )
0049
0050
0051 if not verbose:
0052 process.MessageLogger.cerr.FwkReport.reportEvery = cms.untracked.int32(1000)
0053 process.options = cms.untracked.PSet(wantSummary = cms.untracked.bool(False),
0054
0055 )
0056
0057
0058
0059 process.load('Configuration.Geometry.GeometryExtended2015Reco_cff')
0060 process.load('Configuration.Geometry.GeometryExtended2015_cff')
0061
0062
0063
0064
0065
0066
0067
0068 process.load('Configuration.StandardSequences.Services_cff')
0069 process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi')
0070 process.load('Configuration.EventContent.EventContent_cff')
0071 process.load('SimGeneral.MixingModule.mixNoPU_cfi')
0072
0073
0074 process.load('Configuration.StandardSequences.MagneticField_cff')
0075
0076 process.load('Configuration.StandardSequences.EndOfProcess_cff')
0077 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
0078
0079 from Configuration.AlCa.GlobalTag import GlobalTag
0080
0081 process.GlobalTag = GlobalTag(process.GlobalTag, '103X_upgrade2023_realistic_v2', '')
0082
0083
0084
0085
0086
0087
0088
0089
0090
0091
0092
0093
0094
0095
0096
0097
0098
0099
0100
0101
0102
0103 chosenFiles = []
0104
0105 fileCnt = 1000
0106 if(runDebug == "DEBUG") :
0107 fileCnt = 1;
0108
0109 if True :
0110
0111 path = '/eos/user/a/asotorod/Samples/OMTF-L1/OMTF_fixedTiming/'
0112 firstFile = 1
0113 for i in range(firstFile, firstFile + fileCnt, 1):
0114 filePathName = path + "custom_Displaced_" + str(i) + "_numEvent5000.root"
0115 if isfile(filePathName) :
0116 chosenFiles.append('file://' + filePathName)
0117 else :
0118 print("file not found!!!!!!!: " + filePathName)
0119
0120 if False :
0121 path = '/eos/user/c/cericeci/forOMTF/OMTF_Run3_FixedTiming_FullOutput/'
0122 firstFile = 1001
0123 for i in range(firstFile, firstFile + fileCnt, 1):
0124
0125
0126 filePathName = path + "custom_Displaced_Run3_" + str(i) + "_numEvent2000.root"
0127 if isfile(filePathName) :
0128 chosenFiles.append('file://' + filePathName)
0129 else :
0130 print("file not found!!!!!!!: " + filePathName)
0131
0132
0133 print("chosenFiles")
0134 for chFile in chosenFiles:
0135 print(chFile)
0136
0137 if len(chosenFiles) == 0 :
0138 print("no files selected!!!!!!!!!!!!!!!")
0139 exit
0140
0141 firstEv = 0
0142
0143
0144
0145 process.source = cms.Source('PoolSource',
0146 fileNames = cms.untracked.vstring(
0147
0148
0149 list(chosenFiles), ),
0150 skipEvents = cms.untracked.uint32(0),
0151 inputCommands=cms.untracked.vstring(
0152 'keep *',
0153 'drop l1tEMTFHit2016Extras_simEmtfDigis_CSC_HLT',
0154 'drop l1tEMTFHit2016Extras_simEmtfDigis_RPC_HLT',
0155 'drop l1tEMTFHit2016s_simEmtfDigis__HLT',
0156 'drop l1tEMTFTrack2016Extras_simEmtfDigis__HLT',
0157 'drop l1tEMTFTrack2016s_simEmtfDigis__HLT')
0158 )
0159
0160 if(runDebug == "DEBUG") :
0161 process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(5000))
0162 else :
0163 process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1))
0164
0165
0166
0167 process.load('L1Trigger.L1TMuonOverlapPhase1.fakeOmtfParams_cff')
0168 process.omtfParams.configXMLFile = cms.FileInPath("L1Trigger/L1TMuon/data/omtf_config/hwToLogicLayer_0x0008.xml")
0169
0170 process.esProd = cms.EDAnalyzer("EventSetupRecordDataGetter",
0171 toGet = cms.VPSet(
0172 cms.PSet(record = cms.string('L1TMuonOverlapParamsRcd'),
0173 data = cms.vstring('L1TMuonOverlapParams'))
0174 ),
0175 verbose = cms.untracked.bool(False)
0176 )
0177
0178 analysisType = "efficiency"
0179
0180 for a in sys.argv :
0181 if a == "efficiency" or a == "rate" or a == "withTrackPart" :
0182 analysisType = a
0183 break;
0184
0185 print("analysisType=" + analysisType)
0186
0187 process.TFileService = cms.Service("TFileService", fileName = cms.string('omtfAnalysis2_eff_SingleMu_t' + version + '.root'), closeFileFast = cms.untracked.bool(True) )
0188
0189
0190 if useExtraploationAlgo :
0191 process.load('L1Trigger.L1TMuonOverlapPhase1.simOmtfDigis_extrapolSimple_cfi')
0192 else :
0193 process.load('L1Trigger.L1TMuonOverlapPhase1.simOmtfDigis_cfi')
0194
0195 if(runDebug == "DEBUG") :
0196 process.simOmtfDigis.dumpResultToXML = cms.bool(True)
0197 process.simOmtfDigis.XMLDumpFileName = cms.string("TestEvents_" + version + ".xml")
0198 else :
0199 process.simOmtfDigis.dumpResultToXML = cms.bool(False)
0200
0201
0202 if(runDebug == "DEBUG") :
0203 process.simOmtfDigis.eventCaptureDebug = cms.bool(True)
0204 else :
0205 process.simOmtfDigis.eventCaptureDebug = cms.bool(False)
0206
0207
0208 process.simOmtfDigis.sorterType = cms.string("byLLH")
0209 process.simOmtfDigis.ghostBusterType = cms.string("byRefLayer")
0210
0211 if useExtraploationAlgo :
0212
0213
0214
0215 process.simOmtfDigis.patternsXMLFile = cms.FileInPath("L1Trigger/L1TMuonOverlapPhase1/test/expert/omtf/Patterns_ExtraplMB1nadMB2SimplifiedFP_t17_classProb17_recalib2.xml")
0216 else :
0217 process.simOmtfDigis.patternsXMLFile = cms.FileInPath("L1Trigger/L1TMuon/data/omtf_config/Patterns_0x00012_oldSample_3_30Files_grouped1_classProb17_recalib2.xml")
0218
0219
0220 process.simOmtfDigis.rpcMaxClusterSize = cms.int32(3)
0221 process.simOmtfDigis.rpcMaxClusterCnt = cms.int32(2)
0222 process.simOmtfDigis.rpcDropAllClustersIfMoreThanMax = cms.bool(True)
0223
0224 process.simOmtfDigis.minCSCStubRME12 = cms.int32(410)
0225 process.simOmtfDigis.minCSCStubR = cms.int32(490)
0226
0227 process.simOmtfDigis.goldenPatternResultFinalizeFunction = cms.int32(10)
0228
0229 process.simOmtfDigis.noHitValueInPdf = cms.bool(True)
0230
0231 process.simOmtfDigis.minDtPhiQuality = cms.int32(2)
0232 process.simOmtfDigis.minDtPhiBQuality = cms.int32(4)
0233
0234 process.simOmtfDigis.lctCentralBx = cms.int32(8);
0235
0236 if useExtraploationAlgo :
0237 process.simOmtfDigis.dtRefHitMinQuality = cms.int32(4)
0238
0239 process.simOmtfDigis.usePhiBExtrapolationFromMB1 = cms.bool(True)
0240 process.simOmtfDigis.usePhiBExtrapolationFromMB2 = cms.bool(True)
0241
0242 process.simOmtfDigis.useStubQualInExtr = cms.bool(True)
0243 process.simOmtfDigis.useEndcapStubsRInExtr = cms.bool(True)
0244 process.simOmtfDigis.useFloatingPointExtrapolation = cms.bool(True)
0245 process.simOmtfDigis.extrapolFactorsFilename = cms.string("")
0246
0247 process.simOmtfDigis.stubEtaEncoding = cms.string("valueP1Scale")
0248
0249
0250
0251
0252
0253
0254
0255
0256 process.load("TrackPropagation.SteppingHelixPropagator.SteppingHelixPropagatorAlong_cfi")
0257
0258
0259
0260
0261
0262
0263 process.L1TMuonSeq = cms.Sequence( process.esProd
0264 + process.simOmtfDigis
0265
0266
0267 )
0268
0269 process.L1TMuonPath = cms.Path(process.L1TMuonSeq)
0270
0271
0272
0273
0274
0275
0276
0277