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