diff --git a/distribsForHNLandBG_byEvent.py b/distribsForHNLandBG_byEvent.py index 72f10c8..5705d68 100755 --- a/distribsForHNLandBG_byEvent.py +++ b/distribsForHNLandBG_byEvent.py @@ -74,15 +74,15 @@ c1.Print('accPlots/%s.png'%key) datafolder = '/afs/cern.ch/user/e/egrave/private/ShipData/UsedForTP' -fpimu = r.TFile(datafolder + '/pimu/ShipAna_newGen.root', 'read') +fpimu = r.TFile(datafolder + '/pimu/ShipAna_newGen_caloFix.root', 'read') pimu = fpimu.Get('t') pimu_geo = tools.searchForNodes3_xyz_dict(datafolder + '/pimu/geofile_full.10.0.Pythia8-TGeant4-1.0GeV-008.root')#'../DATA/MUPI/geofile_full.10.0.Pythia8-TGeant4-1.0GeV-008-2985556.root') -fmumunu = r.TFile(datafolder + '/mumunu/ShipAna_newGen.root', 'read')#r.TFile('../DATA/MUMUNU/ShipAna.root','read') +fmumunu = r.TFile(datafolder + '/mumunu/ShipAna_newGen_caloFix.root', 'read')#r.TFile('../DATA/MUMUNU/ShipAna.root','read') mumunu = fmumunu.Get('t') mumunu_geo = tools.searchForNodes3_xyz_dict(datafolder + '/mumunu/geofile_full.10.0.Pythia8-TGeant4-1.0GeV-008-mumunu.root')#'../DATA/MUMUNU/geofile_full.10.0.Pythia8-TGeant4-1.0GeV-008-TOTAL.root') -ftiny = r.TFile(datafolder + '/eenu-100MeV/ShipAna_newGen.root', 'read') +ftiny = r.TFile(datafolder + '/eenu-100MeV/ShipAna_newGen_caloFix.root', 'read') tiny = ftiny.Get('t') tiny_geo = tools.searchForNodes3_xyz_dict(datafolder + '/eenu-100MeV/geofile_full.10.0.Pythia8-TGeant4-0.1GeV-011.root') @@ -100,7 +100,8 @@ # Neutrinos from yandex #fnu = r.TFile('../DATA/nuFromYandex/newGen_15340000_nuBg.root') -fnu = r.TFile.Open('root://eoslhcb.cern.ch//eos/ship/data/neutrinoBackground/Yandex_for_TP/newGen_11560000_nuBg_total.root','read') +#fnu = r.TFile.Open('root://eoslhcb.cern.ch//eos/ship/data/neutrinoBackground/Yandex_for_TP/newGen_11560000_nuBg_total.root','read') +fnu = r.TFile.Open('root://eoslhcb.cern.ch//eos/ship/data/neutrinoBackground/20150702/outputJune2015-nu-16700000-addWeight_100mradcut.root','read') nu = fnu.Get('t') nu_geo = tools.searchForNodes3_xyz_dict(datafolder + '/nuBgGeo/geofile_full.10.0.Genie-TGeant4.root')#neutrino77.root') @@ -134,6 +135,7 @@ # - DOCA < 10 cm # - has no veto? +""" flux_nu = 1.05e+11 * 2.e+20/ 5.e+13#1.61e+11 * 2.e+20/ 4.e+13 flux_anti = 7.38e+10 * 2.e+20 / 5.e+13#1.02e+11 * 2.e+20 / 4.e+13 #flux_nu = (1.09e+12 * 2.e+20)/ 5.e+13 @@ -142,6 +144,17 @@ entries_anti =175*10e+3#entries_anti = 200000-2 weight_nu = "(weight * %s / %s)"%(flux_nu,entries_nu) weight_anti ="(weight * %s / %s)"%(flux_anti,entries_anti) +""" + +# ATTENTION: NEW WEIGHTS SINCE 2 JUL 2015 +# WEIGHT FORMULA HAS CHANGED +# BUT I DID NOT UNDERSTAND IT :) +# Neutrinos +flux_nu = (1.05e+11 * 2.e+20 / (5.e+13)) * 6.7e-39 * 2. +entries_nu = 16700000 +flux_anti = (1.05e+11 * 2.e+20 / (5.e+13)) * 6.7e-39 +entries_anti = 1750000 + class MyParticle(object): """ Simulating an ntuple filled by particle from one filled by event :) """ @@ -592,7 +605,6 @@ return cut, string - def countWithDraw(study, answers=False): t = studies[study]['data'] geo = studies[study]['geo'] @@ -634,6 +646,26 @@ tc.ecal()[0], tc.muon1(1)[0], tc.muon2(1)[0], tc.doca(30.)[0], tc.ip(250.)[0] ] cutnames = [ tc.recoed()[1], tc.notVetoed(1000.)[1], tc.redChi2(5.)[1], tc.ndf(25)[1], tc.fiducial(zmin, zmax, 250., 500.)[1], tc.goodtracks()[1], tc.ecal()[1], tc.muon1(1)[1], tc.muon2(1)[1], tc.doca(30.)[1], tc.ip(250.)[1] ] + if answers: + # answering to referees questions + cuts = [ tc.recoed()[0], tc.notVetoed(1000.)[0], + tc.fiducial(zmin, zmax, 250., 500.)[0], tc.goodtracks()[0], + tc.daughtersP(1.5)[0], tc.redChi2(5.)[0], tc.ndf(25)[0], tc.doca(1.)[0], tc.ip(10.)[0], + tc.ecal()[0], tc.muon1(1)[0], tc.muon2(1)[0] ] + cutnames = [ tc.recoed()[1], tc.notVetoed(1000.)[1], + tc.fiducial(zmin, zmax, 250., 500.)[1], tc.goodtracks()[1], + tc.daughtersP(1.5)[1], tc.redChi2(5.)[1], tc.ndf(25)[1], tc.doca(1.)[1], tc.ip(10.)[1], + tc.ecal()[1], tc.muon1(1)[1], tc.muon2(1)[1] ] + if answers == 2: + # answering to referees questions (NO VETO) + cuts = [ tc.recoed()[0], + tc.fiducial(zmin, zmax, 250., 500.)[0], tc.goodtracks()[0], + tc.daughtersP(1.5)[0], tc.redChi2(5.)[0], tc.ndf(25)[0], tc.doca(1.)[0], tc.ip(10.)[0], + tc.ecal()[0], tc.muon1(1)[0], tc.muon2(1)[0] ] + cutnames = [ tc.recoed()[1], + tc.fiducial(zmin, zmax, 250., 500.)[1], tc.goodtracks()[1], + tc.daughtersP(1.5)[1], tc.redChi2(5.)[1], tc.ndf(25)[1], tc.doca(1.)[1], tc.ip(10.)[1], + tc.ecal()[1], tc.muon1(1)[1], tc.muon2(1)[1] ] elif (study == 'mumunu'): cuts = [ tc.recoed()[0], tc.notVetoed(1000.)[0], tc.redChi2(5.)[0], tc.ndf(25)[0], tc.fiducial(zmin, zmax, 250., 500.)[0], tc.goodtracks()[0], tc.muon1(2)[0], tc.muon2(2)[0], tc.doca(30.)[0], tc.ip(250.)[0] ] @@ -895,7 +927,7 @@ weighted_string = "Acceptance" if study == 'nu': weighted_string = "Events / 5 years" - results[study]['efficiencies'] = [ results[study]['numbersWithWeights'][i]/results[study]['numbersWithWeights'][i-1] for i in xrange(1, len(results[study]['numbersWithWeights']))] + results[study]['efficiencies'] = [ results[study]['numbersWithWeights'][i]/results[study]['numbersWithWeights'][i-1] if results[study]['numbersWithWeights'][i-1] != 0 else 0. for i in xrange(1, len(results[study]['numbersWithWeights']))] results[study]['effStrings'] = ['-'] + [ "{:.1f} \\%".format(float(e) * 100) for e in results[study]['efficiencies'] ] #for s in results[study]['effStrings']: # print s