Exemple #1
0
    br.run(processdata, reconstructdata, rowcount, cfg.reconstructiongridwidth,
           eff)
    message = str(time.asctime(
        time.localtime())) + " Completed simulation of " + str(n) + " events!"
    print message
    import os, sys
    import sendemail as se
    name = os.path.basename(__file__)
    se.send(name, message)

if cfg.plotcut:
    allcounts = cc.run(reconstructdata, rowcount, int(cfg.mincount))

    sys.path.append('/d6/rstein/Hamburg-Cosmic-Rays/BDT')
    import BDT
    BDT.run(reconstructdata, rowcount, int(cfg.mincount), allcounts)

    llcuts = oz.run(reconstructdata + "_BDT", rowcount, int(cfg.mincount),
                    cfg.graph, allcounts)
    print llcuts
    pl.run(reconstructdata + "_BDT", rowcount, int(cfg.mincount), cfg.graph,
           llcuts, allcounts)
    pz.run(reconstructdata + "_BDT", rowcount, int(cfg.mincount), cfg.graph,
           llcuts, allcounts)
    pp.run(reconstructdata + "_BDT", rowcount, int(cfg.mincount), cfg.graph,
           llcuts)
    pe.run(reconstructdata + "_BDT", rowcount, int(cfg.mincount), cfg.graph,
           llcuts)
    ph.run(reconstructdata + "_BDT", rowcount, int(cfg.mincount), cfg.graph,
           llcuts)
	s.run(eff, rowcount, mincount=cfg.mincount, text=cfg.text, graph=cfg.graph, output=sourcedata, layout=cfg.orientation, number = n)
	bp.run(sourcedata, processdata, int(cfg.mincount), rowcount, text=cfg.text)
	br.run(processdata, reconstructdata, rowcount, cfg.reconstructiongridwidth, eff)
	message = str(time.asctime(time.localtime())) + " Completed simulation of " + str(n) + " events!"
	print message
	import os, sys
	import sendemail as se
	name = os.path.basename(__file__)
	se.send(name, message)
	
if cfg.plotcut:
	allcounts = cc.run(reconstructdata, rowcount, int(cfg.mincount))
	
	sys.path.append('/d6/rstein/Hamburg-Cosmic-Rays/BDT')
	import BDT
	BDT.run(reconstructdata, rowcount, int(cfg.mincount), allcounts)
	
	llcuts = oz.run(reconstructdata + "_BDT", rowcount, int(cfg.mincount), cfg.graph, allcounts)
	print llcuts
	pl.run(reconstructdata+ "_BDT", rowcount, int(cfg.mincount), cfg.graph, llcuts, allcounts)
	pz.run(reconstructdata+ "_BDT", rowcount, int(cfg.mincount), cfg.graph, llcuts, allcounts)
	pp.run(reconstructdata+ "_BDT", rowcount, int(cfg.mincount), cfg.graph, llcuts)
	pe.run(reconstructdata+ "_BDT", rowcount, int(cfg.mincount), cfg.graph, llcuts)
	ph.run(reconstructdata+ "_BDT", rowcount, int(cfg.mincount), cfg.graph, llcuts)
	
if cfg.plot:
	pz.run(reconstructdata, rowcount, int(cfg.mincount), cfg.graph, defaultcuts)
	pp.run(reconstructdata, rowcount, int(cfg.mincount), cfg.graph, defaultcuts)
	pe.run(reconstructdata, rowcount, int(cfg.mincount), cfg.graph, defaultcuts)
	ph.run(reconstructdata, rowcount, int(cfg.mincount), cfg.graph, defaultcuts)
rateperhour = detectedflux * 60 * 60
n = int(rateperhour*float(numberofhours))
totalhours = numberofhours*5000
totaln = n*5000
print time.asctime(time.localtime()),"Cosmic Ray Iron Flux is", flux, "Simulated Area is", area, "Field of View is", solidangle, "Detected Flux is", detectedflux
print time.asctime(time.localtime()),"Rate per hour", rateperhour, "Simulated Hours", numberofhours, "Simulated Events", n 
print time.asctime(time.localtime()),"Simulated 500 events, equal to", totalhours, "Simulated Hours. Simulated Events", totaln 



pickle_dir = "/nfs/astrop/d6/rstein/chargereconstructionpickle/combined/"		
statsdata = pickle_dir + "stats.p"
traindata = pickle_dir + "trainingset.p"

plpd.run(statsdata)
BDT.run(traindata, statsdata, int(mincount))
pd.run(statsdata, int(mincount), cuts=[0.0, 0.0])
llcuts = oz.run(statsdata, int(mincount))
pem.run(statsdata, int(mincount), cuts=llcuts)
pb.run(statsdata, int(mincount), cuts=llcuts)
print "Log Likelihood Cuts", llcuts
pz.run(statsdata, int(mincount), cuts=None)
pe.run(statsdata, int(mincount), cuts=None)
pd.run(statsdata, int(mincount), cuts=None)
ph.run(statsdata, int(mincount), cuts=None)
pp.run(statsdata, int(mincount), cuts=None)

pz.run(statsdata, int(mincount), cuts=llcuts)
pl.run(statsdata, int(mincount), cuts=llcuts)
pp.run(statsdata, int(mincount), cuts=llcuts)
pd.run(statsdata, int(mincount), cuts=[0.0, 0.0])