File indexing completed on 2024-06-13 03:23:53
0001
0002 import FWCore.ParameterSet.Config as cms
0003 process = cms.Process("L1TMuonEmulation")
0004 import os
0005 import sys
0006
0007 import re
0008 from os import listdir
0009 from os.path import isfile, join
0010 import fnmatch
0011
0012 process.load("FWCore.MessageLogger.MessageLogger_cfi")
0013
0014 verbose = True
0015
0016 filesNameLike = sys.argv[2]
0017
0018
0019
0020
0021 version = "ExtraplMB1nadMB2DTQualAndEtaFixedP_ValueP1Scale_t20_deltaPhiVsPhiB_500files"
0022
0023 if verbose:
0024 process.MessageLogger = cms.Service("MessageLogger",
0025
0026 destinations = cms.untracked.vstring(
0027
0028
0029
0030
0031 'omtfEventPrint'
0032 ),
0033 categories = cms.untracked.vstring('l1tOmtfEventPrint', 'OMTFReconstruction'),
0034 omtfEventPrint = cms.untracked.PSet(
0035 filename = cms.untracked.string("Patterns_dispalced_test_" + version + "_" + filesNameLike),
0036 extension = cms.untracked.string('.txt'),
0037 threshold = cms.untracked.string('INFO'),
0038 default = cms.untracked.PSet( limit = cms.untracked.int32(0) ),
0039
0040
0041 l1tOmtfEventPrint = cms.untracked.PSet( limit = cms.untracked.int32(1000000000) ),
0042 OMTFReconstruction = cms.untracked.PSet( limit = cms.untracked.int32(1000000000) )
0043 ),
0044 debugModules = cms.untracked.vstring('simOmtfPhase2Digis')
0045
0046 )
0047
0048
0049 if not verbose:
0050 process.MessageLogger.cerr.FwkReport.reportEvery = cms.untracked.int32(-1)
0051 process.options = cms.untracked.PSet(wantSummary = cms.untracked.bool(False),
0052
0053 )
0054
0055
0056 process.load('Configuration.StandardSequences.Services_cff')
0057
0058
0059
0060
0061 process.load('Configuration.Geometry.GeometryExtended2026D95Reco_cff')
0062 process.load('Configuration.StandardSequences.MagneticField_cff')
0063
0064
0065
0066
0067 process.load('Configuration.StandardSequences.EndOfProcess_cff')
0068 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
0069
0070 from Configuration.AlCa.GlobalTag import GlobalTag
0071 process.GlobalTag = GlobalTag(process.GlobalTag, '131X_mcRun4_realistic_v9', '')
0072
0073 chosenFiles = []
0074
0075 cscBx = 8
0076
0077 if filesNameLike == 'displHighPt' :
0078 cscBx = 8
0079
0080 path = '/eos/user/a/asotorod/Samples/OMTF-L1/OMTF_fixedTiming/'
0081
0082 fileCnt = 20
0083 firstFile = 1
0084 for i in range(firstFile, firstFile + fileCnt, 1):
0085 filePathName = path + "custom_Displaced_" + str(i) + "_numEvent5000.root"
0086 if isfile(filePathName) :
0087
0088
0089 chosenFiles.append('file://' + filePathName)
0090
0091
0092 elif filesNameLike == 'mcWaw2023' :
0093 cscBx = 8
0094
0095 for iPt in [0, 1, 2] :
0096 for charge in [0, 2] :
0097 path = "/eos/user/a/akalinow/Data/SingleMu/12_5_2_p1_04_04_2023/SingleMu_ch" + str(charge) + "_iPt" + str(iPt) + "_12_5_2_p1_04_04_2023/12_5_2_p1_04_04_2023/"
0098
0099
0100 root_files = []
0101 for root, dirs, files in os.walk(path):
0102 for file in fnmatch.filter(files, '*.root'):
0103 root_files.append(os.path.join(root, file))
0104
0105 file_cnt = 10
0106
0107 file_num = 0
0108 for root_file in root_files :
0109 if isfile(root_file) :
0110 chosenFiles.append('file://' + root_file)
0111 file_num += 1
0112 else :
0113 print("file not found!!!!!!!: " + root_file)
0114
0115 if file_num >= file_cnt :
0116 break
0117
0118 elif filesNameLike == 'XTo2LLPTo1Mu' :
0119 path = "/eos/user/a/almuhamm/ZMu_Test/ExoticLLP/XTo2LLPTo1Mu_CTau8000_Phase2Exotic/231119_223651/0000/"
0120 root_files = []
0121 for root, dirs, files in os.walk(path):
0122 for file in fnmatch.filter(files, '*.root'):
0123 root_files.append(os.path.join(root, file))
0124
0125 file_cnt = 500
0126
0127 file_num = 0
0128 for root_file in root_files :
0129 if isfile(root_file) :
0130 chosenFiles.append('file://' + root_file)
0131 file_num += 1
0132 else :
0133 print("file not found!!!!!!!: " + root_file)
0134
0135 if file_num >= file_cnt :
0136 break
0137
0138 print("chosenFiles")
0139 for chFile in chosenFiles:
0140 print(chFile)
0141
0142 if len(chosenFiles) == 0 :
0143 print("no files selected!!!!!!!!!!!!!!! (argumetn should be e.g. 20_p")
0144 exit
0145
0146
0147 process.source = cms.Source('PoolSource',
0148 fileNames = cms.untracked.vstring(
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 process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1))
0161
0162
0163
0164 process.load("L1Trigger.DTTriggerPhase2.CalibratedDigis_cfi")
0165 process.CalibratedDigis.dtDigiTag = "simMuonDTDigis"
0166 process.CalibratedDigis.scenario = 0
0167
0168
0169 process.load("L1Trigger.DTTriggerPhase2.dtTriggerPhase2PrimitiveDigis_cfi")
0170 process.dtTriggerPhase2PrimitiveDigis.debug = False
0171 process.dtTriggerPhase2PrimitiveDigis.dump = False
0172 process.dtTriggerPhase2PrimitiveDigis.scenario = 0
0173
0174
0175
0176
0177 process.load('L1Trigger.L1TMuonOverlapPhase2.simOmtfPhase2Digis_cfi')
0178
0179
0180 process.load("TrackPropagation.SteppingHelixPropagator.SteppingHelixPropagatorAlong_cfi")
0181
0182
0183
0184 process.simOmtfPhase2Digis.candidateSimMuonMatcher = cms.bool(True)
0185 process.simOmtfPhase2Digis.simTracksTag = cms.InputTag('g4SimHits')
0186 process.simOmtfPhase2Digis.simVertexesTag = cms.InputTag('g4SimHits')
0187 process.simOmtfPhase2Digis.muonMatcherFile = cms.FileInPath("L1Trigger/L1TMuon/data/omtf_config/muonMatcherHists_100files_smoothStdDev_withOvf.root")
0188
0189
0190 process.simOmtfPhase2Digis.bxMin = cms.int32(0)
0191 process.simOmtfPhase2Digis.bxMax = cms.int32(0)
0192
0193 process.simOmtfPhase2Digis.dumpResultToXML = cms.bool(False)
0194 process.simOmtfPhase2Digis.eventCaptureDebug = cms.bool(False)
0195
0196 process.simOmtfPhase2Digis.patternsXMLFile = cms.FileInPath("L1Trigger/L1TMuonOverlapPhase1/test/expert/omtf/Patterns_template.xml")
0197
0198
0199
0200
0201
0202 process.simOmtfPhase2Digis.patternGenerator = cms.string("2DHists")
0203
0204
0205 process.simOmtfPhase2Digis.patternType = cms.string("GoldenPatternWithStat")
0206 process.simOmtfPhase2Digis.generatePatterns = cms.bool(True)
0207 process.simOmtfPhase2Digis.optimisedPatsXmlFile = cms.string("Patterns_dispalced_test_" + version + "_" + filesNameLike + ".xml")
0208
0209 process.simOmtfPhase2Digis.rpcMaxClusterSize = cms.int32(3)
0210 process.simOmtfPhase2Digis.rpcMaxClusterCnt = cms.int32(2)
0211 process.simOmtfPhase2Digis.rpcDropAllClustersIfMoreThanMax = cms.bool(True)
0212
0213 process.simOmtfPhase2Digis.minCSCStubRME12 = cms.int32(410)
0214 process.simOmtfPhase2Digis.minCSCStubR = cms.int32(500)
0215
0216 process.simOmtfPhase2Digis.minDtPhiQuality = cms.int32(2)
0217 process.simOmtfPhase2Digis.minDtPhiBQuality = cms.int32(4)
0218
0219
0220
0221 process.simOmtfPhase2Digis.dtRefHitMinQuality = cms.int32(4)
0222
0223 process.simOmtfPhase2Digis.usePhiBExtrapolationFromMB1 = cms.bool(True)
0224 process.simOmtfPhase2Digis.usePhiBExtrapolationFromMB2 = cms.bool(True)
0225
0226
0227
0228 process.simOmtfPhase2Digis.useStubQualInExtr = cms.bool(True)
0229 process.simOmtfPhase2Digis.useEndcapStubsRInExtr = cms.bool(True)
0230 process.simOmtfPhase2Digis.useFloatingPointExtrapolation = cms.bool(False)
0231
0232
0233 process.simOmtfPhase2Digis.extrapolFactorsFilename = cms.FileInPath("L1Trigger/L1TMuon/data/omtf_config/ExtrapolationFactors_ExtraplMB1nadMB2DTQual_ValueP1Scale_t20.xml")
0234
0235
0236 process.simOmtfPhase2Digis.stubEtaEncoding = cms.string("valueP1Scale")
0237
0238
0239 process.simOmtfPhase2Digis.goldenPatternResultFinalizeFunction = cms.int32(3)
0240 process.simOmtfPhase2Digis.lctCentralBx = cms.int32(cscBx);
0241
0242
0243
0244
0245
0246
0247 process.L1TMuonSeq = cms.Sequence( process.simOmtfPhase2Digis
0248
0249
0250 )
0251
0252 process.L1TMuonPath = cms.Path(process.L1TMuonSeq)
0253
0254
0255
0256
0257
0258
0259
0260