Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-03-08 02:27:15

0001 from __future__ import print_function
0002 import FWCore.ParameterSet.Config as cms
0003 import sys
0004 
0005 from Configuration.Eras.Era_Run3_cff import Run3
0006 process = cms.Process("CASTORDQM", Run3)
0007 
0008 unitTest=False
0009 if 'unitTest=True' in sys.argv:
0010     unitTest=True
0011 
0012 #=================================
0013 # Event Source
0014 #================================+
0015 
0016 if unitTest:
0017     process.load("DQM.Integration.config.unittestinputsource_cfi")
0018     from DQM.Integration.config.unittestinputsource_cfi import options
0019 else:
0020     # for live online DQM in P5
0021     process.load("DQM.Integration.config.inputsource_cfi")
0022     from DQM.Integration.config.inputsource_cfi import options
0023 
0024 # for testing in lxplus
0025 #process.load("DQM.Integration.config.fileinputsource_cfi")
0026 #from DQM.Integration.config.fileinputsource_cfi import options
0027 
0028 #================================
0029 # DQM Environment
0030 #================================
0031 
0032 process.load("Configuration.StandardSequences.GeometryRecoDB_cff")
0033 
0034 process.load("DQM.Integration.config.environment_cfi")
0035 process.dqmEnv.subSystemFolder = "Castor"
0036 process.dqmSaver.tag = "Castor"
0037 process.dqmSaver.runNumber = options.runNumber
0038 process.dqmSaverPB.tag = "Castor"
0039 process.dqmSaverPB.runNumber = options.runNumber
0040 
0041 process.load("FWCore.MessageLogger.MessageLogger_cfi")
0042 
0043 #process.source = cms.Source("PoolSource",
0044 #                            fileNames = cms.untracked.vstring(
0045 #'file:/eos/user/p/popov/rundata/Castor2018/525D2460-6A90-E811-RAWrun320317.root'),
0046 #                            )
0047 
0048 #============================================
0049 # Castor Conditions: from Global Conditions Tag 
0050 #============================================
0051 process.load("DQM.Integration.config.FrontierCondition_GT_cfi")
0052 ##
0053 #from Configuration.AlCa.GlobalTag import GlobalTag as gtCustomise
0054 #process.GlobalTag = gtCustomise(process.GlobalTag, 'auto:run2_data', '')
0055 
0056 #-----------------------------
0057 # Castor DQM Source + SimpleReconstrctor
0058 #-----------------------------
0059 ###process.load("RecoLocalCalo.CastorReco.CastorSimpleReconstructor_cfi")
0060 process.castorreco = cms.EDProducer("CastorSimpleReconstructor",
0061                                     correctionPhaseNS = cms.double(0.0),
0062                                     digiLabel = cms.InputTag("castorDigis"),
0063                                     samplesToAdd = cms.int32(10),
0064                                     Subdetector = cms.string('CASTOR'),
0065                                     firstSample = cms.int32(0),
0066                                     correctForPhaseContainment = cms.bool(False),
0067                                     correctForTimeslew = cms.bool(False),
0068                                     tsFromDB = cms.bool(False), #True
0069                                     setSaturationFlag = cms.bool(True),
0070                                     maxADCvalue = cms.int32(127),
0071                                     doSaturationCorr = cms.bool(False) #True
0072 )
0073 ###process.castorreco.tsFromDB = cms.untracked.bool(False)
0074 process.load('RecoLocalCalo.Castor.Castor_cff') #castor tower and jet reconstruction
0075 
0076 from EventFilter.CastorRawToDigi.CastorRawToDigi_cff import *
0077 process.castorDigis = castorDigis.clone()
0078 
0079 from DQMServices.Core.DQMEDAnalyzer import DQMEDAnalyzer
0080 process.castorMonitor = DQMEDAnalyzer("CastorMonitorModule",
0081    ### GLOBAL VARIABLES
0082    debug = cms.untracked.int32(0), #(=0 - no messages)
0083    # Turn on/off timing diagnostic
0084    showTiming          = cms.untracked.bool(False),
0085    # Define Labels
0086    l1tStage2uGtSource = cms.InputTag("gtStage2Digis"),
0087    tagTriggerResults   = cms.InputTag('TriggerResults','','HLT'),
0088    HltPaths  = cms.vstring("HLT_ZeroBias","HLT_Random"),
0089    digiLabel            = cms.InputTag("castorDigis"),
0090    rawLabel             = cms.InputTag("rawDataCollector"),
0091    unpackerReportLabel  = cms.InputTag("castorDigis"),
0092    CastorRecHitLabel    = cms.InputTag("castorreco"),
0093    CastorTowerLabel     = cms.InputTag("CastorTowerReco"),
0094    CastorBasicJetsLabel = cms.InputTag("ak7CastorJets"),
0095    CastorJetIDLabel     = cms.InputTag("ak7CastorJetID"),
0096    DataIntMonitor= cms.untracked.bool(True),
0097    TowerJetMonitor= cms.untracked.bool(True),
0098    DigiMonitor = cms.untracked.bool(True),
0099    RecHitMonitor = cms.untracked.bool(True),
0100 #  LEDMonitor = cms.untracked.bool(True),
0101 #  LEDPerChannel = cms.untracked.bool(True),
0102    FirstSignalBin = cms.untracked.int32(0),
0103    LastSignalBin = cms.untracked.int32(9)
0104 )
0105 
0106 #-----------------------------
0107 # Scheduling
0108 #-----------------------------
0109 process.options = cms.untracked.PSet(
0110     Rethrow = cms.untracked.vstring('ProductNotFound', 
0111         'TooManyProducts', 
0112         'TooFewProducts')
0113 )
0114 
0115 # castorDigis   -> CastorRawToDigi_cfi
0116 # castorreco    -> CastorSimpleReconstructor_cfi
0117 # castorMonitor -> CastorMonitorModule_cfi
0118 
0119 process.p = cms.Path(process.castorDigis*process.castorreco*process.castorMonitor*process.dqmEnv*process.dqmSaver*process.dqmSaverPB)
0120 #process.p = cms.Path(process.castorDigis*process.castorMonitor*process.dqmEnv*process.dqmSaver*process.dqmSaverPB)
0121 #process.p = cms.Path(process.castorMonitor*process.dqmEnv*process.dqmSaver*process.dqmSaverPB)
0122 
0123 
0124 process.castorDigis.InputLabel = "rawDataCollector"
0125 process.castorMonitor.rawLabel = "rawDataCollector"
0126     
0127 #--------------------------------------------------
0128 # Heavy Ion Specific Fed Raw Data Collection Label
0129 #--------------------------------------------------
0130 
0131 print("Running with run type = ", process.runType.getRunTypeName())
0132 
0133 if (process.runType.getRunType() == process.runType.hi_run):
0134     process.castorDigis.InputLabel = "rawDataRepacker"
0135     process.castorMonitor.rawLabel = "rawDataRepacker"
0136 
0137 
0138 ### process customizations included here
0139 from DQM.Integration.config.online_customizations_cfi import *
0140 print("Final Source settings:", process.source)
0141 process = customise(process)
0142 
0143