Skip to content

Commit

Permalink
Refactor table assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
gonzaponte committed Mar 10, 2022
1 parent c8c25cb commit 330460f
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions invisible_cities/database/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,15 @@ def loadDB(dbname : str, tables : list):

if __name__ == '__main__':

dbnames = ['NEWDB', 'DEMOPPDB', 'NEXT100DB', 'Flex100DB']
tables = ['DetectorGeo','PmtBlr','ChannelGain','ChannelMapping','ChannelMask',
'PmtNoiseRms','ChannelPosition','SipmBaseline', 'SipmNoisePDF',
'PMTFEMapping', 'PMTFELowFrequencyNoise']

table_dict = dict.fromkeys(dbnames, tuple(tables))
table_dict["NEXT100DB"] += ("Activity", "Efficiency")
dbnames = ('NEWDB', 'DEMOPPDB', 'NEXT100DB', 'Flex100DB')
common_tables = ('DetectorGeo','PmtBlr','ChannelGain','ChannelMapping','ChannelMask',
'PmtNoiseRms','ChannelPosition','SipmBaseline', 'SipmNoisePDF',
'PMTFEMapping', 'PMTFELowFrequencyNoise')
extended = dict(NEXT100DB = ("Activity", "Efficiency"))

table_dict = dict.fromkeys(dbnames, commmon_tables)
for dbname, extra in extended.items():
table_dict[dbname] += extra

if len(sys.argv) > 1:
dbname = sys.argv[1]
Expand Down

0 comments on commit 330460f

Please sign in to comment.