Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-02-02 23:43:35

0001 # -*- coding: utf-8 -*-
0002 import FWCore.ParameterSet.Config as cms
0003 process = cms.Process("L1TMuonEmulation")
0004 import os
0005 import sys
0006 
0007 loadConfigFrom_sqlite_file = True
0008 
0009 loadConfigFrom_fakeOmtfParams = False
0010 
0011 process.load("FWCore.MessageLogger.MessageLogger_cfi")
0012 
0013 process.MessageLogger = cms.Service("MessageLogger",
0014         # suppressInfo       = cms.untracked.vstring('AfterSource', 'PostModule'),
0015         destinations=cms.untracked.vstring(
0016                                                # 'detailedInfo',
0017                                                # 'critical',
0018                                                #'cout',
0019                                                #'cerr',
0020                                                 'omtfEventPrint'
0021                     ),
0022         categories=cms.untracked.vstring('l1tOmtfEventPrint', 'OMTFReconstruction'), #, 'FwkReport'
0023         # cout=cms.untracked.PSet(
0024         #                  threshold=cms.untracked.string('INFO'),
0025         #                  default=cms.untracked.PSet(limit=cms.untracked.int32(0)),
0026         #                  # INFO   =  cms.untracked.int32(0),
0027         #                  # DEBUG   = cms.untracked.int32(0),
0028         #                  l1tOmtfEventPrint=cms.untracked.PSet(limit=cms.untracked.int32(1000000000)),
0029         #                  OMTFReconstruction=cms.untracked.PSet(limit=cms.untracked.int32(1000000000)),
0030         #                  #FwkReport=cms.untracked.PSet(reportEvery = cms.untracked.int32(50) ),
0031         #                ), 
0032         
0033         omtfEventPrint = cms.untracked.PSet(    
0034                          filename  = cms.untracked.string('log_MuonOverlap_run3_data'),
0035                          extension = cms.untracked.string('.txt'),                
0036                          threshold = cms.untracked.string('INFO'),
0037                          default = cms.untracked.PSet( limit = cms.untracked.int32(0) ), 
0038                          #INFO   =  cms.untracked.int32(0),
0039                          #DEBUG   = cms.untracked.int32(0),
0040                          l1tOmtfEventPrint = cms.untracked.PSet( limit = cms.untracked.int32(1000000000) ),
0041                          OMTFReconstruction = cms.untracked.PSet( limit = cms.untracked.int32(1000000000) )
0042                        ),
0043        debugModules=cms.untracked.vstring('simOmtfDigis') 
0044        # debugModules = cms.untracked.vstring('*')
0045     )
0046 
0047 #process.MessageLogger.cerr.FwkReport.reportEvery = cms.untracked.int32(50)
0048 process.options = cms.untracked.PSet(wantSummary=cms.untracked.bool(False),
0049                                          # SkipEvent = cms.untracked.vstring('ProductNotFound') 
0050                                      )
0051 
0052 process.source = cms.Source('PoolSource',
0053  #fileNames = cms.untracked.vstring('file:/afs/cern.ch/work/g/gflouris/public/SingleMuPt6180_noanti_10k_eta1.root')
0054  #fileNames = cms.untracked.vstring('file:///afs/cern.ch/work/k/kbunkow/private/omtf_data/SingleMu_15_p_1_1_qtl.root')    
0055  #fileNames = cms.untracked.vstring('file:///eos/user/k/kbunkow/cms_data/mc/PhaseIIFall17D/SingleMu_PU200_32DF01CC-A342-E811-9FE7-48D539F3863E_dump500Events.root')
0056 # fileNames = cms.untracked.vstring("file:///eos/user/k/kbunkow/cms_data/mc/PhaseIITDRSpring19DR/PhaseIITDRSpring19DR_Mu_FlatPt2to100_noPU_v31_E0D5C6A5-B855-D14F-9124-0B2C9B28D0EA_dump4000Ev.root")
0057  fileNames = cms.untracked.vstring(
0058      #'/store/express/Commissioning2021/ExpressCosmics/FEVT/Express-v1/000/342/094/00000/038c179a-d2ce-45f0-a7d5-8b2d40017042.root',
0059      #'/store/express/Commissioning2021/ExpressCosmics/FEVT/Express-v1/000/344/566/00000/19ef107a-4cd9-4df0-ba93-dbfbab8df1cb.root',
0060      
0061      #'/store/express/Commissioning2021/ExpressCosmics/FEVT/Express-v1/000/342/094/00000/038c179a-d2ce-45f0-a7d5-8b2d40017042.root', # only DT, fw 0x0008
0062      '/store/express/Commissioning2021/ExpressCosmics/FEVT/Express-v1/000/344/266/00000/db2cfbdd-5edf-4ee4-aab0-5bdba105728d.root' #DT and RPC fw 0x0008
0063      #'/store/express/Commissioning2021/ExpressCosmics/FEVT/Express-v1/000/344/566/00000/19ef107a-4cd9-4df0-ba93-dbfbab8df1cb.root'  
0064      #'/store/express/Commissioning2021/ExpressCosmics/FEVT/Express-v1/000/347/053/00000/7b486245-96ea-4b7c-9fe7-76c957968785.root'  #RPC noise only
0065      ),             
0066  )
0067                         
0068 process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(1000))
0069 
0070 # import of standard configurations
0071 process.load('Configuration.StandardSequences.Services_cff')
0072 process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi')
0073 process.load('Configuration.Geometry.GeometryExtended2017Reco_cff')
0074 process.load('Configuration.StandardSequences.MagneticField_AutoFromDBCurrent_cff')
0075 process.load('Configuration.StandardSequences.EndOfProcess_cff')
0076 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
0077 
0078 #process.load('Configuration.StandardSequences.RawToDigi_Data_cff')
0079 #process.load('EventFilter.L1TRawToDigi.omtfStage2Digis_cfi') #unpacker
0080 
0081 #process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
0082 from Configuration.AlCa.GlobalTag import GlobalTag
0083 process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:run2_data', '')
0084 #process.GlobalTag = GlobalTag(process.GlobalTag, '113X_dataRun3_Prompt_v3', '')
0085 #process.GlobalTag = GlobalTag(process.GlobalTag, '102X_upgrade2018_realistic_v16', '')
0086  
0087 
0088 
0089 if loadConfigFrom_fakeOmtfParams :
0090     ####Event Setup Producer
0091     process.load('L1Trigger.L1TMuonOverlapPhase1.fakeOmtfParams_cff')
0092     #process.omtfParams.configXMLFile =  cms.FileInPath("L1Trigger/L1TMuon/data/omtf_config/hwToLogicLayer_0x0008.xml")
0093     
0094     process.esProd = cms.EDAnalyzer("EventSetupRecordDataGetter",
0095        toGet = cms.VPSet(
0096           cms.PSet(record = cms.string('L1TMuonOverlapParamsRcd'),
0097                    data = cms.vstring('L1TMuonOverlapParams'))
0098                        ),
0099        verbose = cms.untracked.bool(False)
0100     )
0101 
0102 
0103 if loadConfigFrom_sqlite_file :
0104     process.load("CondCore.CondDB.CondDB_cfi")
0105     
0106     process.CondDB.connect = "sqlite_file:Patterns.db"
0107     #process.CondDB.connect = "sqlite_file:l1config.db"
0108     
0109     process.CondDB.DBParameters.messageLevel = 3
0110     
0111     process.PoolDBESSourceSqlite = cms.ESSource("PoolDBESSource",
0112       process.CondDB,
0113       toGet = cms.VPSet( 
0114                         cms.PSet(
0115                           record = cms.string('L1TMuonOverlapParamsRcd'),
0116                           tag = cms.string('params') #check the tag name int the DB: sqlite3 l1config.db  ; select * from TAG;
0117                           )
0118        ),
0119       verbose = cms.untracked.bool(False)
0120     )
0121     
0122     process.es_prefer_EcalTBWeights = cms.ESPrefer("PoolDBESSource", "PoolDBESSourceSqlite")
0123 
0124 #process.TFileService = cms.Service("TFileService", fileName = cms.string('omtfAnalysis1.root'), closeFileFast = cms.untracked.bool(True) )
0125                         
0126                         
0127 process.load('Configuration.StandardSequences.RawToDigi_Data_cff')
0128 process.load('EventFilter.L1TRawToDigi.omtfStage2Digis_cfi') #unpacker
0129 
0130         
0131 ####OMTF Emulator
0132 process.load('L1Trigger.L1TMuonOverlapPhase1.simOmtfDigis_cfi')
0133 
0134 process.simOmtfDigis.srcDTPh = cms.InputTag('omtfStage2Digis')
0135 process.simOmtfDigis.srcDTTh = cms.InputTag('omtfStage2Digis')
0136 process.simOmtfDigis.srcCSC = cms.InputTag('omtfStage2Digis')
0137 process.simOmtfDigis.srcRPC = cms.InputTag('omtfStage2Digis')
0138 
0139 process.simOmtfDigis.bxMin = cms.int32(0)
0140 process.simOmtfDigis.bxMax = cms.int32(0)
0141 
0142 process.simOmtfDigis.dumpResultToXML = cms.bool(False)
0143 process.simOmtfDigis.dumpResultToROOT = cms.bool(False)
0144 process.simOmtfDigis.eventCaptureDebug = cms.bool(True)
0145 
0146 
0147 #!!!!!!!!!!!!!!!!!!!!! all possible algorithm configuration parameters, if it is commented, then a defoult value is used
0148 #below is the configuration used for runnig from the autumn of the 2018
0149 
0150 #process.simOmtfDigis.sorterType = cms.string("byLLH")
0151 # process.simOmtfDigis.ghostBusterType = cms.string("GhostBusterPreferRefDt")
0152 #
0153 # process.simOmtfDigis.minDtPhiQuality = cms.int32(2)
0154 # process.simOmtfDigis.minDtPhiBQuality = cms.int32(2)
0155 #
0156 # process.simOmtfDigis.rpcMaxClusterSize = cms.int32(3)
0157 # process.simOmtfDigis.rpcMaxClusterCnt = cms.int32(2)
0158 # process.simOmtfDigis.rpcDropAllClustersIfMoreThanMax = cms.bool(False)
0159 #
0160 # process.simOmtfDigis.goldenPatternResultFinalizeFunction = cms.int32(0) #valid values are 0, 1, 2, 3, 5, 6, but for other then 0 the candidates quality assignemnt must be updated
0161 #
0162 # process.simOmtfDigis.noHitValueInPdf = cms.bool(False)
0163 
0164 process.simOmtfDigis.lctCentralBx = cms.int32(8);#<<<<<<<<<<<<<<<<!!!!!!!!!!!!!!!!!!!!TODO this was changed in CMSSW 10(?) to 8. if the data were generated with the previous CMSSW then you have to use 6
0165 
0166 
0167 
0168 
0169 process.dumpED = cms.EDAnalyzer("EventContentAnalyzer")
0170 process.dumpES = cms.EDAnalyzer("PrintEventSetupContent")
0171 
0172 if loadConfigFrom_fakeOmtfParams :
0173     process.L1TMuonSeq = cms.Sequence(  process.esProd    +      
0174                                     process.omtfStage2Digis + process.simOmtfDigis 
0175                                    #+ process.dumpED
0176                                    #+ process.dumpES
0177                                    )
0178 else :
0179     process.L1TMuonSeq = cms.Sequence(     
0180                                     process.omtfStage2Digis + process.simOmtfDigis 
0181                                    #+ process.dumpED
0182                                    #+ process.dumpES
0183                                    )
0184 
0185 process.L1TMuonPath = cms.Path(process.L1TMuonSeq)
0186 
0187 process.out = cms.OutputModule("PoolOutputModule", 
0188    fileName = cms.untracked.string("l1tomtf_superprimitives1.root")
0189 )
0190 
0191 #process.output_step = cms.EndPath(process.out)
0192 #process.schedule = cms.Schedule(process.L1TMuonPath)
0193 #process.schedule.extend([process.output_step])