Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:26:22

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("DigiToRawToClusters")
0008 
0009 # ---- Data source ----
0010 process.source = cms.Source(
0011    "PoolSource",
0012    fileNames = cms.untracked.vstring(
0013    '/store/relval/CMSSW_3_1_1/RelValQCD_FlatPt_15_3000/GEN-SIM-DIGI-RAW-HLTDEBUG/MC_31X_V2-v1/0002/ECAD7ED7-966B-DE11-B4FE-000423D99CEE.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(
0022     "Tracer",
0023     sourceSeed = cms.untracked.string("$$")
0024     )
0025 
0026 # ---- Conditions ----
0027 process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
0028 process.GlobalTag.globaltag = "MC_31X_V2::All"
0029 
0030 # ---- Region cabling ----
0031 process.load('Configuration.StandardSequences.Geometry_cff')
0032 process.load('Configuration.StandardSequences.MagneticField_cff')
0033 process.load('CalibTracker.SiStripESProducers.SiStripRegionConnectivity_cfi')
0034 
0035 # ---- Reference clusters ----
0036 from RecoLocalTracker.SiStripClusterizer.SiStripClusterizer_cfi import *
0037 process.referenceSiStripClusters = siStripClusters.clone()
0038 process.referenceSiStripClusters.DigiProducersList = cms.VInputTag(cms.InputTag('simSiStripDigis:ZeroSuppressed'))
0039 
0040 # ---- DigiToRaw ----
0041 process.load("EventFilter.SiStripRawToDigi.SiStripDigiToRaw_cfi")
0042 process.SiStripDigiToRaw.InputDigis = cms.InputTag('simSiStripDigis', 'ZeroSuppressed')
0043 
0044 # ---- RawToClusters ----
0045 process.load('EventFilter.SiStripRawToDigi.SiStripRawToClusters_cfi')
0046 process.SiStripRawToClustersFacility.ProductLabel = cms.InputTag("SiStripDigiToRaw")
0047 process.load('EventFilter.SiStripRawToDigi.SiStripRawToClustersRoI_cfi')
0048 process.SiStripRoI.SiStripLazyGetter = cms.InputTag("SiStripRawToClustersFacility")
0049 process.load('EventFilter.SiStripRawToDigi.test.SiStripClustersDSVBuilder_cfi')
0050 process.siStripClustersDSV.SiStripLazyGetter = cms.InputTag("SiStripRawToClustersFacility")
0051 process.siStripClustersDSV.SiStripRefGetter = cms.InputTag("SiStripRoI")
0052 process.siStripClustersDSV.DetSetVectorNew = True
0053 process.SiStripRawToClusters = cms.Sequence( process.SiStripRawToClustersFacility * process.SiStripRoI * process.siStripClustersDSV )
0054 
0055 # ---- Validation ----
0056 process.load('EventFilter.SiStripRawToDigi.test.SiStripClusterValidator_cfi')
0057 process.ValidateSiStripClusters.Collection1 = cms.untracked.InputTag("referenceSiStripClusters")
0058 process.ValidateSiStripClusters.Collection2 = cms.untracked.InputTag("siStripClustersDSV")
0059 process.ValidateSiStripClusters.DetSetVectorNew = True
0060 
0061 # ----- FedReadoutMode -----
0062 if Mode == str("ZS") :
0063     process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(1000) )
0064     process.SiStripDigiToRaw.FedReadoutMode = cms.string('ZERO_SUPPRESSED')
0065     process.SiStripDigiToRaw.PacketCode = cms.string('ZERO_SUPPRESSED')
0066 elif Mode == str("VR") :
0067     process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(10) )
0068     process.SiStripDigiToRaw.FedReadoutMode = cms.string('VIRGIN_RAW')
0069     process.SiStripDigiToRaw.PacketCode = cms.string('VIRGIN_RAW')
0070 elif Mode == str("PR") :
0071     process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(10) )
0072     process.SiStripDigiToRaw.FedReadoutMode = cms.string('PROCESSED_RAW')
0073     process.SiStripDigiToRaw.PacketCode = cms.string('PROCESSED_RAW')
0074 else :
0075     print("UNKNOWN FED READOUT MODE!")
0076     import sys
0077     sys.exit()
0078 
0079 # ---- Sequence ----
0080 process.p = cms.Path(
0081     process.referenceSiStripClusters *
0082     process.SiStripDigiToRaw *
0083     process.SiStripRawToClusters *
0084     process.ValidateSiStripClusters
0085     )
0086 
0087 # ----- WriteToDisk -----
0088 process.output = cms.OutputModule(
0089     "PoolOutputModule",
0090     fileName = cms.untracked.string('output.root'),
0091     outputCommands = cms.untracked.vstring(
0092     'drop *',
0093     'keep SiStrip*_simSiStripDigis_*_*', # (to drop SimLinks)
0094     'keep *_*_*_DigiToRawToClusters'
0095     )
0096     )
0097 process.output.fileName = "DigiToRawToClusters"+Mode+".root"
0098 if Write == bool(True) :
0099     process.e = cms.EndPath( process.output )
0100 else :
0101     print("Event content not written to disk!") 
0102