Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-07-18 08:35:32

0001 import FWCore.ParameterSet.Config as cms
0002 import FWCore.Utilities.FileUtils as FileUtils
0003 import FWCore.ParameterSet.VarParsing as VarParsing
0004 
0005 # PART 1 : PARSE ARGUMENTS
0006 
0007 options = VarParsing.VarParsing ('analysis')
0008 options.register('debug',
0009                  0,
0010                  VarParsing.VarParsing.multiplicity.singleton,
0011                  VarParsing.VarParsing.varType.int,
0012                  "Print out additional debugging information")
0013 options.register ('format',
0014                   'EMP', # default value
0015                   VarParsing.VarParsing.multiplicity.singleton,
0016                   VarParsing.VarParsing.varType.string,
0017                   "File format (APx, EMP or X2O)")
0018 options.register('threads',
0019                  1, # default value
0020                  VarParsing.VarParsing.multiplicity.singleton,
0021                  VarParsing.VarParsing.varType.int,
0022                  "Number of threads to run")
0023 options.register('streams',
0024                  0, # default value
0025                  VarParsing.VarParsing.multiplicity.singleton,
0026                  VarParsing.VarParsing.varType.int,
0027                  "Number of streams to run")
0028 options.parseArguments()
0029 
0030 inputFiles = []
0031 for filePath in options.inputFiles:
0032     if filePath.endswith(".root"):
0033         inputFiles.append(filePath)
0034     elif filePath.endswith("_cff.py"):
0035         filePath = filePath.replace("/python/","/")
0036         filePath = filePath.replace("/", ".")
0037         inputFilesImport = getattr(__import__(filePath.strip(".py"),fromlist=["readFiles"]),"readFiles")
0038         inputFiles.extend( inputFilesImport )
0039     else:
0040         inputFiles += FileUtils.loadListFromFile(filePath)
0041 
0042 # PART 2: SETUP MAIN CMSSW PROCESS 
0043 
0044 process = cms.Process("GTTFileWriter")
0045 
0046 process.load('Configuration.Geometry.GeometryExtended2026D88Reco_cff')
0047 process.load('Configuration.Geometry.GeometryExtended2026D88_cff')
0048 process.load('Configuration.StandardSequences.MagneticField_cff')
0049 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
0050 from Configuration.AlCa.GlobalTag import GlobalTag
0051 process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase2_realistic', '')
0052 process.load("FWCore.MessageLogger.MessageLogger_cfi")
0053 
0054 process.source = cms.Source("PoolSource",
0055     fileNames = cms.untracked.vstring(inputFiles),
0056     inputCommands = cms.untracked.vstring("keep *", "drop l1tTkPrimaryVertexs_L1TkPrimaryVertex__*")
0057 )
0058 process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(options.maxEvents) )
0059 process.options = cms.untracked.PSet(
0060     numberOfThreads = cms.untracked.uint32(options.threads),
0061     numberOfStreams = cms.untracked.uint32(options.streams if options.streams>0 else 0)
0062 )
0063 
0064 process.load('L1Trigger.L1TTrackMatch.l1tGTTInputProducer_cfi')
0065 process.load('L1Trigger.L1TTrackMatch.l1tTrackSelectionProducer_cfi')
0066 process.load('L1Trigger.VertexFinder.l1tVertexProducer_cfi')
0067 process.load('L1Trigger.L1TTrackMatch.l1tTrackVertexAssociationProducer_cfi')
0068 process.load('L1Trigger.L1TTrackMatch.l1tTrackJetsEmulation_cfi')
0069 process.load('L1Trigger.L1TTrackMatch.l1tTrackerEmuHTMiss_cfi')
0070 process.load('L1Trigger.L1TTrackMatch.l1tTrackerEmuEtMiss_cfi')
0071 process.load('L1Trigger.DemonstratorTools.l1tGTTFileWriter_cfi')
0072                                                             
0073 process.l1tGTTInputProducer.debug = cms.int32(options.debug)
0074 
0075 process.l1tTrackSelectionProducer.processSimulatedTracks = cms.bool(False)
0076 process.l1tVertexFinderEmulator.VertexReconstruction.VxMinTrackPt = cms.double(0.0)
0077 process.l1tVertexFinderEmulator.debug = options.debug
0078 process.l1tTrackVertexAssociationProducer.processSimulatedTracks = cms.bool(False)
0079 
0080 process.l1tTrackSelectionProducerForEtMiss.processSimulatedTracks = cms.bool(False)
0081 process.l1tTrackVertexAssociationProducerForEtMiss.processSimulatedTracks = cms.bool(False)
0082 process.l1tTrackerEmuEtMiss.debug = options.debug
0083 
0084 process.l1tTrackSelectionProducerForJets.processSimulatedTracks = cms.bool(False)
0085 process.l1tTrackSelectionProducerForJets.cutSet = cms.PSet(
0086     ptMin = cms.double(2.0), # pt must be greater than this value, [GeV]
0087     absEtaMax = cms.double(2.4), # absolute value of eta must be less than this value
0088     absZ0Max = cms.double(15.0), # z0 must be less than this value, [cm]
0089     nStubsMin = cms.int32(4), # number of stubs must be greater than or equal to this value
0090     nPSStubsMin = cms.int32(0), # the number of stubs in the PS Modules must be greater than or equal to this value
0091     
0092     reducedBendChi2Max = cms.double(2.25), # bend chi2 must be less than this value
0093     reducedChi2RZMax = cms.double(5.0), # chi2rz/dof must be less than this value
0094     reducedChi2RPhiMax = cms.double(20.0), # chi2rphi/dof must be less than this value
0095 )
0096 process.l1tTrackVertexAssociationProducerForJets.processSimulatedTracks = cms.bool(False)
0097 process.l1tTrackVertexAssociationProducerForJets.cutSet = cms.PSet(
0098     #deltaZMaxEtaBounds = cms.vdouble(0.0, absEtaMax.value), # these values define the bin boundaries in |eta|
0099     #deltaZMax = cms.vdouble(0.5), # delta z must be less than these values, there will be one less value here than in deltaZMaxEtaBounds, [cm]
0100     deltaZMaxEtaBounds = cms.vdouble(0.0, 0.7, 1.0, 1.2, 1.6, 2.0, 2.4), # these values define the bin boundaries in |eta|
0101     deltaZMax = cms.vdouble(0.37, 0.50, 0.60, 0.75, 1.00, 1.60), # delta z must be less than these values, there will be one less value here than in deltaZMaxEtaBounds, [cm]
0102 )
0103 process.l1tTrackerEmuHTMiss.debug = (options.debug > 0)
0104 
0105 #Disable internal track selection
0106 process.l1tTrackJetsEmulation.MaxDzTrackPV = cms.double(10000.0)
0107 process.l1tTrackJetsEmulation.trk_zMax = cms.double(10000.0)    # maximum track z
0108 process.l1tTrackJetsEmulation.trk_ptMax = cms.double(10000.0)    # maximumum track pT before saturation [GeV]
0109 process.l1tTrackJetsEmulation.trk_ptMin = cms.double(0.0)     # minimum track pt [GeV]
0110 process.l1tTrackJetsEmulation.trk_etaMax = cms.double(10000.0)    # maximum track eta
0111 process.l1tTrackJetsEmulation.nStubs4PromptChi2=cms.double(10000.0) #Prompt track quality flags for loose/tight
0112 process.l1tTrackJetsEmulation.nStubs4PromptBend=cms.double(10000.0)
0113 process.l1tTrackJetsEmulation.nStubs5PromptChi2=cms.double(10000.0)
0114 process.l1tTrackJetsEmulation.nStubs5PromptBend=cms.double(10000.0)
0115 
0116 if options.debug:
0117     process.MessageLogger.cerr.INFO.limit = cms.untracked.int32(1000000000)
0118     process.MessageLogger.suppressInfo = cms.untracked.vstring('CondDBESSource', 'PoolDBESSource')
0119     process.MessageLogger.cerr.CondDBESSource = cms.untracked.PSet(
0120         limit = cms.untracked.int32(0)
0121     )
0122 
0123 process.l1tGTTFileWriter.format = cms.untracked.string(options.format) #FIXME Put all this into the default GTTFileWriter
0124 process.l1tGTTFileWriter.tracks = cms.untracked.InputTag("l1tTTTracksFromTrackletEmulation", "Level1TTTracks")
0125 process.l1tGTTFileWriter.convertedTracks = cms.untracked.InputTag("l1tGTTInputProducer", "Level1TTTracksConverted")
0126 process.l1tGTTFileWriter.selectedTracks = cms.untracked.InputTag("l1tTrackSelectionProducer", "Level1TTTracksSelectedEmulation")
0127 process.l1tGTTFileWriter.vertices = cms.untracked.InputTag("l1tVertexFinderEmulator", "L1VerticesEmulation")
0128 process.l1tGTTFileWriter.vertexAssociatedTracks = cms.untracked.InputTag("l1tTrackVertexAssociationProducer", "Level1TTTracksSelectedAssociatedEmulation")
0129 process.l1tGTTFileWriter.jets = cms.untracked.InputTag("l1tTrackJetsEmulation","L1TrackJets")
0130 process.l1tGTTFileWriter.htmiss = cms.untracked.InputTag("l1tTrackerEmuHTMiss", "L1TrackerEmuHTMiss")
0131 process.l1tGTTFileWriter.etmiss = cms.untracked.InputTag("l1tTrackerEmuEtMiss", "L1TrackerEmuEtMiss")
0132 process.l1tGTTFileWriter.outputCorrelatorFilename = cms.untracked.string("L1GTTOutputToCorrelatorFile")
0133 process.l1tGTTFileWriter.outputGlobalTriggerFilename = cms.untracked.string("L1GTTOutputToGlobalTriggerFile")
0134 process.l1tGTTFileWriter.selectedTracksFilename = cms.untracked.string("L1GTTSelectedTracksFile")
0135 process.l1tGTTFileWriter.vertexAssociatedTracksFilename = cms.untracked.string("L1GTTVertexAssociatedTracksFile")
0136 
0137 process.MessageLogger.cerr.FwkReport.reportEvery = 1
0138 process.Timing = cms.Service("Timing", summaryOnly = cms.untracked.bool(True))
0139 
0140 
0141 process.p = cms.Path(process.l1tGTTFileWriter)
0142 process.p.associate(cms.Task(process.l1tGTTInputProducer, 
0143                              process.l1tTrackSelectionProducer,
0144                              process.l1tVertexFinderEmulator, 
0145                              process.l1tTrackVertexAssociationProducer,
0146                              process.l1tTrackSelectionProducerForJets,
0147                              process.l1tTrackVertexAssociationProducerForJets,
0148                              process.l1tTrackJetsEmulation, 
0149                              process.l1tTrackerEmuHTMiss, 
0150                              process.l1tTrackSelectionProducerForEtMiss,
0151                              process.l1tTrackVertexAssociationProducerForEtMiss,
0152                              process.l1tTrackerEmuEtMiss,
0153                          )
0154                 )