Functions | Variables
RunSnowGlobes Namespace Reference

Functions

def ParseSnowGlobesEventTable (file)
 Functions. More...
 

Variables

 parser = OptionParser()
 
 help
 
 action
 
 type
 
 dest
 
 default
 
 options
 
 args
 
string DATA_DIRECTORY = "/nova/app/users/jvasel/private/projects/supernova/Matts-code/data"
 Parameters. More...
 
string FLUX_DIRECTORY = "/nova/app/users/jvasel/private/projects/supernova/Matts-code/out"
 
string OUT_DIRECTORY = "/nova/app/users/jvasel/private/projects/supernova/Matts-code/sg-out"
 
string DISTANCE = "10"
 
string CHANNELS = "nova_soup"
 
string DETECTOR = "novaFD"
 
list INTERACTIONS = ["ibd", "nue", "nue_C12", "nuebar_C12"]
 
 raw_data_files = glob("%s/SN_fluence_%s_%s_kPc*.dat"%(FLUX_DIRECTORY,options.input,DISTANCE))
 Get data files raw_data_files = glob("%s/SN_fluence_%s_kPc_mb_*.dat"%(FLUX_DIRECTORY,DISTANCE)) raw_data_files = glob("%s/SN_fluence_garching_%s_kPc*.dat"%(FLUX_DIRECTORY,DISTANCE)) More...
 
list data_files = []
 
 mb = int(d[len(FLUX_DIRECTORY)+1:len(d)-4].split("_").pop())
 
 this_d = d[len(FLUX_DIRECTORY)+1:len(d)-4]
 
bool remove_all = True
 
dictionary interaction_pdfs = {}
 Run snowglobes for each of these. More...
 
string command = "./supernova.pl %s %s %s"
 
 output_files = glob("%s/*%s_*%s_events_smeared.dat"%(OUT_DIRECTORY,d,DETECTOR))
 
list this_out = []
 
 pdf = ParseSnowGlobesEventTable(this_out[0])
 
string root_output_name = "%s_pdfs.root"
 Finalise print "run : --- Output c++" for i in INTERACTIONS: print "run : Interaction type: %s"i mbs = interaction_pdfs[i].keys() print "run : found %i mbs"len(mbs) mbs.sort() print mbs check that these are continous and complete assert(mbs[0]==1.) assert(mbs[-1]==len(mbs)) print "static const int fNtimePoints = %i;"len(mbs) print "static const int fNenergyBins = 200;" output_file = open("pdf.txt", "w") output_file.write("PositronPDF: ") output_file.write("[") for mb in mbs: string = " [" for p in interaction_pdfs[i][mb]: if p!=interaction_pdfs[i][mb][-1]: string+="%e,"p else: string+="%e"p if mb != mbs[-1]: string+="]," else: string+="]" output_file.write(string+"\n") output_file.write("]") More...
 
 root_file = ROOT.TFile(root_output_name, "RECREATE")
 
 mbs = interaction_pdfs[i].keys()
 
 n_pdfs = len(interaction_pdfs[i][1])
 
 histogram = ROOT.TH2F(i, "%s;Time [mb];Energy [MeV];PDF;"%i,len(mbs),0.5,len(mbs)+0.5,n_pdfs,0.5,n_pdfs+0.5)
 

Function Documentation

def RunSnowGlobes.ParseSnowGlobesEventTable (   file)

Functions.

Definition at line 21 of file RunSnowGlobes.py.

References ana.assert(), check_time_usage.float, and open().

22  return_values = []
23  lines = open(file,"r").readlines()
24  assert(len(lines)==202)
25  for i,line in enumerate(lines):
26  if i >= 200:continue
27  #print line.strip()
28  data = float(line.split()[1])
29  return_values.append(data)
30  pass
31  assert(len(return_values)==200)
32  return return_values
procfile open("FD_BRL_v0.txt")
def ParseSnowGlobesEventTable(file)
Functions.
assert(nhit_max >=nhit_nbins)

Variable Documentation

RunSnowGlobes.action

Definition at line 12 of file RunSnowGlobes.py.

RunSnowGlobes.args

Definition at line 15 of file RunSnowGlobes.py.

string RunSnowGlobes.CHANNELS = "nova_soup"

Definition at line 38 of file RunSnowGlobes.py.

string RunSnowGlobes.command = "./supernova.pl %s %s %s"

Definition at line 69 of file RunSnowGlobes.py.

string RunSnowGlobes.DATA_DIRECTORY = "/nova/app/users/jvasel/private/projects/supernova/Matts-code/data"

Parameters.

Definition at line 34 of file RunSnowGlobes.py.

list RunSnowGlobes.data_files = []

Definition at line 46 of file RunSnowGlobes.py.

RunSnowGlobes.default

Definition at line 12 of file RunSnowGlobes.py.

RunSnowGlobes.dest

Definition at line 12 of file RunSnowGlobes.py.

string RunSnowGlobes.DETECTOR = "novaFD"

Definition at line 39 of file RunSnowGlobes.py.

string RunSnowGlobes.DISTANCE = "10"

Definition at line 37 of file RunSnowGlobes.py.

string RunSnowGlobes.FLUX_DIRECTORY = "/nova/app/users/jvasel/private/projects/supernova/Matts-code/out"

Definition at line 35 of file RunSnowGlobes.py.

RunSnowGlobes.help

Definition at line 12 of file RunSnowGlobes.py.

RunSnowGlobes.histogram = ROOT.TH2F(i, "%s;Time [mb];Energy [MeV];PDF;"%i,len(mbs),0.5,len(mbs)+0.5,n_pdfs,0.5,n_pdfs+0.5)
dictionary RunSnowGlobes.interaction_pdfs = {}

Run snowglobes for each of these.

Definition at line 62 of file RunSnowGlobes.py.

list RunSnowGlobes.INTERACTIONS = ["ibd", "nue", "nue_C12", "nuebar_C12"]

Definition at line 40 of file RunSnowGlobes.py.

RunSnowGlobes.mb = int(d[len(FLUX_DIRECTORY)+1:len(d)-4].split("_").pop())
RunSnowGlobes.mbs = interaction_pdfs[i].keys()

Definition at line 125 of file RunSnowGlobes.py.

RunSnowGlobes.n_pdfs = len(interaction_pdfs[i][1])

Definition at line 131 of file RunSnowGlobes.py.

RunSnowGlobes.options

Definition at line 15 of file RunSnowGlobes.py.

string RunSnowGlobes.OUT_DIRECTORY = "/nova/app/users/jvasel/private/projects/supernova/Matts-code/sg-out"

Definition at line 36 of file RunSnowGlobes.py.

RunSnowGlobes.output_files = glob("%s/*%s_*%s_events_smeared.dat"%(OUT_DIRECTORY,d,DETECTOR))

Definition at line 78 of file RunSnowGlobes.py.

RunSnowGlobes.parser = OptionParser()

Definition at line 11 of file RunSnowGlobes.py.

RunSnowGlobes.pdf = ParseSnowGlobesEventTable(this_out[0])
RunSnowGlobes.raw_data_files = glob("%s/SN_fluence_%s_%s_kPc*.dat"%(FLUX_DIRECTORY,options.input,DISTANCE))

Get data files raw_data_files = glob("%s/SN_fluence_%s_kPc_mb_*.dat"%(FLUX_DIRECTORY,DISTANCE)) raw_data_files = glob("%s/SN_fluence_garching_%s_kPc*.dat"%(FLUX_DIRECTORY,DISTANCE))

Definition at line 44 of file RunSnowGlobes.py.

bool RunSnowGlobes.remove_all = True

Definition at line 55 of file RunSnowGlobes.py.

RunSnowGlobes.root_file = ROOT.TFile(root_output_name, "RECREATE")

Definition at line 122 of file RunSnowGlobes.py.

string RunSnowGlobes.root_output_name = "%s_pdfs.root"

Finalise print "run : --- Output c++" for i in INTERACTIONS: print "run : Interaction type: %s"i mbs = interaction_pdfs[i].keys() print "run : found %i mbs"len(mbs) mbs.sort() print mbs check that these are continous and complete assert(mbs[0]==1.) assert(mbs[-1]==len(mbs)) print "static const int fNtimePoints = %i;"len(mbs) print "static const int fNenergyBins = 200;" output_file = open("pdf.txt", "w") output_file.write("PositronPDF: ") output_file.write("[") for mb in mbs: string = " [" for p in interaction_pdfs[i][mb]: if p!=interaction_pdfs[i][mb][-1]: string+="%e,"p else: string+="%e"p if mb != mbs[-1]: string+="]," else: string+="]" output_file.write(string+"\n") output_file.write("]")

Definition at line 120 of file RunSnowGlobes.py.

RunSnowGlobes.this_d = d[len(FLUX_DIRECTORY)+1:len(d)-4]

Definition at line 52 of file RunSnowGlobes.py.

list RunSnowGlobes.this_out = []

Definition at line 83 of file RunSnowGlobes.py.

RunSnowGlobes.type

Definition at line 12 of file RunSnowGlobes.py.