File indexing completed on 2024-11-06 06:06:46
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 import fnmatch
0010
0011 process.load("FWCore.MessageLogger.MessageLogger_cfi")
0012
0013 verbose = True
0014
0015 version = "ExtraplMB1nadMB2Simplified_t27_DTQ_4_4"
0016
0017
0018 filesNameLike = sys.argv[1]
0019
0020 runDebug = "INFO"
0021
0022 if verbose:
0023 process.MessageLogger = cms.Service("MessageLogger",
0024
0025 destinations = cms.untracked.vstring(
0026
0027
0028
0029
0030 'omtfEventPrint'
0031 ),
0032 categories = cms.untracked.vstring('l1tOmtfEventPrint', 'OMTFReconstruction'),
0033 omtfEventPrint = cms.untracked.PSet(
0034 filename = cms.untracked.string('Patterns_layerStat_' + version + '_' + filesNameLike),
0035 extension = cms.untracked.string('.txt'),
0036 threshold = cms.untracked.string('INFO'),
0037 default = cms.untracked.PSet( limit = cms.untracked.int32(0) ),
0038
0039
0040 l1tOmtfEventPrint = cms.untracked.PSet( limit = cms.untracked.int32(1000000000) ),
0041 OMTFReconstruction = cms.untracked.PSet( limit = cms.untracked.int32(1000000000) )
0042 ),
0043 debugModules = cms.untracked.vstring('simOmtfDigis')
0044
0045 )
0046
0047
0048 if not verbose:
0049 process.MessageLogger.cerr.FwkReport.reportEvery = cms.untracked.int32(-1)
0050 process.options = cms.untracked.PSet(wantSummary = cms.untracked.bool(False),
0051
0052 )
0053
0054 process.load('Configuration.Geometry.GeometryExtended2023Reco_cff')
0055 process.load('Configuration.Geometry.GeometryExtended2023_cff')
0056
0057
0058 process.load('Configuration.StandardSequences.Services_cff')
0059 process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi')
0060 process.load('Configuration.EventContent.EventContent_cff')
0061 process.load('SimGeneral.MixingModule.mixNoPU_cfi')
0062
0063
0064 process.load('Configuration.StandardSequences.MagneticField_cff')
0065
0066 process.load('Configuration.StandardSequences.EndOfProcess_cff')
0067 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
0068
0069 from Configuration.AlCa.GlobalTag import GlobalTag
0070
0071
0072 process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:run3_mc_FULL', '')
0073
0074 chosenFiles = []
0075
0076 cscBx = 8
0077 fileCnt = 100000
0078 if filesNameLike == 'mcWaw2023_OneOverPt_and_iPt2':
0079 cscBx = 8
0080 matchUsingPropagation = False
0081 paths = [
0082 {"path": "/eos/user/a/akalinow/Data/SingleMu/12_5_2_p1_20_04_2023/SingleMu_ch0_OneOverPt_12_5_2_p1_20_04_2023/", "fileCnt" : 500},
0083 {"path": "/eos/user/a/akalinow/Data/SingleMu/12_5_2_p1_20_04_2023/SingleMu_ch2_OneOverPt_12_5_2_p1_20_04_2023/", "fileCnt" : 500},
0084
0085 {"path": "/eos/user/a/akalinow/Data/SingleMu/12_5_2_p1_14_04_2023/SingleMu_ch0_OneOverPt_12_5_2_p1_14_04_2023/", "fileCnt" : 500},
0086 {"path": "/eos/user/a/akalinow/Data/SingleMu/12_5_2_p1_14_04_2023/SingleMu_ch2_OneOverPt_12_5_2_p1_14_04_2023/", "fileCnt" : 500},
0087
0088 {"path": "/eos/user/a/akalinow/Data/SingleMu/12_5_2_p1_04_04_2023/SingleMu_ch0_OneOverPt_12_5_2_p1_04_04_2023/", "fileCnt" : 500},
0089 {"path": "/eos/user/a/akalinow/Data/SingleMu/12_5_2_p1_04_04_2023/SingleMu_ch2_OneOverPt_12_5_2_p1_04_04_2023/", "fileCnt" : 500},
0090
0091 {"path": "/eos/user/a/akalinow/Data/SingleMu/12_5_2_p1_22_02_2023/SingleMu_ch0_OneOverPt_12_5_2_p1_22_02_2023/", "fileCnt" : 500},
0092 {"path": "/eos/user/a/akalinow/Data/SingleMu/12_5_2_p1_22_02_2023/SingleMu_ch2_OneOverPt_12_5_2_p1_22_02_2023/", "fileCnt" : 500},
0093
0094
0095
0096 {"path": "/eos/user/a/akalinow/Data/SingleMu/12_5_2_p1_04_04_2023/SingleMu_ch0_iPt2_12_5_2_p1_04_04_2023/", "fileCnt" : 200},
0097 {"path": "/eos/user/a/akalinow/Data/SingleMu/12_5_2_p1_04_04_2023/SingleMu_ch2_iPt2_12_5_2_p1_04_04_2023/", "fileCnt" : 200},
0098 ]
0099
0100 if filesNameLike == 'mcWaw2023_iPt1':
0101 cscBx = 8
0102 matchUsingPropagation = False
0103 paths = [
0104 {"path": "/eos/user/a/akalinow/Data/SingleMu/12_5_2_p1_20_04_2023/SingleMu_ch0_OneOverPt_12_5_2_p1_20_04_2023/", "fileCnt" : 10},
0105 {"path": "/eos/user/a/akalinow/Data/SingleMu/12_5_2_p1_20_04_2023/SingleMu_ch2_OneOverPt_12_5_2_p1_20_04_2023/", "fileCnt" : 10},
0106
0107
0108
0109
0110
0111
0112
0113
0114
0115
0116
0117
0118
0119
0120 ]
0121
0122
0123 print("input data paths", paths)
0124
0125 if(runDebug == "DEBUG") :
0126 fileCnt = 1;
0127
0128 for path in paths :
0129 root_files = []
0130 for root, dirs, files in os.walk(path["path"]):
0131 for file in fnmatch.filter(files, '*.root'):
0132 root_files.append(os.path.join(root, file))
0133
0134 file_num = 0
0135 for root_file in root_files :
0136 if isfile(root_file) :
0137 chosenFiles.append('file://' + root_file)
0138 file_num += 1
0139 else :
0140 print("file not found!!!!!!!: " + root_file)
0141
0142 if file_num >= path["fileCnt"] :
0143 break
0144 if file_num >= fileCnt :
0145 break
0146
0147 print("chosenFiles")
0148 for chFile in chosenFiles:
0149 print(chFile)
0150
0151
0152 print("chosen file count", len(chosenFiles) )
0153
0154 if len(chosenFiles) == 0 :
0155 print("no files selected!!!!!!!!!!!!!!!")
0156 exit
0157
0158 print("running version", version)
0159
0160
0161 process.source = cms.Source('PoolSource',
0162 fileNames = cms.untracked.vstring(
0163 *(list(chosenFiles)) ),
0164 skipEvents = cms.untracked.uint32(0),
0165 inputCommands=cms.untracked.vstring(
0166 'keep *',
0167 'drop l1tEMTFHit2016Extras_simEmtfDigis_CSC_HLT',
0168 'drop l1tEMTFHit2016Extras_simEmtfDigis_RPC_HLT',
0169 'drop l1tEMTFHit2016s_simEmtfDigis__HLT',
0170 'drop l1tEMTFTrack2016Extras_simEmtfDigis__HLT',
0171 'drop l1tEMTFTrack2016s_simEmtfDigis__HLT')
0172 )
0173
0174
0175 process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1))
0176
0177
0178
0179 process.load('L1Trigger.L1TMuonOverlapPhase1.fakeOmtfParams_cff')
0180 process.omtfParams.configXMLFile = cms.FileInPath("L1Trigger/L1TMuon/data/omtf_config/hwToLogicLayer_0x0009_patGen.xml")
0181 process.omtfParams.patternsXMLFiles = cms.VPSet(
0182 cms.PSet(patternsXMLFile = cms.FileInPath("L1Trigger/L1TMuon/data/omtf_config/Patterns_template.xml")), )
0183
0184 process.esProd = cms.EDAnalyzer("EventSetupRecordDataGetter",
0185 toGet = cms.VPSet(
0186 cms.PSet(record = cms.string('L1TMuonOverlapParamsRcd'),
0187 data = cms.vstring('L1TMuonOverlapParams'))
0188 ),
0189 verbose = cms.untracked.bool(False)
0190 )
0191
0192
0193
0194
0195 process.load('L1Trigger.L1TMuonOverlapPhase1.simOmtfDigis_extrapolSimple_cfi')
0196
0197
0198 process.load("TrackPropagation.SteppingHelixPropagator.SteppingHelixPropagatorAlong_cfi")
0199
0200
0201
0202
0203 process.simOmtfDigis.simTracksTag = cms.InputTag('g4SimHits')
0204
0205
0206
0207
0208 process.simOmtfDigis.bxMin = cms.int32(0)
0209 process.simOmtfDigis.bxMax = cms.int32(0)
0210
0211 process.simOmtfDigis.dumpResultToXML = cms.bool(False)
0212 process.simOmtfDigis.eventCaptureDebug = cms.bool(False)
0213
0214 process.simOmtfDigis.patternsXMLFile = cms.FileInPath("L1Trigger/L1TMuon/data/omtf_config/Patterns_template.xml")
0215
0216
0217
0218
0219 process.simOmtfDigis.patternGenerator = cms.string("patternGen")
0220
0221 process.simOmtfDigis.patternType = cms.string("GoldenPatternWithStat")
0222 process.simOmtfDigis.generatePatterns = cms.bool(True)
0223 process.simOmtfDigis.cleanStubs = cms.bool(True)
0224
0225 process.simOmtfDigis.optimisedPatsXmlFile = cms.string("Patterns_layerStat_" + version + "_" + filesNameLike + ".xml")
0226
0227 process.simOmtfDigis.rpcMaxClusterSize = cms.int32(3)
0228 process.simOmtfDigis.rpcMaxClusterCnt = cms.int32(2)
0229 process.simOmtfDigis.rpcDropAllClustersIfMoreThanMax = cms.bool(True)
0230
0231 process.simOmtfDigis.minCSCStubRME12 = cms.int32(410)
0232 process.simOmtfDigis.minCSCStubR = cms.int32(500)
0233
0234 process.simOmtfDigis.minDtPhiQuality = cms.int32(4)
0235 process.simOmtfDigis.minDtPhiBQuality = cms.int32(4)
0236
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(False)
0243 process.simOmtfDigis.useEndcapStubsRInExtr = cms.bool(False)
0244 process.simOmtfDigis.useFloatingPointExtrapolation = cms.bool(False)
0245
0246 process.simOmtfDigis.dtRefHitMinQuality = cms.int32(4)
0247
0248
0249
0250 process.simOmtfDigis.goldenPatternResultFinalizeFunction = cms.int32(3)
0251 process.simOmtfDigis.lctCentralBx = cms.int32(cscBx);
0252
0253
0254
0255
0256
0257 process.L1TMuonSeq = cms.Sequence( process.esProd
0258 + process.simOmtfDigis
0259
0260
0261 )
0262
0263 process.L1TMuonPath = cms.Path(process.L1TMuonSeq)
0264
0265
0266
0267
0268
0269
0270
0271