Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-11-27 03:17:54

0001 #
0002 # cfg file to pack (DigiToRaw) a GT DAQ record, unpack (RawToDigi) it back
0003 # and compare the two set of digis
0004 #
0005 # V M Ghete 2009-04-06
0006 
0007 import FWCore.ParameterSet.Config as cms
0008 
0009 # process
0010 process = cms.Process('TestGtPackUnpackAnalyzer')
0011 
0012 ###################### user choices ######################
0013 
0014 
0015 # choose the type of sample used (True for RelVal, False for data)
0016 useRelValSample = True 
0017 #useRelValSample=False 
0018 
0019 # actual GlobalTag must be appropriate for the sample use
0020 
0021 if useRelValSample == True :
0022     useGlobalTag = 'IDEAL_V12'
0023     #useGlobalTag='STARTUP_V9'
0024 else :
0025     useGlobalTag = 'CRAFT_ALL_V12'
0026 
0027 # change to True to use local files
0028 #     the type of file should match the choice of useRelValSample and useGlobalTag
0029 useLocalFiles = False 
0030 
0031 ###################### end user choices ###################
0032 
0033 
0034 # number of events to be processed and source file
0035 process.maxEvents = cms.untracked.PSet(
0036     input=cms.untracked.int32(10)
0037 )
0038 
0039 readFiles = cms.untracked.vstring()
0040 secFiles = cms.untracked.vstring() 
0041 process.source = cms.Source ('PoolSource', fileNames=readFiles, secondaryFileNames=secFiles)
0042 
0043 # type of sample used (True for RelVal, False for data)
0044 
0045 if useRelValSample == True :
0046     if useGlobalTag.count('IDEAL') :
0047 
0048         #/RelValTTbar/CMSSW_2_2_4_IDEAL_V11_v1/GEN-SIM-DIGI-RAW-HLTDEBUG
0049         dataset = cms.untracked.vstring('RelValTTbar_CMSSW_2_2_4_IDEAL_V11_v1')
0050         
0051         readFiles.extend([
0052             '/store/relval/CMSSW_2_2_4/RelValTTbar/GEN-SIM-DIGI-RAW-HLTDEBUG/IDEAL_V11_v1/0000/02697009-5CF3-DD11-A862-001D09F2423B.root',
0053             '/store/relval/CMSSW_2_2_4/RelValTTbar/GEN-SIM-DIGI-RAW-HLTDEBUG/IDEAL_V11_v1/0000/064657A8-59F3-DD11-ACA5-000423D991F0.root',
0054             '/store/relval/CMSSW_2_2_4/RelValTTbar/GEN-SIM-DIGI-RAW-HLTDEBUG/IDEAL_V11_v1/0000/0817F6DE-5BF3-DD11-880D-0019DB29C5FC.root',
0055             '/store/relval/CMSSW_2_2_4/RelValTTbar/GEN-SIM-DIGI-RAW-HLTDEBUG/IDEAL_V11_v1/0000/0899697C-5AF3-DD11-9D21-001617DBD472.root'
0056             ]);
0057 
0058 
0059         secFiles.extend([
0060             ])
0061 
0062     elif useGlobalTag.count('STARTUP') :
0063 
0064         #/RelValTTbar/CMSSW_2_2_4_STARTUP_V8_v1/GEN-SIM-DIGI-RAW-HLTDEBUG
0065         dataset = cms.untracked.vstring('RelValTTbar_CMSSW_2_2_4_STARTUP_V8_v1')
0066         
0067         readFiles.extend([
0068             '/store/relval/CMSSW_2_2_4/RelValTTbar/GEN-SIM-DIGI-RAW-HLTDEBUG/STARTUP_V8_v1/0000/069AA022-5BF3-DD11-9A56-001617E30D12.root',
0069             '/store/relval/CMSSW_2_2_4/RelValTTbar/GEN-SIM-DIGI-RAW-HLTDEBUG/STARTUP_V8_v1/0000/08DA99A6-5AF3-DD11-AAC1-001D09F24493.root',
0070             '/store/relval/CMSSW_2_2_4/RelValTTbar/GEN-SIM-DIGI-RAW-HLTDEBUG/STARTUP_V8_v1/0000/0A725E15-5BF3-DD11-8B4B-000423D99CEE.root',
0071             '/store/relval/CMSSW_2_2_4/RelValTTbar/GEN-SIM-DIGI-RAW-HLTDEBUG/STARTUP_V8_v1/0000/0AF5B676-5AF3-DD11-A22F-001617DBCF1E.root'
0072             ]);
0073 
0074 
0075         secFiles.extend([
0076             ])
0077     else :
0078         print('Error: Global Tag ', useGlobalTag, ' not defined.')    
0079 
0080 else : 
0081 
0082     # data
0083     dataset = '/Cosmics/Commissioning09-v1/RAW'
0084     print('   Running on set: '+ dataset)    
0085     
0086     readFiles.extend( [
0087        '/store/data/Commissioning09/Cosmics/RAW/v1/000/076/966/00BD9A1F-B908-DE11-8B2C-000423D94A04.root',
0088        '/store/data/Commissioning09/Cosmics/RAW/v1/000/076/966/025E8B48-B608-DE11-A0EE-00161757BF42.root',
0089        '/store/data/Commissioning09/Cosmics/RAW/v1/000/076/966/027AA271-D208-DE11-9A7F-001617DBD5AC.root',
0090        '/store/data/Commissioning09/Cosmics/RAW/v1/000/076/966/04281D2F-D108-DE11-9A27-000423D944DC.root',
0091        '/store/data/Commissioning09/Cosmics/RAW/v1/000/076/966/065B0C1C-C008-DE11-A32B-001617E30F48.root',
0092        '/store/data/Commissioning09/Cosmics/RAW/v1/000/076/966/08B1054B-BD08-DE11-AF8B-001617C3B78C.root',
0093        '/store/data/Commissioning09/Cosmics/RAW/v1/000/076/966/0C055C33-D108-DE11-B678-001617C3B73A.root',
0094        '/store/data/Commissioning09/Cosmics/RAW/v1/000/076/966/0E480977-D208-DE11-BA78-001617C3B6E2.root',
0095        '/store/data/Commissioning09/Cosmics/RAW/v1/000/076/966/0E79251B-B908-DE11-83FF-000423D99CEE.root',
0096        '/store/data/Commissioning09/Cosmics/RAW/v1/000/076/966/101B8CA0-B508-DE11-B614-000423D99160.root',
0097        '/store/data/Commissioning09/Cosmics/RAW/v1/000/076/966/12C62C71-BF08-DE11-A48C-000423D99614.root',
0098        '/store/data/Commissioning09/Cosmics/RAW/v1/000/076/966/16A77E08-B008-DE11-9121-000423D8F63C.root'
0099         ]);
0100 
0101     secFiles.extend([
0102         ])
0103 
0104 if useLocalFiles :
0105     readFiles = 'file:/afs/cern.ch/user/g/ghete/scratch0/CmsswTestFiles/testGt_PackUnpackAnalyzer_source.root.root'
0106 
0107 
0108 # load and configure modules via Global Tag
0109 # https://twiki.cern.ch/twiki/bin/view/CMS/SWGuideFrontierConditions
0110 
0111 process.load("Configuration.StandardSequences.GeometryDB_cff")
0112 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
0113 
0114 process.GlobalTag.globaltag = useGlobalTag
0115 
0116 # remove FakeConditions when GTag is OK
0117 process.load('L1Trigger.Configuration.L1Trigger_FakeConditions_cff')
0118 
0119 #
0120 # pack.......
0121 #
0122 
0123 process.load("EventFilter.L1GlobalTriggerRawToDigi.l1GtPack_cfi")
0124 
0125 # input tag for GT readout collection: 
0126 # input tag for GMT readout collection: 
0127 #     source        = hardware record
0128 
0129 if useRelValSample == True :
0130     daqGtInputTagPack = 'simGtDigis'
0131     muGmtInputTagPack = 'simGmtDigis'
0132 else :
0133     daqGtInputTagPack = 'l1GtUnpack'
0134     muGmtInputTagPack = 'l1GtUnpack'
0135 
0136 process.l1GtPack.DaqGtInputTag = daqGtInputTagPack
0137 process.l1GtPack.MuGmtInputTag = muGmtInputTagPack
0138 
0139 # mask for active boards (actually 16 bits)
0140 #      if bit is zero, the corresponding board will not be packed
0141 #      default: no board masked: ActiveBoardsMask = 0xFFFF
0142 
0143 # no board masked (default)
0144 #process.l1GtPack.ActiveBoardsMask = 0xFFFF
0145     
0146 # GTFE only in the record
0147 #process.l1GtPack.ActiveBoardsMask = 0x0000
0148 
0149 # GTFE + FDL 
0150 #process.l1GtPack.ActiveBoardsMask = 0x0001
0151      
0152 # GTFE + GMT 
0153 #process.l1GtPack.ActiveBoardsMask = 0x0100
0154 
0155 # GTFE + FDL + GMT 
0156 #process.l1GtPack.ActiveBoardsMask = 0x0101
0157 
0158 # set it to verbose
0159 process.l1GtPack.Verbosity = cms.untracked.int32(1)
0160 
0161 #
0162 # unpack.......
0163 #
0164 
0165 import EventFilter.L1GlobalTriggerRawToDigi.l1GtUnpack_cfi
0166 process.gtPackedUnpack = EventFilter.L1GlobalTriggerRawToDigi.l1GtUnpack_cfi.l1GtUnpack.clone()
0167 
0168 # input tag for GT and GMT readout collections in the packed data: 
0169 process.gtPackedUnpack.DaqGtInputTag = 'l1GtPack'
0170 
0171 # Active Boards Mask
0172 # no board masked (default)
0173 #process.gtPackedUnpack.ActiveBoardsMask = 0xFFFF
0174 
0175 # GTFE only in the record
0176 #process.gtPackedUnpack.ActiveBoardsMask = 0x0000
0177 
0178 # GTFE + FDL 
0179 #process.gtPackedUnpack.ActiveBoardsMask = 0x0001
0180 
0181 # GTFE + GMT 
0182 #process.gtPackedUnpack.ActiveBoardsMask = 0x0100
0183 
0184 # GTFE + FDL + GMT 
0185 #process.gtPackedUnpack.ActiveBoardsMask = 0x0101
0186 
0187 # BxInEvent to be unpacked
0188 
0189 # all available BxInEvent (default)
0190 #process.gtPackedUnpack.UnpackBxInEvent = -1 
0191 
0192 # BxInEvent = 0 (L1A)
0193 #process.gtPackedUnpack.UnpackBxInEvent = 1 
0194 
0195 # 3 BxInEvent (F, 0, 1)  
0196 #process.gtPackedUnpack.UnpackBxInEvent = 3 
0197 
0198 #
0199 # compare the initial and final digis .......
0200 #
0201 process.load("L1Trigger.GlobalTriggerAnalyzer.l1GtPackUnpackAnalyzer_cfi")
0202 
0203 # input tag for the initial GT DAQ record: must match the pack label
0204 # input tag for the initial GMT readout collection: must match the pack label 
0205 
0206 process.l1GtPackUnpackAnalyzer.InitialDaqGtInputTag = daqGtInputTagPack
0207 process.l1GtPackUnpackAnalyzer.InitialMuGmtInputTag = muGmtInputTagPack
0208 
0209 # input tag for the final GT DAQ and GMT records:  must match the unpack label 
0210 #     GT unpacker:  gtPackedUnpack (cloned unpacker from L1GtPackUnpackAnalyzer.cfg)
0211 #process.l1GtPackUnpackAnalyzer.FinalGtGmtInputTag = 'gtPackedUnpack'
0212 
0213 # path to be run
0214 if useRelValSample == True :
0215     process.p = cms.Path(process.l1GtPack*process.gtPackedUnpack*process.l1GtPackUnpackAnalyzer)
0216 else :
0217     process.p = cms.Path(process.l1GtPack*process.gtPackedUnpack*process.l1GtPackUnpackAnalyzer)
0218     # FIXME unpack first raw data
0219 
0220 # Message Logger
0221 process.load('FWCore.MessageService.MessageLogger_cfi')
0222 process.MessageLogger.debugModules = [ 'l1GtPack', 'l1GtUnpack', 'l1GtPackUnpackAnalyzer']
0223 process.MessageLogger.cerr.enable = False
0224 process.MessageLogger.files.L1GtPackUnpackAnalyzer = cms.untracked.PSet(
0225     threshold=cms.untracked.string('DEBUG'),
0226     #threshold = cms.untracked.string('INFO'),
0227     #threshold = cms.untracked.string('ERROR'),
0228     DEBUG=cms.untracked.PSet(
0229         limit=cms.untracked.int32(-1)
0230     ),
0231     INFO=cms.untracked.PSet(
0232         limit=cms.untracked.int32(-1)
0233     ),
0234     WARNING=cms.untracked.PSet(
0235         limit=cms.untracked.int32(-1)
0236     ),
0237     ERROR=cms.untracked.PSet(
0238         limit=cms.untracked.int32(-1)
0239     ),
0240     default = cms.untracked.PSet( 
0241         limit=cms.untracked.int32(-1)  
0242     )
0243 )
0244 
0245 # summary
0246 process.options = cms.untracked.PSet(
0247     wantSummary = cms.untracked.bool(True)
0248 )
0249 
0250 
0251 # output 
0252 process.outputL1GtPackUnpack = cms.OutputModule("PoolOutputModule",
0253     fileName = cms.untracked.string('L1GtPackUnpackAnalyzer.root'),
0254     # keep only emulated data, packed data, unpacked data in the ROOT file
0255     outputCommands = cms.untracked.vstring('drop *', 
0256         'keep *_simGtDigis_*_*', 
0257         'keep *_simGmtDigis_*_*', 
0258         'keep *_l1GtPack_*_*', 
0259         'keep *_l1GtPackedUnpack_*_*')
0260 )
0261 
0262 process.outpath = cms.EndPath(process.outputL1GtPackUnpack)