demo0.py
Go to the documentation of this file.
1 import os
2 import sys
3 sys.path.append('../..')
4 
5 from PandAna.core import *
6 # import matplotlib.pyplot as plt
7 # import xkcd
8 
9 # Simple var
10 kSlcE = Var(lambda tables: tables['rec.slc']['calE'])
11 
12 # Simple cut
13 kEnergyCut = (kSlcE > 1) & (kSlcE < 4)
14 
15 # Latest h5s from Karl
16 loc = '/pnfs/nova/persistent/users/karlwarb/HDF5-Training-19-02-26/FD-FluxSwap-FHC'
17 files = [os.path.join(loc, f) for f in os.listdir(loc) if 'h5caf.h5' in f]
18 tables = loader(files, limit=50)
19 
20 # Create a spectrum
21 myspectrum = spectrum(tables, kEnergyCut, kSlcE)
22 
23 # Let's do it!
24 tables.Go()
25 
26 print('myspectrum internal dataframe: ')
27 print(myspectrum.df().head())
28 
29 # n, bins = myspectrum.histogram(bins=50, range=(1,4))
30 #
31 # print('Selected ' + str(n.sum()) + ' events from ' + str(myspectrum.POT()) + ' POT.')
32 #
33 # plt.hist(bins[:-1], bins=bins, weights=n, histtype='step', color='xkcd:dark blue', label='FluxSwap')
34 # plt.xlabel('Slice calE')
35 # plt.ylabel('Events')
36 #
37 # plt.legend(loc='upper right')
38 #
39 # plt.show()
Eigen::Matrix< T, Eigen::Dynamic, 1 > head(const Eigen::Matrix< T, Eigen::Dynamic, 1 > &v, size_t n)
Definition: head.hpp:24
bool print