Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:31:03

0001 # from https://twiki.cern.ch/twiki/bin/viewauth/CMS/L1O2OOperations
0002 # to test the emulator from the .cms cluster retrieving the global tag
0003 #
0004 # The reference is L1Trigger/Configuration/test/L1EmulatorFromRaw_cfg.py
0005 #
0006 # test.py starts here
0007 # 
0008 #
0009 import FWCore.ParameterSet.Config as cms
0010 process = cms.Process('L1')
0011 
0012 process.maxEvents = cms.untracked.PSet(input=cms.untracked.int32(50))
0013 
0014 readFiles = cms.untracked.vstring('file:Raw.root')
0015 secFiles = cms.untracked.vstring() 
0016 process.source = cms.Source('PoolSource',
0017                             fileNames=readFiles,
0018                             secondaryFileNames=secFiles
0019                             )
0020 
0021 # import of standard configurations
0022 process.load('Configuration/StandardSequences/Services_cff')
0023 process.load('Configuration/StandardSequences/GeometryIdeal_cff')
0024 process.load('Configuration/StandardSequences/MagneticField_38T_cff')
0025 process.load('Configuration/StandardSequences/FrontierConditions_GlobalTag_cff')
0026 process.load('Configuration/EventContent/EventContent_cff')
0027 
0028 # load and configure modules via Global Tag
0029 # https://twiki.cern.ch/twiki/bin/view/CMS/SWGuideFrontierConditions
0030 #from CondTools.L1Trigger.L1CondDBSource_cff import initCondDBSource
0031 #initCondDBSource(
0032 #    process,
0033 #    inputDBConnect = 'sqlite_file:csctf.db',
0034 #    tagBase = 'IDEAL',
0035 #    includeAllTags = True
0036 #)
0037 
0038  
0039 process.GlobalTag.globaltag = 'GR10_H_V4::All'
0040 
0041 ## process.GlobalTag.toGet.append(cms.PSet(record  = cms.string( "L1MuCSCTFConfigurationRcd" ),
0042 ##                                         tag     = cms.string("L1MuCSCTFConfiguration_IDEAL" ),
0043 ##                                         connect = cms.untracked.string( "sqlite_file:csctf.db")
0044 ##                                         )
0045 ##                                )
0046 
0047 from CondCore.DBCommon.CondDBSetup_cfi import CondDBSetup
0048  
0049 process.l1conddb = cms.ESSource("PoolDBESSource",
0050                                 CondDBSetup,
0051                                 connect = cms.string("sqlite_file:csctf.db"),
0052                                 toGet = cms.VPSet(cms.PSet(record = cms.string('L1MuCSCTFConfigurationRcd'),
0053                                                            tag = cms.string('L1MuCSCTFConfiguration_IDEAL')
0054                                                            )
0055                                                   )
0056                                                   ##,
0057                                                   ##cms.PSet(record = cms.string('L1TriggerKeyRcd'),
0058                                                   ##         tag = cms.string('L1TriggerKey_' + )
0059                                                   ##         )
0060                                                   ##)
0061                                 )
0062 
0063 
0064 process.es_prefer_l1conddb = cms.ESPrefer("PoolDBESSource","l1conddb")
0065                                  
0066 # Message Logger
0067 process.load('FWCore.MessageService.MessageLogger_cfi')
0068 process.MessageLogger.debugModules = ['*']
0069 
0070 process.MessageLogger.cerr.enable = False
0071 process.MessageLogger.cout = cms.untracked.PSet(
0072     enable = cms.untracked.bool(True),
0073     threshold = cms.untracked.string('INFO'),
0074     DEBUG=cms.untracked.PSet(
0075         limit=cms.untracked.int32(-1)
0076     ),
0077     INFO=cms.untracked.PSet(
0078         limit=cms.untracked.int32(-1)
0079     ),
0080     WARNING=cms.untracked.PSet(
0081         limit=cms.untracked.int32(-1)
0082     ),
0083     ERROR=cms.untracked.PSet(
0084         limit=cms.untracked.int32(-1)
0085     )
0086 )
0087 
0088 # Output definition
0089 process.output = cms.OutputModule("PoolOutputModule",
0090                                   outputCommands = process.FEVTDEBUGHLTEventContent.outputCommands,
0091                                   fileName = cms.untracked.string('L1EmulatorFromRaw.root'),
0092                                   dataset = cms.untracked.PSet(dataTier = cms.untracked.string("\'GEN-SIM-DIGI-RAW-HLTDEBUG\'"),
0093                                                                filterName = cms.untracked.string('')
0094                                                                )
0095                                   )
0096 
0097 process.out_step = cms.EndPath(process.output)
0098 #
0099 # test.py ends here
0100 #
0101 
0102 # Unpackers
0103 process.load("EventFilter.CSCTFRawToDigi.csctfunpacker_cfi")
0104 process.load("EventFilter.DTTFRawToDigi.dttfunpacker_cfi")
0105 
0106 
0107 # ------------------------------------------------------------------------------------------------
0108 # IMPORTANT:
0109 # ---------
0110 #
0111 # IF YOU WANT TO CONFIGURE THE EMULATOR VIA EventSetup (O2O mechanism or fake producer) the
0112 # option initializeFromPSet in L1Trigger/CSCTrackFinder/python/csctfTrackDigis_cfi.py
0113 # has to be set to False: initializeFromPSet = cms.bool(False)
0114 import L1Trigger.CSCTrackFinder.csctfTrackDigis_cfi
0115 process.simCsctfTrackDigis = L1Trigger.CSCTrackFinder.csctfTrackDigis_cfi.csctfTrackDigis.clone()
0116 process.simCsctfTrackDigis.SectorReceiverInput = cms.untracked.InputTag("csctfunpacker")
0117 process.simCsctfTrackDigis.DTproducer = cms.untracked.InputTag("dttfunpacker")
0118 process.simCsctfTrackDigis.SectorProcessor.initializeFromPSet = cms.bool(False)
0119 
0120 # if you want to read the DT stubs unpacked by CSCTF
0121 # process.simCsctfTrackDigis.readDtDirect = cms.bool(True)
0122 # process.simCsctfTrackDigis.mbProducer = cms.untracked.InputTag("csctfunpacker","DT")
0123 # ------------------------------------------------------------------------------------------------
0124 
0125 process.p = cms.Path( process.csctfunpacker
0126                      *process.dttfunpacker
0127                      *process.simCsctfTrackDigis)