Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-06-28 02:36:14

0001 import FWCore.ParameterSet.Config as cms
0002 import FWCore.ParameterSet.VarParsing as VarParsing
0003 
0004 from Configuration.Eras.Era_Run3_cff import Run3
0005 
0006 process = cms.Process('reRECO',Run3)
0007 
0008 options = VarParsing.VarParsing('analysis')
0009 options.register('globalTag',
0010                  "auto:run3_data_prompt", # default value
0011                  VarParsing.VarParsing.multiplicity.singleton, # singleton or list
0012                  VarParsing.VarParsing.varType.string, # string, int, or float
0013                  "input file name")                
0014 options.register('isStrip',
0015                  True, # default value
0016                  VarParsing.VarParsing.multiplicity.singleton, # singleton or list
0017                  VarParsing.VarParsing.varType.bool, # string, int, or float
0018                  "true filters on Strips, false filters on Pixels")
0019 # Register the option as a list of strings
0020 options.register('testCombinations',
0021                  '',  # Default value as an empty string
0022                  VarParsing.VarParsing.multiplicity.list,  # Allows multiple values
0023                  VarParsing.VarParsing.varType.string,  # Specifies that the values are strings
0024                  "List of combinations of partitions to test")
0025 options.parseArguments()
0026 
0027 # import of standard configurations
0028 process.load('Configuration.StandardSequences.Services_cff')
0029 
0030 process.load('FWCore.MessageService.MessageLogger_cfi')   
0031 process.MessageLogger.cerr.enable = False
0032 process.MessageLogger.DetectorStatusFilter=dict()  
0033 process.MessageLogger.cout = cms.untracked.PSet(
0034     enable = cms.untracked.bool(True),
0035     threshold = cms.untracked.string("INFO"),
0036     default   = cms.untracked.PSet(limit = cms.untracked.int32(0)),                       
0037     FwkReport = cms.untracked.PSet(limit = cms.untracked.int32(-1),
0038                                    reportEvery = cms.untracked.int32(1)
0039                                    ),                                                      
0040     DetectorStatusFilter = cms.untracked.PSet( limit = cms.untracked.int32(-1)),
0041     enableStatistics = cms.untracked.bool(True)
0042     )
0043 
0044 process.load('Configuration.StandardSequences.GeometryRecoDB_cff')
0045 process.load('Configuration.StandardSequences.MagneticField_cff')
0046 process.load('Configuration.StandardSequences.RawToDigi_Data_cff')
0047 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
0048 
0049 process.maxEvents = cms.untracked.PSet(
0050     input = cms.untracked.int32(options.maxEvents),
0051     output = cms.optional.untracked.allowed(cms.int32,cms.PSet)
0052 )
0053 
0054 # Input source
0055 process.source = cms.Source("PoolSource",
0056                             #fileNames = cms.untracked.vstring("/store/express/Commissioning2021/ExpressCosmics/FEVT/Express-v1/000/343/498/00000/004179ae-ac29-438a-bd2d-ea98139c21a7.root") # default value
0057                             fileNames = cms.untracked.vstring(options.inputFiles)
0058                             )
0059 # Other statements
0060 from Configuration.AlCa.GlobalTag import GlobalTag
0061 process.GlobalTag = GlobalTag(process.GlobalTag, options.globalTag, '')
0062 
0063 # Path and EndPath definitions
0064 process.raw2digi_step = cms.Path(process.RawToDigi)
0065 
0066 process.OUT = cms.OutputModule("PoolOutputModule",
0067                                outputCommands = cms.untracked.vstring('drop *',
0068                                                                       'keep *_onlineMetaDataDigis_*_*',
0069                                                                       'keep *_scalersRawToDigi_*_*'),
0070                                SelectEvents = cms.untracked.PSet(SelectEvents = cms.vstring('analysis_step')),
0071                                fileName = cms.untracked.string(options.outputFile)
0072                                )
0073 
0074 # the module to be tested
0075 from DQM.TrackerCommon.TrackerFilterConfiguration_cfi import detectorStateFilter
0076 process.SiPixelFilter = detectorStateFilter.clone(DetectorType = 'pixel',
0077                                                   DebugOn = True)
0078 
0079 process.SiStripFilter = detectorStateFilter.clone(DetectorType = 'sistrip',
0080                                                   DebugOn = True,
0081                                                   acceptedCombinations = options.testCombinations)
0082 
0083 #process.analysis_step = cms.Path(process.detectorStateFilter)
0084 if(options.isStrip) :
0085     process.analysis_step = cms.Path(process.SiStripFilter)
0086 else:
0087     process.analysis_step = cms.Path(process.SiPixelFilter)
0088 
0089 # end path
0090 process.printEventNumber = cms.OutputModule("AsciiOutputModule")
0091 process.this_is_the_end = cms.EndPath(process.OUT*process.printEventNumber)
0092 
0093 process.schedule = cms.Schedule(process.raw2digi_step,process.analysis_step,process.this_is_the_end)