Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-04-29 23:10:38

0001 from __future__ import print_function
0002 #
0003 # cfg file to unpack RAW L1 GT DAQ data
0004 # the options set in "user choices" file
0005 #   L1Trigger/GlobalTriggerAnalyzer/python/UserOptions.py
0006  
0007 # V M Ghete 2009-04-03
0008 # V M Ghete 2011-02-09 use UserOptions.py
0009 
0010  
0011 import FWCore.ParameterSet.Config as cms
0012 import sys
0013 
0014 process = cms.Process("TestL1GtUnpacker")
0015 
0016 print('\n')
0017 from L1Trigger.GlobalTriggerAnalyzer.UserOptions_cff import *
0018 if errorUserOptions == True :
0019     print('\nError returned by UserOptions_cff\n')
0020     sys.exit()
0021 
0022 # source according to data type
0023 if dataType == 'StreamFile' :
0024     process.source = cms.Source("NewEventStreamFileReader", fileNames=readFiles)
0025 else :        
0026     process.source = cms.Source ('PoolSource', 
0027                                  fileNames=readFiles, 
0028                                  secondaryFileNames=secFiles,
0029                                  eventsToProcess = selectedEvents
0030                                  )
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 # https://twiki.cern.ch/twiki/bin/view/CMS/SWGuideFrontierConditions
0041 
0042 process.load("Configuration.StandardSequences.GeometryDB_cff")
0043 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
0044 
0045 process.GlobalTag.globaltag = useGlobalTag
0046 
0047 # L1 GT/GMT unpack
0048 process.load("EventFilter.L1GlobalTriggerRawToDigi.l1GtUnpack_cfi")
0049 
0050 # input tag for GT readout collection (before CMSSW_5_0_X)
0051 #     source        = hardware record
0052 #
0053 #if useRelValSample == True :
0054 #    daqGtInputTag = 'rawDataCollector'
0055 #else :
0056 #    daqGtInputTag = 'rawDataCollector'
0057 
0058 daqGtInputTag = 'rawDataCollector'
0059 
0060 process.l1GtUnpack.DaqGtInputTag = daqGtInputTag
0061 #process.l1GtUnpack.DaqGtInputTag = 'l1GtTextToRaw'
0062 
0063 # Active Boards Mask
0064 
0065 # no board masked (default)
0066 #process.l1GtUnpack.ActiveBoardsMask = 0xFFFF
0067     
0068 # GTFE only in the record
0069 #process.l1GtUnpack.ActiveBoardsMask = 0x0000
0070 
0071 # GTFE + FDL 
0072 #process.l1GtUnpack.ActiveBoardsMask = 0x0001
0073      
0074 # GTFE + GMT 
0075 #process.l1GtUnpack.ActiveBoardsMask = 0x0100
0076 
0077 # GTFE + FDL + GMT 
0078 #process.l1GtUnpack.ActiveBoardsMask = 0x0101
0079 
0080 # BxInEvent to be unpacked
0081 # all available BxInEvent (default)
0082 #process.l1GtUnpack.UnpackBxInEvent = -1 
0083 
0084 # BxInEvent = 0 (L1A)
0085 #process.l1GtUnpack.UnpackBxInEvent = 1 
0086 
0087 # 3 BxInEvent (F, 0, 1)  
0088 #process.l1GtUnpack.UnpackBxInEvent = 3 
0089 
0090 # set it to verbose
0091 process.l1GtUnpack.Verbosity = cms.untracked.int32(1)
0092 
0093 #
0094 # l1GtTrigReport module
0095 #
0096 
0097 process.load("L1Trigger.GlobalTriggerAnalyzer.l1GtTrigReport_cfi")
0098  
0099 # boolean flag to select the input record
0100 # if true, it will use L1GlobalTriggerRecord 
0101 #process.l1GtTrigReport.UseL1GlobalTriggerRecord = True
0102 
0103 # input tag for GT record: 
0104 #   GT emulator:    gtDigis (DAQ record)
0105 #   GT unpacker:    gtDigis (DAQ record)
0106 #   GT lite record: l1GtRecord 
0107 process.l1GtTrigReport.L1GtRecordInputTag = "l1GtUnpack"
0108 
0109 #process.l1GtTrigReport.PrintVerbosity = 10
0110 
0111 # print output: 0 = std::cout; 1 = LogTrace; 2 = LogVerbatim; 3 = LogInfo
0112 #process.l1GtTrigReport.PrintOutput = 0
0113 
0114 
0115 # path to be run
0116 process.p = cms.Path(process.l1GtUnpack*process.l1GtTrigReport)
0117 
0118 # Message Logger
0119 process.load('FWCore.MessageService.MessageLogger_cfi')
0120 process.MessageLogger.debugModules = ['l1GtUnpack', 'l1GtTrigReport']
0121 process.MessageLogger.cerr.enable = False
0122 
0123 process.MessageLogger.files.L1GtUnpacker_errors = cms.untracked.PSet( 
0124         threshold = cms.untracked.string('ERROR'),
0125         ERROR = cms.untracked.PSet( limit = cms.untracked.int32(-1) ),
0126         L1GlobalTriggerRawToDigi = cms.untracked.PSet( limit = cms.untracked.int32(-1) ) 
0127        )
0128 
0129 process.MessageLogger.files.L1GtUnpacker_warnings = cms.untracked.PSet( 
0130         threshold = cms.untracked.string('WARNING'),
0131         WARNING = cms.untracked.PSet( limit = cms.untracked.int32(0) ),
0132         ERROR = cms.untracked.PSet( limit = cms.untracked.int32(0) ),
0133         L1GlobalTriggerRawToDigi = cms.untracked.PSet( limit = cms.untracked.int32(-1) ) 
0134         )
0135 
0136 process.MessageLogger.files.L1GtUnpacker_info = cms.untracked.PSet( 
0137         threshold = cms.untracked.string('INFO'),
0138         INFO = cms.untracked.PSet( limit = cms.untracked.int32(0) ),
0139         WARNING = cms.untracked.PSet( limit = cms.untracked.int32(0) ),
0140         ERROR = cms.untracked.PSet( limit = cms.untracked.int32(0) ),
0141         L1GtTrigReport = cms.untracked.PSet( limit = cms.untracked.int32(-1) ) 
0142         )
0143 
0144 process.MessageLogger.files.L1GtUnpacker = cms.untracked.PSet( 
0145         threshold = cms.untracked.string('DEBUG'),
0146         DEBUG = cms.untracked.PSet( limit = cms.untracked.int32(0) ),
0147         INFO = cms.untracked.PSet( limit = cms.untracked.int32(0) ),
0148         WARNING = cms.untracked.PSet( limit = cms.untracked.int32(0) ),
0149         ERROR = cms.untracked.PSet( limit = cms.untracked.int32(0) ),
0150         L1GlobalTriggerRawToDigi = cms.untracked.PSet( limit = cms.untracked.int32(-1) ) 
0151         )
0152 
0153 
0154 # summary
0155 process.options = cms.untracked.PSet(
0156     wantSummary = cms.untracked.bool(True)
0157 )
0158 
0159 # output 
0160 
0161 process.outputL1GtUnpack = cms.OutputModule("PoolOutputModule",
0162     fileName = cms.untracked.string('L1GtUnpacker.root'),
0163     # keep only unpacked data in the ROOT file
0164     outputCommands = cms.untracked.vstring('drop *', 
0165         'keep *_l1GtUnpack_*_*')
0166 )
0167 
0168 process.outpath = cms.EndPath(process.outputL1GtUnpack)
0169