Ejemplo n.º 1
0
fspec, axspec = plt.subplots()
fsig, axsig = plt.subplots()
if efficiencynorm == 'y' and exposurenorm == 'y':
    addinfo = 'expo and efficiency'
if efficiencynorm == 'y' and exposurenorm == 'n':
    addinfo = 'efficiency only'
if efficiencynorm == 'n' and exposurenorm == 'y':
    addinfo = 'expo only'
if efficiencynorm == 'n' and exposurenorm == 'n':
    addinfo = 'raw'
fspec.suptitle(str(names)+ ' Emin = ' + str(E1) + ' DLL cut: ' +str(dlllimit) + ' DC cut: ' +str(dclimvalue) + addinfo)
first = True
for runs,n in zip(allruns,names):
    # get the format of the dataframe
    df = utils.initialize_dataframe(exemplepath)
    # merge the runs
    df = utils.mergeruns(runs,folder,fname,df)
    expo = 0
    for r in runs:
        expo += utils.getrunexposure(r,extnr)

        rmexpo = utils.removedexpofromDC(r,dfDC,dclimvalue)
#        print 'rmexpo = ' , rmexpo
        expo -= rmexpo
#    print 'expo =  ', expo
    dfsel = df.query(constant.basecuts + ' & ' + dllcut + '&' + fidcut + '&' + Ecut )
    for imc in imcuts:
        dfsel = dfsel.query(imc)
        
    rate = float(len(dfsel))/expo
Ejemplo n.º 2
0
import glob
import argparse

iteration = 4
#runs = ['run100ks1','run100ks2','run100ks3','run30ks1','run30ks2']
runs = ['run100ks1', 'run100ks2', 'run100ks3', 'run30ks1', 'run30ks2']
runsall = [
    'run100ks1', 'run100ks2', 'run100ks3', 'run30ks1', 'run30ks2', 'run30ks4'
]
#runs = ['run30ks4']
dlllimit = -23
fname = 'data'
folder = constant.basefolders[4]
exemplepath = '/Users/gaior/DAMIC/data/official4/cryoOFF_100000s-IntW800_OS_1x100_run2/pkl/data.pkl'
# get the format of the dataframe
dfmoriond = utils.initialize_dataframe(exemplepath)
dfall = utils.initialize_dataframe(exemplepath)
dflast = utils.initialize_dataframe(exemplepath)
# merge the runs
dfmoriond = utils.mergeruns(runs, folder, fname, dfmoriond)
dfall = utils.mergeruns(runsall, folder, fname, dfall)
dflast = utils.mergeruns(['run30ks4'], folder, fname, dflast)
#define the cut related to the DLL
dllcut = ' ll - llc < ' + str(dlllimit)
fidcut = 'sigma > 0.3 & sigma < 0.8'
# perform
dfsel = dfall.query(constant.basecuts + ' & ' + dllcut + '&' + fidcut)
dfselM = dfmoriond.query(constant.basecuts + ' & ' + dllcut + '&' + fidcut)
dfselL = dflast.query(constant.basecuts + ' & ' + dllcut + '&' + fidcut)

dfselM.to_pickle(constant.outfolder + 'event/' + 'evmoriond.pkl')