TWiki> LHCb Web>LHCbTCK>PrivateTCK (revision 9)EditAttachPDF

How to create HLT Trigger Configuration Keys

Creating split HLT1 and HLT2 TCKs for 2016

Producing a dataset with at least one accepted event per HLT line

This step is not normally needed, as the existing dataset should be sufficient. Please consult with one of the HLT experts if in doubt. There is a script in Hlt/HltPiquetScripts which does this. scripts/Moore_Hlt1Hlt2_MakeDataForTCK_Parallel.py This script runs Moore with a configurable number of parallel processes. It keeps track of which lines have fired, and only writes out an accepted event if it is the first time for any of the lines. It is slightly more efficient though, since it doesn't actually require that the line fires -- only that the next to last algorithm has been executed. First step is to make sure that we have suitable input data. The process is most efficient if we start from a mix of raw data from the different streams. E.g,.

nsls /castor/cern.ch/grid/lhcb/data/2015/RAW/TURCAL/LHCb/COLLISION15/164699/ | head -n 5
Then copy the data to /scratch/hlt/make_tcks on the online system. From the online system do
getpack Hlt/HltPiquetScripts
You probably want to do this in a screen session:
lb-run Moore v25r1 python Hlt/HltPiquetScripts/scripts/Moore_Hlt1Hlt2_MakeDataForTCKs_Parallel.py 2>&1 | tee log
There will be an .mdf and .log file for each Moore process, and they will be filled in real time.

Creating and testing the split TCKs from the above dataset

First, create the Moore environment. If you need to check out versions of packages that are different from the Moore release, then you will need to do an lb-dev. The following is an example with Moore v25r2. If you don't need any package updates, then you could replace all "./run" with "lb-run Moore v25r2"

lb-dev Moore v25r2
cd MooreDev_v25r2
# getpack XYZ if needed
make purge
make -j 8 install
The scripts to create and test the Hlt TCKs live in the Hlt/Moore package under tests/options/TCK/ You can see them e.g. with
./run ls '$MOOREROOT/tests/options/TCK'
You will need to edit these scripts, so copy them locally
cp `./run echo '$MOOREROOT'`/tests/options/TCK/* .  ## for some reason I can't just do ./run cp '$MOOREROOT/tests/options/TCK/*' .
The first step is to create the HLT configuration using CreateTCK1.py. You need to make sure that the script points at the correct input data
IOHelper('MDF').inputFiles(['mdf:root://eoslhcb.cern.ch//eos/lhcb/wg/HLT/2016CommissioningDatasets/OneAcceptedPerLine_v2\
5r1_Physics_pp_May2016_190416/Moore%02d.mdf' %i for i in range(0,15)]) 
Also pay particular attention to Moore().ThresholdSettings, Moore().ConfigLabel and the L0TCK. Now you should be ready to run
./run gaudirun.py CreateTCK1.py 2>&1 | tee CreateTCK1.log

Creating a private TCK

To keep this tutorial simple and complete a separate config.tar file is used to store the private TCK, but the same steps apply when using config.tar from the TCK/HltTCK package.

The first thing which needs to be done is to ensure that a ThresholdSettings is available which contains all of the required features. This will generally involve getpacking Hlt/HltSettings, Hlt/Hlt{1,2}Lines and sometimes other packages and making the required changes. This is assumed to be completed and the settings are assumed to be named PrivateThresholdSettings.

Setting up the environment

Start by setting up the cmt environment for Moore and creating an empty file in which the TCK(s) will be stored; this needs to be done only once. A template script to use is attached as https://twiki.cern.ch/twiki/pub/LHCb/PrivateTCK/CreateTCK.py.txt; save it somewhere and modify it to suit the input MC DST you want to use. Make sure that the database tags and datatype are correct.
$> SetupProject --build-env Moore v24r0
$> cd $User_release_area/Moore_v24r0
$> mkdir TCKData
$> cp /path/to/CreateTCK.py.txt CreateTCK.py

Make sure that the TCKData property in the script points to the directory you just created.

Create the TCK

Logout and log back in (or create a new shell), make sure that the modified threshold settings and other packages which contain the changes you require are properly installed and run the script.
$> SetupProject Moore v24r0
$> cd $User_release_area/Moore_v24r0
$> gaudirun.py CreateTCK.py

You should now have the TCK dumped in a config.cdb file in the TCKData directory. If something goes wrong, delete the TCKData directory, make it again, fix the problem and run again.

Mapping the configuration to a TCK.

The following steps require the use of TCKsh; you can stay in the same shell.

To prevent possible confusion and errors, It is vital that you select a unique and unused TCK for your configuration. To see which TCKs are already in use, start TCKsh and look at the configurations. Search for the latest Moore version and find the highest TCK.

$> TCKsh
>>> listConfigurations()
>>> quit()

Once you have found a suitable TCK, it is time to map your configuration to it. Below 0x00900032 is used.

$> TCKsh
>>> cas_rw = ConfigAccessSvc( Mode = 'ReadWrite', File='/path/to/config.cdb' )
>>> printConfigurations( getConfigurations( cas = cas_rw ) )
starting appMgr @ pid = 720
MOORE_v12r7
    Physics_May2011
          <NONE> : 24e17751af7447fed73ec35b108218b6 : Test TCK
>>> id = '24e17751af7447fed73ec35b108218b6'
>>> createTCKEntries( { 0x00900032 : id }, cas = cas_rw )
creating mapping TCK: 0x00900032 -> ID: 24e17751af7447fed73ec35b108218b6
>>> quit()

The private TCK 0x00900032 is now created and stored in your own config.tar

Modifying a private TCK.

Instead of creating a new TCK from scratch, it can be easier, safer and faster to create a new TCK by modifying an existing one. This is described on the HLTTCK page.

Creating a DST using a private TCK

Once the private TCK has been generated, Moore needs to be run on the input DST using the private TCK.

The following lines insure the available TCKs are read from your private file:

from Configurables import ConfigCDBAccessSvc
ConfigCDBAccessSvc().File = 'config.cdb'
Moore().TCKData='/path/to/TCKData'

A template script is attached as https://twiki.cern.ch/twiki/pub/LHCb/PrivateTCK/runMoore_CreateDST.py.txt; save it somewhere.

$> SetupProject Moore v12r7
$> cd $User_release_area/Moore_v12r7/scripts
$> cp runMoore_CreateDST.py.txt runMoore_CreateDST.py
$> gaudirun.py runMoore_CreateDST.py

Running DaVinci on your DST with private TCK

Once the DST has been created, DaVinci can be run on it, but it needs to be told where to find the private TCK. This is done by adding the following options to the script:
from Configurables import ConfigAccessSvc
ConfigAccessSvc().File = '/path/to/your/config.tar'

-- RoelAaij - 04-Jul-2011

Topic attachments
I Attachment History Action Size Date Who CommentSorted ascending
Texttxt CreateTCK.py.txt r1 manage 0.6 K 2015-07-31 - 14:04 MatthewKenzie  
Texttxt runMoore_CreateTCK.py.txt r3 r2 r1 manage 0.8 K 2014-10-30 - 08:56 SeanBenson  
Texttxt runMoore_CreateTCK_2.py.txt r1 manage 0.8 K 2014-10-30 - 08:57 SeanBenson  
Texttxt runMoore_CreateDST.py.txt r3 r2 r1 manage 1.9 K 2014-10-30 - 08:52 SeanBenson Script to generate a private TCK
Edit | Attach | Watch | Print version | History: r17 | r11 < r10 < r9 < r8 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r9 - 2016-04-26 - MikaVesterinen
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    LHCb All webs login

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