Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:02:44

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 minIov = 368023
0004 maxIov = 999999999
0005 subSystemName = "TotemT2"
0006 
0007 
0008 process = cms.Process('writeTotemDAQMappingMask')
0009 
0010 process.source = cms.Source("EmptyIOVSource",
0011     timetype = cms.string('runnumber'),
0012     firstValue = cms.uint64(minIov),
0013     lastValue = cms.uint64(minIov),
0014     interval = cms.uint64(1)
0015 )
0016 
0017 process.MessageLogger = cms.Service("MessageLogger",
0018   destinations = cms.untracked.vstring('cout'),
0019   cout = cms.untracked.PSet(
0020       threshold = cms.untracked.string('ERROR'),    
0021   )
0022 )
0023 
0024 # load a mapping from XML file, set dummy validity range
0025 process.load("CalibPPS.ESProducers.totemDAQMappingESSourceXML_cfi")
0026 process.totemDAQMappingESSourceXML.subSystem = subSystemName
0027 process.totemDAQMappingESSourceXML.sampicSubDetId = cms.uint32(7)
0028 process.totemDAQMappingESSourceXML.multipleChannelsPerPayload = True
0029 process.totemDAQMappingESSourceXML.configuration = cms.VPSet(
0030   cms.PSet(
0031     validityRange = cms.EventRange(f"{minIov}:min - {maxIov}:max"),
0032     mappingFileNames = cms.vstring('CondFormats/PPSObjects/xml/mapping_totem_nt2_2023_final.xml'),
0033     maskFileNames = cms.vstring(),
0034   )
0035 )
0036 
0037 #Database output service
0038 process.load("CondCore.CondDB.CondDB_cfi")
0039 process.CondDB.connect = "sqlite_file:CTPPSTotemT2_DAQMapping.db"
0040 process.PoolDBOutputService = cms.Service("PoolDBOutputService",
0041     process.CondDB,
0042     timetype = cms.untracked.string('runnumber'),
0043     toPut = cms.VPSet(
0044     cms.PSet(
0045         record = cms.string('TotemReadoutRcd'),
0046         tag = cms.string('DiamondDAQMapping'),
0047         label = cms.string(subSystemName)
0048     ),
0049     cms.PSet(
0050         record = cms.string('TotemAnalysisMaskRcd'),
0051         tag = cms.string('AnalysisMask'),
0052         label = cms.string(subSystemName)
0053     )
0054     
0055   )
0056 )
0057 
0058 # print the mapping and write it to DB
0059 process.writeCTPPSTotemDAQMappingMask = cms.EDAnalyzer("WriteCTPPSTotemDAQMappingMask",
0060     cms.PSet(
0061         daqMappingIov = cms.uint64(minIov),
0062         recordMap = cms.string('TotemReadoutRcd'),
0063         recordMask = cms.string('TotemAnalysisMaskRcd'),
0064         label = cms.string(subSystemName),
0065     )
0066 )
0067 
0068 process.content = cms.EDAnalyzer("EventContentAnalyzer") 
0069 
0070 process.path = cms.Path(
0071   process.writeCTPPSTotemDAQMappingMask
0072 )