Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:11:03

0001 from __future__ import print_function
0002 import FWCore.ParameterSet.Config as cms
0003 
0004 Mode = str("ZS")    # Options: "ZS", "VR", "PR", "FK"
0005 Write = bool(False) # Write output to disk
0006 
0007 process = cms.Process("DigiToRawToDigi")
0008 
0009 # ---- Data source ----
0010 process.source = cms.Source(
0011    "PoolSource",
0012    fileNames = cms.untracked.vstring(
0013    '/store/relval/CMSSW_3_5_2/RelValQCD_Pt_80_120/GEN-SIM-DIGI-RAW-HLTDEBUG/MC_3XY_V21-v1/0015/FA48FEA0-191E-DF11-9B68-003048679076.root'
0014     )
0015    )
0016 
0017 # ---- Services ----
0018 process.load("DQM.SiStripCommon.MessageLogger_cfi")
0019 process.MessageLogger.debugModules = cms.untracked.vstring()
0020 process.Timing = cms.Service("Timing")
0021 process.Tracer = cms.Service("Tracer")
0022 
0023 # ---- Conditions ----
0024 process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
0025 process.GlobalTag.globaltag = "MC_3XY_V21::All"
0026 
0027 # ---- DigiToRaw ----
0028 process.load("EventFilter.SiStripRawToDigi.SiStripDigiToRaw_cfi")
0029 process.SiStripDigiToRaw.InputDigis = cms.InputTag('simSiStripDigis', "ZeroSuppressed")
0030 
0031 # ---- RawToDigi ----
0032 from EventFilter.SiStripRawToDigi.SiStripDigis_cfi import *
0033 process.testSiStripDigis = siStripDigis.clone()
0034 process.testSiStripDigis.ProductLabel = 'SiStripDigiToRaw'
0035 
0036 # ---- Validation ----
0037 process.load('EventFilter.SiStripRawToDigi.test.SiStripDigiValidator_cfi')
0038 process.DigiValidator.TagCollection1 = "simSiStripDigis:ZeroSuppressed"
0039 process.DigiValidator.TagCollection2 = "testSiStripDigis:ZeroSuppressed"
0040 
0041 # ----- FedReadoutMode -----
0042 if Mode == str("ZS") :
0043     process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(1000) )
0044     process.SiStripDigiToRaw.FedReadoutMode = cms.string('ZERO_SUPPRESSED')
0045     process.SiStripDigiToRaw.PacketCode = cms.string('ZERO_SUPPRESSED')
0046 elif Mode == str("VR") :
0047     process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(10) )
0048     process.SiStripDigiToRaw.FedReadoutMode = cms.string('VIRGIN_RAW')
0049     process.SiStripDigiToRaw.PacketCode = cms.string('VIRGIN_RAW')
0050     process.DigiValidator.TagCollection2 = "testSiStripDigis:VirginRaw"
0051     process.DigiValidator.RawCollection2 = True
0052 elif Mode == str("PR") :
0053     process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(10) )
0054     process.SiStripDigiToRaw.FedReadoutMode = cms.string('PROCESSED_RAW')
0055     process.SiStripDigiToRaw.PacketCode = cms.string('PROCESSED_RAW')
0056     process.DigiValidator.TagCollection2 = "testSiStripDigis:ProcessedRaw"
0057     process.DigiValidator.RawCollection2 = True
0058 else :
0059     print("UNKNOWN FED READOUT MODE!")
0060     import sys
0061     sys.exit()
0062 
0063 # ---- Sequence ----
0064 process.p = cms.Path(
0065     process.SiStripDigiToRaw *
0066     process.testSiStripDigis *
0067     process.DigiValidator
0068     )
0069 
0070 # ----- WriteToDisk -----
0071 process.output = cms.OutputModule(
0072     "PoolOutputModule",
0073     fileName = cms.untracked.string('output.root'),
0074     outputCommands = cms.untracked.vstring(
0075     'drop *',
0076     'keep SiStrip*_simSiStripDigis_*_*', # (to drop SimLinks)
0077     'keep *_*_*_DigiToRawToDigi'
0078     )
0079     )
0080 process.output.fileName = "DigiToRawToDigi"+Mode+".root"
0081 if Write == bool(True) :
0082     process.e = cms.EndPath( process.output )
0083 else :
0084     print("Event content not written to disk!") 
0085