Commit 89694521b63af5a9a2701765bb03b6a400a0974f

Authored by Jürgen Knödlseder
1 parent 4dce6214

Update for new DESY files.

Showing 1 changed file with 33 additions and 64 deletions
scripts/cta_root2caldb.py
... ... @@ -945,6 +945,13 @@ class caldb():
945 945 file.GetObject("AngRes_offaxis", r68)
946 946 neng = r68.GetXaxis().GetNbins()
947 947 noffset = r68.GetYaxis().GetNbins()
  948 +
  949 + # Converts 68% -> 1 sigma
  950 + r68_to_sigma = 0.6624305
  951 + for ioff in range(noffset):
  952 + for ieng in range(neng):
  953 + sigma = r68.GetBinContent(ieng+1,ioff+1) * r68_to_sigma
  954 + r68.SetBinContent(ieng+1,ioff+1,sigma)
948 955  
949 956 # Compute scale histogram
950 957 scale = r68.Clone()
... ... @@ -1317,81 +1324,43 @@ def set_prod2_desy():
1317 1324 Set Prod2 DESY database.
1318 1325 """
1319 1326 # Set database attributes
1320   - path = "/project-data/cta/performance/prod2/Performance_DESY_20140128"
1321   - rebin = False
1322   - psftype = "Gauss"
1323   - scale = 1.0/180000.0
  1327 + path_aar = "/project-data/cta/performance/prod2/Performance_DESY_20140131_Aar"
  1328 + path_ten = "/project-data/cta/performance/prod2/Performance_DESY_20140131_Tenerife_50h"
  1329 + rebin = False
  1330 + psftype = "Gauss"
  1331 + #scale = 1.0/180000.0
  1332 + scale = 1.0
1324 1333  
1325 1334 # Set database content
1326 1335 db = [{'inst': "aar", 'id': "DESY20140105_50h",
1327   - 'path': path, 'rebin': rebin, 'psftype': psftype, 'scale': scale,
1328   - 'file': "DESY.d20140105.Erec1.V2.ID0NIM2.prod2-Aar-NS.S.2a.180000s.root"},
  1336 + 'path': path_aar, 'rebin': rebin, 'psftype': psftype, 'scale': scale,
  1337 + 'file': "DESY.d20140105.Erec1.V3.ID0NIM2.prod2-Aar-NS.S.2a.180000s.root"},
1329 1338 {'inst': "aar", 'id': "DESY20140105_50h_0deg",
1330   - 'path': path, 'rebin': rebin, 'psftype': psftype, 'scale': scale,
1331   - 'file': "DESY.d20140105.Erec1.V2.ID0_0degNIM2.prod2-Aar-NS.S.2a.180000s.root"},
  1339 + 'path': path_aar, 'rebin': rebin, 'psftype': psftype, 'scale': scale,
  1340 + 'file': "DESY.d20140105.Erec1.V3.ID0_0degNIM2.prod2-Aar-NS.S.2a.180000s.root"},
1332 1341 {'inst': "aar", 'id': "DESY20140105_50h_180deg",
1333   - 'path': path, 'rebin': rebin, 'psftype': psftype, 'scale': scale,
1334   - 'file': "DESY.d20140105.Erec1.V2.ID0_180degNIM2.prod2-Aar-NS.S.2a.180000s.root"},
  1342 + 'path': path_aar, 'rebin': rebin, 'psftype': psftype, 'scale': scale,
  1343 + 'file': "DESY.d20140105.Erec1.V3.ID0_180degNIM2.prod2-Aar-NS.S.2a.180000s.root"},
1335 1344  
1336 1345 {'inst': "aar500", 'id': "DESY20140105_50h",
1337   - 'path': path, 'rebin': rebin, 'psftype': psftype, 'scale': scale,
1338   - 'file': "DESY.d20140105.Erec1.V2.ID0NIM2.prod2-Aar-500m-NS.S.2a.180000s.root"},
  1346 + 'path': path_aar, 'rebin': rebin, 'psftype': psftype, 'scale': scale,
  1347 + 'file': "DESY.d20140105.Erec1.V3.ID0NIM2.prod2-Aar-500m-NS.S.2a.180000s.root"},
1339 1348 {'inst': "aar500", 'id': "DESY20140105_50h_0deg",
1340   - 'path': path, 'rebin': rebin, 'psftype': psftype, 'scale': scale,
1341   - 'file': "DESY.d20140105.Erec1.V2.ID0_0degNIM2.prod2-Aar-500m-NS.S.2a.180000s.root"},
  1349 + 'path': path_aar, 'rebin': rebin, 'psftype': psftype, 'scale': scale,
  1350 + 'file': "DESY.d20140105.Erec1.V3.ID0_0degNIM2.prod2-Aar-500m-NS.S.2a.180000s.root"},
1342 1351 {'inst': "aar500", 'id': "DESY20140105_50h_180deg",
1343   - 'path': path, 'rebin': rebin, 'psftype': psftype, 'scale': scale,
1344   - 'file': "DESY.d20140105.Erec1.V2.ID0_180degNIM2.prod2-Aar-500m-NS.S.2a.180000s.root"},
1345   -
1346   - {'inst': "leoncito", 'id': "DESY20140105_50h",
1347   - 'path': path, 'rebin': rebin, 'psftype': psftype, 'scale': scale,
1348   - 'file': "DESY.d20140105.Erec1.V2.ID0NIM2.prod2-LeoncitoPP-NS.S.2a.180000s.root"},
1349   - {'inst': "leoncito", 'id': "DESY20140105_50h_0deg",
1350   - 'path': path, 'rebin': rebin, 'psftype': psftype, 'scale': scale,
1351   - 'file': "DESY.d20140105.Erec1.V2.ID0_0degNIM2.prod2-LeoncitoPP-NS.S.2a.180000s.root"},
1352   - {'inst': "leoncito", 'id': "DESY20140105_50h_180deg",
1353   - 'path': path, 'rebin': rebin, 'psftype': psftype, 'scale': scale,
1354   - 'file': "DESY.d20140105.Erec1.V2.ID0_180degNIM2.prod2-LeoncitoPP-NS.S.2a.180000s.root"},
1355   -
1356   - {'inst': "sac", 'id': "DESY20140105_50h",
1357   - 'path': path, 'rebin': rebin, 'psftype': psftype, 'scale': scale,
1358   - 'file': "DESY.d20140105.Erec1.V2.ID0NIM2.prod2-SAC100-NS.S.2a.180000s.root"},
1359   - {'inst': "sac", 'id': "DESY20140105_50h_0deg",
1360   - 'path': path, 'rebin': rebin, 'psftype': psftype, 'scale': scale,
1361   - 'file': "DESY.d20140105.Erec1.V2.ID0_0degNIM2.prod2-SAC100-NS.S.2a.180000s.root"},
1362   - {'inst': "sac", 'id': "DESY20140105_50h_180deg",
1363   - 'path': path, 'rebin': rebin, 'psftype': psftype, 'scale': scale,
1364   - 'file': "DESY.d20140105.Erec1.V2.ID0_180degNIM2.prod2-SAC100-NS.S.2a.180000s.root"},
1365   -
1366   - {'inst': "spm", 'id': "DESY20140105_50h",
1367   - 'path': path, 'rebin': rebin, 'psftype': psftype, 'scale': scale,
1368   - 'file': "DESY.d20140105.Erec1.V2.ID0NIM2.prod2-SPM-NS.N.2NN.180000s.root"},
1369   - {'inst': "spm", 'id': "DESY20140105_50h_0deg",
1370   - 'path': path, 'rebin': rebin, 'psftype': psftype, 'scale': scale,
1371   - 'file': "DESY.d20140105.Erec1.V2.ID0_0degNIM2.prod2-SPM-NS.N.2NN.180000s.root"},
1372   - {'inst': "spm", 'id': "DESY20140105_50h_180deg",
1373   - 'path': path, 'rebin': rebin, 'psftype': psftype, 'scale': scale,
1374   - 'file': "DESY.d20140105.Erec1.V2.ID0_180degNIM2.prod2-SPM-NS.N.2NN.180000s.root"},
  1352 + 'path': path_aar, 'rebin': rebin, 'psftype': psftype, 'scale': scale,
  1353 + 'file': "DESY.d20140105.Erec1.V3.ID0_180degNIM2.prod2-Aar-500m-NS.S.2a.180000s.root"},
1375 1354  
1376 1355 {'inst': "tenerife", 'id': "DESY20140105_50h",
1377   - 'path': path, 'rebin': rebin, 'psftype': psftype, 'scale': scale,
1378   - 'file': "DESY.d20140105.Erec1.V2.ID0NIM2.prod2-Tenerife-NS.N.2NN.180000s.root"},
  1356 + 'path': path_ten, 'rebin': rebin, 'psftype': psftype, 'scale': scale,
  1357 + 'file': "DESY.d20140105.Erec1.V3.ID0NIM2.prod2-Tenerife-NS.N.2NN.180000s.root"},
1379 1358 {'inst': "tenerife", 'id': "DESY20140105_50h_0deg",
1380   - 'path': path, 'rebin': rebin, 'psftype': psftype, 'scale': scale,
1381   - 'file': "DESY.d20140105.Erec1.V2.ID0_0degNIM2.prod2-Tenerife-NS.N.2NN.180000s.root"},
  1359 + 'path': path_ten, 'rebin': rebin, 'psftype': psftype, 'scale': scale,
  1360 + 'file': "DESY.d20140105.Erec1.V3.ID0_0degNIM2.prod2-Tenerife-NS.N.2NN.180000s.root"},
1382 1361 {'inst': "tenerife", 'id': "DESY20140105_50h_180deg",
1383   - 'path': path, 'rebin': rebin, 'psftype': psftype, 'scale': scale,
1384   - 'file': "DESY.d20140105.Erec1.V2.ID0_180degNIM2.prod2-Tenerife-NS.N.2NN.180000s.root"},
1385   -
1386   - {'inst': "us", 'id': "DESY20140105_50h",
1387   - 'path': path, 'rebin': rebin, 'psftype': psftype, 'scale': scale,
1388   - 'file': "DESY.d20140105.Erec1.V2.ID0NIM2.prod2-US-NS.N.2NN.180000s.root"},
1389   - {'inst': "us", 'id': "DESY20140105_50h_0deg",
1390   - 'path': path, 'rebin': rebin, 'psftype': psftype, 'scale': scale,
1391   - 'file': "DESY.d20140105.Erec1.V2.ID0_0degNIM2.prod2-US-NS.N.2NN.180000s.root"},
1392   - {'inst': "us", 'id': "DESY20140105_50h_180deg",
1393   - 'path': path, 'rebin': rebin, 'psftype': psftype, 'scale': scale,
1394   - 'file': "DESY.d20140105.Erec1.V2.ID0_180degNIM2.prod2-US-NS.N.2NN.180000s.root"}]
  1362 + 'path': path_ten, 'rebin': rebin, 'psftype': psftype, 'scale': scale,
  1363 + 'file': "DESY.d20140105.Erec1.V3.ID0_180degNIM2.prod2-Tenerife-NS.N.2NN.180000s.root"}]
1395 1364  
1396 1365 # Return database
1397 1366 return db
... ... @@ -1421,9 +1390,9 @@ if __name__ == '__main__':
1421 1390 - Ebias_offaxis (2D) - Energy bias
1422 1391 """
1423 1392 # Get database
1424   - entries = set_test()
  1393 + #entries = set_test()
1425 1394 #entries = set_prod1_ifae()
1426   - #entries = set_prod2_desy()
  1395 + entries = set_prod2_desy()
1427 1396  
1428 1397 # Loop over entries
1429 1398 for entry in entries:
... ...