How to use the Moore_RateTest script

The script lives in the DBASE package, PRConfig. You can see it here it in websvn. You can refer to these slides for some examples on how to use the tool. It is visible to a Moore environment, e.g. lb-run Moore/prod cat '$PRCONFIG/python/MooreTests/'. Many of the common uses of the Moore_RateTest are tested with nightly qmtests, which are configured here.

List of example instructions

Please let us know if you have a use case that isn't covered by the following list of examples. The recommended example for line development is this one.

Example: Using trigger-dev to test the HLT2 line rate with HLT1 filtered input data.

This is the recommended example for testing the rate of your development HLT2 line for 2017 datataking. Check the comprehensive up-to-date instructions at
source /cvmfs/ -c x86_64-centos7-gcc62-opt  # use CVMFS with the correct gcc version
cd /afs/
git clone ssh:// workspace
cd workspace

# Clone PRConfig
mkdir DBASE && cd DBASE
git lb-clone-pkg PRConfig
cd ..

# Build and run the test
export LC_ALL=C
make  # do not add -j
Moore/run python DBASE/PRConfig/python/MooreTests/ --inputdata=2018_Hlt1_0x11751801 --L0TCK=0x1801 --evtmax=1000 --input_rate=110.e3 | tee Moore_RateTest.log

Example: Testing the rate of your development HLT2 line with the production version of Moore, and HLT1 filtered input data.

This is the default example for testing the rate of your development HLT2 line for 2018 datataking. This example for 2017 was tested in LBHLT-138 and a log file is attached there in case you want to compare with your test.
#lb-dev --list Moore
lb-dev --name=RateTest Moore/prod
cd RateTest
#the following would be if you want to make some changes, e.g. to the settings or lines
#git lb-use Hlt
#git lb-checkout Hlt/2018-patches Hlt/HltSettings
#git lb-checkout Hlt/2018-patches Hlt/Hlt2Lines
mkdir DBASE && cd DBASE
git lb-clone-pkg PRConfig
cd ..
make -j 4
./run python DBASE/PRConfig/python/MooreTests/ --inputdata=2018_Hlt1_0x11751801 --L0TCK=0x1801 --evtmax=1000 --input_rate=110.e3 | tee Moore_RateTest.log

Example: Measure the rate w.r.t. L0 filtered data while tuning some HLT2 lines with the Moore v26r0 release.

lb-dev Moore v26r0
cd MooreDev_v26r0
git lb-use Hlt
git lb-checkout Hlt/master Hlt/HltSettings
git lb-checkout Hlt/master Hlt/Hlt2Lines
getpack PRConfig head
make -j 4
./run python PRConfig/python/MooreTests/ --evtmax=10000 --inputdata=2016NB_25ns_L0Filt0x1609 --tuplefile=tuples.root | tee Moore_RateTest_orig.log
#make some changes
make -j 4
./run python PRConfig/python/MooreTests/ --evtmax=10000 --inputdata=2016NB_25ns_L0Filt0x1609 --tuplefile=tuples.root | tee Moore_RateTest_new.log

Example: Run straight from a nightly or release build without lb-dev

lb-run --nightly lhcb-head [DAY] Moore/HEAD python '$PRCONFIGROOT/python/MooreTests/'

Example: Measure signal efficiencies

First of all, we need to prepare a suitable signal MC sample.
  1. It should be juggled to look like raw data. Here is an example script: For changing the example script to your data you might have to change the input version (2.0 can be used for most MC) together with the input location.
  2. Then you should rerun L0 using L0App with
  3. Then you should run the Moore_RateTest script with the --mode='efficiency' option.
There is a sample of juggled $D^* \to D^0\pi, D^0 \to K\pi$ 2015, Sim08, MC in the testfile db under "Juggled_MC_2015_27163003_DstToD0pip_D0ToKmPip". Steps 2 and 3 are tested using a small number of events from this sample in the nightlies. If you encounter any problems with this script, please first look here to see if the nightly test is OK. Aside: If you are developing Hlt code, then it is expected that you regularly follow the nightly tests.

Please note: Not all MC samples contain the full raw event information which is needed to run L0 and Moore. A description of all file types can be found here.

lb-dev --nightly-cvmfs --nightly lhcb-head Moore/HEAD --name MooreDev_eff
cd MooreDev_eff
# if needed
# git lb-use ...
# git lb-checkout ...
make -j 8
# then you need to get the scripts for step 2
./run cp '$MOOREROOT/tests/options/Moore_RateTest/' .
./run cp '$PRCONFIGROOT/python/MooreTests/' .
# edit the RedoL0 script to take your juggled MC sample as input
# then run it 
./run 2>&1 | tee Moore_RateTest_MC_RedoL0.log
# this should produce a new file called rerunL0.dst
# then you run Moore_RateTest over it in efficiency mode
./run python '$PRCONFIGROOT/python/MooreTests/' \
    --evtmax=500 \
    --mode=efficiency \
    --DisableRunStampCheck \
    --inputdata=rerunL0.dst \
    --TFDB=Juggled_MC_2015_27163003_DstToD0pip_D0ToKmPip 2>&1 | tee Moore_RateTest.log
# it uses the testfileDB entry to get the DataType, tags, Simulation=True/False etc...
Please note that you can also use conddb and simdb tags directly, as noted by Mika:

You can replace —TFDBForTags=XYZ by settings the tags explicitly

Log files from this example are here

-- MikaVesterinen - 2016-05-27

Topic attachments
I Attachment History Action Size Date Who Comment
Unknown file formatlog Moore_RateTest_MC.log r1 manage 110.9 K 2016-05-27 - 14:13 MikaVesterinen  
Texttxt Moore_RateTest_MC_RedoL0.log.txt r1 manage 36.5 K 2016-05-27 - 14:03 MikaVesterinen  
Texttxt Moore_RateTest_MC_short.log.txt r1 manage 43.3 K 2016-05-27 - 14:19 MikaVesterinen  
Texttxt r1 manage 0.9 K 2017-01-20 - 17:44 SaschaStahl  
Edit | Attach | Watch | Print version | History: r27 < r26 < r25 < r24 < r23 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r27 - 2018-06-13 - 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-2020 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