ATLAS Offline Software
Loading...
Searching...
No Matches
example.py
Go to the documentation of this file.
1#!/usr/bin/python
2
3# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
4
5import os
6import sys, string, commands
7from datetime import datetime
8
9
10CWD = os.getcwd()
11import ROOT
12
15from ROOT import gSystem
16os.chdir(CWD)
17
18gSystem.Load('../StandAlone/libGoodRunsLists.so')
19from ROOT import Root
20
21
22
23reader = Root.TGoodRunsListReader('LumiRangeCollectionA.xml')
24#reader.AddXMLFile('LumiRangeCollectionB.xml')
25reader.Interpret()
26goodrunslist = reader.GetMergedGRLCollection()
27
28
29goodrunslist.Summary()
30
31
32if goodrunslist.HasRun (90210) : print "Foo!" # contains run 90210 ?
33if goodrunslist.HasRunLumiBlock (90210,7) : print "Bar!" # run 90210, lb 7 ?
34
35
37writer.SetGRLCollection(goodrunslist)
38writer.SetFilename('test2.xml')
39writer.WriteXMLFile()
40