ATLAS Offline Software
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 
5 import os
6 import sys, string, commands
7 from datetime import datetime
8 
9 
10 CWD = os.getcwd()
11 import ROOT
12 
15 from ROOT import gSystem
16 os.chdir(CWD)
17 
18 gSystem.Load('../StandAlone/libGoodRunsLists.so')
19 from ROOT import Root
20 
21 
22 
23 reader = Root.TGoodRunsListReader('LumiRangeCollectionA.xml')
24 #reader.AddXMLFile('LumiRangeCollectionB.xml')
25 reader.Interpret()
26 goodrunslist = reader.GetMergedGRLCollection()
27 
28 
29 goodrunslist.Summary()
30 
31 
32 if goodrunslist.HasRun (90210) : print "Foo!" # contains run 90210 ?
33 if goodrunslist.HasRunLumiBlock (90210,7) : print "Bar!" # run 90210, lb 7 ?
34 
35 
37 writer.SetGRLCollection(goodrunslist)
38 writer.SetFilename('test2.xml')
39 writer.WriteXMLFile()
40 
Root::TGoodRunsListReader
Definition: TGoodRunsListReader.h:34
Root::TGoodRunsListWriter
Definition: TGoodRunsListWriter.h:38