ATLAS Offline Software
Loading...
Searching...
No Matches
validateMioctEncodingFile.py
Go to the documentation of this file.
1#!/bin/env python
2
3# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
4
5import sys, argparse
6from TrigConfMuctpi.XMLReader import MioctGeometryXMLReader
7
8
9def readXML(filename):
10 return MioctGeometryXMLReader(filename)
11
12def validate(geometry):
13 stats = {'miocts' : 0, 'sectors' : 0, 'rois' : 0, 'decodes' : 0, 'topocells' : 0}
14
15 stats['miocts'] = len(geometry.getMIOCTs())
16
17 for mioct in geometry.getMIOCTs():
18 stats['sectors'] += len(mioct.Sectors)
19 for sector in mioct.Sectors:
20 stats['rois'] += len(sector.ROIs)
21 #print "M %2s S %-4s #R %3i" % (mioct['id'], sector['name'], len(sector.ROIs) )
22
23 stats['decodes'] += len(mioct.Decodes)
24 for decode in mioct.Decodes:
25 stats['topocells'] += len(decode.TopoCells)
26 print("#MIOCTs : %i" % stats['miocts'])
27 print("#Sectors : %i" % stats['sectors'])
28 print("#ROIs : %i" % stats['rois'])
29 print("#Decodes : %i" % stats['decodes'])
30 print("#TopoCells : %i" % stats['topocells'])
31
32
33
34
35
36def main(args):
37
38 print("Using input %s" % args.infile)
39 geometry = readXML( args.infile )
40
41 validate(geometry)
42
43if __name__=="__main__":
44
45 parser = argparse.ArgumentParser( description=__doc__,
46 formatter_class = argparse.RawTextHelpFormatter)
47
48 parser.add_argument('-i', dest='infile', default="TrigConfMuctpi/TestMioctGeometry2016.xml", type=str,
49 help='name of input combined muon geometry filei [TrigConfMuctpi/TestMioctGeometry2016.xml]')
50
51 opts = parser.parse_args()
52
53 sys.exit( main(opts) )
void print(char *figname, TCanvas *c1)
int main()
Definition hello.cxx:18