ATLAS

ATLAS-D Tutorial 2010: Good Runs Lists Tutorial

Links

Exercises

GRL Generation

GRL Application

In the following we will demonstrate that it is quite easy to use GRL in non athena applications. For simplicity we will use PyRoot.

You need to setup athena version 15.6.12:

cd atlas/testarea/15.6.12
asetup 15.6.12
mkdir run.GRL
cd run.GRL

The following python script will load the GRL package, your generated GRL xml file and print out some summary information:

#!/bin/env python

# import ROOT
import ROOT
## Import the ROOT library for reading GRL
ROOT.gSystem.Load('libGoodRunsListsLib')

## read the goodrunslist xml file(s)
reader = ROOT.Root.TGoodRunsListReader('data10_7TeV.periodE.160387-161948_LBSUMM_DetStatus-v03-pass1-analysis-2010E_data_eg_standard_7TeV.xml')
reader.Interpret()
goodrunslist = reader.GetMergedGRLCollection()

## show summary of content
goodrunslist.Summary() ## Detailed: Summary(True)

## constains run and/or lumiblock ?
if goodrunslist.HasRun (90210) : print "Foo!"    # contains run 90210 ?
if goodrunslist.HasRunLumiBlock (90210,7) : print "Bar!"  # run 90210, lb 7 ?

Copy and paste this code into a file called 'grl.py'. Also, copy a GRL file into the same directory and adjust the GRL name accordingly. You can get an example GRL with the following command:

cp /afs/naf.desy.de/user/e/efeld/public/ADT10/data10_7TeV.periodE.160387-161948_LBSUMM_DetStatus-v03-pass1-analysis-2010E_data_eg_standard_7TeV.xml .

Execute the script in python and keep it in interpreter mode:

python -i example.py

Test a few lumi blocks of run 161948:

goodrunslist.HasRunLumiBlock(161948, 410)
goodrunslist.HasRunLumiBlock(161948, 411)
goodrunslist.HasRunLumiBlock(161948, 412)

The C++ code will look very similar. If you do not want to setup the atlas environment, you can also checkout the GoodRunsLists package and compile a standalone library. For more details see the ATLAS Good Runs Lists tutorial.

ATLAS: WorkBook/NAF/ADT10GRL (last edited 2010-09-20 22:16:05 by WolfgangEhrenfeld)