Commit a11d120501142c6ccb5b78f942211f125563663d

Authored by Jürgen Knödlseder
1 parent 158b8e06

Update ROOT IRF test data and add script to generate test data (#2135)

dev/make_root_irf.py 0 → 100755
  1 +#! /usr/bin/env python
  2 +# ==========================================================================
  3 +# Generates ROOT IRF test file
  4 +#
  5 +# Copyright (C) 2017 Juergen Knoedlseder
  6 +#
  7 +# This program is free software: you can redistribute it and/or modify
  8 +# it under the terms of the GNU General Public License as published by
  9 +# the Free Software Foundation, either version 3 of the License, or
  10 +# (at your option) any later version.
  11 +#
  12 +# This program is distributed in the hope that it will be useful,
  13 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
  14 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15 +# GNU General Public License for more details.
  16 +#
  17 +# You should have received a copy of the GNU General Public License
  18 +# along with this program. If not, see <http://www.gnu.org/licenses/>.
  19 +#
  20 +# ==========================================================================
  21 +from ROOT import TFile
  22 +
  23 +# Open input file
  24 +filename = '/project-data/cta/performance/prod3b/CTA-Performance-North-E-20170502/CTA-Performance-North-20deg-average-50h_20170502.root'
  25 +infile = TFile(filename)
  26 +
  27 +# Open output file
  28 +outfile = TFile('irf.root', 'RECREATE')
  29 +
  30 +# Open histograms
  31 +aeff1 = infile.Get('EffectiveAreaEtrueNoTheta2cut_offaxis')
  32 +aeff2 = infile.Get('EffectiveAreaEtrueNoTheta2cut')
  33 +psf1 = infile.Get('AngRes_offaxis')
  34 +psf2 = infile.Get('AngRes80_offaxis')
  35 +psf3 = infile.Get('AngularPSF2DEtrue_offaxis')
  36 +edisp1 = infile.Get('EestOverEtrue_offaxis')
  37 +edisp2 = infile.Get('MigMatrixNoTheta2cut_offaxis')
  38 +bkg1 = infile.Get('BGRatePerSqDeg_offaxis')
  39 +bkg2 = infile.Get('BGRatePerSqDeg')
  40 +
  41 +# Write histograms
  42 +infile.GetList().Write()
  43 +
  44 +# Close output file
  45 +outfile.Close()
test/data/irf.root
No preview for this file type