Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:20:04

0001 from __future__ import print_function
0002 #
0003 # cfg file to test L1GtBeamModeFilter
0004 # it requires as input:
0005 #   a RAW data-tier sample (with FED 812 included) or 
0006 #   a digi data-tier sample, with L1GlobalTriggerEvmReadoutRecord product valid or
0007 #   a RECO data-tier sample, with ConditionsInEdm product valid
0008 #
0009 # the input sample is chosen in L1Trigger.GlobalTriggerAnalyzer.UserOptions_cff
0010 #
0011 # V.M. Ghete 2010-06-22
0012 #
0013 
0014 import FWCore.ParameterSet.Config as cms
0015 import sys
0016 
0017 process = cms.Process('TestL1GtBeamModeFilter')
0018 
0019 print('\n')
0020 from L1Trigger.GlobalTriggerAnalyzer.UserOptions_cff import *
0021 if errorUserOptions == True :
0022     print('\nError returned by UserOptions_cff\n')
0023     sys.exit()
0024 
0025 
0026 # source according to data type
0027 if dataType == 'StreamFile' :
0028     process.source = cms.Source("NewEventStreamFileReader", fileNames=readFiles)
0029 else :        
0030     process.source = cms.Source ('PoolSource', fileNames=readFiles, secondaryFileNames=secFiles)
0031 
0032 
0033 # number of events to be processed and source file
0034 process.maxEvents = cms.untracked.PSet(
0035     input=cms.untracked.int32(maxNumberEvents)
0036 )
0037 
0038 #
0039 # load and configure modules via Global Tag
0040 
0041 process.load("Configuration.StandardSequences.GeometryDB_cff")
0042 # https://twiki.cern.ch/twiki/bin/view/CMS/SWGuideFrontierConditions
0043 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
0044 
0045 process.GlobalTag.globaltag = useGlobalTag
0046 
0047 
0048 
0049 
0050 
0051 # this module
0052 process.load('L1Trigger.GlobalTriggerAnalyzer.l1GtBeamModeFilter_cfi')
0053  
0054 # replacing arguments for l1GtBeamModeFilter
0055 
0056 # input tag for input tag for ConditionInEdm products
0057 #process.l1GtBeamModeFilter.CondInEdmInputTag = cms.InputTag("conditionsInEdm"),
0058 
0059 # input tag for the L1 GT EVM product 
0060 #process.l1GtBeamModeFilter.L1GtEvmReadoutRecordTag = cms.InputTag("gtEvmDigis")
0061 
0062 # vector of allowed beam modes (see enumeration in header file for implemented values)
0063 # default value: 11 (STABLE)
0064 #process.l1GtBeamModeFilter.AllowedBeamMode = cms.vuint32(11)
0065 process.l1GtBeamModeFilter.AllowedBeamMode = cms.vuint32(9, 10, 11)
0066 
0067 # return the inverted result, to be used instead of NOT
0068 #process.l1GtBeamModeFilter.InvertResult = False
0069 
0070 # path to be run
0071 # for RAW data, run first the RAWTODIGI 
0072 if (dataType == 'RAW') and not (useRelValSample) :
0073     process.load('Configuration/StandardSequences/RawToDigi_Data_cff')
0074     process.gtEvmDigis.UnpackBxInEvent = cms.int32(1)
0075     # set EVM unpacker to verbose
0076     process.gtEvmDigis.Verbosity = cms.untracked.int32(1)
0077 
0078     process.p = cms.Path(process.RawToDigi * process.l1GtBeamModeFilter)
0079 
0080 elif (dataType == 'RAW') and (useRelValSample) :
0081     process.load('Configuration/StandardSequences/RawToDigi_cff')
0082     process.gtEvmDigis.UnpackBxInEvent = cms.int32(1)
0083     # set EVM unpacker to verbose
0084     process.gtEvmDigis.Verbosity = cms.untracked.int32(1)
0085 
0086     process.p = cms.Path(process.RawToDigi * process.l1GtBeamModeFilter)
0087     
0088 else :        
0089     # run on standard RECO
0090     process.p = cms.Path(process.l1GtBeamModeFilter)
0091 
0092 # services
0093 
0094 # Message Logger
0095 process.load('FWCore.MessageService.MessageLogger_cfi')
0096 process.MessageLogger.debugModules = ['gtEvmDigis', 'l1GtBeamModeFilter']
0097 process.MessageLogger.L1GlobalTriggerEvmRawToDigi=dict()
0098 process.MessageLogger.L1GtBeamModeFilter=dict()
0099 
0100 process.MessageLogger.cerr.threshold = 'DEBUG'
0101 #process.MessageLogger.cerr.threshold = 'INFO'
0102 #process.MessageLogger.cerr.threshold = 'WARNING'
0103 #process.MessageLogger.cerr.threshold = 'ERROR'
0104 
0105 process.MessageLogger.cerr.DEBUG = cms.untracked.PSet( limit = cms.untracked.int32(0) )
0106 process.MessageLogger.cerr.INFO = cms.untracked.PSet( limit = cms.untracked.int32(0) )
0107 process.MessageLogger.cerr.WARNING = cms.untracked.PSet( limit = cms.untracked.int32(0) )
0108 process.MessageLogger.cerr.ERROR = cms.untracked.PSet( limit = cms.untracked.int32(0) )
0109 
0110 process.MessageLogger.cerr.L1GlobalTriggerEvmRawToDigi = cms.untracked.PSet( limit = cms.untracked.int32(0) )
0111 process.MessageLogger.cerr.L1GtBeamModeFilter = cms.untracked.PSet( limit = cms.untracked.int32(-1) )
0112 
0113