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

Contents

Creating a split TCK

Start dumping instructions here: Creating a split TCK takes a few more steps.
  • run from threshold settings in split=Hlt1, to produce the Hlt1TCK
  • run from this Hlt1TCK in split=Hlt1 to test it, and to produce an .mdf that is need for the next step
  • run over .mdf from previous step, and from threshold settings in split=Hlt2, to produce Hlt2 TCK
  • run from Hlt2TCK to test it..

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

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 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 ActionSorted ascending Size Date Who Comment
Texttxt CreateTCK.py.txt r1 manage 0.6 K 2015-07-31 - 14:04 MatthewKenzie  
Texttxt runMoore_CreateDST.py.txt r3 r2 r1 manage 1.9 K 2014-10-30 - 08:52 SeanBenson Script to generate a private TCK
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  
Edit | Attach | Watch | Print version | History: r17 | r10 < r9 < r8 < r7 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r8 - 2016-04-21 - SaschaStahl
 
    • 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