Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 23:30:23

0001 from __future__ import print_function
0002 # Auto generated configuration file
0003 # using: 
0004 # Revision: 1.19 
0005 # Source: /local/reps/CMSSW/CMSSW/Configuration/Applications/python/ConfigBuilder.py,v 
0006 # with command line options: SingleElectronPt10_cfi.py -s GEN,SIM,DIGI,L1 --pileup=NoPileUp --geometry DB --conditions=auto:startup -n 1 --no_exec
0007 #
0008 #  This was adapted from unpackBuffers-CaloStage2.py.
0009 #    -Dropped formation of RAW data from MP7 Buffer txt files.
0010 #    -Unpacking of the uGT raw data has been added
0011 #    -uGT Emulation starting with the Demux output and/or the uGT input 
0012 #    -Analysis for uGT objects using L1TGlobalAnalyzer
0013 #
0014 #   Brian Winer, March 16, 2015
0015 #  
0016 import FWCore.ParameterSet.Config as cms
0017 
0018 
0019 # options
0020 import FWCore.ParameterSet.VarParsing as VarParsing
0021 options = VarParsing.VarParsing('analysis')
0022 options.register('skipEvents',
0023                  0,
0024                  VarParsing.VarParsing.multiplicity.singleton,
0025                  VarParsing.VarParsing.varType.int,
0026                  "Number of events to skip")
0027 options.register('dump',
0028                  False,
0029                  VarParsing.VarParsing.multiplicity.singleton,
0030                  VarParsing.VarParsing.varType.bool,
0031                  "Print RAW data")
0032 options.register('debug',
0033                  False,
0034                  VarParsing.VarParsing.multiplicity.singleton,
0035                  VarParsing.VarParsing.varType.bool,
0036                  "Enable debug data")
0037                  
0038 options.parseArguments()
0039 
0040 if (options.maxEvents == -1):
0041     options.maxEvents = 1
0042 
0043 
0044 process = cms.Process('Raw2DigiuGTEmul')
0045 
0046 # import of standard configurations
0047 process.load('Configuration.StandardSequences.Services_cff')
0048 process.load('FWCore.MessageService.MessageLogger_cfi')
0049 process.load('Configuration.StandardSequences.GeometryRecoDB_cff')
0050 process.load('Configuration.Geometry.GeometryDB_cff')
0051 process.load('Configuration.StandardSequences.MagneticField_38T_cff')
0052 process.load('Configuration.StandardSequences.SimL1Emulator_cff')
0053 process.load('Configuration.StandardSequences.EndOfProcess_cff')
0054 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
0055 
0056 process.maxEvents = cms.untracked.PSet(
0057     input = cms.untracked.int32(options.maxEvents)
0058 )
0059 
0060 
0061 # Input source
0062 process.source = cms.Source("PoolSource",
0063     secondaryFileNames = cms.untracked.vstring(),
0064 #    inputCommands = cms.untracked.vstring("drop BXVector*_*_*_*"),
0065     fileNames = cms.untracked.vstring("file:l1tCalo_Test.root"),
0066     skipEvents = cms.untracked.uint32(options.skipEvents) 
0067 )
0068 
0069 
0070 
0071 # Additional output definition
0072 # TTree output file
0073 process.load("CommonTools.UtilAlgos.TFileService_cfi")
0074 process.TFileService.fileName = cms.string('l1t_histos.root')
0075 
0076 
0077 # enable debug message logging for our modules
0078 
0079 process.MessageLogger.L1TCaloEvents=dict()
0080 process.MessageLogger.L1TGlobalEvents=dict()
0081 
0082 process.MessageLogger.suppressInfo = cms.untracked.vstring('Geometry', 'AfterSource')
0083 
0084 if (options.dump):
0085     process.MessageLogger.files.infos = cms.untracked.PSet(
0086         INFO = cms.untracked.PSet(limit = cms.untracked.int32(0)),
0087         L1TCaloEvents = cms.untracked.PSet(
0088             limit = cms.untracked.int32(10000)
0089         )
0090     )
0091 
0092 if (options.debug):
0093 #    process.MessageLogger.debugModules = cms.untracked.vstring('L1TRawToDigi:caloStage2Digis', 'MP7BufferDumpToRaw:stage2MPRaw', 'MP7BufferDumpToRaw:stage2DemuxRaw')
0094     process.MessageLogger.debugModules = cms.untracked.vstring('*')
0095     process.MessageLogger.cerr.threshold = cms.untracked.string('DEBUG')
0096 
0097 
0098 
0099 # Other statements
0100 from Configuration.AlCa.GlobalTag import GlobalTag
0101 process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:startup', '')
0102 
0103 # print some debug info
0104 print("Job config :")
0105 print("maxEvents     = ", options.maxEvents)
0106 print("skipEvents    = ", options.skipEvents)
0107 print("dump          = ", options.dump)
0108 print("debug         = ", options.debug)
0109 print(" ")
0110 
0111 
0112 # dump raw data
0113 process.dumpRaw = cms.EDAnalyzer( 
0114     "DumpFEDRawDataProduct",
0115     label = cms.untracked.string("rawDataCollector"),
0116     feds = cms.untracked.vint32 ( 1360, 1366, 1404 ),
0117     dumpPayload = cms.untracked.bool ( options.dump )
0118 )
0119 
0120 # raw to digi
0121 process.load('EventFilter.L1TRawToDigi.caloStage2Digis_cfi')
0122 process.caloStage2Digis.InputLabel = cms.InputTag('rawDataCollector')
0123 
0124 process.load('EventFilter.L1TRawToDigi.gtStage2Digis_cfi')
0125 process.gtStage2Digis.InputLabel = cms.InputTag('rawDataCollector')
0126 
0127 
0128 # Setup for Emulation of uGT
0129 process.load('L1Trigger.L1TGlobal.StableParametersConfig_cff')
0130 process.load('L1Trigger.L1TGlobal.TriggerMenuXml_cfi')
0131 process.TriggerMenuXml.TriggerMenuLuminosity = 'startup'
0132 process.TriggerMenuXml.DefXmlFile = 'L1Menu_CaloSliceTest_2015.xml'
0133 
0134 process.load('L1Trigger.L1TGlobal.TriggerMenuConfig_cff')
0135 process.es_prefer_l1GtParameters = cms.ESPrefer('l1t::TriggerMenuXmlProducer','TriggerMenuXml')
0136 
0137 process.emL1uGtFromGtInput = cms.EDProducer("L1TGlobalProducer",
0138     ProduceL1GtObjectMapRecord = cms.bool(False),
0139     AlgorithmTriggersUnmasked = cms.bool(False),
0140     EmulateBxInEvent = cms.int32(1),
0141     L1DataBxInEvent = cms.int32(1),
0142     AlgorithmTriggersUnprescaled = cms.bool(False),
0143     ProduceL1GtDaqRecord = cms.bool(True),
0144     GmtInputTag = cms.InputTag(""),
0145     caloInputTag = cms.InputTag("gtStage2Digis"),
0146     AlternativeNrBxBoardDaq = cms.uint32(0),
0147     BstLengthBytes = cms.int32(-1),
0148     Verbosity = cms.untracked.int32(5)
0149 )
0150 
0151 process.emL1uGtFromDemuxOutput = cms.EDProducer("L1TGlobalProducer",
0152     ProduceL1GtObjectMapRecord = cms.bool(False),
0153     AlgorithmTriggersUnmasked = cms.bool(False),
0154     EmulateBxInEvent = cms.int32(1),
0155     L1DataBxInEvent = cms.int32(1),
0156     AlgorithmTriggersUnprescaled = cms.bool(False),
0157     ProduceL1GtDaqRecord = cms.bool(True),
0158     GmtInputTag = cms.InputTag(""),
0159     caloInputTag = cms.InputTag("caloStage2Digis"),
0160     AlternativeNrBxBoardDaq = cms.uint32(0),
0161     BstLengthBytes = cms.int32(-1),
0162     Verbosity = cms.untracked.int32(5)
0163 )
0164 
0165 
0166 
0167 # object analyser
0168 process.load('L1Trigger.L1TCalorimeter.l1tStage2CaloAnalyzer_cfi')
0169 process.l1tStage2CaloAnalyzer.doText = cms.untracked.bool(options.debug)
0170 process.l1tStage2CaloAnalyzer.towerToken = cms.InputTag("caloStage2Digis")
0171 process.l1tStage2CaloAnalyzer.clusterToken = cms.InputTag("None")
0172 process.l1tStage2CaloAnalyzer.mpEGToken = cms.InputTag("None")
0173 process.l1tStage2CaloAnalyzer.mpTauToken = cms.InputTag("None")
0174 
0175 
0176 # gt analyzer
0177 process.l1tGlobalAnalyzer = cms.EDAnalyzer('L1TGlobalAnalyzer',
0178     doText = cms.untracked.bool(options.debug),
0179     dmxEGToken = cms.InputTag("None"),
0180     dmxTauToken = cms.InputTag("None"),
0181     dmxJetToken = cms.InputTag("caloStage2Digis"),
0182     dmxEtSumToken = cms.InputTag("caloStage2Digis"),
0183     egToken = cms.InputTag("None"),
0184     tauToken = cms.InputTag("None"),
0185     jetToken = cms.InputTag("None"),
0186     etSumToken = cms.InputTag("None"),
0187     gtAlgToken = cms.InputTag("gtStage2Digis"),
0188     emulDxAlgToken = cms.InputTag("emL1uGtFromDemuxOutput"),
0189     emulGtAlgToken = cms.InputTag("None")
0190 )
0191 
0192 
0193 # Path and EndPath definitions
0194 process.path = cms.Path(
0195      process.dumpRaw
0196     +process.caloStage2Digis
0197     +process.gtStage2Digis
0198 #    +process.emL1uGtFromGtInput
0199     +process.emL1uGtFromDemuxOutput
0200     +process.l1tStage2CaloAnalyzer
0201     +process.l1tGlobalAnalyzer
0202 )
0203 
0204 
0205