#!/usr/bin/env python """ Mupage2 is an event generator for downgoing muon events. It is a reimplementation of the origianal mupage code. -o : output file (.evt extension will cause writing ascii) default = mupage2.aa.root -n : number of events default = 100000 -r : can radius (m) default = 1000 -t : depth of top of can default = 2000 -b : depth of bottom of can default = 2000 -v : verbosity default = 0 -h : help default = False """ import aa,sys,ROOT,muons from math import * from ROOT import * ROOT.TH1.AddDirectory( False ) options = aa.Options( __doc__, sys.argv[1:] ) mupage = ROOT.Mupage() mupage.Emin = 50 mupage.bias_m1 = False mupage.depth = options.t / 1000 * 1.03 mupage.can.height = options.b - options.t mupage.can.radius = options.r mupage.can.center.set( 0,0, mupage.can.height / 2 ); mupage.init() c = TCanvas("c","c",600,900) c.Divide(2,3) E = EnergySampler( 2.0 , 0.1, 10 ) E.h_r_vs_e1.Draw("colz") for i in range( 1,10 ): E.h_en[i].SetMaximum(0.14) E.h_en[i].SetLineColor(i) E.h_en[i].Draw( "same" if i>1 else "" ) print i, E.h_en[i].Integral() import sys sys.exit() import copy h1 = copy.copy(h0) h2 = copy.copy(h1) N = 1 for i in range( 6 ) : print i, N c.cd(i+1) gPad.SetLogy() h2.DrawCopy() h2 = convolute_log( h2, h2 ) N*=2 h2.SetTitle( str(N) ) h2.Scale( 1.0 / h2.Integral() ) h1.Scale(0) for i in range(1000000): x = log10( sum( 10**h0.GetRandom() for n in range(32) ) ) h1.Fill(x ) print "done" c.cd(6) h1.Scale( 1.0 / h1.Integral() ) h1.Draw("same") gPad.Update()