ATLAS Offline Software
Loading...
Searching...
No Matches
extractScanInfo.py
Go to the documentation of this file.
1#!/usr/bin/env python
2
3# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
4"""
5Extract necessary info (pLB, tstart, tend, sep, acqFlag) from VdM ntuple.
6Ntuples are usually found at /afs/cern.ch/atlas/project/LumiWG/CoolScanNtuple/
7"""
8
9import sys
10import ROOT
11
12if len(sys.argv) != 2:
13 sys.exit('Usage: extractScanInfo.py <filename>')
14
15filename = sys.argv[1]
16f = ROOT.TFile(filename)
17t = f.Get('vdMScanData')
18
19run = None
20for e in t:
21 if e.ScanRun != 0:
22 run = e.ScanRun
23 break
24
25fout = open('r%s_pLB.txt' %run, 'w')
26foutacq = open('r%s_pLB.acq.txt' % run, 'w')
27
28for e in t:
29 fout.write('%s %s %s %s\n' %(e.ScanLB, e.StartTime, e.EndTime, e.NominalSeparation))
30 foutacq.write('%s %s %s %s %s\n' %(e.ScanLB, e.StartTime, e.EndTime, e.NominalSeparation, e.AcquisitionFlag))
31
32fout.close()
33foutacq.close()