dirs = subprocess.check_output(['find . -iname "*autogen*" | sort -k1.13'],
                               shell=True).split('\n')[:-1]

numprots = [1e9, 1e8, 1e7, 1e6]

for typ in typs:
    ctsetsets = []
    for line, numprot in zip(
            dirs, [item for item in numprots for i in range(len(typs) / 4)]):
        for haha in ['iba', 'ipnl']:
            if haha + 'lyso' in line and haha + '-' in typ:
                print(haha, line, typ)
                ctsetsets.append(
                    auger.getctset(numprot,
                                   line[2:10],
                                   line[2:10],
                                   typ,
                                   addnoise=addnoise))
            if haha + 'zinv' in line and haha + '-' in typ:
                print(haha, line, typ)
                ctsetsets.append(
                    auger.getctset(numprot,
                                   line[2:10],
                                   line[2:10],
                                   typ,
                                   addnoise=addnoise))
    assert (len(ctsetsets) == 4)
    megaplot(ctsetsets, 'PMMA_phantom')
    print 'Mean detection yield in', typ, 'study over', sum(
        [ctset['totnprim'] for ctset in ctsetsets]), 'primaries in', sum([
            ctset['nreal'] for ctset in ctsetsets
Example #2
0
###########################################################################################################

# BOTTOM ROW IBA

f, ((ax4, ax5, ax6), (ax1, ax2, ax3)) = plot.subplots(nrows=2,
                                                      ncols=3,
                                                      sharex=True,
                                                      sharey=False)

typ = 'iba-auger-notof-3.root'

yield_av = auger.plot_all_ranges_2(
    ax1,
    auger.getctset(1e9,
                   'fromclus-sorted/spots-iba/run.k0Zs',
                   'fromclus-sorted/spots-iba/run.Y1My',
                   typ,
                   manualshift=volume_offset))
ax1.set_title('KES, Spot A,\nyield: ' + plot.sn(yield_av), fontsize=8)
ax1.set_ylabel('PG detected [counts]')

yield_av = auger.plot_all_ranges_2(
    ax2,
    auger.getctset(1e9,
                   'fromclus-sorted/spots-iba/run.tsUO',
                   'fromclus-sorted/spots-iba/run.TUEA',
                   typ,
                   manualshift=volume_offset))
ax2.set_title('KES, Spot B,\nyield: ' + plot.sn(yield_av), fontsize=8)
ax2.set_xlabel('Position [mm]')
###########################################################################################################

# BOTTOM ROW IBA

f, ((ax4, ax5, ax6), (ax1, ax2, ax3)) = plot.subplots(nrows=2,
                                                      ncols=3,
                                                      sharex=True,
                                                      sharey=False)

typ = 'iba-auger-notof-3.root'

yield_av = auger.plot_all_ranges_2(ax1,
                                   auger.getctset(
                                       840964615,
                                       'fromclus-sorted/layers-beide/run.e8ai',
                                       'fromclus-sorted/layers-beide/run.96ra',
                                       typ,
                                       manualshift=volume_offset),
                                   firstcolor='steelblue',
                                   secondcolor=None)
yield_av = auger.plot_all_ranges_2(ax1,
                                   auger.getctset(
                                       848710335,
                                       'fromclus-sorted/layers-beide/run.m4RU',
                                       'fromclus-sorted/layers-beide/run.tLiY',
                                       typ,
                                       manualshift=volume_offset),
                                   firstcolor='seagreen',
                                   secondcolor=None)
ax1.set_title('KES, Spot A,\nyield: ' + plot.sn(yield_av), fontsize=8)
ax1.set_ylabel('PG detected [counts]')
	
#f.savefig('spotplot-sums.pdf', bbox_inches='tight')
#plot.close('all')

################################################################################

#typ='ipnl-auger-tof-1.root'
#typ='ipnl-auger-notof-1.root'
#typ='iba-auger-tof-3.root'
typ='iba-auger-notof-3.root'

#nieuwe sums. distal layer
#22 , 4 ,
#4 : 65802598.6018 , 7 : 88235302.6706 , 10 : 67298112.2064 , 43 : 64073566.2641 , 

ctset_4 = auger.getctset(65802598,'run.4Zh8','run.8Yoh',typ)
ctset_7 = auger.getctset(88235302,'run.MjnN','run.a5rv',typ)
ctset_10 = auger.getctset(67298112,'run.XXMy','run.btzm',typ)#XXMy + 3x HyIv
ctset_43 = auger.getctset(64073566,'run.iohj','run.hDu1',typ)

ctset_sum_0 = auger.sumctset('sum',ctset_4,ctset_7,ctset_10,ctset_43)

f, ((ax1,ax2,ax3),(ax4,ax5,ax6)) = plot.subplots(nrows=2, ncols=3, sharex=False, sharey=False)

auger.plotrange(ax1,ctset_4)
auger.plotrange(ax2,ctset_7)
auger.plotrange(ax3,ctset_10)
auger.plotrange(ax4,ctset_43)
ax5.axis('off')
auger.plotrange(ax6,ctset_sum_0)
	'ipnl4mm-auger-tof-1.root',
	'iba-auger-tof-1.root',
	'ipnl-auger-notof-1.root',
	'ipnl4mm-auger-notof-1.root',
	'iba-auger-notof-1.root',
	'ipnl-auger-tof-3.root',
	'ipnl4mm-auger-tof-3.root',
	'iba-auger-tof-3.root',
	'ipnl-auger-notof-3.root',
	'ipnl4mm-auger-notof-3.root',
	'iba-auger-notof-3.root']

# typs=['ipnl-auger-tof-1.root','iba-auger-tof-1.root','ipnl-auger-notof-3.root','iba-auger-notof-3.root']
dirs = subprocess.check_output(['find . -iname "*autogen*" | sort -k1.13'],shell=True).split('\n')[:-1]

numprots = [1e9,1e8,1e7,1e6]

for typ in typs:
    ctsetsets = []
    for line,numprot in zip(dirs,[item for item in numprots for i in range(len(typs)/4)]):
        for haha in ['iba','ipnl','ipnl4mm']:
            if haha+'lyso' in line and haha+'-' in typ:
                print (haha,line,typ)
                ctsetsets.append( auger.getctset(numprot,line[2:10],line[2:10],typ) )
            if haha+'zinv' in line and haha+'-' in typ:
                print (haha,line,typ)
                ctsetsets.append( auger.getctset(numprot,line[2:10],line[2:10],typ) )
    assert(len(ctsetsets)==4)
    megaplot(ctsetsets,'PMMA_phantom')
    print 'Mean detection yield in',typ,'study over',sum([ctset['totnprim'] for ctset in ctsetsets]),'primaries in',sum([ctset['nreal'] for ctset in ctsetsets]),'realisations:',sum([ctset['detyieldmu'] for ctset in ctsetsets])
Example #6
0
                      y=1.08)

    #plt.legend()#shadow = True,frameon = True,fancybox = True,ncol = 1,fontsize = 'x-small',loc = 'lower right')

    #plt.tight_layout(rect = [-0.1, 0.0, 1.0, 1.1])#L,B,R,T
    plt.savefig(studyname + '-' + typ +
                '-FOP-dist.pdf')  #, bbox_inches='tight')
    plt.close('all')

    #############################################################################################
    # TODO add pgemissions plots.


for typ in typs:
    ctsetsets = []

    ctsetsets.append(auger.getctset(1e9, '1e9', '1e9', typ))
    ctsetsets.append(auger.getctset(1e8, '1e8', '1e8', typ))
    ctsetsets.append(auger.getctset(1e7, '1e7', '1e7', typ))
    ctsetsets.append(auger.getctset(1e6, '1e6', '1e6', typ))
    #ctsetsets.append( auger.getctset(1e9,'run.3poV','run.wucX',typ) )
    #ctsetsets.append( auger.getctset(1e8,'run.1XRe','run.lTdI',typ) )
    #ctsetsets.append( auger.getctset(1e7,'run.oPE7','run.RWkp',typ) )
    #ctsetsets.append( auger.getctset(1e6,'run.7bG6','run.pijb',typ) )
    megaplot(ctsetsets, 'waterbox_redo')

    print 'Mean detection yield in', typ, 'study over', sum(
        [ctset['totnprim'] for ctset in ctsetsets]), 'primaries in', sum([
            ctset['nreal'] for ctset in ctsetsets
        ]), 'realisations:', sum([ctset['detyieldmu'] for ctset in ctsetsets])
# BOTTOM ROW IBA

f, ((ax4, ax5, ax6), (ax1, ax2, ax3)) = plot.subplots(nrows=2,
                                                      ncols=3,
                                                      sharex=True,
                                                      sharey=False)

typ = 'iba-auger-tof-1.root'
typ = 'iba-auger-notof-3.root'

yield_av = auger.plot_all_ranges_2(
    ax1,
    auger.getctset(1e9,
                   'run.o5zC',
                   'run.o5zC',
                   typ,
                   manualshift=volume_offset,
                   addnoise=addnoise))
ax1.set_title('KES, 1e9,\nyield: ' + plot.sn(yield_av), fontsize=8)
ax1.set_ylabel('PG detected [counts]')

yield_av = auger.plot_all_ranges_2(
    ax2,
    auger.getctset(1e8,
                   'run.fFpk',
                   'run.fFpk',
                   typ,
                   manualshift=volume_offset,
                   addnoise=addnoise))
ax2.set_title('KES, 1e8,\nyield: ' + plot.sn(yield_av), fontsize=8)
ax2.set_xlabel('Position [mm]')
#ctsetsets.append( auger.getctset(1e9,'run.TtIT','run.SmHn',typ,manualshift=shift) )
#ctsetsets.append( auger.getctset(1e8,'run.t4Fb','run.w9Te',typ,manualshift=shift) )
#ctsetsets.append( auger.getctset(27200000,'run.YtND','run.SQy4',typ,manualshift=shift) )
#ctsetsets.append( auger.getctset(1e7,'run.WQUJ','run.JJQQ',typ,manualshift=shift) )
#megaplot(ctsetsets,'spot40',emisfops=None,labels=["$10^9$","$10^8$","$2.7\cdot10^7$","$10^7$"])

#shift = 22.20-29.04
#ctsetsets = []
#ctsetsets.append( auger.getctset(1e9,'run.EYBe','run.6HvZ',typ,manualshift=shift) )
#ctsetsets.append( auger.getctset(1e8,'run.W3sR','run.q7v2',typ,manualshift=shift) )
#ctsetsets.append( auger.getctset(47300000,'run.R9KU','run.rTUp',typ,manualshift=shift) )
#ctsetsets.append( auger.getctset(1e7,'run.1jXf','run.8NDz',typ,manualshift=shift) )
#megaplot(ctsetsets,'spot61',emisfops=None,labels=["$10^9$","$10^8$","$4.7\cdot10^7$","$10^7$"])

ctsetsets = []
ctsetsets.append( auger.getctset(840964615,'run.CKCH','run.lrnj',typ) )#elay
ctsetsets.append( auger.getctset(848710335,'run.3At2','run.Ydep',typ) )#geolay
megaplot(ctsetsets,'layer29',emisfops=None,labels=['Iso-Energy Layer','Iso-Depth Layer'],axlabel='Grouping Method')

ctsetsets = []
ctsetsets.append( auger.getctset(1068263318,'run.7coj','run.ptEe',typ) )#elay, same as elay61
ctsetsets.append( auger.getctset(1071596684,'run.KXRm','run.jTj9',typ) )#geolay
megaplot(ctsetsets,'layer40',emisfops=None,labels=['Iso-Energy Layer','Iso-Depth Layer'],axlabel='Grouping Method')

ctsetsets = []
ctsetsets.append( auger.getctset(1068263318,'run.7coj','run.ptEe',typ,manualshift=15.37-19.00) )#elay
ctsetsets.append( auger.getctset(979533764,'run.8aMd','run.wM5z',typ,manualshift=18.57-23.51) )#geolay
megaplot(ctsetsets,'layer61',emisfops=None,labels=['Iso-Energy Layer','Iso-Depth Layer'],axlabel='Grouping Method')

#############################################################################################
from scipy.ndimage.filters import gaussian_filter

###########################################################################################################

#volume_offset=-141.59+7.96#spot sources
volume_offset=150-141.59+7.96#spot sources

###########################################################################################################

# BOTTOM ROW IBA

f, ((ax4,ax5,ax6),(ax1,ax2,ax3)) = plot.subplots(nrows=2, ncols=3, sharex=True, sharey=False)

typ = 'iba-auger-notof-3.root'

yield_av = auger.plot_all_ranges_2(ax1, auger.getctset(1e9,'fromclus-sorted/spots-iba/run.k0Zs','fromclus-sorted/spots-iba/run.Y1My',typ,manualshift=volume_offset) )
ax1.set_title('KES, Spot A,\nyield: '+plot.sn(yield_av), fontsize=8)
ax1.set_ylabel('PG detected [counts]')

yield_av = auger.plot_all_ranges_2(ax2, auger.getctset(1e9,'fromclus-sorted/spots-iba/run.tsUO','fromclus-sorted/spots-iba/run.TUEA',typ,manualshift=volume_offset) )
ax2.set_title('KES, Spot B,\nyield: '+plot.sn(yield_av), fontsize=8)
ax2.set_xlabel('Position [mm]')

yield_av = auger.plot_all_ranges_2(ax3, auger.getctset(1e9,'fromclus-sorted/spots-iba/run.tf1u','fromclus-sorted/spots-iba/run.cDeA',typ,manualshift=volume_offset) )
ax3.set_title('KES, Spot C,\nyield: '+plot.sn(yield_av), fontsize=8)

######## TopRow IPNL

typ = 'ipnl-auger-tof-1.root'

#shift = 13.76-19.44
#volume_offset=-141.59+7.96#spot sources
volume_offset=0
addnoise = False
#addnoise = 'onlynoise'

###########################################################################################################

# BOTTOM ROW IBA

f, ((ax4,ax5,ax6),(ax1,ax2,ax3)) = plot.subplots(nrows=2, ncols=3, sharex=True, sharey=False)

typ = 'iba-auger-tof-1.root'
typ = 'iba-auger-notof-3.root'

yield_av = auger.plot_all_ranges_2(ax1, auger.getctset(1e9,'run.o5zC','run.o5zC',typ,manualshift=volume_offset,addnoise=addnoise) )
ax1.set_title('KES, 1e9,\nyield: '+plot.sn(yield_av), fontsize=8)
ax1.set_ylabel('PG detected [counts]')

yield_av = auger.plot_all_ranges_2(ax2, auger.getctset(1e8,'run.fFpk','run.fFpk',typ,manualshift=volume_offset,addnoise=addnoise) )
ax2.set_title('KES, 1e8,\nyield: '+plot.sn(yield_av), fontsize=8)
ax2.set_xlabel('Position [mm]')

yield_av = auger.plot_all_ranges_2(ax3, auger.getctset(1e7,'run.Gfu4','run.Gfu4',typ,manualshift=volume_offset,addnoise=addnoise) )
ax3.set_title('KES, 1e7\nyield: '+plot.sn(yield_av), fontsize=8)

######## TopRow IPNL

typ = 'ipnl-auger-tof-1.root'
typ = 'ipnl-auger-notof-3.root'
#f.savefig('spotplot-sums.pdf', bbox_inches='tight')
#plot.close('all')

################################################################################

#typ='ipnl-auger-tof-1.root'
#typ='ipnl-auger-notof-1.root'
#typ='iba-auger-tof-3.root'
typ = 'iba-auger-notof-3.root'

#nieuwe sums. distal layer
#22 , 4 ,
#4 : 65802598.6018 , 7 : 88235302.6706 , 10 : 67298112.2064 , 43 : 64073566.2641 ,

ctset_4 = auger.getctset(65802598, 'run.4Zh8', 'run.8Yoh', typ)
ctset_7 = auger.getctset(88235302, 'run.MjnN', 'run.a5rv', typ)
ctset_10 = auger.getctset(67298112, 'run.XXMy', 'run.btzm',
                          typ)  #XXMy + 3x HyIv
ctset_43 = auger.getctset(64073566, 'run.iohj', 'run.hDu1', typ)

ctset_sum_0 = auger.sumctset('sum', ctset_4, ctset_7, ctset_10, ctset_43)

f, ((ax1, ax2, ax3), (ax4, ax5, ax6)) = plot.subplots(nrows=2,
                                                      ncols=3,
                                                      sharex=False,
                                                      sharey=False)

auger.plotrange(ax1, ctset_4)
auger.plotrange(ax2, ctset_7)
auger.plotrange(ax3, ctset_10)
	'ipnl-auger-tof-1.root',
	'iba-auger-tof-1.root',
	'ipnl-auger-notof-1.root',
	'iba-auger-notof-1.root',
	'ipnl-auger-tof-3.root',
	'iba-auger-tof-3.root',
	'ipnl-auger-notof-3.root',
	'iba-auger-notof-3.root']

# typs=['ipnl-auger-tof-1.root','iba-auger-tof-1.root','ipnl-auger-notof-3.root','iba-auger-notof-3.root']
dirs = subprocess.check_output(['find . -iname "*autogen*" | sort -k1.13'],shell=True).split('\n')[:-1]

numprots = [1e9,1e8,1e7,1e6]

for typ in typs:
    ctsetsets = []
    for line,numprot in zip(dirs,[item for item in numprots for i in range(len(typs)/4)]):
        for haha in ['iba','ipnl']:
            if haha+'lyso' in line and haha+'-' in typ:
                print (haha,line,typ)
                ctsetsets.append( auger.getctset(numprot,line[2:10],line[2:10],typ,addnoise=addnoise) )
            if haha+'zinv' in line and haha+'-' in typ:
                print (haha,line,typ)
                ctsetsets.append( auger.getctset(numprot,line[2:10],line[2:10],typ,addnoise=addnoise) )
    assert(len(ctsetsets)==4)
    megaplot(ctsetsets,'PMMA_phantom')
    print 'Mean detection yield in',typ,'study over',sum([ctset['totnprim'] for ctset in ctsetsets]),'primaries in',sum([ctset['nreal'] for ctset in ctsetsets]),'realisations:',sum([ctset['detyieldmu'] for ctset in ctsetsets])

tableio.print2d(resultstable)
tableio.write(resultstable,'resultstable.tsv')
#############gate_run_submit_cluster_nomove.sh mac/main-int7rpct.mac 10
#############gate_run_submit_cluster_nomove.sh mac/main-int6ct.mac 10
#############gate_run_submit_cluster_nomove.sh mac/main-int6rpct.mac 10
#############xTcG
#############b2Aj
#############bfrX
#############rOx1
#############41VE
#############NE7B
#############yjzw
#############wfmx

#typ='ipnl'
typ='iba'

ctset_int_6 = auger.getctset(1e6,'run.yjzw','run.wfmx',typ)
ctset_int_7 = auger.getctset(1e7,'run.41VE','run.NE7B',typ)
ctset_int_8 = auger.getctset(1e8,'run.bfrX','run.rOx1',typ)
ctset_int_9 = auger.getctset(1e9,'run.xTcG','run.b2Aj',typ)

f, ((ax1,ax2),(ax3,ax4)) = plot.subplots(nrows=2, ncols=2, sharex=False, sharey=False)

auger.plotrange(ax1,ctset_int_9)
auger.plotrange(ax2,ctset_int_8)
auger.plotrange(ax3,ctset_int_7)
auger.plotrange(ax4,ctset_int_6)
f.subplots_adjust(hspace=.5)

ax1.set_xlim(-40,40)
ax2.set_xlim(-40,40)
ax3.set_xlim(-40,40)
pgemis_smooth_ctfo=auger.get_fop(pgemis_ct_x,pgemis_ct_y_smooth)
pgemis_smooth_rpctfo=auger.get_fop(pgemis_rpct_x,pgemis_rpct_y_smooth)


pgemis_ct_y_smooth20 = gaussian_filter(pgemis_ct_y, sigma=20)
pgemis_ct_y_smooth20 = pgemis_ct_y_smooth20/pgemis_ct_y_smooth20.max()
pgemis_smooth20_ctfo=auger.get_fop(pgemis_ct_x,pgemis_ct_y_smooth20)

###########################################################################################################

#detection in local frame, remove shift. coords already centered as zero, so can just add the shift

det_offset = -17.31

ipnl = auger.getctset(1e9,'fromcluster/run.8ZQJ','fromcluster/run.ahDK','ipnl-auger-tof-1.root')

pgipnl_ct_x = np.array(ipnl['ct']['x'])
pgipnl_ct_x = pgipnl_ct_x+det_offset
pgipnl_ct_y = np.array(ipnl['ct']['av'])
pgipnl_ct_y = pgipnl_ct_y-(pgipnl_ct_y[pgipnl_ct_y < np.percentile(pgipnl_ct_y, 25)].mean())  #remove floor
pgipnl_ct_y = pgipnl_ct_y/pgipnl_ct_y.max() #scale

pgipnl_rpct_x = np.array(ipnl['rpct']['x'])
pgipnl_rpct_x = pgipnl_rpct_x+det_offset
pgipnl_rpct_y = np.array(ipnl['rpct']['av'])
pgipnl_rpct_y = pgipnl_rpct_y-(pgipnl_rpct_y[pgipnl_rpct_y < np.percentile(pgipnl_rpct_y, 25)].mean()) #remove floor
pgipnl_rpct_y = pgipnl_rpct_y/pgipnl_rpct_y.max() #scale

pgipnl_ctfo = np.mean(ipnl['ct']['falloff'])+det_offset
pgipnl_rpctfo = np.mean(ipnl['rpct']['falloff'])+det_offset
    'ipnl-auger-tof-3.root', 'ipnl4mm-auger-tof-3.root',
    'iba-auger-tof-3.root', 'ipnl-auger-notof-3.root',
    'ipnl4mm-auger-notof-3.root', 'iba-auger-notof-3.root'
]

# typs=['ipnl-auger-tof-1.root','iba-auger-tof-1.root','ipnl-auger-notof-3.root','iba-auger-notof-3.root']
dirs = subprocess.check_output(['find . -iname "*autogen*" | sort -k1.13'],
                               shell=True).split('\n')[:-1]

numprots = [1e9, 1e8, 1e7, 1e6]

for typ in typs:
    ctsetsets = []
    for line, numprot in zip(
            dirs, [item for item in numprots for i in range(len(typs) / 4)]):
        for haha in ['iba', 'ipnl', 'ipnl4mm']:
            if haha + 'lyso' in line and haha + '-' in typ:
                print(haha, line, typ)
                ctsetsets.append(
                    auger.getctset(numprot, line[2:10], line[2:10], typ))
            if haha + 'zinv' in line and haha + '-' in typ:
                print(haha, line, typ)
                ctsetsets.append(
                    auger.getctset(numprot, line[2:10], line[2:10], typ))
    assert (len(ctsetsets) == 4)
    megaplot(ctsetsets, 'PMMA_phantom')
    print 'Mean detection yield in', typ, 'study over', sum(
        [ctset['totnprim'] for ctset in ctsetsets]), 'primaries in', sum([
            ctset['nreal'] for ctset in ctsetsets
        ]), 'realisations:', sum([ctset['detyieldmu'] for ctset in ctsetsets])

###########################################################################################################

#volume_offset=-141.59+7.96#spot sources
volume_offset=150-141.59+7.96#spot sources

###########################################################################################################

# BOTTOM ROW IBA

f, ((ax4,ax5,ax6),(ax1,ax2,ax3)) = plot.subplots(nrows=2, ncols=3, sharex=True, sharey=False)

typ = 'iba-auger-notof-3.root'

yield_av = auger.plot_all_ranges_2(ax1,auger.getctset(840964615,'fromclus-sorted/layers-beide/run.e8ai','fromclus-sorted/layers-beide/run.96ra',typ,manualshift=volume_offset),firstcolor='steelblue',secondcolor=None)
yield_av = auger.plot_all_ranges_2(ax1,auger.getctset(848710335,'fromclus-sorted/layers-beide/run.m4RU','fromclus-sorted/layers-beide/run.tLiY',typ,manualshift=volume_offset),firstcolor='seagreen',secondcolor=None)
ax1.set_title('KES, Spot A,\nyield: '+plot.sn(yield_av), fontsize=8)
ax1.set_ylabel('PG detected [counts]')

yield_av = auger.plot_all_ranges_2(ax2,auger.getctset(1068263318,'fromclus-sorted/layers-beide/run.E2tF','fromclus-sorted/layers-beide/run.qE8o',typ,manualshift=volume_offset),firstcolor='steelblue',secondcolor=None)
yield_av = auger.plot_all_ranges_2(ax2,auger.getctset(1071596684,'fromclus-sorted/layers-beide/run.r48i','fromclus-sorted/layers-beide/run.c0rg',typ,manualshift=volume_offset),firstcolor='seagreen',secondcolor=None)
ax2.set_title('KES, Spot B,\nyield: '+plot.sn(yield_av), fontsize=8)
ax2.set_xlabel('Position [mm]')

yield_av = auger.plot_all_ranges_2(ax3,auger.getctset(1068263318,'fromclus-sorted/layers-beide/run.E2tF','fromclus-sorted/layers-beide/run.qE8o',typ,manualshift=volume_offset),firstcolor='steelblue',secondcolor=None)
yield_av = auger.plot_all_ranges_2(ax3,auger.getctset(979533764,'fromclus-sorted/layers-beide/run.c4UF','fromclus-sorted/layers-beide/run.bj2R',typ,manualshift=volume_offset),firstcolor='seagreen',secondcolor=None)
ax3.set_title('KES, Spot C,\nyield: '+plot.sn(yield_av), fontsize=8)

######## TopRow IPNL
Example #17
0
pgemis_rpct_y_smooth = gaussian_filter(pgemis_rpct_y, sigma=smooth_param)
pgemis_rpct_y_smooth = pgemis_rpct_y_smooth / pgemis_rpct_y_smooth.max()

#pgemis_ctfo=auger.get_fop(pgemis_ct_x,pgemis_ct_y)
pgemis_rpctfo = auger.get_fop(pgemis_rpct_x, pgemis_rpct_y)

#pgemis_smooth_ctfo=auger.get_fop(pgemis_ct_x,pgemis_ct_y_smooth)
pgemis_smooth_rpctfo = auger.get_fop(pgemis_rpct_x, pgemis_rpct_y_smooth)

###########################################################################################################

#detection in local frame, remove shift. coords already centered as zero, so can just add the shift

det_offset = 13.61

ipnl = auger.getctset(1e9, 'fromcluster/run.13px', 'fromcluster/run.13px',
                      'ipnl-auger-tof-1.root')  #CT IS NONSENSE DATA

#pgipnl_ct_x = np.array(ipnl['ct']['x'])
#pgipnl_ct_x = pgipnl_ct_x+det_offset
#pgipnl_ct_y = np.array(ipnl['ct']['av'])
#pgipnl_ct_y = pgipnl_ct_y-(pgipnl_ct_y[pgipnl_ct_y < np.percentile(pgipnl_ct_y, 25)].mean())  #remove floor
#pgipnl_ct_y = pgipnl_ct_y/pgipnl_ct_y.max() #scale

pgipnl_rpct_x = np.array(ipnl['rpct']['x'])
pgipnl_rpct_x = pgipnl_rpct_x + det_offset
#pgipnl_rpct_y = np.array(ipnl['rpct']['av'])
pgipnl_rpct_y = np.array(ipnl['rpct']['data'][0])
pgipnl_rpct_y = pgipnl_rpct_y - (
    pgipnl_rpct_y[pgipnl_rpct_y < np.percentile(pgipnl_rpct_y, 25)].mean()
)  #remove floor
pgipnl_rpct_y = pgipnl_rpct_y / pgipnl_rpct_y.max()  #scale
	#ctsetsets.append( auger.getctset(1e6,'run.rFN5','run.jUPf',typ) )# 5 , 0  # AGJb ,  		:done
	#megaplot(ctsetsets,'spot61',[[6.715,20.58]])

	#ctsetsets.append( auger.getctset(1e9,'run.9WZ0','run.xEMN',typ) )#
	#ctsetsets.append( auger.getctset(1e8,'run.E3So','run.okUi',typ) )#
	#ctsetsets.append( auger.getctset(1e7,'run.aNrj','run.GERe',typ) )# , 1 # , w9gm 			:done
	#ctsetsets.append( auger.getctset(1e6,'run.7OvR','run.ykAn',typ) )#
	#megaplot(ctsetsets,'spot29',[[-1.75,0.291]])
	
	#ctsetsets.append( auger.getctset(1e9,'run.AuZu','run.ECUY',typ) )# 2 , 1 # vWKg , wS3i	:done
	#ctsetsets.append( auger.getctset(1e8,'run.XkoP','run.cLDV',typ) )#  , 6 #  , kDxT		:done
	#ctsetsets.append( auger.getctset(1e7,'run.V4ER','run.Hhup',typ) )#
	#ctsetsets.append( auger.getctset(1e6,'run.zE43','run.MUoq',typ) )# 7 ,  # EdQf , 		:done
	#megaplot(ctsetsets,'spot40',[[-10.6,-7.59]])

	ctsetsets.append( auger.getctset(1e9,'run.kVk7','run.iias',typ) )
	ctsetsets.append( auger.getctset(1e8,'run.cj4U','run.RWsd',typ) )
	ctsetsets.append( auger.getctset(1e7,'run.ngMk','run.Ho8b',typ) )
	ctsetsets.append( auger.getctset(1e6,'run.WbDj','run.f9cL',typ) )
	megaplot(ctsetsets,'waterbox')
	
	#ctsetsets.append( auger.getctset(1e9,'run.1vRP','run.KvuV',typ) )#  , 11 #  ,  g4RC		:done
	#ctsetsets.append( auger.getctset(1e8,'run.SwIj','run.XYSQ',typ) )# 50 ,  # SwIj ,  		:done
	#ctsetsets.append( auger.getctset(1e7,'run.UAJZ','run.ebjM',typ) )
	#ctsetsets.append( auger.getctset(1e6,'run.BPnu','run.q7Vn',typ) )
	#megaplot(ctsetsets,'waterboxshifted')
	
	#compare 144MeV against shifted 139mev
	#ctsetsets.append( auger.getctset(1e9,'run.LswJ','run.KvuV',typ) )
	#ctsetsets.append( auger.getctset(1e8,'run.IdLD','run.XYSQ',typ) )
	#ctsetsets.append( auger.getctset(1e7,'run.pDRM','run.ebjM',typ) )
Example #19
0
pgemis_rpct_y_smooth = gaussian_filter(pgemis_rpct_y, sigma=smooth_param)
pgemis_rpct_y_smooth = pgemis_rpct_y_smooth / pgemis_rpct_y_smooth.max()

pgemis_ctfo = auger.get_fop(pgemis_ct_x, pgemis_ct_y)
pgemis_rpctfo = auger.get_fop(pgemis_rpct_x, pgemis_rpct_y)

pgemis_smooth_ctfo = auger.get_fop(pgemis_ct_x, pgemis_ct_y_smooth)
pgemis_smooth_rpctfo = auger.get_fop(pgemis_rpct_x, pgemis_rpct_y_smooth)

###########################################################################################################

#detection in local frame, remove shift. coords already centered as zero, so can just add the shift

det_offset = -17.31

ipnl = auger.getctset(1e9, 'fromcluster/run.8ZQJ', 'fromcluster/run.ahDK',
                      'ipnl-auger-tof-1.root')

pgipnl_ct_x = np.array(ipnl['ct']['x'])
pgipnl_ct_x = pgipnl_ct_x + det_offset
pgipnl_ct_y = np.array(ipnl['ct']['av'])
pgipnl_ct_y = pgipnl_ct_y - (
    pgipnl_ct_y[pgipnl_ct_y < np.percentile(pgipnl_ct_y, 25)].mean()
)  #remove floor
pgipnl_ct_y = pgipnl_ct_y / pgipnl_ct_y.max()  #scale

pgipnl_rpct_x = np.array(ipnl['rpct']['x'])
pgipnl_rpct_x = pgipnl_rpct_x + det_offset
pgipnl_rpct_y = np.array(ipnl['rpct']['av'])
pgipnl_rpct_y = pgipnl_rpct_y - (
    pgipnl_rpct_y[pgipnl_rpct_y < np.percentile(pgipnl_rpct_y, 25)].mean()
)  #remove floor
dirs = subprocess.check_output(['find . -iname "*autogen*" | sort -k1.13'],
                               shell=True).split('\n')[:-1]

numprots = [1e9, 1e9, 1e8, 1e8, 1e7, 1e7]

typ = None
for dirr, numprot in zip(dirs, numprots):
    if numprot != 1e9:
        continue
    ctsetsets = []
    if 'iba' in dirr:
        typ = 'iba-perdet.root'
        ctsetsets.append(
            auger.getctset(numprot,
                           dirr[2:10],
                           dirr[2:10],
                           typ,
                           addnoise=addnoise))

    if 'ipnl' in dirr:
        typ = 'ipnl-perdet.root'
        ctsetsets.append(
            auger.getctset(numprot,
                           dirr[2:10],
                           dirr[2:10],
                           typ,
                           addnoise=addnoise))

    megaplot(ctsetsets, 'PMMA_phantom')
    print 'Mean detection yield in', typ, 'study over', sum(
        [ctset['totnprim'] for ctset in ctsetsets]), 'primaries in', sum([
Example #21
0
print(dirs)
numprots = [1e9, 1e9]

for typ in typs:
    ctsetsets = []
    for line, numprot in zip(
            dirs,
        [item for item in numprots for i in range(len(typs) / len(numprots))]):
        for haha in ['iba', 'ipnl']:
            if (haha + 'lyso' in line) and haha + '-' in typ:
                print(haha, line, typ, numprot)
                ctsetsets.append(
                    auger.getctset(numprot,
                                   line[2:14],
                                   None,
                                   typ,
                                   addnoise=addnoise,
                                   precolli=precolli))
                PHYSDET_PROFILE_IPNL = ctsetsets[-1]['ct']['av']
            if haha + 'zinv' in line and haha + '-' in typ:
                print(haha, line, typ, numprot)
                ctsetsets.append(
                    auger.getctset(numprot,
                                   line[2:14],
                                   None,
                                   typ,
                                   addnoise=addnoise,
                                   precolli=precolli))
                PHYSDET_PROFILE_IBA = ctsetsets[-1]['ct']['av']

    megaplot(ctsetsets, 'physabs-physcolli')
#########################################################################################################

#typ='ipnl-auger-notof-1.root'
#typ='ipnlf-auger-tof-1.root'
#typ='ipnlf-auger-notof-1.root'
#typ='iba-auger-tof-3.root'

typ = 'ipnl-auger-tof-1.root'
typ = 'iba-auger-notof-3.root'

#we dont know what the added or reduced noise level is when changing energy windows, so we cant compare performance for ipnl3 and iba1.
#we could study the signal only.

#geolayaers
geolabels = ["mid", "75\%", "dist 2", "dist"]
ctset_dist = auger.getctset(197149701, 'run.YKEk', 'run.pwy4', typ)  #-1
ctset_dist2 = auger.getctset(395650000, 'run.C8rL', 'run.r0LF', typ)  # -1-2
ctset_75 = auger.getctset(1381819491, 'run.oVKm', 'run.dltw', typ)  # -6
ctset_mid = auger.getctset(1428709464, 'run.LqMK', 'run.WZUT', typ)  # -12

#elayers
elabels = ["mid", "75\%", "dist"]
ctset_dist_e = auger.getctset(488628830, 'run.Mwtv', 'run.EKMm', typ)  # 0
ctset_75_e = auger.getctset(1285014551, 'run.gFh9', 'run.q4DU', typ)  # 10
ctset_mid_e = auger.getctset(976598251, 'run.G8o6', 'run.UQ32', typ)  # 24

#########################################################################################################

from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
	for i,ctset in enumerate(ctsets):
		auger.plotfodist(ax1,ctset,i,emisfops,labels,axlabel)
	if emisfops is not None and len(emisfops) == 1:
		ax1.set_title(studyname+', $CT_{FOP_{em}}$ = '+str(emisfops[0][0])[:5]+', $RPCT_{FOP_{em}}$ = '+str(emisfops[0][1])[:5], y=1.08)

	#plt.legend()#shadow = True,frameon = True,fancybox = True,ncol = 1,fontsize = 'x-small',loc = 'lower right')

	#plt.tight_layout(rect = [-0.1, 0.0, 1.0, 1.1])#L,B,R,T
	plt.savefig(studyname+'-'+typ+'-FOP-dist.pdf')#, bbox_inches='tight')
	plt.close('all')

	#############################################################################################
	# TODO add pgemissions plots.


for typ in typs:
	ctsetsets = []

	ctsetsets.append( auger.getctset(1e9,'1e9','1e9',typ) )
	ctsetsets.append( auger.getctset(1e8,'1e8','1e8',typ) )
	ctsetsets.append( auger.getctset(1e7,'1e7','1e7',typ) )
	ctsetsets.append( auger.getctset(1e6,'1e6','1e6',typ) )
	#ctsetsets.append( auger.getctset(1e9,'run.3poV','run.wucX',typ) )
	#ctsetsets.append( auger.getctset(1e8,'run.1XRe','run.lTdI',typ) )
	#ctsetsets.append( auger.getctset(1e7,'run.oPE7','run.RWkp',typ) )
	#ctsetsets.append( auger.getctset(1e6,'run.7bG6','run.pijb',typ) )
	megaplot(ctsetsets,'waterbox_redo')

	print 'Mean detection yield in',typ,'study over',sum([ctset['totnprim'] for ctset in ctsetsets]),'primaries in',sum([ctset['nreal'] for ctset in ctsetsets]),'realisations:',sum([ctset['detyieldmu'] for ctset in ctsetsets])
numprots = [1e9, 1e8, 1e7]  #,1e6]

for typ in typs:
    ctsetsets = []
    for line, numprot in zip(
            dirs,
        [item for item in numprots for i in range(len(typs) / len(numprots))]):

        for haha in ['iba', 'ipnl']:
            if (haha + 'lyso' in line
                    or haha + 'bgo' in line) and haha + '-' in typ:
                print(haha, line, typ)
                ctsetsets.append(
                    auger.getctset(numprot,
                                   line[2:10],
                                   line[2:10],
                                   typ,
                                   addnoise=addnoise,
                                   precolli=precolli))
            if haha + 'zinv' in line and haha + '-' in typ:
                print(haha, line, typ)
                ctsetsets.append(
                    auger.getctset(numprot,
                                   line[2:10],
                                   line[2:10],
                                   typ,
                                   addnoise=addnoise,
                                   precolli=precolli))
    assert (len(ctsetsets) == 3)
    megaplot(ctsetsets, 'PMMA_phantom')
    print 'Mean detection yield in', typ, 'study over', sum(
        [ctset['totnprim'] for ctset in ctsetsets]), 'primaries in', sum([
#########################################################################################################

#typ='ipnl-auger-notof-1.root'
#typ='ipnlf-auger-tof-1.root'
#typ='ipnlf-auger-notof-1.root'
#typ='iba-auger-tof-3.root'

typ='ipnl-auger-tof-1.root'
typ='iba-auger-notof-3.root'

#we dont know what the added or reduced noise level is when changing energy windows, so we cant compare performance for ipnl3 and iba1.
#we could study the signal only.

#geolayaers
geolabels = ["mid","75\%","dist 2","dist"]
ctset_dist = auger.getctset(197149701,'run.YKEk','run.pwy4',typ) #-1
ctset_dist2 = auger.getctset(395650000,'run.C8rL','run.r0LF',typ) # -1-2
ctset_75 = auger.getctset(1381819491,'run.oVKm','run.dltw',typ) # -6
ctset_mid = auger.getctset(1428709464,'run.LqMK','run.WZUT',typ) # -12

#elayers
elabels = ["mid","75\%","dist"]
ctset_dist_e = auger.getctset(488628830,'run.Mwtv','run.EKMm',typ) # 0
ctset_75_e = auger.getctset(1285014551,'run.gFh9','run.q4DU',typ) # 10
ctset_mid_e = auger.getctset(976598251,'run.G8o6','run.UQ32',typ) # 24


#########################################################################################################

from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
Example #26
0
#ctsetsets.append( auger.getctset(1e9,'run.TtIT','run.SmHn',typ,manualshift=shift) )
#ctsetsets.append( auger.getctset(1e8,'run.t4Fb','run.w9Te',typ,manualshift=shift) )
#ctsetsets.append( auger.getctset(27200000,'run.YtND','run.SQy4',typ,manualshift=shift) )
#ctsetsets.append( auger.getctset(1e7,'run.WQUJ','run.JJQQ',typ,manualshift=shift) )
#megaplot(ctsetsets,'spot40',emisfops=None,labels=["$10^9$","$10^8$","$2.7\cdot10^7$","$10^7$"])

#shift = 22.20-29.04
#ctsetsets = []
#ctsetsets.append( auger.getctset(1e9,'run.EYBe','run.6HvZ',typ,manualshift=shift) )
#ctsetsets.append( auger.getctset(1e8,'run.W3sR','run.q7v2',typ,manualshift=shift) )
#ctsetsets.append( auger.getctset(47300000,'run.R9KU','run.rTUp',typ,manualshift=shift) )
#ctsetsets.append( auger.getctset(1e7,'run.1jXf','run.8NDz',typ,manualshift=shift) )
#megaplot(ctsetsets,'spot61',emisfops=None,labels=["$10^9$","$10^8$","$4.7\cdot10^7$","$10^7$"])

ctsetsets = []
ctsetsets.append(auger.getctset(840964615, 'run.CKCH', 'run.lrnj', typ))  #elay
ctsetsets.append(auger.getctset(848710335, 'run.3At2', 'run.Ydep',
                                typ))  #geolay
megaplot(ctsetsets,
         'layer29',
         emisfops=None,
         labels=['Iso-Energy Layer', 'Iso-Depth Layer'],
         axlabel='Grouping Method')

ctsetsets = []
ctsetsets.append(auger.getctset(1068263318, 'run.7coj', 'run.ptEe',
                                typ))  #elay, same as elay61
ctsetsets.append(auger.getctset(1071596684, 'run.KXRm', 'run.jTj9',
                                typ))  #geolay
megaplot(ctsetsets,
         'layer40',
pgemis_rpct_y_smooth = pgemis_rpct_y_smooth/pgemis_rpct_y_smooth.max()

#pgemis_ctfo=auger.get_fop(pgemis_ct_x,pgemis_ct_y)
pgemis_rpctfo=auger.get_fop(pgemis_rpct_x,pgemis_rpct_y)

#pgemis_smooth_ctfo=auger.get_fop(pgemis_ct_x,pgemis_ct_y_smooth)
pgemis_smooth_rpctfo=auger.get_fop(pgemis_rpct_x,pgemis_rpct_y_smooth)


###########################################################################################################

#detection in local frame, remove shift. coords already centered as zero, so can just add the shift

det_offset = 13.61

ipnl = auger.getctset(1e9,'fromcluster/run.13px','fromcluster/run.13px','ipnl-auger-tof-1.root') #CT IS NONSENSE DATA

#pgipnl_ct_x = np.array(ipnl['ct']['x'])
#pgipnl_ct_x = pgipnl_ct_x+det_offset
#pgipnl_ct_y = np.array(ipnl['ct']['av'])
#pgipnl_ct_y = pgipnl_ct_y-(pgipnl_ct_y[pgipnl_ct_y < np.percentile(pgipnl_ct_y, 25)].mean())  #remove floor
#pgipnl_ct_y = pgipnl_ct_y/pgipnl_ct_y.max() #scale

pgipnl_rpct_x = np.array(ipnl['rpct']['x'])
pgipnl_rpct_x = pgipnl_rpct_x+det_offset
#pgipnl_rpct_y = np.array(ipnl['rpct']['av'])
pgipnl_rpct_y = np.array(ipnl['rpct']['data'][0])
pgipnl_rpct_y = pgipnl_rpct_y-(pgipnl_rpct_y[pgipnl_rpct_y < np.percentile(pgipnl_rpct_y, 25)].mean()) #remove floor
pgipnl_rpct_y = pgipnl_rpct_y/pgipnl_rpct_y.max() #scale

#pgipnl_ctfo = np.mean(ipnl['ct']['falloff'])+det_offset