Created
July 17, 2013 00:09
-
-
Save ndawe/6016436 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ROOT | |
ROOT.gSystem.Load('GoodRunsLists/StandAlone/libGoodRunsLists.so') | |
from ROOT import Root | |
grl_str = '''\ | |
<?xml version="1.0"?> | |
<!DOCTYPE LumiRangeCollection SYSTEM "http://atlas-runquery.cern.ch/LumiRangeCollection.dtd"> | |
<!-- This document was created by goodruns: http://pypi.python.org/pypi/goodruns/ on 2013-07-16 at 08:24:28 --> | |
<LumiRangeCollection> | |
<NamedLumiRange> | |
<Name>GRL</Name> | |
<Version>1.0</Version> | |
<LumiBlockCollection> | |
<Run>1</Run> | |
<LBRange Start="1" End="100"/> | |
</LumiBlockCollection> | |
</NamedLumiRange> | |
</LumiRangeCollection> | |
''' | |
grl_str_rev = '''\ | |
<?xml version="1.0"?> | |
<!DOCTYPE LumiRangeCollection SYSTEM "http://atlas-runquery.cern.ch/LumiRangeCollection.dtd"> | |
<!-- This document was created by goodruns: http://pypi.python.org/pypi/goodruns/ on 2013-07-16 at 08:24:28 --> | |
<LumiRangeCollection> | |
<NamedLumiRange> | |
<Name>GRL</Name> | |
<Version>1.0</Version> | |
<LumiBlockCollection> | |
<Run>1</Run> | |
<LBRange End="100" Start="1"/> | |
</LumiBlockCollection> | |
</NamedLumiRange> | |
</LumiRangeCollection> | |
''' | |
for s in (grl_str, grl_str_rev): | |
reader = Root.TGoodRunsListReader() | |
reader.AddXMLString(s) | |
reader.Interpret() | |
grl = reader.GetMergedGoodRunsList() | |
print grl.HasRunLumiBlock(1, 101) | |
writer = Root.TGoodRunsListWriter() | |
writer.SetGoodRunsList(grl) | |
print writer.GetXMLString() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment