ATLAS Offline Software
Loading...
Searching...
No Matches
FPGATrackSimMapConfig Namespace Reference

Functions

 findFileWithTest (datapath, filename)
 getRegionIndex (map_tag)
 getRegionName (map_tag)
 getSampleType (map_tag)
 getWithPU (map_tag)
 getNSubregions (tag)

Function Documentation

◆ findFileWithTest()

FPGATrackSimMapConfig.findFileWithTest ( datapath,
filename )

Definition at line 8 of file FPGATrackSimMapConfig.py.

8def findFileWithTest(datapath,filename):
9 retv = findFile(datapath,filename)
10 if retv is None:
11 msg.info(datapath)
12 raise OSError(2, "Couldn't find file", filename)
13 return retv
14

◆ getNSubregions()

FPGATrackSimMapConfig.getNSubregions ( tag)

Definition at line 34 of file FPGATrackSimMapConfig.py.

34def getNSubregions(tag):
35 formats = {
36 'region': getRegionIndex(tag),
37 'regionName': getRegionName(tag),
38 }
39
40 if tag['formatted']:
41 path = tag['subrmap'].format(**formats)
42 else:
43 path = tag['subrmap']
44 path = findFile(os.environ['DATAPATH'], path)
45
46 with open(path, 'r') as f:
47 fields = f.readline().split()
48 assert(fields[0] == 'towers')
49 return int(fields[1])
std::vector< std::string > split(const std::string &s, const std::string &t=":")
Definition hcg.cxx:177

◆ getRegionIndex()

FPGATrackSimMapConfig.getRegionIndex ( map_tag)
Note the region member of the tag is a string

Definition at line 15 of file FPGATrackSimMapConfig.py.

15def getRegionIndex(map_tag):
16 '''
17 Note the region member of the tag is a string
18 '''
19 try:
20 return int(map_tag['region'])
21 except ValueError:
22 return map_tag['regionNames'].index(map_tag['region'])
23
24
Definition index.py:1

◆ getRegionName()

FPGATrackSimMapConfig.getRegionName ( map_tag)

Definition at line 25 of file FPGATrackSimMapConfig.py.

25def getRegionName(map_tag):
26 return map_tag['regionNames'][getRegionIndex(map_tag)]
27

◆ getSampleType()

FPGATrackSimMapConfig.getSampleType ( map_tag)

Definition at line 28 of file FPGATrackSimMapConfig.py.

28def getSampleType(map_tag):
29 return map_tag['sampleType']
30

◆ getWithPU()

FPGATrackSimMapConfig.getWithPU ( map_tag)

Definition at line 31 of file FPGATrackSimMapConfig.py.

31def getWithPU(map_tag):
32 return map_tag['withPU']
33