diff --git a/distribsForHNLandBG_byEvent.py b/distribsForHNLandBG_byEvent.py index 8e099fe..f1f3661 100755 --- a/distribsForHNLandBG_byEvent.py +++ b/distribsForHNLandBG_byEvent.py @@ -73,26 +73,19 @@ c1.Print('accPlots/%s.pdf'%key) c1.Print('accPlots/%s.png'%key) - - - -fpimu = r.TFile('../DATA/NewPIMU/ShipAna_newGen.root','read')#r.TFile('../DATA/MUPI/ShipAna.root','read') +datafolder = '/afs/cern.ch/user/e/egrave/private/ShipData/UsedForTP' +#fpimu = r.TFile(datafolder + '/pimu/ShipAna_newGen_caloFix.root', 'read') +fpimu = r.TFile(datafolder + '/pimu/ShipAna_newGen_caloFix_betterTracks.root', 'read') pimu = fpimu.Get('t') -pimu_geo = tools.searchForNodes3_xyz_dict('../DATA/NewPIMU/geofile_full.10.0.Pythia8-TGeant4-1.0GeV-008.root')#'../DATA/MUPI/geofile_full.10.0.Pythia8-TGeant4-1.0GeV-008-2985556.root') +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') -""" -fpimu = r.TFile('../DATA/signalFromThomas/ShipAna_newGen.root','read')#r.TFile('../DATA/MUPI/ShipAna.root','read') -pimu = fpimu.Get('t') -pimu_geo = tools.searchForNodes3_xyz_dict('../DATA/signalFromThomas/geofile_full.10.0.Pythia8-TGeant4_50k.root')#'../DATA/MUPI/geofile_full.10.0.Pythia8-TGeant4-1.0GeV-008-2985556.root') -""" - -fmumunu = r.TFile('../DATA/NewMUMUNU/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('../DATA/NewMUMUNU/geofile_full.10.0.Pythia8-TGeant4-1.0GeV-008-mumunu.root')#'../DATA/MUMUNU/geofile_full.10.0.Pythia8-TGeant4-1.0GeV-008-TOTAL.root') +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('../DATA/SmallHNLs/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('../DATA/SmallHNLs/geofile_full.10.0.Pythia8-TGeant4-0.1GeV-011.root') +tiny_geo = tools.searchForNodes3_xyz_dict(datafolder + '/eenu-100MeV/geofile_full.10.0.Pythia8-TGeant4-0.1GeV-011.root') #fcosmics = r.TFile('../DATA/Cosmics/ShipAna.root','read') #cosmics = fcosmics.Get('ShipAna') @@ -107,18 +100,29 @@ #nu_geo = tools.searchForNodes3_xyz_dict('../DATA/NewKLONG/geofile_full.10.0.Genie-TGeant4_nu.root')#neutrino77.root') # Neutrinos from yandex -fnu = r.TFile('../DATA/nuFromYandex/newGen_15340000_nuBg.root') +#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/20150702/outputJune2015-nu-16700000-addWeight_100mradcut.root','read') nu = fnu.Get('t') -nu_geo = tools.searchForNodes3_xyz_dict('../DATA/nuFromYandex/geofile_full.10.0.Genie-TGeant4.root')#neutrino77.root') +nu_geo = tools.searchForNodes3_xyz_dict(datafolder + '/nuBgGeo/geofile_full.10.0.Genie-TGeant4.root')#neutrino77.root') + +#fdp = r.TFile(datafolder + '/../HNLasDP/ShipAna_newGen.root') +fdp = r.TFile(datafolder + '/../HNLasDP/ShipAna_newGen_betterTracks.root') +dp = fdp.Get('t') +dp_geo = tools.searchForNodes3_xyz_dict(datafolder + '/../HNLasDP/geofile_full.10.0.Pythia8-TGeant4.root') # For a correct normalisation, we subtract the events that have an HNL vertex produced outside of the 60m fiducial volume +r.gROOT.SetBatch(r.kTRUE) +ndp = dp.Draw('weight', 'BadTruthVtx==0 && weight>0') +r.gROOT.SetBatch(r.kFALSE) + studies = { 'pimu': {'data':pimu, 'geo':pimu_geo, 'seen':[], 'ntot':20000-125},#136}, - #'pimu': {'data':pimu, 'geo':pimu_geo, 'seen':[], 'ntot':50000-125},#136}, 'mumunu': {'data':mumunu, 'geo':mumunu_geo, 'seen':[], 'ntot':20000-280},#289}, 'tiny': {'data': tiny, 'geo':tiny_geo, 'seen':[], 'ntot':20000-43},#66}, 'nu': {'data': nu, 'geo':nu_geo, 'seen':[], 'ntot':1.534e7}, + 'fakedp': {'data': dp, 'geo':dp_geo, 'seen':[], 'ntot':ndp}, #'cosmics': {'data':cosmics, 'geo':cosmics_geo, 'seen':[], 'ntot':cosmics.GetEntriesFast()}, #'nubar': {'data': nubar, 'geo':nubar_geo, 'seen':[], 'ntot':99999*2},#99999*2}, #'nu': {'data': nu, 'geo':nu_geo, 'seen':[], 'ntot':99999*2}#99999} @@ -133,6 +137,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 @@ -141,6 +146,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 :) """ @@ -581,6 +597,14 @@ cut = " Sum$(%sIP0 < %s) &&"%(noB, th)+" Sum$(numberOfHitLSSegments == 0) && Sum$(strawVetoAny%s==0) && Sum$(upstreamVetoAny%s==0) && Sum$(RPCany%s==0) "%(opt, opt, opt) string = "Event not vetoed" return cut, string + def notVetoedNoRPC(self, th, noB=None, opt=None): + if not noB: + noB = self.noB + if not opt: + opt = self.opt + cut = " Sum$(%sIP0 < %s) &&"%(noB, th)+" Sum$(numberOfHitLSSegments == 0) && Sum$(strawVetoAny%s==0) && Sum$(upstreamVetoAny%s==0) "%(opt, opt) + string = "Event not vetoed (no RPC)" + return cut, string def daughtersP(self, th, noB=None): if not noB: noB = self.noB @@ -591,7 +615,6 @@ return cut, string - def countWithDraw(study, answers=False): t = studies[study]['data'] geo = studies[study]['geo'] @@ -602,47 +625,224 @@ tc.nu = True zmin = geo['Veto_5']['z']['pos']+geo['Veto_5']['z']['dim'] zmax = geo['Tr1_1']['z']['pos']-geo['Tr1_1']['z']['dim'] - if (study == 'pimu'): + if (study == 'pimu') or (study == 'fakedp') or (study == 'nu'): 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.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: + if answers == 1: # 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] ] + cuts = [ tc.recoed()[0], tc.nRecoed(1)[0], + tc.fiducial(zmin + 20., zmax - 20., 249., 499.)[0], tc.goodtracks()[0], + tc.ndf(25)[0], tc.doca(1.)[0], tc.redChi2(5.)[0], tc.daughtersP(1.)[0], tc.ip(10.)[0], + tc.notVetoed(1000.)[0], tc.muon1(1)[0], tc.muon2(1)[0] ] + cutnames = [ tc.recoed()[1], tc.nRecoed(1)[1], + tc.fiducial(zmin + 20., zmax - 20., 249., 499.)[1], tc.goodtracks()[1], + tc.ndf(25)[1], tc.doca(1.)[1], tc.redChi2(5.)[1], tc.daughtersP(1.)[1], tc.ip(10.)[1], + tc.notVetoed(1000.)[1], tc.muon1(1)[1], tc.muon2(1)[1] ] + elif answers == 2: + # answering to referees questions (NO RPC VETO) + cuts = [ tc.recoed()[0], tc.nRecoed(1)[0], + tc.fiducial(zmin + 20., zmax - 20., 249., 499.)[0], tc.goodtracks()[0], + tc.ndf(25)[0], tc.doca(1.)[0], tc.redChi2(5.)[0], tc.daughtersP(1.)[0], tc.ip(10.)[0], + tc.notVetoedNoRPC(1000.)[0], tc.muon1(1)[0], tc.muon2(1)[0] ] + cutnames = [ tc.recoed()[1], tc.nRecoed(1)[1], + tc.fiducial(zmin + 20., zmax - 20., 249., 499.)[1], tc.goodtracks()[1], + tc.ndf(25)[1], tc.doca(1.)[1], tc.redChi2(5.)[1], tc.daughtersP(1.)[1], tc.ip(10.)[1], + tc.notVetoedNoRPC(1000.)[1], tc.muon1(1)[1], tc.muon2(1)[1] ] + elif answers == 3: + # answering to referees questions (IP < 2.5 m) + cuts = [ tc.recoed()[0], tc.nRecoed(1)[0], + tc.fiducial(zmin + 20., zmax - 20., 249., 499.)[0], tc.goodtracks()[0], + tc.ndf(25)[0], tc.doca(1.)[0], tc.redChi2(5.)[0], tc.daughtersP(1.)[0], tc.ip(250.)[0], + tc.notVetoed(1000.)[0], tc.muon1(1)[0], tc.muon2(1)[0] ] + cutnames = [ tc.recoed()[1], tc.nRecoed(1)[1], + tc.fiducial(zmin + 20., zmax - 20., 249., 499.)[1], tc.goodtracks()[1], + tc.ndf(25)[1], tc.doca(1.)[1], tc.redChi2(5.)[1], tc.daughtersP(1.)[1], tc.ip(250.)[1], + tc.notVetoed(1000.)[1], tc.muon1(1)[1], tc.muon2(1)[1] ] + elif answers == 4: + # answering to referees questions (IP < 2.5 m) (NO RPC VETO) + cuts = [ tc.recoed()[0], tc.nRecoed(1)[0], + tc.fiducial(zmin + 20., zmax - 20., 249., 499.)[0], tc.goodtracks()[0], + tc.ndf(25)[0], tc.doca(1.)[0], tc.redChi2(5.)[0], tc.daughtersP(1.)[0], tc.ip(250.)[0], + tc.notVetoedNoRPC(1000.)[0], tc.muon1(1)[0], tc.muon2(1)[0] ] + cutnames = [ tc.recoed()[1], tc.nRecoed(1)[1], + tc.fiducial(zmin + 20., zmax - 20., 249., 499.)[1], tc.goodtracks()[1], + tc.ndf(25)[1], tc.doca(1.)[1], tc.redChi2(5.)[1], tc.daughtersP(1.)[1], tc.ip(250.)[1], + tc.notVetoedNoRPC(1000.)[1], tc.muon1(1)[1], tc.muon2(1)[1] ] - elif (study == 'nu'): - 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.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] ] + elif answers == 5: + # vetoes at the beginning + cuts = [ tc.recoed()[0], tc.notVetoed(1000.)[0], tc.nRecoed(1)[0], + tc.fiducial(zmin + 20., zmax - 20., 249., 499.)[0], tc.goodtracks()[0], + tc.ndf(25)[0], tc.doca(1.)[0], tc.redChi2(5.)[0], tc.daughtersP(1.)[0], tc.ip(10.)[0], + tc.muon1(1)[0], tc.muon2(1)[0] ] + cutnames = [ tc.recoed()[1], tc.notVetoed(1000.)[1], tc.nRecoed(1)[1], + tc.fiducial(zmin + 20., zmax - 20., 249., 499.)[1], tc.goodtracks()[1], + tc.ndf(25)[1], tc.doca(1.)[1], tc.redChi2(5.)[1], tc.daughtersP(1.)[1], tc.ip(10.)[1], + tc.muon1(1)[1], tc.muon2(1)[1] ] + + #elif (study == 'nu'): + # 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.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 == 1: + # # answering to referees questions + # cuts = [ tc.recoed()[0], + # tc.fiducial(zmin + 20., zmax - 20., 249., 499.)[0], tc.goodtracks()[0], + # tc.ndf(25)[0], tc.doca(1.)[0], tc.redChi2(5.)[0], tc.daughtersP(1.5)[0], tc.ip(10.)[0], + # tc.notVetoed(1000.)[0], tc.nRecoed(1)[0] ] + # cutnames = [ tc.recoed()[1], + # tc.fiducial(zmin + 20., zmax - 20., 249., 499.)[1], tc.goodtracks()[1], + # tc.ndf(25)[1], tc.doca(1.)[1], tc.redChi2(5.)[1], tc.daughtersP(1.5)[1], tc.ip(10.)[1], + # tc.notVetoed(1000.)[1], tc.nRecoed(1)[1] ] + # elif answers == 2: + # # answering to referees questions (NO RPC VETO) + # cuts = [ tc.recoed()[0], + # tc.fiducial(zmin + 20., zmax - 20., 249., 499.)[0], tc.goodtracks()[0], + # tc.ndf(25)[0], tc.doca(1.)[0], tc.redChi2(5.)[0], tc.daughtersP(1.5)[0], tc.ip(10.)[0], + # tc.notVetoedNoRPC(1000.)[0], tc.nRecoed(1)[0] ] + # cutnames = [ tc.recoed()[1], + # tc.fiducial(zmin + 20., zmax - 20., 249., 499.)[1], tc.goodtracks()[1], + # tc.ndf(25)[1], tc.doca(1.)[1], tc.redChi2(5.)[1], tc.daughtersP(1.5)[1], tc.ip(10.)[1], + # tc.notVetoedNoRPC(1000.)[1], tc.nRecoed(1)[1] ] + # elif answers == 3: + # # answering to referees questions (IP < 2.5 m) + # cuts = [ tc.recoed()[0], + # tc.fiducial(zmin + 20., zmax - 20., 249., 499.)[0], tc.goodtracks()[0], + # tc.ndf(25)[0], tc.doca(1.)[0], tc.redChi2(5.)[0], tc.daughtersP(1.5)[0], tc.ip(250.)[0], + # tc.notVetoed(1000.)[0], tc.nRecoed(1)[0] ] + # cutnames = [ tc.recoed()[1], + # tc.fiducial(zmin + 20., zmax - 20., 249., 499.)[1], tc.goodtracks()[1], + # tc.ndf(25)[1], tc.doca(1.)[1], tc.redChi2(5.)[1], tc.daughtersP(1.5)[1], tc.ip(250.)[1], + # tc.notVetoed(1000.)[1], tc.nRecoed(1)[1] ] + # elif answers == 4: + # # answering to referees questions (IP < 2.5 m) (NO RPC VETO) + # cuts = [ tc.recoed()[0], + # tc.fiducial(zmin + 20., zmax - 20., 249., 499.)[0], tc.goodtracks()[0], + # tc.ndf(25)[0], tc.doca(1.)[0], tc.redChi2(5.)[0], tc.daughtersP(1.5)[0], tc.ip(250.)[0], + # tc.notVetoedNoRPC(1000.)[0], tc.nRecoed(1)[0] ] + # cutnames = [ tc.recoed()[1], + # tc.fiducial(zmin + 20., zmax - 20., 249., 499.)[1], tc.goodtracks()[1], + # tc.ndf(25)[1], tc.doca(1.)[1], tc.redChi2(5.)[1], tc.daughtersP(1.5)[1], tc.ip(250.)[1], + # tc.notVetoedNoRPC(1000.)[1], tc.nRecoed(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] ] 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.muon1(2)[1], tc.muon2(2)[1], tc.doca(30.)[1], tc.ip(250.)[1] ] + if answers == 1: + # answering to referees questions + cuts = [ tc.recoed()[0], tc.nRecoed(1)[0], + tc.fiducial(zmin + 20., zmax - 20., 249., 499.)[0], tc.goodtracks()[0], + tc.ndf(25)[0], tc.doca(1.)[0], tc.redChi2(5.)[0], tc.daughtersP(1.)[0], tc.ip(250.)[0], + tc.notVetoed(1000.)[0], tc.muon1(2)[0], tc.muon2(2)[0] ] + cutnames = [ tc.recoed()[1], tc.nRecoed(1)[1], + tc.fiducial(zmin + 20., zmax - 20., 249., 499.)[1], tc.goodtracks()[1], + tc.ndf(25)[1], tc.doca(1.)[1], tc.redChi2(5.)[1], tc.daughtersP(1.)[1], tc.ip(250.)[1], + tc.notVetoed(1000.)[1], tc.muon1(2)[1], tc.muon2(2)[1] ] + elif answers == 2: + # answering to referees questions (NO RPC VETO) + cuts = [ tc.recoed()[0], tc.nRecoed(1)[0], + tc.fiducial(zmin + 20., zmax - 20., 249., 499.)[0], tc.goodtracks()[0], + tc.ndf(25)[0], tc.doca(1.)[0], tc.redChi2(5.)[0], tc.daughtersP(1.)[0], tc.ip(250.)[0], + tc.notVetoedNoRPC(1000.)[0], tc.muon1(2)[0], tc.muon2(2)[0] ] + cutnames = [ tc.recoed()[1], tc.nRecoed(1)[1], + tc.fiducial(zmin + 20., zmax - 20., 249., 499.)[1], tc.goodtracks()[1], + tc.ndf(25)[1], tc.doca(1.)[1], tc.redChi2(5.)[1], tc.daughtersP(1.)[1], tc.ip(250.)[1], + tc.notVetoedNoRPC(1000.)[1], tc.muon1(2)[1], tc.muon2(2)[1] ] + elif answers == 3: + # answering to referees questions (IP < 2.5 m) + cuts = [ tc.recoed()[0], tc.nRecoed(1)[0], + tc.fiducial(zmin + 20., zmax - 20., 249., 499.)[0], tc.goodtracks()[0], + tc.ndf(25)[0], tc.doca(1.)[0], tc.redChi2(5.)[0], tc.daughtersP(1.)[0], tc.ip(250.)[0], + tc.notVetoed(1000.)[0], tc.muon1(2)[0], tc.muon2(2)[0] ] + cutnames = [ tc.recoed()[1], tc.nRecoed(1)[1], + tc.fiducial(zmin + 20., zmax - 20., 249., 499.)[1], tc.goodtracks()[1], + tc.ndf(25)[1], tc.doca(1.)[1], tc.redChi2(5.)[1], tc.daughtersP(1.)[1], tc.ip(250.)[1], + tc.notVetoed(1000.)[1], tc.muon1(2)[1], tc.muon2(2)[1] ] + elif answers == 4: + # answering to referees questions (IP < 2.5 m) (NO RPC VETO) + cuts = [ tc.recoed()[0], tc.nRecoed(1)[0], + tc.fiducial(zmin + 20., zmax - 20., 249., 499.)[0], tc.goodtracks()[0], + tc.ndf(25)[0], tc.doca(1.)[0], tc.redChi2(5.)[0], tc.daughtersP(1.)[0], tc.ip(250.)[0], + tc.notVetoedNoRPC(1000.)[0], tc.muon1(2)[0], tc.muon2(2)[0] ] + cutnames = [ tc.recoed()[1], tc.nRecoed(1)[1], + tc.fiducial(zmin + 20., zmax - 20., 249., 499.)[1], tc.goodtracks()[1], + tc.ndf(25)[1], tc.doca(1.)[1], tc.redChi2(5.)[1], tc.daughtersP(1.)[1], tc.ip(250.)[1], + tc.notVetoedNoRPC(1000.)[1], tc.muon1(2)[1], tc.muon2(2)[1] ] + elif answers == 5: + # vetoes at the beginning + cuts = [ tc.recoed()[0], tc.notVetoed(1000.)[0], tc.nRecoed(1)[0], + tc.fiducial(zmin + 20., zmax - 20., 249., 499.)[0], tc.goodtracks()[0], + tc.ndf(25)[0], tc.doca(1.)[0], tc.redChi2(5.)[0], tc.daughtersP(1.)[0], tc.ip(250.)[0], + tc.muon1(2)[0], tc.muon2(2)[0] ] + cutnames = [ tc.recoed()[1], tc.notVetoed(1000.)[1], tc.nRecoed(1)[1], + tc.fiducial(zmin + 20., zmax - 20., 249., 499.)[1], tc.goodtracks()[1], + tc.ndf(25)[1], tc.doca(1.)[1], tc.redChi2(5.)[1], tc.daughtersP(1.)[1], tc.ip(250.)[1], + tc.muon1(2)[1], tc.muon2(2)[1] ] + + elif (study == 'tiny'): 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.ecal()[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.doca(30.)[1], tc.ip(250.)[1] ] + + if answers == 1: + # answering to referees questions + cuts = [ tc.recoed()[0], tc.nRecoed(1)[0], + tc.fiducial(zmin + 20., zmax - 20., 249., 499.)[0], tc.goodtracks()[0], + tc.ndf(25)[0], tc.doca(1.)[0], tc.redChi2(5.)[0], tc.daughtersP(1.)[0], tc.ip(250.)[0], + tc.notVetoed(1000.)[0], ] + cutnames = [ tc.recoed()[1], tc.nRecoed(1)[1], + tc.fiducial(zmin + 20., zmax - 20., 249., 499.)[1], tc.goodtracks()[1], + tc.ndf(25)[1], tc.doca(1.)[1], tc.redChi2(5.)[1], tc.daughtersP(1.)[1], tc.ip(250.)[1], + tc.notVetoed(1000.)[1], ] + elif answers == 2: + # answering to referees questions (NO RPC VETO) + cuts = [ tc.recoed()[0], tc.nRecoed(1)[0], + tc.fiducial(zmin + 20., zmax - 20., 249., 499.)[0], tc.goodtracks()[0], + tc.ndf(25)[0], tc.doca(1.)[0], tc.redChi2(5.)[0], tc.daughtersP(1.)[0], tc.ip(250.)[0], + tc.notVetoedNoRPC(1000.)[0], ] + cutnames = [ tc.recoed()[1], tc.nRecoed(1)[1], + tc.fiducial(zmin + 20., zmax - 20., 249., 499.)[1], tc.goodtracks()[1], + tc.ndf(25)[1], tc.doca(1.)[1], tc.redChi2(5.)[1], tc.daughtersP(1.)[1], tc.ip(250.)[1], + tc.notVetoedNoRPC(1000.)[1], ] + elif answers == 3: + # answering to referees questions (IP < 2.5 m) + cuts = [ tc.recoed()[0], tc.nRecoed(1)[0], + tc.fiducial(zmin + 20., zmax - 20., 249., 499.)[0], tc.goodtracks()[0], + tc.ndf(25)[0], tc.doca(1.)[0], tc.redChi2(5.)[0], tc.daughtersP(1.)[0], tc.ip(250.)[0], + tc.notVetoed(1000.)[0], ] + cutnames = [ tc.recoed()[1], tc.nRecoed(1)[1], + tc.fiducial(zmin + 20., zmax - 20., 249., 499.)[1], tc.goodtracks()[1], + tc.ndf(25)[1], tc.doca(1.)[1], tc.redChi2(5.)[1], tc.daughtersP(1.)[1], tc.ip(250.)[1], + tc.notVetoed(1000.)[1], ] + elif answers == 4: + # answering to referees questions (IP < 2.5 m) (NO RPC VETO) + cuts = [ tc.recoed()[0], tc.nRecoed(1)[0], + tc.fiducial(zmin + 20., zmax - 20., 249., 499.)[0], tc.goodtracks()[0], + tc.ndf(25)[0], tc.doca(1.)[0], tc.redChi2(5.)[0], tc.daughtersP(1.)[0], tc.ip(250.)[0], + tc.notVetoedNoRPC(1000.)[0], ] + cutnames = [ tc.recoed()[1], tc.nRecoed(1)[1], + tc.fiducial(zmin + 20., zmax - 20., 249., 499.)[1], tc.goodtracks()[1], + tc.ndf(25)[1], tc.doca(1.)[1], tc.redChi2(5.)[1], tc.daughtersP(1.)[1], tc.ip(250.)[1], + tc.notVetoedNoRPC(1000.)[1], ] + elif answers == 5: + # vetoes at the beginning + cuts = [ tc.recoed()[0], tc.notVetoed(1000.)[0], tc.nRecoed(1)[0], + tc.fiducial(zmin + 20., zmax - 20., 249., 499.)[0], tc.goodtracks()[0], + tc.ndf(25)[0], tc.doca(1.)[0], tc.redChi2(5.)[0], tc.daughtersP(1.)[0], tc.ip(250.)[0],] + cutnames = [ tc.recoed()[1], tc.notVetoed(1000.)[1], tc.nRecoed(1)[1], + tc.fiducial(zmin + 20., zmax - 20., 249., 499.)[1], tc.goodtracks()[1], + tc.ndf(25)[1], tc.doca(1.)[1], tc.redChi2(5.)[1], tc.daughtersP(1.)[1], tc.ip(250.)[1],] + + + # if not cutnames: # cutnames = [ "converged", "not vetoed", "chi2/n<5", "ndf>15", "z", "ellipse", "good tracks", "ecal", "muon1", "muon2", "doca<30", "IP<250" ] # cutStrings = [ "Track fit converged", @@ -687,7 +887,8 @@ def tableWithDraw(answers=False): results = {} - for study in ['nu', 'pimu', 'mumunu', 'tiny']: + #for study in ['nu', 'pimu', 'fakedp']: # ['nu', 'pimu', 'mumunu', 'tiny', 'fakedp']: + for study in ['nu', 'pimu', 'mumunu', 'tiny', 'fakedp']: results[study] = {} numbers, numbersWithWeights, cuts = countWithDraw(study, answers) results[study]['numbers'] = numbers @@ -885,7 +1086,8 @@ header = { 'pimu': ("$HNL \\to \\pi \\mu$", "tab:recpimu"), 'mumunu': ("$HNL \\to \\mu \\mu \\nu$", "tab:recmmnu"), 'tiny': ("$HNL \\to e e \\nu$", "tab:receenu"), - 'nu': ("neutrino-induced background", "tab:recnubkg") + 'nu': ("neutrino-induced background", "tab:recnubkg"), + 'fakedp': ("$\\gamma' \\to \\mu\\mu$", "tab:darkphoton"), } def makeTex(results): @@ -893,7 +1095,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