Instructions for validating L1 subsystem O2O code

The instructions below assume you are using CondTools/L1Trigger from a central release area. If you have a locally compiled version of CondTools/L1Trigger, replace CMSSW_RELEASE_BASE and CMSSW_BASE.

Set up authentication.xml

In the directory where you run cmsRun, make a file called authentication.xml containing these lines:
<?xml version="1.0" ?>
<connectionlist>
<connection name="oracle://CMS_OMDS_LB/CMS_TRG_R">
  <parameter name="user" value="CMS_TRG_R" />
  <parameter name="password" value="TRG_R_password" />
</connection>
</connectionlist>
with TRG_R_password replaced by the real password.

A copy of this file (without the real password) is in CondTools/L1Trigger/test/authentication.xml.

Set up TNS_ADMIN environment variable

unix> export TNS_ADMIN=/nfshome0/popcondev/conddb
This command must be issued after "eval `scramv1 run -sh`" because the eval resets TNS_ADMIN.

Prepare sqlite file

unix> $CMSSW_RELEASE_BASE/src/CondTools/L1Trigger/test/bootstrap.com -l
unix> cmsRun $CMSSW_RELEASE_BASE/src/CondTools/L1Trigger/test/init_cfg.py

A sqlite file called l1config.db will be created, and the screen output should look something like this:

[l1emulator@srv-C2C05-15 o2o]$ cmsRun $CMSSW_BASE/src/CondTools/L1Trigger/test/init_cfg.py
%MSG-i EventSetupDependency:  AfterSource 12-Feb-2011 22:37:55 CET BeforeEvents
The EventSetup record L1TriggerKeyRcd depends on at least one Record 
 (L1TriggerKeyListRcd) which is not present in the job.
 This may lead to an exception begin thrown during event processing.
 If no exception occurs during the job than it is usually safe to ignore this message.
%MSG
Begin processing the 1st record. Run 1, Event 1, LumiSection 1 at 12-Feb-2011 22:37:55.063 CET
Begin processing the 1st record. Run 1, Event 1, LumiSection 1 at 12-Feb-2011 22:37:55.063 CET
Object key for L1TriggerKeyRcd@L1TriggerKey:  
L1TriggerKeyRcd@L1TriggerKey PAYLOAD TOKEN [DB=00000000-0000-0000-0000-000000000000][CNT=L1TriggerKey][CLID=78B8EAD8-668E-8B72-656A-8D5FE8CEBA51][TECH=00000B01][OID=00000000-00000000]
L1TriggerKeyListRcd PAYLOAD TOKEN [DB=00000000-0000-0000-0000-000000000000][CNT=L1TriggerKeyList][CLID=BA3DE86D-0161-F189-234D-7A8EA8C18A8F][TECH=00000B01][OID=00000001-00000000]
L1TriggerKeyListRcd SINCE 1

Run CMSSW job

Two choices below: use either a prepackaged script or write your own.

Write payload and IOV to sqlite file

This recipe only tests whether the payload for a given object key can be read from OMDS and written to an sqlite file. It does not test writing to an Oracle database, nor does it test emulator performance with the new object.

These scripts are available in CondTools/L1Trigger V03-32-02 and later tags. Here is an example using the L1RCTChannelMask object.

cmsRun $CMSSW_RELEASE_BASE/src/CondTools/L1Trigger/test/L1ConfigWriteSinglePayload_cfg.py objectKey=Full_RCT20090808180437057000 objectType=L1RCTChannelMask recordName=L1RCTChannelMaskRcd genFromOMDS=1
cmsRun $CMSSW_RELEASE_BASE/src/CondTools/L1Trigger/test/L1ConfigWriteSingleIOV_cfg.py objectKey=Full_RCT20090808180437057000 objectType=L1RCTChannelMask recordName=L1RCTChannelMaskRcd tagName=L1RCTChannelMask

Successful writing should look something like this:

[l1emulator@srv-C2C05-15 o2o]$ cmsRun $CMSSW_BASE/src/CondTools/L1Trigger/test/L1ConfigWriteSinglePayload_cfg.py objectKey=Full_RCT20090808180437057000 objectType=L1RCTChannelMask recordName=L1RCTChannelMaskRcd genFromOMDS=1
%MSG-i EventSetupDependency:  AfterSource 12-Feb-2011 22:38:07 CET BeforeEvents
The EventSetup record L1GctJetFinderParamsRcd depends on at least one Record 
 (L1CaloGeometryRecord) which is not present in the job.
 This may lead to an exception begin thrown during event processing.
 If no exception occurs during the job than it is usually safe to ignore this message.
%MSG
%MSG-i EventSetupDependency:  AfterSource 12-Feb-2011 22:38:07 CET BeforeEvents
The EventSetup record L1GtTriggerMenuRcd depends on at least one Record 
 (L1GtStableParametersRcd) which is not present in the job.
 This may lead to an exception begin thrown during event processing.
 If no exception occurs during the job than it is usually safe to ignore this message.
%MSG
Begin processing the 1st record. Run 1, Event 1, LumiSection 1 at 12-Feb-2011 22:38:07.007 CET
Begin processing the 1st record. Run 1, Event 1, LumiSection 1 at 12-Feb-2011 22:38:07.007 CET
object key for L1RCTChannelMaskRcd@L1RCTChannelMask: Full_RCT20090808180437057000
 Current key is Full_RCT20090808180437057000
L1RCTChannelMaskRcd@L1RCTChannelMask PAYLOAD TOKEN [DB=00000000-0000-0000-0000-000000000000][CNT=L1RCTChannelMask][CLID=D3114EB3-BBD3-626A-A328-79BE39F1E852][TECH=00000B01][OID=00000003-00000000]
L1TriggerKeyListRcd PAYLOAD TOKEN [DB=00000000-0000-0000-0000-000000000000][CNT=L1TriggerKeyList][CLID=BA3DE86D-0161-F189-234D-7A8EA8C18A8F][TECH=00000B01][OID=00000001-00000001]
L1TriggerKeyListRcd SINCE 2

[l1emulator@srv-C2C05-15 o2o]$ cmsRun $CMSSW_BASE/src/CondTools/L1Trigger/test/L1ConfigWriteSingleIOV_cfg.py objectKey=Full_RCT20090808180437057000 objectType=L1RCTChannelMask recordName=L1RCTChannelMaskRcd tagName=L1RCTChannelMask
Begin processing the 1st record. Run 1000, Event 1, LumiSection 1 at 12-Feb-2011 22:38:46.957 CET
Begin processing the 1st record. Run 1000, Event 1, LumiSection 1 at 12-Feb-2011 22:38:46.957 CET
Object key for L1RCTChannelMaskRcd@L1RCTChannelMask: Full_RCT20090808180437057000
L1RCTChannelMaskRcd PAYLOAD TOKEN [DB=00000000-0000-0000-0000-000000000000][CNT=L1RCTChannelMask][CLID=D3114EB3-BBD3-626A-A328-79BE39F1E852][TECH=00000B01][OID=00000003-00000000]
L1RCTChannelMaskRcd SINCE 1

To use this sqlite file (l1config.db) in a subsequent CMSSW job, insert the following python snippet in your configuration file. No need to remove the Global Tag; it will be overridden by the sqlite file.

from CondCore.DBCommon.CondDBSetup_cfi import CondDBSetup
process.l1conddb = cms.ESSource("PoolDBESSource",
    CondDBSetup,
    connect = cms.string('sqlite_file:l1config.db'),
    toGet = cms.VPSet(cms.PSet(
    record = cms.string('L1RCTChannelMaskRcd'),
    tag = cms.string('L1RCTChannelMask_IDEAL')))
)
process.es_prefer_l1conddb = cms.ESPrefer("PoolDBESSource","l1conddb")

Custom configuration file

To write your own configuration file, follow the two steps below. Use this file to run your own EDAnalyzer or to test subsystem keys or TSC keys, instead of object keys.

The configuration file below generates C++ configuration objects from OMDS data, and these objects can be retrieved by a user-provided EDAnalyzer. For validation purposes, this EDAnalyzer should, at a minimum, retrieve the configuration objects from EventSetup and print out its contents (which should match the contents of OMDS).

Below, replace MYSUBSYSTEM with your subsystem name and MYOBJECT with your configuration object name. TSC objects should be handled separately from RS objects, in separate jobs.

The EventSetupRecordDataGetter below can be replaced by any analyzer that uses the MYOBJECT object from EventSetup, and the MYOBJECT will be constructed from the data in OMDS corresponding to the key provided by the user.

Part 1: basic skeleton

import FWCore.ParameterSet.Config as cms

process = cms.Process("L1ConfigWritePayloadDummy")
process.load("FWCore.MessageLogger.MessageLogger_cfi")
process.MessageLogger.cout.placeholder = cms.untracked.bool(False)
process.MessageLogger.cout.threshold = cms.untracked.string('INFO')
process.MessageLogger.debugModules = cms.untracked.vstring('*')


# Get configuration data from OMDS.  This is the subclass of L1ConfigOnlineProdBase.
process.load("L1TriggerConfig.MYSUBSYSTEMConfigProducers.MYOBJECTConfigOnline_cfi")

process.maxEvents = cms.untracked.PSet(
    input = cms.untracked.int32(1)
)
process.source = cms.Source("EmptySource")

from CondTools.L1Trigger.L1CondDBPayloadWriter_cff import initPayloadWriter
initPayloadWriter( process )

process.getter = cms.EDAnalyzer("EventSetupRecordDataGetter",
   toGet = cms.VPSet(cms.PSet(
   record = cms.string('MYOBJECTRcd'),
   data = cms.vstring('MYOBJECT')
   )),
   verbose = cms.untracked.bool(True)
)

process.p = cms.Path(process.getter)

Option to copy from CondDB
Instead of producing a new payload from OMDS configuration data, the online producer (subclass of L1ConfigOnlineProdBase) can copy an existing payload from the CondDB:
process.MYOBJECTConfigOnline.copyFromCondDB = cms.bool( True )
In this case, the online producer will use L1TriggerKeyList to retrieve the payload for a given object key (as specified in the current run's L1TriggerKey). If copyFromCondDB is True, then L1ConfigOnlineProdBase::newObject() will not be called.

Part 2: object key producers

One must also load ESProducers that deliver the object key. Choose one of the following three options:

For a known object key (MyObjectKey):
This is the only available option for Run Settings objects.
process.load("CondTools.L1Trigger.L1TriggerKeyDummy_cff")
process.L1TriggerKeyDummy.objectKeys = cms.VPSet(cms.PSet(
        record = cms.string('MYOBJECTRcd'),
        type = cms.string('MYOBJECT'),
        key = cms.string('MyObjectKey')
))

For a known subsystem key (MySubsystemKey):
process.load("CondTools.L1Trigger.L1TriggerKeyDummy_cff")
process.L1TriggerKeyDummy.objectKeys = cms.VPSet()
process.L1TriggerKeyDummy.label = cms.string('SubsystemKeysOnly')

# xxxKey = csctfKey, dttfKey, rpcKey, gmtKey, rctKey, gctKey, gtKey, or tsp0Key
process.L1TriggerKeyDummy.xxxKey = cms.string('MySubsystemKey')

# Subclass of L1ObjectKeysOnlineProdBase.
process.load("L1TriggerConfig.MYSUBSYSTEMConfigProducers.MYSUBSYSTEM_TSCObjectKeysOnline_cfi")
process.MYSUBSYSTEM_TSCObjectKeysOnline.subsystemLabel = cms.string('')

For a known TSC key (MyTSCKey):
process.load("CondTools.L1Trigger.L1SubsystemKeysOnline_cfi")
process.L1SubsystemKeysOnline.tscKey = cms.string( 'MyTSCKey' )

# Subclass of L1ObjectKeysOnlineProdBase.
process.load("L1TriggerConfig.MYSUBSYSTEMConfigProducers.MYSUBSYSTEM_TSCObjectKeysOnline_cfi")
process.MYSUBSYSTEM_TSCObjectKeysOnline.subsystemLabel = cms.string('')

-- WernerSun - 26 Feb 2009

Edit | Attach | Watch | Print version | History: r10 < r9 < r8 < r7 < r6 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r10 - 2013-11-01 - WernerSun
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    CMSPublic All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback