Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-04-01 23:54:04

0001 import FWCore.ParameterSet.Config as cms
0002 import FWCore.Utilities.FileUtils as FileUtils
0003 import FWCore.ParameterSet.VarParsing as VarParsing
0004 
0005 
0006 # PART 1 : PARSE ARGUMENTS
0007 
0008 options = VarParsing.VarParsing ('analysis')
0009 options.register('debug',
0010                  0,
0011                  VarParsing.VarParsing.multiplicity.singleton,
0012                  VarParsing.VarParsing.varType.int,
0013                  "Print out additional debugging information")
0014 options.register ('format',
0015                   'EMP', # default value
0016                   VarParsing.VarParsing.multiplicity.singleton,
0017                   VarParsing.VarParsing.varType.string,
0018                   "File format (APx, EMP or X20)")
0019 options.register('threads',
0020                  1, # default value
0021                  VarParsing.VarParsing.multiplicity.singleton,
0022                  VarParsing.VarParsing.varType.int,
0023                  "Number of threads to run")
0024 options.register('streams',
0025                  0, # default value
0026                  VarParsing.VarParsing.multiplicity.singleton,
0027                  VarParsing.VarParsing.varType.int,
0028                  "Number of streams to run")
0029 options.parseArguments()
0030 
0031 inputFiles = []
0032 for filePath in options.inputFiles:
0033     if filePath.endswith(".root"):
0034         inputFiles.append(filePath)
0035     elif filePath.endswith("_cff.py"):
0036         filePath = filePath.replace("/python/","/")
0037         filePath = filePath.replace("/", ".")
0038         inputFilesImport = getattr(__import__(filePath.strip(".py"),fromlist=["readFiles"]),"readFiles")
0039         inputFiles.extend( inputFilesImport )
0040     else:
0041         inputFiles += FileUtils.loadListFromFile(filePath)
0042 
0043 # PART 2: SETUP MAIN CMSSW PROCESS 
0044 
0045 process = cms.Process("GTTFileWriter")
0046 
0047 process.load('Configuration.Geometry.GeometryExtended2026D49Reco_cff')
0048 process.load('Configuration.Geometry.GeometryExtended2026D49_cff')
0049 process.load('Configuration.StandardSequences.MagneticField_cff')
0050 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
0051 from Configuration.AlCa.GlobalTag import GlobalTag
0052 process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:upgradePLS3', '')
0053 process.load("FWCore.MessageLogger.MessageLogger_cfi")
0054 
0055 process.source = cms.Source("PoolSource", fileNames = cms.untracked.vstring(inputFiles) )
0056 process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(options.maxEvents) )
0057 process.options = cms.untracked.PSet(
0058     numberOfThreads = cms.untracked.uint32(options.threads),
0059     numberOfStreams = cms.untracked.uint32(options.streams if options.streams>0 else 0)
0060 )
0061 
0062 process.load("L1Trigger.TrackFindingTracklet.L1HybridEmulationTracks_cff")
0063 process.load('L1Trigger.L1TTrackMatch.L1GTTInputProducer_cfi')
0064 process.load('L1Trigger.VertexFinder.VertexProducer_cff')
0065 process.load('L1Trigger.DemonstratorTools.GTTFileWriter_cff')
0066 
0067 process.L1GTTInputProducer.debug = cms.int32(options.debug)
0068 process.VertexProducer.l1TracksInputTag = cms.InputTag("L1GTTInputProducer","Level1TTTracksConverted")
0069 process.VertexProducer.VertexReconstruction.Algorithm = cms.string("FastHistoEmulation")
0070 process.VertexProducer.VertexReconstruction.VxMinTrackPt = cms.double(0.0)
0071 process.VertexProducer.debug = options.debug
0072 if options.debug:
0073     process.MessageLogger.cerr.INFO.limit = cms.untracked.int32(1000000000)
0074 
0075 process.GTTFileWriter.format = cms.untracked.string(options.format)
0076 # process.GTTFileWriter.outputFilename = cms.untracked.string("myOutputFile.txt")
0077 
0078 process.MessageLogger.cerr.FwkReport.reportEvery = 1
0079 process.Timing = cms.Service("Timing", summaryOnly = cms.untracked.bool(True))
0080 
0081 process.p = cms.Path(process.L1HybridTracks * process.L1GTTInputProducer * process.VertexProducer * process.GTTFileWriter)