1803def analyzeDIS(NsubJobs=0,delta=13,hists="../Muons Extended Scoring Plane/muonDISfull.root",runCoverage=6.):
1804
1805 pathToPlots = "/mnt/hgfs/microDisk/SND@LHC/MuonDis/reMake2022"
1806 latex = 'latex.txt'
1807 if options.pythia6<0:
1808 pathToPlots = "/mnt/hgfs/microDisk/CERNBOX/SND@LHC/MuonGeant4/"
1809 latex = 'latex-geant4.tex'
1810 if NsubJobs==0:
1811
1812 ut.readHists(h,hists)
1813 else:
1814 s = 0
1815 while s < NsubJobs:
1816 sMin,sMax = s,s+delta
1817 print("reading muonDISfull-"+str(sMin)+"_"+str(sMax)+".root" )
1818 ut.readHists(h,"muonDISfull-"+str(sMin)+"_"+str(sMax)+".root")
1819 s+=delta
1820
1821 ut.bookCanvas(h,'muDIS_SND2','incoming muon energy',1500,900,2,1)
1822 c=h['muDIS_SND2'].cd(1)
1823 hname = "inMu"
1824 h[hname] = h["inMu_013" ].ProjectionX(hname)
1825 h[hname].Add(h["inMu_0-13" ].ProjectionX())
1826 ut.makeIntegralDistrib(h,hname)
1827 h['I-'+hname].SetTitle('incoming muon energy;> E [GeV/c];N arbitrary units')
1828 h['I-'+hname].SetMinimum(1.E-6)
1829 h['I-'+hname].SetStats(0)
1830 h['I-'+hname].SetLineWidth(3)
1831 h['I-'+hname].Draw('hist')
1832 c=h['muDIS_SND2'].cd(2)
1833 h[hname].SetTitle('incoming muon energy; E [GeV/c];N arbitrary units')
1834 h[hname].SetStats(0)
1835 h[hname].SetLineWidth(3)
1836 h[hname].Draw('hist')
1837 myPrint(h['muDIS_SND2'],'inMuEnergy.png',pathToPlots=pathToPlots)
1838
1839 c=h['muDIS_SND2'].cd(1)
1840 hname = "xyz_mu_0"
1841 for x in ['13','-13']:
1842 h["xy_mu_0"+x] = h["xyz_mu_0"+x].Project3D('yx')
1843 h["xy_mu_0"+x].SetName("xy_mu_0"+x)
1844 h["xy_mu_0"+x].SetStats(0)
1845 h["xy_mu_0"+x].SetTitle(PDG.GetParticle(int(x)).GetName()+' ;x [cm]; y [cm]')
1846 h["xy_mu_0"+x].Draw('colz')
1847 c=h['muDIS_SND2'].cd(2)
1848 myPrint(h['muDIS_SND2'],'inMu_0XY',pathToPlots=pathToPlots)
1849 h["xyz_mu_0"]=h["xyz_mu_013"].Clone("xyz_mu_0")
1850 h["xyz_mu_0"].Add(h["xyz_mu_0-13"])
1851 h["yz_mu_0"] = h["xyz_mu_0"].Project3D('yz')
1852 h["yz_mu_0"].SetName("yz_mu_0")
1853 h["yz_mu_0"].SetStats(0)
1854 h["yz_mu_0"].SetTitle("; z [cm]; y [cm]")
1855 ut.bookCanvas(h,'muDIS_SNDyz','incoming muon',1200,900,1,1)
1856 c=h['muDIS_SNDyz'].cd()
1857 h["yz_mu_0"].Draw('colz')
1858 myPrint(h['muDIS_SNDyz'],'inMu_0YZ',pathToPlots=pathToPlots)
1859
1860 parts = [130,2112,-2112,310,3122,-3122,3322,-3322,22]
1861
1862 fbScale = 1E5
1863 ut.bookCanvas(h,'muDIS_N0In','primary neutrals',1200,1200,3,3)
1864 for k in range(len(parts)):
1865 pid = parts[k]
1866 pname = PDG.GetParticle(pid).GetName()
1867 tc=h['muDIS_N0In'].cd(k+1)
1868 tc.SetLogy(1)
1869 hname = "inE_"+str(pid)
1870 hConcr = "inE_Concrete_"+str(pid)
1871 hout = "inE_out_"+str(pid)
1872 h[hout] = h[hname].Clone(hout)
1873 h[hout].Add(h[hConcr],-1.)
1874 h[hout+'_projx'] = h[hout].ProjectionX(hout+'_projx')
1875 h[hname+'_projx'] = h[hname].ProjectionX(hname+'_projx')
1876 h[hout+'_projx'].SetMarkerStyle(20)
1877 h[hname+'_projx'].SetMarkerStyle(27)
1878 h[hname+'_projx'].SetStats(0)
1879 binw = int(h[hname+'_projx'].GetBinWidth(1))
1880 h[hname+'_projx'].GetYaxis().SetTitle('N [Hz/'+str(binw)+'GeV]')
1881 h[hout+'_projx'].SetMarkerStyle(29)
1882 h[hname+'_projx'].GetXaxis().SetRangeUser(0.,2900.)
1883 h[hname+'_projx'].GetXaxis().SetTitle('Energy [GeV] ')
1884 h[hname+'_projx'].SetTitle(pname)
1885 h[hname+'_projx'].GetYaxis().SetTitleOffset(1.2)
1886 h[hname+'_projx'].SetMaximum(20.)
1887 h[hname+'_projx'].Draw('PHIST')
1888 h[hname+'_projx'].Draw('histsame')
1889 h[hout+'_projx'].SetLineColor(ROOT.kRed)
1890 h[hout+'_projx'].Draw('SAMEPHIST')
1891 h[hout+'_projx'].Draw('histsame')
1892 myPrint(h['muDIS_N0In'],'EofPrimNeutrals',pathToPlots=pathToPlots)
1893
1894 tname = 'muDIS_inSND'
1895 ut.bookCanvas(h,tname,'neutrals not in concrete and z>-25cm',1200,1200,3,3)
1896 for k in range(len(parts)):
1897 pid = parts[k]
1898 pname = PDG.GetParticle(pid).GetName()
1899 tc=h[tname].cd(k+1)
1900 tc.SetLogy(1)
1901 h["inE_prim_"+str(pid)] = h["inE_"+str(pid)].Clone("inE_prim_"+str(pid))
1902 h["inE_prim_"+str(pid)].Add(h["inE_Concrete_"+str(pid)],-1)
1903 h["inE_seco_"+str(pid)] = h["inE_"+str(pid)+'_secondary'].Clone("inE_"+str(pid)+'_secondary_out')
1904 h["inE_seco_"+str(pid)].Add(h["inE_Concrete_"+str(pid)+'_secondary'],-1)
1905 for x in ['prim_','seco_']:
1906 zmin = h["inE_"+x+str(pid)].GetYaxis().FindBin(-25.)
1907 zmax = h["inE_"+x+str(pid)].GetYaxis().FindBin(+25.)
1908 hname = "inE_"+x+str(pid)+'_SND'
1909 h[hname] = h["inE_"+x+str(pid)].ProjectionX(hname,zmin,zmax)
1910 h[hname].SetStats(0)
1911 binw = int(h[hname].GetBinWidth(1))
1912 h[hname].GetYaxis().SetTitle('N [Hz/'+str(binw)+'GeV]')
1913 h[hname].GetXaxis().SetRangeUser(0.,2900.)
1914 h[hname].GetXaxis().SetTitle('Energy [GeV] ')
1915 h[hname].SetTitle(pname)
1916 h[hname].GetYaxis().SetTitleOffset(1.2)
1917 h[hname].SetMaximum(20.)
1918 h[hname].SetMinimum(1.E-6)
1919 hname = "inE_prim_"+str(pid)+'_SND'
1920 h[hname].SetLineColor(ROOT.kRed)
1921 h[hname].Draw('hist')
1922 hname = "inE_seco_"+str(pid)+'_SND'
1923 h[hname].SetLineColor(ROOT.kBlue)
1924 h[hname].Draw('histsame')
1925 myPrint(h[tname],'EofNeutralsInSND',pathToPlots=pathToPlots)
1926
1927 colour = {}
1928 colour[''] = ROOT.kRed
1929 colour['_secondary'] = ROOT.kBlue
1930 minMax = {'out_':[9,1E-6],'Concrete_':[30.,1E-5]}
1931 for k in range(len(parts)):
1932 pid = parts[k]
1933 for origin in ['_secondary','']:
1934 hname = "inE_"+str(pid)+origin
1935 hConcr = "inE_Concrete_"+str(pid) +origin
1936 hout = "inE_out_"+str(pid)+origin
1937 h[hout] = h[hname].Clone(hout)
1938 h[hout].Add(h[hConcr],-1.)
1939
1940 for c in ['out_','Concrete_']:
1941 tname = 'muDIS_neuZend'+c
1942 ut.bookCanvas(h,tname,'end vertex z',1200,1200,3,3)
1943 for k in range(len(parts)):
1944 pid = parts[k]
1945 pname = PDG.GetParticle(pid).GetName()
1946 tc=h[tname].cd(k+1)
1947 tc.SetLogy(1)
1948 for origin in ['_secondary','']:
1949
1950 hname = "inE_"+c+str(pid)+origin
1951 h[hname+'_projz'] = h[hname].ProjectionY(hname+'_projz')
1952 h[hname+'_projz'].SetLineColor(colour[origin])
1953 h[hname+'_projz'].SetStats(0)
1954 binw = int(h[hname+'_projz'].GetBinWidth(1))
1955 h[hname+'_projz'].GetYaxis().SetTitle('N [Hz/'+str(binw)+'GeV]')
1956 h[hname+'_projz'].GetXaxis().SetTitle('z [cm] ')
1957 h[hname+'_projz'].SetTitle(pname)
1958 h[hname+'_projz'].GetYaxis().SetTitleOffset(1.2)
1959 h[hname+'_projz'].SetMaximum(minMax[c][0])
1960 h[hname+'_projz'].SetMinimum(minMax[c][1])
1961 if origin=='_secondary': h[hname+'_projz'].Draw('HIST')
1962 else: h[hname+'_projz'].Draw('HISTsame')
1963 myPrint(h[tname],c+'zEndOfNeutrals',pathToPlots=pathToPlots)
1964
1965
1966
1967 for hist in ['xyz_muInter','xyz_Inter','xyzE100_Inter','xyz_origin','inE','inE_Concrete','xyzVeto_Inter','z_veto']:
1968 first = True
1969 for pid in parts:
1970 if pid==22: continue
1971 if first:
1972 h[hist] = h[hist+'_'+str(pid)].Clone(hist)
1973 first = False
1974 else: h[hist].Add(h[hist+'_'+str(pid)])
1975 h['inE-noConc']=h['inE'].Clone('inE-noConc')
1976 h['inE-noConc'].Add(h['inE_Concrete'],-1.)
1977 h['inE-noConc_22']=h['inE_22'].Clone('inE-noConc_22')
1978 h['inE-noConc_22'].Add(h['inE_Concrete_22'],-1.)
1979 for hist in ['xyz_muInter','xyz_Inter','xyzE100_Inter','xyz_origin','inE','inE-noConc','xyzVeto_Inter','z_veto']:
1980 if h[hist].ClassName() == 'TH2D':
1981 h[hist+'_z']=h[hist].ProjectionY(hist+'_z')
1982 h[hist+'_22_z']=h[hist+'_22'].ProjectionY(hist+'_22_z')
1983 h[hist+'_22_z'].SetTitle(';z [cm]')
1984 h[hist+'_z'].SetTitle(';z [cm]')
1985 else:
1986 for g in ['','_22']:
1987 h[hist+g+'_z'] =h[hist+g].ProjectionZ(hist+g+'_z')
1988 h[hist+g+'_z'].SetTitle(';z [cm]')
1989 h[hist+g+'_xy']=h[hist+g].Project3D('yx')
1990 h[hist+g+'_xy'].SetName(hist+g+'_xy')
1991 h[hist+g+'_xy'].SetTitle(';x [cm]; y [cm]')
1992 h[hist+g+'_xy'].SetStats(0)
1993 h[hist+g+'_xz']=h[hist+g].Project3D('xz')
1994 h[hist+g+'_xz'].SetName(hist+g+'_xz')
1995 h[hist+g+'_xz'].SetTitle(';z [cm]; x [cm]')
1996 h[hist+g+'_xz'].SetStats(0)
1997 h[hist+g+'_yz']=h[hist+g].Project3D('yz')
1998 h[hist+g+'_yz'].SetName(hist+g+'_yz')
1999 h[hist+g+'_yz'].SetTitle(';z [cm]; y [cm]')
2000 h[hist+g+'_yz'].SetStats(0)
2001 h[hist+'_z'].SetStats(0)
2002 h[hist+'_z'].SetTitle('; z [cm]')
2003 ut.bookCanvas(h,'vertices'+hist+'_z','vertices '+hist,1200,900,1,1)
2004 tc = h['vertices'+hist+'_z'].cd()
2005 if hist=='z_veto': tc.SetLogy()
2006 if hist=='xyzVeto_Inter': tc.SetLogy()
2007 if hist in ['xyz_muInter','xyz_origin']:
2008 h[hist+'_z'].Draw()
2009 else:
2010 h[hist+'_22_z'].SetStats(0)
2011 h[hist+'_22_z'].SetLineColor(ROOT.kRed)
2012 h[hist+'_22_z'].Draw()
2013 h[hist+'_z'].Draw('same')
2014 if hist=='xyzE100_Inter':
2015 txtlam = 'empty'
2016 txtrad = 'empty'
2017 if h[hist+'_z'].GetEntries()>10:
2018 rc = h[hist+'_z'].Fit('expo','S','',-25.,30.)
2019 fitresult = rc.Get()
2020 txtlam = '#lambda =%4.1Fcm'%(-1./fitresult.GetParams()[1])
2021 rc = h[hist+'_22_z'].Fit('expo','SL','',-30.,10.)
2022 fitresult = rc.Get()
2023 funRad =h[hist+'_22_z'].GetFunction('expo')
2024 funRad.SetBit(ROOT.TF1.kNotDraw)
2025 funRad.SetLineColor(h[hist+'_22_z'].GetLineColor())
2026 txtrad = 'X_{0} =%4.1Fcm'%(-1./fitresult.GetParams()[1])
2027 h[hist+'_z'].GetFunction('expo').SetLineColor(h[hist+'_z'].GetLineColor())
2028 h[hist+'_z'].Draw()
2029 h[hist+'_22_z'].Draw('same')
2030 T = ROOT.TLatex()
2031 T.DrawLatex(-10,0.005,txtlam)
2032
2033 myPrint(h['vertices'+hist+'_z'],hist+'_z',pathToPlots=pathToPlots)
2034 if h[hist].ClassName() == 'TH3D':
2035 for proj in ['xy','xz','yz']:
2036 ut.bookCanvas(h,'vertices'+hist+'_'+proj,'vertices '+hist,1200,900,1,1)
2037 tc = h['vertices'+hist+'_'+proj].cd()
2038 h[hist+'_'+proj].Draw('colz')
2039 myPrint(h['vertices'+hist+'_'+proj],hist+'_'+proj,pathToPlots=pathToPlots)
2040
2041 ut.bookCanvas(h,'verticesinE_z','vertices inE_z',1200,900,1,1)
2042 h['verticesinE_z'].cd()
2043 h["inE-noConc_z"].SetLineColor(ROOT.kRed)
2044 h["inE_z"].Draw('hist')
2045 h["inE-noConc_z"].Draw('samehist')
2046 myPrint(h['verticesinE_z'],"inE_z",pathToPlots=pathToPlots)
2047 ut.bookCanvas(h,'verticesxyz_Inter_z','vertices xyz_Inter_z',1200,900,1,1)
2048 h['verticesxyz_Inter_z'].cd()
2049 h['xyz_Inter_z'].GetXaxis().SetRangeUser(-50.,100.)
2050 h["xyz_Inter_z"].Draw('hist')
2051 myPrint(h['verticesxyz_Inter_z'],"verticesxyz_Inter_z",pathToPlots=pathToPlots)
2052
2053 withMult=False
2054 if withMult:
2055 ut.bookCanvas(h,'mult',' ',1200,900,1,1)
2056 tc = h['mult'].cd()
2057 tc.SetLogy(1)
2058 mults = {22:[19,ROOT.kMagenta],130:[20,ROOT.kRed],2112:[22,ROOT.kBlue],-2112:[23,ROOT.kCyan],
2059 310:[21,ROOT.kOrange],3122:[24,ROOT.kGreen-1],-3122:[25,ROOT.kGreen+1],
2060 3322:[26,ROOT.kGreen-2],-3322:[27,ROOT.kGreen+2]}
2061 h['legmult']=ROOT.TLegend(0.6,0.6,0.82,0.75)
2062 for m in mults:
2063 hist = 'mult_'+str(m)
2064 h[hist].SetStats(0)
2065 h[hist].SetTitle('; N')
2066 h[hist].SetMarkerStyle(mults[m][0])
2067 h[hist].SetMarkerColor(mults[m][1])
2068 h[hist].SetLineColor(mults[m][1])
2069 rc = h['legmult'].AddEntry(h[hist],PDG.GetParticle(m).GetName(),'PL')
2070 h['mult_22'].Draw()
2071 for m in mults: h['mult_'+str(m)].Draw('same')
2072 h['legmult'].Draw('same')
2073 myPrint(h['mult'],"neutralMultiplicities",pathToPlots=pathToPlots)
2074 for pid in parts:
2075 ut.makeIntegralDistrib(h,"inE_"+str(pid))
2076 ut.makeIntegralDistrib(h,"inE_Concrete_"+str(pid))
2077 for o in ["","prim"]:
2078 hname = "Esnd"+o+"_"+str(pid)
2079 h[hname] = h["E"+o+"_"+str(pid)].ProjectionX(hname)
2080 h["Esnd"+o+"_all_"+str(pid)] = h["E"+o+"_veto_"+str(pid)].ProjectionX("Esnd"+o+"_all_"+str(pid))
2081 h["Esnd"+o+"_all_"+str(pid)] .Add(h[hname] )
2082 ut.makeIntegralDistrib(h,hname)
2083 h['I-'+hname].GetXaxis().SetRangeUser(0.,1000.)
2084 h['I-'+hname].SetMinimum(1E-6)
2085 ut.makeIntegralDistrib(h,"Esnd"+o+"_all_"+str(pid))
2086
2087 ut.bookCanvas(h,'muDIS_SNDwithVeto','neutrals arriving at SND',1800,1200,3,3)
2088 for k in range(len(parts)):
2089 tc=h['muDIS_SNDwithVeto'].cd(k+1)
2090 tc.SetLogy(1)
2091 pname = PDG.GetParticle(parts[k]).GetName()
2092 hnameScaled = "Esnd_"+str(parts[k])+"_fb150"
2093 h[hnameScaled] = h["Esnd_"+str(parts[k])].Clone(hnameScaled)
2094 h[hnameScaled].Scale(150.*fbScale/runCoverage)
2095 h[hnameScaled].GetXaxis().SetRangeUser(0,500)
2096 h[hnameScaled].SetStats(0)
2097 h[hnameScaled].SetMaximum(4E6)
2098 h[hnameScaled].SetTitle(pname+'; E [GeV/c];N/10GeV /150 fb^{-1}')
2099 h[hnameScaled].SetLineWidth(3)
2100 h[hnameScaled].Draw('hist')
2101 myPrint(h['muDIS_SNDwithVeto'],'EofNeutralsInSND_vetoApplied',pathToPlots=pathToPlots)
2102
2103 ut.bookCanvas(h,'muDIS_SNDnoVetoRequired','neutrals arriving at SND',1800,1200,3,3)
2104 for k in range(len(parts)):
2105 tc=h['muDIS_SNDnoVetoRequired'].cd(k+1)
2106 tc.SetLogy(1)
2107 pname = PDG.GetParticle(parts[k]).GetName()
2108 hnameScaled = "Esnd_all_"+str(parts[k])+"_fb150"
2109 h[hnameScaled] = h["Esnd_all_"+str(parts[k])].Clone(hnameScaled)
2110 h[hnameScaled].Scale(150.*fbScale/runCoverage)
2111 h[hnameScaled].GetXaxis().SetRangeUser(0,500)
2112 h[hnameScaled].SetStats(0)
2113 h[hnameScaled].SetMaximum(4E6)
2114 h[hnameScaled].SetTitle(pname+'; E [GeV/c];N/10GeV /150 fb^{-1}')
2115 h[hnameScaled].SetLineWidth(3)
2116 h[hnameScaled].Draw('hist')
2117 myPrint(h['muDIS_SNDnoVetoRequired'],'EofNeutralsInSND_NoVetoApplied',pathToPlots=pathToPlots)
2118
2119 for o in ["","prim"]:
2120 ut.bookCanvas(h,'muDIS_SND'+o,'neutrals arriving at SND',1800,1200,3,3)
2121 for k in range(len(parts)):
2122 tc=h['muDIS_SND'+o].cd(k+1)
2123 tc.SetLogy(1)
2124 tc.SetLogx(0)
2125 pname = PDG.GetParticle(parts[k]).GetName()
2126 hname = "Esnd"+o+"_"+str(parts[k])
2127 hnameAll = "Esnd"+o+"_all_"+str(parts[k])
2128 for X in [hname,hnameAll]:
2129 h['IFB-'+X] = h['I-'+X].Clone('IFB-'+X)
2130 h['IFB-'+X].Scale(150.*fbScale)
2131 h['IFB-'+X].SetTitle(pname+';> E [GeV/c];N /150 fb^{-1}')
2132 h['IFB-'+X]. GetYaxis().SetTitleOffset(1.4)
2133 h['IFB-'+X]. GetXaxis().SetRangeUser(0.1,1200.)
2134 h['IFB-'+X].SetMaximum(2E7)
2135 h['IFB-'+X].SetStats(0)
2136 h['IFB-'+X].SetLineWidth(3)
2137 h['IFB-'+X].SetMinimum(1.0)
2138 h['IFB-'+hnameAll].Draw('hist')
2139 h['IFB-'+hname].SetLineColor(ROOT.kRed)
2140 h['IFB-'+hname].Draw('histsame')
2141 hist = h['I-'+hname]
2142 histAll = h['I-'+hnameAll]
2143 print("----> results for "+o)
2144 for E in [0,10,100,200,300,500,1000]:
2145 n = hist.FindBin(E)
2146 RVeto = hist.GetBinContent(n) / runCoverage
2147 R = histAll.GetBinContent(n) / runCoverage
2148 faser = ''
2149 if parts[k] in FASERNU:
2150 if E in FASERNU[parts[k]]:
2151 faser = "%5.2G"%( FASERNU[parts[k]][E]*scaleFactor )
2152 print("E>%i GeV, %s: %5.2F N/sec %5.2F N fb with Veto: %5.2F N fb | %5.2G veto %5.2G (%s) "%(E,pname,R,R*fbScale,RVeto*fbScale,R*150.*fbScale,RVeto*150.*fbScale,faser))
2153 myPrint(h['muDIS_SND'+o],'muDIS_SND'+o,pathToPlots=pathToPlots)
2154
2155 fout = open(latex,'w')
2156 platex = {2112:'$n$' ,-2112: '$\overline{n}$' ,130:'$K_L$',310:'$K_S$',3122:'$\Lambda$',-3122:'$\overline{\Lambda}$',3322:'$\Xi + \overline{\Xi}$',22:'$\gamma$'}
2157
2158 for x in [2112,-2112,130,310,3122,-3122,3322,22]:
2159 line = platex[x]
2160 for E in [10,100,200,300,500,1000]:
2161 pname = PDG.GetParticle(x).GetName()
2162 hnameAll = "Esnd"+"_all_"+str(x)
2163 histAll = h['I-'+hnameAll]
2164 n = histAll.FindBin(E)
2165 R = histAll.GetBinContent(n) / runCoverage
2166 if x == 3322: R+=h['I-'+hnameAll.replace('3322','-3322')].GetBinContent(n) / runCoverage
2167 R150 = R*150.*fbScale
2168 if R150<1E-8: R150=0
2169 if R150<1000: line += "& $%5.1F$"%(R150)
2170 else: line += "& $%6.2G$"%(R150)
2171 line+= "\\\\ \n"
2172
2173 xline = line.replace('E+0','\,10^')
2174 fout.write(xline)
2175 fout.write("$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$\n")
2176 for x in [2112,-2112,130,310,3122,-3122,3322,22]:
2177 line = platex[x]
2178 for E in [10,100,200,300,500,1000]:
2179 pname = PDG.GetParticle(x).GetName()
2180 hname = "Esnd_"+str(x)
2181 hist= h['I-'+hname]
2182 n = hist.FindBin(E)
2183 R = hist.GetBinContent(n) / runCoverage
2184 if x == 3322: R+=h['I-'+hname.replace('3322','-3322')].GetBinContent(n) / runCoverage
2185 R150 = R*150.*fbScale
2186 if R150<1E-8: R150=0
2187 if R150<1000: line += "& $%5.1F$"%(R150)
2188 else: line += "& $%6.2G$"%(R150)
2189 line+= "\\\\ \n"
2190
2191 xline = line.replace('E+0','\,10^')
2192 fout.write(xline)
2193 fout.write("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n")
2194 for x in [2112,-2112,130,310,3122,-3122,3322,22]:
2195 line = platex[x]
2196 for E in [10,100,300,1000]:
2197 faser = FASERNU[x][E]*scaleFactor
2198 if x == 3322: faser+=FASERNU[-x][E]*scaleFactor
2199 if faser<1000: line += "& $%5.1F$"%(faser)
2200 else: line += "& $%6.2G$"%(faser)
2201 line+= "\\\\ \n"
2202
2203 xline = line.replace('E+0','\,10^')
2204 fout.write(xline)
2205 fout.close()
2206