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