Use GoodRunsLists on D3PD

Introduction

This is only some personal experience on using GRL over D3PD. You can find basic information from StandAllone_GoodRunsListsTutorial. Here we focus one how to apply GRL using stand-alone GoodRunsLists tools.

Important

I compiled ROOT macro to Cpp executable file and run over D3PD.

General idea

The GoodRunsLists you get will be in a format of xml file, which is only some LBRange. Your analysis code (ROOT macro) will read these GRL and get the Good LBRange numbers. Then it will reject the not good LB in input D3PD.

Get GoodRunsLists package and compile it using stand-alone mode.

1. Chect out package.
svn co svn+ssh://svn.cern.ch/reps/atlasoff/DataQuality/GoodRunsLists/tags/GoodRunsLists-00-00-76

2. compile

cd GoodRunsLists/cmt
make -f Makefile.Standalone

3. Copy your goodRunsLists lib to somewhere.

cp   StandAlone/GoodRunsListsLib.so  /yourDir/Libs/goodRunsList.15.6.0-i686-slc4-gcc34/GoodRunsListsLib.so

Integrate to your analysis code

1. Include header files.

#include "GoodRunsLists/TGoodRunsListReader.h"
#include "GoodRunsLists/TGoodRunsList.h"
using namespace std;
using namespace Root;

2. Read GRL.

TGoodRunsListReader* grlR;
 Root::TGoodRunsList grl;
 grlR = new TGoodRunsListReader();
 string sname = "MyLBCollection.xml";
 cout << "XML to load: " << sname.c_str() << endl;
 grlR->SetXMLFile(sname.c_str());
 grlR->Interpret();
 grl = grlR->GetMergedGoodRunsList();
 grl.Summary(true);
 cout << endl;

3. Event selection.

if (!grl.HasRunLumiBlock(RunNumber,LumiBlock))continue;

Compile your analysis code

Tell gcc where you put your goodRunsList library.

1. souce enviroment.

if [ `arch` = "i686" ]; then
libGoodRunLists="/yourDir/Libs/goodRunsList.15.6.0-i686-slc4-gcc34"   # 32 bit library
else
libGoodRunLists="/yourDir/Libs/goodRunsList.15.6.0-x86_64-slc4-gcc34" # 64 bit library
fi
export  LD_LIBRARY_PATH=${libGoodRunLists}:${LD_LIBRARY_PATH}
export  GoodRunsListLib="-lGoodRunsLists -L${libGoodRunLists}"

2. Change your Makefile

ROOTCFLAGS   := $(shell root-config --cflags)
ROOTLIBS     := $(shell root-config --libs) -lMinuit -lEG -lg2c
ROOTLIBS  += $(shell echo ${GoodRunsListLib})
LIBS             += $(ROOTLIBS)

3. Compile it.

make

You still have to source step1 when you run your code.

-- HaifengLi - 25-Apr-2010

Edit | Attach | Watch | Print version | History: r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r1 - 2010-04-25 - HaifengLi
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Main All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright &© 2008-2024 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