Ejemplo n.º 1
0
    def conclude(self, pars):
        org = self.organizer(pars, verbose=True)
        org.scale(toPdf=True)
        #org.scale( lumiToUseInAbsenceOfData = pars['lumi'] )

        kwargs = {
            "detailedCalculables": False,
            "blackList": ["lumiHisto", "xsHisto", "nJobsHisto"],
            "rowColors": 2 * [13] + 2 * [45],
            "rowCycle": 100,
            #"omit2D" : True,
        }

        supy.plotter(org,
                     pdfFileName=self.pdfFileName(org.tag + "_log"),
                     doLog=True,
                     pegMinimum=0.01,
                     **kwargs).plotAll()
        supy.plotter(org,
                     pdfFileName=self.pdfFileName(org.tag + "_nolog"),
                     doLog=False,
                     **kwargs).plotAll()
        r.gStyle.SetOptStat(0)

        self.resPlots(org)
        self.filterPlots(org)
        self.fitPlots(org)
Ejemplo n.º 2
0
 def conclude(self,pars) :
     #make a pdf file with plots from the histograms created above
     org = self.organizer(pars)
     org.scale(lumiToUseInAbsenceOfData=1.0e-3) # /pb
     supy.plotter(org,
                  pdfFileName = self.pdfFileName(org.tag),
                  ).plotAll()
Ejemplo n.º 3
0
    def conclude(self, pars):
        org = self.organizer(pars, verbose=True)

        def gopts(name="", color=1):
            return {"name": name, "color": color, "markerStyle": 1, "lineWidth": 2, "goptions": "ehist"}

        for new, old, color in [("DY->tt", "dy_tt", r.kBlue),
                                ("DY->mt", "dy_mt", r.kRed),
                                ("DY->et", "dy_et", r.kOrange + 3),
                                ("DY->em", "dy_em", r.kGreen),
                                ]:
            org.mergeSamples(targetSpec=gopts(new, color), sources=[old])

        # org.scale()  # to data
        org.scale(lumiToUseInAbsenceOfData=4.0e3) # /pb
        # org.scale(toPdf=True)

        def yx(h):
            if "_prof" in h.GetName():
                ax = h.GetXaxis()
                f = r.TF1("yx", "x", ax.GetXmin(), ax.GetXmax())
                f.SetLineWidth(1)
                f.Draw("same")
                return f

        supy.plotter(org,
                     pdfFileName=self.pdfFileName(org.tag),
                     printImperfectCalcPageIfEmpty=False,
                     printXs=True,
                     blackList=["lumiHisto", "xsHisto", "nJobsHisto"],
                     rowColors=[r.kBlack, r.kViolet+4],
                     doLog=False,
                     # pegMinimum=0.1,
                     fitFunc=yx,
                     ).plotAll()
Ejemplo n.º 4
0
 def conclude(self, pars):
     org = self.organizer(pars)
     org.scale(lumiToUseInAbsenceOfData=20.0)
     supy.plotter(org,
                  doLog=False,
                  pdfFileName=self.pdfFileName(org.tag),
                  ).plotAll()
Ejemplo n.º 5
0
    def conclude(self, pars):
        org = self.organizer(pars, prefixesNoScale=["efficiency_"])

        def gopts(name="", color=1):
            return {
                "name": name,
                "color": color,
                "markerStyle": 1,
                "lineWidth": 2,
                "goptions": "ehist"
            }

        org.mergeSamples(targetSpec=gopts("QCD", r.kBlue),
                         sources=["QCD_c4_pu140_Pt_0p3_4"])
        org.mergeSamples(targetSpec=gopts("H", r.kBlue), allWithPrefix="H_")
        org.scale(1.0 / fb)
        supy.plotter(
            org,
            pdfFileName=self.pdfFileName(org.tag),
            printImperfectCalcPageIfEmpty=False,
            printXs=True,
            blackList=["lumiHisto", "xsHisto", "nJobsHisto"],
            rowColors=[r.kBlack, r.kViolet + 4],
            fitFunc=lambda x: self.profFit(x, "eta"),
            doLog=False,
            drawYx=True,
            showStatBox=True,
            optStat=1100,
        ).plotAll()

        self.dumpFitResults(fileName="fitResults.py")
Ejemplo n.º 6
0
    def conclude(self, config):
        org = self.organizer(config)
        supy.utils.io.printSkimResults(org)

        supy.plotter(
            org, pdfFileName=self.pdfFileName(org.tag), blackList=["lumiHisto", "xsHisto", "nJobsHisto"]
        ).plotAll()
Ejemplo n.º 7
0
 def conclude(self,pars) :
     org = self.organizer(pars)
     org.scale(lumiToUseInAbsenceOfData=20.0)
     supy.plotter(org,
                  pdfFileName = self.pdfFileName(org.tag),
                  doLog = False,
                  blackList = ['lumiHisto','xsHisto','nJobsHisto'],
                  ).plotAll()
 def conclude(self,pars) :
     #make a pdf file with plots from the histograms created above
     org = self.organizer(pars)
     supy.plotter( org,
                   pdfFileName = self.pdfFileName(org.tag),
                   doLog = False,
                   blackList = ['num_.*', 'den_.*'],
                   ).plotAll()
Ejemplo n.º 9
0
 def conclude(self, pars):
     org = self.organizer(pars)
     org.mergeSamples(targetSpec={"name": "qcd_py6", "color": r.kBlue}, allWithPrefix="v12_qcd_py6")
     org.scale(100)
     supy.plotter(
         org,
         pdfFileName=self.pdfFileName(org.tag),
         blackList=["lumiHisto", "xsHisto", "xsPostWeightsHisto", "nJobsHisto"],
     ).plotAll()
Ejemplo n.º 10
0
 def conclude(self,pars) :
     #make a pdf file with plots from the histograms created above
     org = self.organizer(pars)
     org.scale()
     supy.plotter( org,
                   pdfFileName = self.pdfFileName(org.tag),
                   #samplesForRatios = ("Example_Skimmed_900_GeV_Data","Example_Skimmed_900_GeV_MC"),
                   #sampleLabelsForRatios = ("data","sim"),
                   ).plotAll()
Ejemplo n.º 11
0
    def conclude(self, pars):
        org = self.organizer(pars, verbose=True)

        def gopts(name="", color=1):
            return {"name":name, "color":color, "markerStyle":1, "lineWidth":2, "goptions":"ehist"}

        org.mergeSamples(targetSpec={"name": "Data"}, allWithPrefix="data")

        mc = ".".join(["", "LastBinOverBin1", "diTauHadTriggerWeight"])
        sig = mc + ".x100"
        for sample, color, ws in [("H260_hh_bbtautau", r.kOrange,    sig),
                                  ("H300_hh_bbtautau", 28,           sig),
                                  ("H350_hh_bbtautau", 44,           sig),
                                  ("ZZ_llqq",          r.kYellow,    mc),
                                  ("tt_bblnln",        r.kMagenta,   mc),
                                  ("tt_bblnqq",        r.kBlue,      mc),
                                  ("dy_ll",            r.kGreen,     mc),
                                  ]:
            name = sample
            if ws.endswith(".x100"):
                name = sample[:4] + ".x100"
            org.mergeSamples(targetSpec=gopts(name, color), sources=[sample + ws])

        org.mergeSamples(targetSpec=gopts("w_ln_123j", r.kMagenta+2), allWithPrefix="w_ln")

        org.mergeSamples(targetSpec=gopts("EWK", r.kRed),
                         keepSources=True,
                         sources=["ZZ_llqq", "tt_bblnln", "tt_bblnqq", "dy_ll", "w_ln_123j"])

        org.scale()  # to data
        #org.scale(lumiToUseInAbsenceOfData=20.0e3) # /pb
        #org.scale(toPdf=True)

        supy.plotter(org,
                     pdfFileName=self.pdfFileName(org.tag),
                     printImperfectCalcPageIfEmpty=False,
                     printXs=True,
                     blackList=["lumiHisto", "xsHisto", "nJobsHisto"],
                     rowColors=[r.kBlack, r.kViolet+4],

                     doLog=True,
                     pegMinimum=0.1,
                     showStatBox=False,
                     latexYieldTable=False,

                     #samplesForRatios=("H300_hh_bbtautau", "tt_bbll"),
                     #sampleLabelsForRatios=("hh", "tt"),
                     #foms=[{"value": lambda x, y: x/y,
                     #       "uncRel": lambda x, y, xUnc, yUnc: ((xUnc/x)**2 + (yUnc/y)**2)**0.5,
                     #       "label": lambda x, y:"%s/%s" % (x, y),
                     #       },
                     #      #{"value": lambda x,y: x/(y**0.5),
                     #      # "uncRel": lambda x, y, xUnc, yUnc: math.sqrt((xUnc/x)**2 + (yUnc/y/2.)**2),
                     #      # "label": lambda x,y: "%s/sqrt(%s)" % (x, y),
                     #      # },
                     #      ],
                     ).plotAll()
Ejemplo n.º 12
0
 def conclude(self,pars) :
     #make a pdf file with plots from the histograms created above
     org = self.organizer(pars)
     org.scale(lumiToUseInAbsenceOfData=1.0e-3) # /pb
     supy.plotter(org,
                  pdfFileName = self.pdfFileName(org.tag),
                  samplesForRatios = ('SM', ['A2', 'A4', 'A6', 'P3']),
                  sampleLabelsForRatios = ('SM','BSM'),
                  ).plotAll()
Ejemplo n.º 13
0
 def conclude(self,pars) :
     #make a pdf file with plots from the histograms created above
     org = self.organizer(pars)
     org.scale()
     supy.plotter(org,
                  pdfFileName = self.pdfFileName(org.tag),
                  doLog=False,
                  blackList = ['lumiHisto','xsHisto','nJobsHisto','cnt_.*', 'cum_.*'],
                  ).plotAll()
Ejemplo n.º 14
0
 def conclude(self,pars) :
     #make a pdf file with plots from the histograms created above
     org = self.organizer(pars)
     mode = self.parameters()['mode']
     mode, skim = self.parameters()['mode'], self.parameters()['skim']
     supy.plotter( org,
                   pdfFileName = self.pdfFileName(org.tag+self.parameters()['mode']),
                   doLog = False,
                   blackList = ['num_.*', 'den_.*'],
                   ).plotAll()
Ejemplo n.º 15
0
 def conclude(self, conf) :
     org = self.organizer(conf)
     org.scale(5.0e3)
     supy.plotter(org,
                  pdfFileName = self.pdfFileName(org.tag),
                  rowColors = [r.kBlack, r.kViolet+4],
                  #doLog = False,
                  pegMinimum = 0.1,
                  blackList = ["lumiHisto","xsHisto","nJobsHisto"],
                  ).plotAll()
Ejemplo n.º 16
0
 def conclude(self,pars) :
     #make a pdf file with plots from the histograms created above
     org = self.organizer(pars)
     org.scale(lumiToUseInAbsenceOfData=1.0e-3) # /pb
     supy.plotter(org,
                  pdfFileName = self.pdfFileName(org.tag),
                  doLog=False,
                  blackList = ['lumiHisto','xsHisto','nJobsHisto',],
                  samplesForRatios=('tt-fs',['tt-af','tHu-af','tHu-fs']),
                  ).plotAll()
 def conclude(self, pars):
     #make a pdf file with plots from the histograms created above
     org = self.organizer(pars)
     org.scale()
     supy.plotter(org,
                  pdfFileName=self.pdfFileName(org.tag),
                  samplesForRatios=("Data", "MC"),
                  sampleLabelsForRatios=("data", "sim"),
                  detailedCalculables=True,
                  ).plotAll()
Ejemplo n.º 18
0
 def conclude(self,pars) :
     org = self.organizer(pars)
     org.mergeSamples(targetSpec = {"name":"qcd_mg", "color":r.kBlue}, allWithPrefix="qcd_mg")
     org.mergeSamples(targetSpec = {"name":"qcd_py6", "color":r.kRed}, allWithPrefix="qcd_py6")
     org.scale()
     supy.plotter( org,
                   pdfFileName = self.pdfFileName(org.tag),
                   blackList = ["lumiHisto","xsHisto","xsPostWeightsHisto","nJobsHisto","genpthat"],
                   detailedCalculables = True,
                   ).plotAll()
Ejemplo n.º 19
0
    def conclude(self,pars) :
        org = self.organizer(pars)
        org.scale(1.0e3)

        supy.plotter(org,
                     pdfFileName = self.pdfFileName(""),
                     blackList = ["lumiHisto","xsHisto","nJobsHisto",],
                     rowColors = [r.kBlack, r.kViolet+4],
                     pegMinimum = 0.1,
                     doLog = False,
                     ).plotAll()
Ejemplo n.º 20
0
    def conclude(self,pars) :
        org = self.organizer(pars)
        org.mergeSamples(sources = ["ttz_8_mg.job269_1"], targetSpec = {"name":"TTZ", "markerStyle":20})
        org.scale(10.0e3)

        supy.plotter(org,
                     pdfFileName = self.pdfFileName(""),
                     blackList = ["lumiHisto","xsHisto","nJobsHisto",],
                     rowColors = [r.kBlack, r.kViolet+4],
                     pegMinimum = 0.1,
                     doLog = False,
                     ).plotAll()
Ejemplo n.º 21
0
 def conclude(self,pars) :
     org = self.organizer(pars)
     org.scale(toPdf=True)
     
     supy.plotter(org,
                  pdfFileName = self.pdfFileName(org.tag),
                  doLog = False,
                  #noSci = True,
                  #pegMinimum = 0.1,
                  detailedCalculables = True,
                  blackList = ["lumiHisto","xsHisto","nJobsHisto"],
                  ).plotAll()
Ejemplo n.º 22
0
 def conclude(self,pars) :
     #make a pdf file with plots from the histograms created above
     org = self.organizer(pars)
     # mergeSamples doesn't work with the special step matchingEffVsEt that implements mergeFunc
     #org.mergeSamples(targetSpec = {"name":"Period B (part)", "color":r.kBlack}, allWithPrefix="202")
     #org.mergeSamples(targetSpec = {"name":"Period B (part)", "color":r.kBlack},
     #                 sources=['202668_L1_4J15', '202712_L1_4J15', '202740_L1_4J15', '202798_L1_4J15'])
     #org.scale(lumiToUseInAbsenceOfData=1000.)
     supy.plotter( org,
                   pdfFileName = self.pdfFileName(org.tag),
                   doLog = False,
                   blackList = ['num_', 'den_'],
                   ).plotAll()
Ejemplo n.º 23
0
 def conclude(self, pars):
     org = self.organizer(pars, prefixesNoScale=["efficiency_"])
     supy.utils.printSkimResults(org)
     org.scale(1.e3)
     supy.plotter(org,
                  pdfFileName=self.pdfFileName(org.tag),
                  printImperfectCalcPageIfEmpty=False,
                  printXs=True,
                  blackList=["lumiHisto", "xsHisto", "nJobsHisto"],
                  rowColors=[1, 2],
                  doLog=True,
                  optStat=1111,
                  showStatBox=False,
                  ).plotAll()
Ejemplo n.º 24
0
    def conclude(self, pars):
        org = self.organizer(pars)
        supy.utils.printSkimResults(org)

        def gopts(name="", color=1):
            return {
                "name": name,
                "color": color,
                "markerStyle": 1,
                "lineWidth": 2,
                "goptions": "ehist"
            }

        org.mergeSamples(targetSpec=gopts("tt_0_6", r.kBlue),
                         sources=["tt_0_6.GenWeight"])
        org.mergeSamples(targetSpec=gopts("tt_6_11", r.kGreen),
                         sources=["tt_6_11.GenWeight"])
        org.mergeSamples(targetSpec=gopts("tt_11_17", r.kCyan),
                         sources=["tt_11_17.GenWeight"])
        org.mergeSamples(targetSpec=gopts("tt_17_25", r.kMagenta),
                         sources=["tt_17_25.GenWeight"])
        org.mergeSamples(targetSpec=gopts("tt_25_1k", r.kOrange),
                         sources=["tt_25_1k.GenWeight"])
        org.mergeSamples(targetSpec=gopts("tt", r.kBlack),
                         allWithPrefix="tt_",
                         keepSources=True)

        org.scale(3.e3 / fb)
        supy.plotter(
            org,
            pdfFileName=self.pdfFileName(org.tag),
            printImperfectCalcPageIfEmpty=False,
            printXs=True,
            blackList=["lumiHisto", "xsHisto", "nJobsHisto"],
            rowColors=[r.kBlack, r.kViolet + 4],
            doLog=True,
            #optStat=1100,
            optStat=1111,
            #fitFunc=self.profFit,
            showStatBox=False,
            latexYieldTable=True,
            #samplesForRatios=("hh_bbtt", "tt"),
            #sampleLabelsForRatios=("hh", "tt"),
            #foms=[{"value": lambda x, y: x/y,
            #       "uncRel": lambda x, y, xUnc, yUnc: math.sqrt((xUnc/x)**2 + (yUnc/y)**2),
            #       "label": lambda x, y:"%s/%s" % (x, y),
            #       },
            #      ],
        ).plotAll()
Ejemplo n.º 25
0
    def conclude(self,pars) :
        org = self.organizer(pars)
        org.mergeSamples(targetSpec = {"name":"SingleMu","color":r.kBlack,"markerStyle":20}, allWithPrefix="SingleMu")
        org.mergeSamples(targetSpec = {"name":"qcd", "color":r.kBlue}, allWithPrefix="qcd")
        org.mergeSamples(targetSpec = {"name":"w_jets","color":r.kRed}, allWithPrefix="w_jets")
        org.mergeSamples(targetSpec = {"name":"t#bar{t}","color":r.kViolet}, allWithPrefix="tt_tauola_fj_mg")
        #org.scaleOneRaw([ss['name'] for ss in org.samples].index('w_jets'), 0.6)
        org.mergeSamples(targetSpec = {"name":"s.m.", "color":r.kGreen+3}, keepSources = True, sources = ['qcd','w_jets','t#bar{t}'], force = True)
        org.scale()

        kwargs = { "blackList":["lumiHisto","xsHisto","nJobsHisto","muonTriggerWeightPF"],
                   "samplesForRatios":("SingleMu","s.m.") if "s.m." in [ss['name'] for ss in org.samples] else ("","")}

        supy.plotter(org, pdfFileName = self.pdfFileName(org.tag+'_log'),   doLog = True,  **kwargs).plotAll()
        supy.plotter(org, pdfFileName = self.pdfFileName(org.tag+'_nolog'), doLog = False, **kwargs).plotAll()
Ejemplo n.º 26
0
 def conclude(self, pars):
     org = self.organizer(pars, prefixesNoScale=["efficiency_"])
     supy.utils.printSkimResults(org)
     org.scale(1.e3)
     supy.plotter(
         org,
         pdfFileName=self.pdfFileName(org.tag),
         printImperfectCalcPageIfEmpty=False,
         printXs=True,
         blackList=["lumiHisto", "xsHisto", "nJobsHisto"],
         rowColors=[1, 2],
         doLog=True,
         optStat=1111,
         showStatBox=False,
     ).plotAll()
Ejemplo n.º 27
0
    def conclude(self,pars) :
        org = self.organizer(pars, verbose = True )
        org.mergeSamples(targetSpec={"name":"qcd"}, allWithPrefix="qcd")
        org.scale( toPdf = True )

        names = [ss["name"] for ss in org.samples]
        kwargs = {"detailedCalculables": False,
                  "blackList":["lumiHisto","xsHisto","nJobsHisto"],
                  "detailedCalculables" : True,
                  "rowColors" : self.rowcolors,
                  "rowCycle" : 100,
                  }
        
        supy.plotter(org, pdfFileName = self.pdfFileName(org.tag+"_log"),  doLog = True, pegMinimum = 0.01, **kwargs ).plotAll()
        supy.plotter(org, pdfFileName = self.pdfFileName(org.tag+"_nolog"), doLog = False, **kwargs ).plotAll()
Ejemplo n.º 28
0
	def conclude(self,pars) :
		#make a pdf file with plots from the histograms created above
		org = self.organizer(pars)
		org.mergeSamples(targetSpec = {"name":"Standard Model", "color":r.kBlue,"lineWidth":3,"goptions":"hist"}, allWithPrefix = "qcd")
		org.mergeSamples(targetSpec = {"name":"Data", "color":r.kBlack, "markerStyle":20}, allWithPrefix = "data")
		org.mergeSamples(targetSpec = {"name":"H #rightarrow X #rightarrow q#bar{q}", "color":r.kRed,"lineWidth":3,"goptions":"hist","lineStyle":2}, allWithPrefix = "H")
		org.scale()
		plotter = supy.plotter( org,
			pdfFileName = self.pdfFileName(org.tag),
			#samplesForRatios = ("data","qcd"),
			#sampleLabelsForRatios = ("data","qcd"),
			doLog=True,
			anMode=True,
			pegMinimum=1,
			blackList = ["lumiHisto","xsHisto","nJobsHisto"],
		)
		plotter.plotAll()

		plotter.individualPlots(plotSpecs = [{"plotName":"PromptEnergyFrac_h_jetPromptEnergyFrac",
                                              "stepName":"promptness",
                                              "stepDesc":"promptness",
                                              "newTitle":"; Charged Prompt Energy Fraction; jets / bin",
                                              "legendCoords": (0.35, 0.35, 0.9, 0.55),
                                              "stampCoords": (0.6, 0.68)
                                              },
                                              {"plotName":"NPromptTracks_h_jetPromptEnergyFrac",
                                              "stepName":"promptness",
                                              "stepDesc":"promptness",
                                              "newTitle":"; Number of Prompt Tracks ; jets / bin",
                                              "legendCoords": (0.55, 0.55, 0.9, 0.75),
                                              "stampCoords": (0.7, 0.88)
                                              },
                                            ]
                               )
Ejemplo n.º 29
0
	def conclude(self,pars) :
		#make a pdf file with plots from the histograms created above
		org = self.organizer(pars)
		#org.mergeSamples(targetSpec = {"name":"#tilde{q}(1500)#rightarrow#tilde{#chi}(500) c#tau=18.1cm", "color":r.kRed,"lineWidth":3,"goptions":"hist","lineStyle":1}, allWithPrefix = "SQ_1500_CHI_494")                
		#org.mergeSamples(targetSpec = {"name":"#tilde{q}(1500)#rightarrow#tilde{#chi}(150) c#tau=4.5cm", "color":r.kYellow,"lineWidth":3,"goptions":"hist","lineStyle":1}, allWithPrefix = "SQ_1500_CHI_150")                
		#org.mergeSamples(targetSpec = {"name":"#tilde{q}(1000)#rightarrow#tilde{#chi}(150) c#tau=5.9cm", "color":r.kBlack,"lineWidth":3,"goptions":"hist","lineStyle":1}, allWithPrefix = "SQ_1000_CHI_148")                
		#org.mergeSamples(targetSpec = {"name":"#tilde{q}(1000)#rightarrow#tilde{#chi}(500) c#tau=22.7cm", "color":r.kOrange,"lineWidth":3,"goptions":"hist","lineStyle":1}, allWithPrefix = "SQ_1000_CHI_500")                
		#org.mergeSamples(targetSpec = {"name":"#tilde{q}(350)#rightarrow#tilde{#chi}(150) c#tau=18.8cm", "color":r.kGreen,"lineWidth":3,"goptions":"hist","lineStyle":1}, allWithPrefix = "SQ_350_CHI_148")                
		#org.mergeSamples(targetSpec = {"name":"#tilde{q}(700)#rightarrow#tilde{#chi}(150) c#tau=8.1cm", "color":r.kBlue,"lineWidth":3,"goptions":"hist","lineStyle":1}, allWithPrefix = "SQ_700_CHI_150")                
		#org.mergeSamples(targetSpec = {"name":"#tilde{q}(700)#rightarrow#tilde{#chi}(500) c#tau=27.9cm", "color":r.kMagenta,"lineWidth":3,"goptions":"hist","lineStyle":1}, allWithPrefix = "SQ_700_CHI_500")                
		org.scale(lumiToUseInAbsenceOfData=18600)
		plotter = supy.plotter( org,
			pdfFileName = self.pdfFileName(org.tag),
			doLog=True,
			anMode=True,
			showStatBox=True,
			pegMinimum=0.1,
			shiftUnderOverFlows=False,
			blackList = ["lumiHisto","xsHisto","nJobsHisto"],
			)
		plotter.plotAll()
		#plotter.doLog=False
		plotter.anMode=True
	
		#self.meanLxy(org)
		#self.sqsqRatio(org)
		org.lumi=None
		#self.flavors(org)
		#self.effPlots(org,plotter,denName='NE',numName='NEReco',sel='Low',flavor='')
		#self.sigPlots(plotter)	
		self.totEvtEff(org,dir='eff2Neu')
Ejemplo n.º 30
0
	def conclude(self,pars) :
		#make a pdf file with plots from the histograms created above
		org = self.organizer(pars)
		org.mergeSamples(targetSpec = {"name":"QCD", "color":r.kBlue,"lineWidth":3,"goptions":"E2","fillColor":r.kBlue,"fillStyle":3001,"double":True,"markerSize":0}, allWithPrefix = "qcd")
		org.mergeSamples(targetSpec = {"name":"Data", "color":r.kBlack, "markerStyle":20}, allWithPrefix = "data")
		org.mergeSamples(targetSpec = {"name":"H#rightarrow X #rightarrow q#bar{q}", "color":r.kRed,"lineWidth":3,"goptions":"hist","lineStyle":2}, allWithPrefix = "H")
		org.scale(lumiToUseInAbsenceOfData=11)
		plotter = supy.plotter( org,
			pdfFileName = self.pdfFileName(org.tag),
			samplesForRatios = ("Data","QCD"),
            sampleLabelsForRatios = ("Data","QCD"),
			doLog=True,
			pageNumbers=False,
			#pegMinimum=1,
			anMode=True,
			blackList = ["lumiHisto","xsHisto","nJobsHisto"],
		)
		#plotter.plotAll()
		#plotABCDscan(self,org,plotter,4,blind=False)
	
		plotter.individualPlots(plotSpecs = [
                                              {"plotName":"Discriminant_h_dijetTrueLxy",
                                              "stepName":"ABCDvars",
                                              "stepDesc":"ABCDvars",
                                              "newTitle":"; Vertex-Cluster discriminant; dijets / bin",
                                              "legendCoords": (0.7, 0.75, 0.9, 0.9),
                                              "stampCoords": (0.45, 0.88)
                                              },
											])
Ejemplo n.º 31
0
	def conclude(self,pars) :
		#make a pdf file with plots from the histograms created above
		org = self.organizer(pars)
		org.mergeSamples(targetSpec = {"name":"Simulation", "color":r.kBlue,"lineWidth":3,"goptions":"hist"}, allWithPrefix = "qcd")
		org.mergeSamples(targetSpec = {"name":"Data", "color":r.kBlack, "markerStyle":20}, allWithPrefix = "data")
		org.scale(lumiToUseInAbsenceOfData=18600)
		plotter = supy.plotter( org,
			pdfFileName = self.pdfFileName(org.tag),
			doLog=True,
			samplesForRatios = ("Data","Simulation"),
			sampleLabelsForRatios = ("Data","Sim"),
			#anMode=True,
			blackList = ["lumiHisto","xsHisto","nJobsHisto"],
			dependence2D=True,
			doCorrTable=True,
			pegMinimum=5,
			anMode=True
		)
		plotter.plotAll()
		org.lumi=None
		plotter.individualPlots(plotSpecs = [{"plotName":"NAvgMissHitsAfterVert_h_dijetVtxpt",
                                              "stepName":"cutvars",
                                              "stepDesc":"cutvars",
                                              "newTitle":";Missing Hits per track after Vertex;dijets / bin",
                                              "legendCoords": (0.55, 0.55, 0.9, 0.75),
                                              "stampCoords": (0.67, 0.88)
                                              },
                                            ]
                               )
Ejemplo n.º 32
0
 def conclude(self, pars):
     # make a pdf file with plots from the histograms created above
     org = self.organizer(pars)
     org.mergeSamples(
         targetSpec={"name": "Simulation", "color": r.kBlue, "markerStyle": 21, "markerSize": 0.6},
         allWithPrefix="qcd",
     )
     org.mergeSamples(
         targetSpec={"name": "Data", "color": r.kBlack, "markerStyle": 21, "markerSize": 0.6}, allWithPrefix="data"
     )
     org.scale(lumiToUseInAbsenceOfData=11)
     plotter = supy.plotter(
         org,
         pdfFileName=self.pdfFileName(org.tag),
         samplesForRatios=("Data", "Simulation"),
         sampleLabelsForRatios=("Data", "Sim"),
         doLog=True,
         anMode=True,
         pageNumbers=False,
         pushLeft=True,
         blackList=["lumiHisto", "xsHisto", "nJobsHisto"],
     )
     plotter.plotAll()
     plotter.doLog = False
     self.makeEfficiencyPlots1(org, "jetPt", "jetTrigPrompt1", plotter)
     self.makeEfficiencyPlots2(org, "jetPromptEnergyFrac", "jetTrigPrompt2", plotter)
Ejemplo n.º 33
0
	def conclude(self,pars) :
		#make a pdf file with plots from the histograms created above
		org = self.organizer(pars)
		org.mergeSamples(targetSpec = {"name":"H^{0}(1000)#rightarrow 2X^{0}(350) c#tau=35cm", "color":r.kRed,"lineWidth":3,"goptions":"","lineStyle":1}, allWithPrefix = "H_1000_X_350")                                 
		org.mergeSamples(targetSpec = {"name":"H^{0}(400)#rightarrow 2X^{0}(150) c#tau=40cm", "color":r.kGreen,"lineWidth":3,"goptions":"","lineStyle":1}, allWithPrefix = "H_400_X_150")                               
		org.mergeSamples(targetSpec = {"name":"H^{0}(200)#rightarrow 2X^{0}(50) c#tau=20cm", "color":r.kBlack,"lineWidth":3,"goptions":"","lineStyle":1}, allWithPrefix = "H_200_X_50")
		org.mergeSamples(targetSpec = {"name":"H^{0}(1000)#rightarrow 2X^{0}(150) c#tau=10cm", "color":r.kBlue,"lineWidth":3,"goptions":"","lineStyle":1}, allWithPrefix = "H_1000_X_150")
		org.mergeSamples(targetSpec = {"name":"H^{0}(400)#rightarrow 2X^{0}(50) c#tau=8cm", "color":r.kMagenta,"lineWidth":3,"goptions":"","lineStyle":1}, allWithPrefix = "H_400_X_50")                               
		org.scale(lumiToUseInAbsenceOfData=18600)
		plotter = supy.plotter( org,
			pdfFileName = self.pdfFileName(org.tag),
			doLog=True,
			anMode=True,
			showStatBox=True,
			pegMinimum=0.0001,
			shiftUnderOverFlows=False,
			blackList = ["lumiHisto","xsHisto","nJobsHisto"],
			)
		plotter.plotAll()
		plotter.anMode=True
	
		#self.meanLxy(org)
		org.lumi=None
		#self.effPlots(org,plotter,denName='NE',numName='NEReco',sel='Low',flavor='')
		#self.sigPlots(plotter)	
		#self.totalEfficiencies(org,dir='eff2',flavor='')
		self.totEvtEff(org,dir='eff2HV')
Ejemplo n.º 34
0
 def conclude(self,pars) :
     org = self.organizer(pars)
     #org.mergeSamples(targetSpec = {"name":"SingleMu", "color":r.kBlack}, allWithPrefix="SingleMu")
     #org.scale()
     
     supy.plotter(org,
                  pdfFileName = self.pdfFileName(org.tag),
                  #samplesForRatios = ("2010 Data","standard_model"),
                  #sampleLabelsForRatios = ("data","s.m."),
                  #whiteList = ["lowestUnPrescaledTrigger"],
                  #doLog = False,
                  #compactOutput = True,
                  #noSci = True,
                  #pegMinimum = 0.1,
                  blackList = ["lumiHisto","xsHisto","nJobsHisto"],
                  ).plotAll()
Ejemplo n.º 35
0
 def plotMeldScale(self, tagSuffix):
     if tagSuffix not in self.orgMelded:
         print tagSuffix, "not in", self.orgMelded.keys()
         print "run meldScale() before plotMeldScale()"
         return
     melded = copy.deepcopy(self.orgMelded[tagSuffix])
     lname, tt, sn, jn, ptMin = tagSuffix.split('_')
     for s in [
             'top.ttj_%s.%s.pu' % (tt, s)
             for s in ['wQQ', 'wQG', 'wAG', 'wGG']
     ]:
         melded.drop(s)
     for log, label in [(False, ""), (True, "_log")][:1]:
         pl = supy.plotter(
             melded,
             pdfFileName=self.pdfFileName(melded.tag + label),
             doLog=log,
             blackList=["lumiHisto", "xsHisto", "nJobsHisto"],
             rowColors=self.rowcolors,
             samplesForRatios=("top.Data 2012", "S.M."),
             sampleLabelsForRatios=('data', 's.m.'),
             rowCycle=100,
             omit2D=True,
             pageNumbers=False,
         ).plotAll()
     print
     print 'fitTopDPtDPhi indices:'
     print melded.indicesOfStepsWithKey('fitTopDPtDPhi')
Ejemplo n.º 36
0
    def conclude(self, pars):
        org = self.organizer(pars, prefixesNoScale=["efficiency_"])

        def gopts(name="", color=1):
            return {
                "name": name,
                "color": color,
                "markerStyle": 1,
                "lineWidth": 2,
                "goptions": "ehist"
            }

        #org.mergeSamples(targetSpec=gopts("BB_0_3",   r.kGreen),   sources=["BB_0_3.GenWeight"])
        #org.mergeSamples(targetSpec=gopts("BB_3_7",   r.kCyan),    sources=["BB_3_7.GenWeight"])
        #org.mergeSamples(targetSpec=gopts("BB_7_13",  r.kMagenta), sources=["BB_7_13.GenWeight"])
        #org.mergeSamples(targetSpec=gopts("BB_13_21", r.kOrange),  sources=["BB_13_21.GenWeight"])
        org.mergeSamples(targetSpec=gopts("BB", r.kBlue), allWithPrefix="BB_")
        org.mergeSamples(targetSpec=gopts("H", r.kBlue), allWithPrefix="H_")

        org.mergeSamples(targetSpec=gopts("hh_bb#tau#tau", r.kRed),
                         sources=["hh_bbtt"])

        #org.mergeSamples(targetSpec=gopts("H_c0_pu0",         r.kBlack),   sources=["H_0_3_c0_pu0.GenWeight"])
        #org.mergeSamples(targetSpec=gopts("H_c0_pu140",       r.kBlue),    sources=["H_0_3_c0_pu140.GenWeight"])
        #org.mergeSamples(targetSpec=gopts("H_c3_pu140",       r.kGreen),   sources=["H_0_3_c3_pu140.GenWeight"])
        #org.mergeSamples(targetSpec=gopts("H_c4_pu140",       r.kCyan),    sources=["H_0_3_c4_pu140.GenWeight"])

        #org.mergeSamples(targetSpec=gopts("hh_bbtt_c3_pu140", r.kRed),     sources=["hh_bbtt_c3_pu140"])
        #org.mergeSamples(targetSpec=gopts("hh_bbtt_c4_pu140", r.kMagenta), sources=["hh_bbtt_c4_pu140"])

        org.scale(1.0 / fb)
        #org.scale(toPdf=True)

        supy.plotter(
            org,
            pdfFileName=self.pdfFileName(org.tag),
            printImperfectCalcPageIfEmpty=False,
            printXs=True,
            blackList=["lumiHisto", "xsHisto", "nJobsHisto"],
            rowColors=[r.kBlack, r.kViolet + 4],
            doLog=False,
            fitFunc=lambda x: self.profFit(x, "b_v4"),
            showStatBox=True,
            optStat=1100,
        ).plotAll()

        self.dumpFitResults(fileName="fitResults.py")
Ejemplo n.º 37
0
    def conclude(self, pars):
        org = self.organizer(pars)
        #org.mergeSamples(targetSpec = {"name":"SingleMu", "color":r.kBlack}, allWithPrefix="SingleMu")
        #org.scale()

        supy.plotter(
            org,
            pdfFileName=self.pdfFileName(org.tag),
            #samplesForRatios = ("2010 Data","standard_model"),
            #sampleLabelsForRatios = ("data","s.m."),
            #whiteList = ["lowestUnPrescaledTrigger"],
            #doLog = False,
            #compactOutput = True,
            #noSci = True,
            #pegMinimum = 0.1,
            blackList=["lumiHisto", "xsHisto", "nJobsHisto"],
        ).plotAll()
Ejemplo n.º 38
0
    def conclude(self,pars) :
        rw = pars['reweights']['abbr']

        org = self.organizer(pars, verbose = True )

        org.mergeSamples(targetSpec = {"name":"Data 2012", "color":r.kBlack, "markerStyle":20},
                         sources=getattr(self,'muons' if pars['lepton']['name']=='mu' else 'electrons')('.jw') )

        org.mergeSamples(targetSpec={"name":"t#bar{t}", "color":r.kViolet}, sources=['ttj_ph.wAG.pu.sf','ttj_ph.wQG.pu.sf','ttj_ph.wQQ.pu.sf','ttj_ph.wGG.pu.sf'], keepSources=True)
        org.mergeSamples(targetSpec={"name":"Wbb", "color":r.kRed}, allWithPrefix='wbb')
        org.mergeSamples(targetSpec={"name":"W", "color":28}, allWithPrefix='w')
        org.mergeSamples(targetSpec={"name":"DY", "color":r.kYellow}, allWithPrefix="dy")
        org.mergeSamples(targetSpec={"name":"t", "color":r.kWhite}, sources=['.'.join([s,rw,'sf']) for s in self.single_top() if 'top_t_' in s], keepSources=True)
        org.mergeSamples(targetSpec={"name":"t_", "color":r.kWhite}, sources=['.'.join([s,rw,'sf']) for s in self.single_top() if 'tbar_t_' in s], keepSources=True)
        org.mergeSamples(targetSpec={"name":"Single", "color":r.kGray}, sources=['.'.join([s,rw,'sf']) for s in self.single_top()])
        org.mergeSamples(targetSpec={"name":"St.Model", "color":r.kGreen+2}, sources=["t#bar{t}","W","DY","Single"],
                         keepSources=True)
        try:
            self.skimStats(org)
            self.printTable(org)
            self.skimControl(org)
        except: pass
        org.scale( lumiToUseInAbsenceOfData = 19590, toPdf=False )

        names = [ss["name"] for ss in org.samples]
        kwargs = {"detailedCalculables": False,
                  "blackList":["lumiHisto","xsHisto","nJobsHisto"],
                  "samplesForRatios" : next(iter(filter(lambda x: x[0] in names and x[1] in names,
                                                        [("Data 2012","St.Model")])), ("","")),
                  "sampleLabelsForRatios" : ("data","s.m."),
                  "detailedCalculables" : True,
                  "rowColors" : self.rowcolors,
                  "rowCycle" : 100,
                  "omit2D" : True,
                  }
        
        #supy.plotter(org, pdfFileName = self.pdfFileName(org.tag+"_log"),  doLog=True, pegMinimum=0.01, **kwargs ).plotAll()
        supy.plotter(org, pdfFileName = self.pdfFileName(org.tag+"_nolog"), doLog=False, **kwargs ).plotAll()
Ejemplo n.º 39
0
    def conclude(self, pars):
        org = self.organizer(pars, prefixesNoScale=["efficiency_"])
        supy.utils.printSkimResults(org)

        def gopts(name="", color=1):
            return {
                "name": name,
                "color": color,
                "markerStyle": 1,
                "lineWidth": 2,
                "goptions": "ehist"
            }

        c = pars["tag"]
        org.mergeSamples(targetSpec=gopts("hh_bb#tau#tau", r.kRed),
                         sources=["hh_bbtt_%s_20_skim" % c])

        keep = pars["keepSources"]

        if keep:
            org.mergeSamples(targetSpec=gopts("tt_0_6", r.kBlue),
                             sources=["tt_%s_0_6_skim.GenWeight" % c])
            org.mergeSamples(targetSpec=gopts("tt_6_11", r.kGreen),
                             sources=["tt_%s_6_11_skim.GenWeight" % c])
            org.mergeSamples(targetSpec=gopts("tt_11_17", r.kCyan),
                             sources=["tt_%s_11_17_skim.GenWeight" % c])
            org.mergeSamples(targetSpec=gopts("tt_17_25", r.kMagenta),
                             sources=["tt_%s_17_25_skim.GenWeight" % c])
            org.mergeSamples(targetSpec=gopts("tt_25_1k", r.kOrange),
                             sources=["tt_%s_25_1k_skim.GenWeight" % c])
        org.mergeSamples(targetSpec=gopts("tt", r.kBlue),
                         allWithPrefix="tt_",
                         keepSources=keep)

        bj = [
            "B_skim", "Bj_0_3_skim", "Bj_3_6_skim", "Bj_6_11_skim",
            "Bj_11_18_skim", "Bj_18_27_skim", "Bj_27_37_skim", "Bj_37_1k_skim"
        ]
        org.mergeSamples(targetSpec=gopts("Bj", r.kGreen),
                         sources=[x + ".GenWeight" for x in bj],
                         keepSources=keep)

        tb = [
            "tB_0_5_skim", "tB_5_9_skim", "tB_9_15_skim", "tB_15_22_skim",
            "tB_22_1k_skim"
        ]
        org.mergeSamples(targetSpec=gopts("tB", r.kCyan),
                         sources=[x + ".GenWeight" for x in tb],
                         keepSources=keep)

        ttb = [
            "ttB_0_9_skim", "ttB_9_16_skim", "ttB_16_25_skim", "ttB_25_1k_skim"
        ]
        org.mergeSamples(targetSpec=gopts("ttB", r.kBlue - 8),
                         sources=[x + ".GenWeight" for x in ttb],
                         keepSources=keep)

        h = ["H_0_3_skim", "H_3_8_skim", "H_8_15_skim", "H_15_1k_skim"]
        org.mergeSamples(targetSpec=gopts("H", r.kOrange - 3),
                         sources=[x + ".GenWeight" for x in h],
                         keepSources=keep)

        if keep:
            org.mergeSamples(targetSpec=gopts("BB_0_3", r.kBlue),
                             sources=["BB_%s_0_3_skim.GenWeight" % c])
            org.mergeSamples(targetSpec=gopts("BB_3_7", r.kGreen),
                             sources=["BB_%s_3_7_skim.GenWeight" % c])
            org.mergeSamples(targetSpec=gopts("BB_7_13", r.kCyan),
                             sources=["BB_%s_7_13_skim.GenWeight" % c])
            org.mergeSamples(targetSpec=gopts("BB_13_21", r.kMagenta),
                             sources=["BB_%s_13_21_skim.GenWeight" % c])
            org.mergeSamples(targetSpec=gopts("BB_21_1k", r.kOrange),
                             sources=["BB_%s_21_1k_skim.GenWeight" % c])
        org.mergeSamples(targetSpec=gopts("BB", r.kBlack),
                         allWithPrefix="BB_",
                         keepSources=keep)

        if keep:
            org.mergeSamples(targetSpec=gopts("BBB_0_6", r.kBlue),
                             sources=["BBB_%s_0_6_skim.GenWeight" % c])
            org.mergeSamples(targetSpec=gopts("BBB_6_13", r.kGreen),
                             sources=["BBB_%s_6_13_skim.GenWeight" % c])
            org.mergeSamples(targetSpec=gopts("BBB_13_1k", r.kCyan),
                             sources=["BBB_%s_13_1k_skim.GenWeight" % c])
        org.mergeSamples(targetSpec=gopts("BBB", r.kBlack),
                         allWithPrefix="BBB_",
                         keepSources=keep)

        bjj = [
            "Bjj_0_7_skim", "Bjj_7_14_skim", "Bjj_14_23_skim", "Bjj_23_34_skim"
        ]
        org.mergeSamples(targetSpec=gopts("Bjj", r.kYellow),
                         sources=[x + ".GenWeight" for x in bjj],
                         keepSources=keep)

        ll = [
            "LL_0_1_skim", "LL_1_2_skim", "LL_2_5_skim", "LL_5_9_skim",
            "LL_9_14_skim", "LL_14_1k_skim"
        ]
        org.mergeSamples(targetSpec=gopts("LL", r.kBlack),
                         sources=[x + ".GenWeight" for x in ll],
                         keepSources=keep)

        llb = ["LLB_0_4_skim", "LLB_4_9_skim", "LLB_9_1k_skim"]
        org.mergeSamples(targetSpec=gopts("LLB", r.kBlack),
                         sources=[x + ".GenWeight" for x in llb],
                         keepSources=keep)

        tj = [
            "tj_0_5_skim", "tj_5_10_skim", "tj_10_16_skim", "tj_16_24_skim",
            "tj_24_1k_skim"
        ]
        org.mergeSamples(targetSpec=gopts("tj", r.kPink),
                         sources=[x + ".GenWeight" for x in tj],
                         keepSources=keep)

        others = ["BB", "BBB", "Bjj", "LL", "LLB", "tj"]
        org.mergeSamples(targetSpec=gopts("others", r.kMagenta),
                         sources=others,
                         keepSources=False)

        sm = ["tt", "Bj", "tB", "ttB", "H", "others"]
        org.mergeSamples(targetSpec=gopts("SM", r.kBlack),
                         sources=sm,
                         keepSources=True)

        org.scale(3.e3 / fb)
        #org.scale(toPdf=True)

        supy.plotter(
            org,
            pdfFileName=self.pdfFileName(org.tag),
            printImperfectCalcPageIfEmpty=False,
            printXs=True,
            blackList=["lumiHisto", "xsHisto", "nJobsHisto"],
            rowColors=[r.kBlack, r.kViolet + 4],
            doLog=True,
            pegMinimum=0.1,
            #optStat=1100,
            optStat=1111,
            #fitFunc=self.profFit,
            showStatBox=False,
            latexYieldTable=False,
            samplesForRatios=("hh_bb#tau#tau", "SM"),
            sampleLabelsForRatios=("hh", "SM"),
            foms=[
                {
                    "value":
                    lambda x, y: x / y,
                    "uncRel":
                    lambda x, y, xUnc, yUnc: math.sqrt((xUnc / x)**2 +
                                                       (yUnc / y)**2),
                    "label":
                    lambda x, y: "%s/%s" % (x, y),
                },
                #      #{"value": lambda x,y: x/(y**0.5),
                #      # "uncRel": lambda x, y, xUnc, yUnc: math.sqrt((xUnc/x)**2 + (yUnc/y/2.)**2),
                #      # "label": lambda x,y: "%s/sqrt(%s)" % (x, y),
                #      # },
            ],
        ).plotAll()
Ejemplo n.º 40
0
    def conclude(self, pars):
        org = self.organizer(pars, prefixesNoScale=["efficiency_"])
        def gopts(name="", color=1):
            return {"name":name, "color":color, "markerStyle":1, "lineWidth":2, "goptions":"ehist"}

        #org.mergeSamples(targetSpec=gopts("tt_0_6",   r.kBlue),    sources=["tt_0_6.GenWeight"])
        #org.mergeSamples(targetSpec=gopts("tt_6_11",  r.kGreen),   sources=["tt_6_11.GenWeight"])
        #org.mergeSamples(targetSpec=gopts("tt_11_17", r.kCyan),    sources=["tt_11_17.GenWeight"])
        #org.mergeSamples(targetSpec=gopts("tt_17_25", r.kMagenta), sources=["tt_17_25.GenWeight"])
        #org.mergeSamples(targetSpec=gopts("tt_25_1k", r.kOrange),  sources=["tt_25_1k.GenWeight"])
        #org.mergeSamples(targetSpec=gopts("tt", r.kBlack), allWithPrefix="tt_")

        #org.mergeSamples(targetSpec=gopts("BB_0_3",   r.kGreen),   sources=["BB_0_3.GenWeight"])
        #org.mergeSamples(targetSpec=gopts("BB_3_7",   r.kCyan),    sources=["BB_3_7.GenWeight"])
        #org.mergeSamples(targetSpec=gopts("BB_7_13",  r.kMagenta), sources=["BB_7_13.GenWeight"])
        #org.mergeSamples(targetSpec=gopts("BB_13_21", r.kOrange),  sources=["BB_13_21.GenWeight"])
        org.mergeSamples(targetSpec=gopts("BB", r.kBlue), allWithPrefix="BB_")

        #org.mergeSamples(targetSpec=gopts("BBB_0_6",   r.kBlue),    sources=["BBB_0_6.GenWeight"])
        #org.mergeSamples(targetSpec=gopts("BBB_6_13",  r.kCyan),    sources=["BBB_6_13.GenWeight"])
        #org.mergeSamples(targetSpec=gopts("BBB_13_1k", r.kMagenta), sources=["BBB_13_1k.GenWeight"])
        org.mergeSamples(targetSpec=gopts("BBB", r.kGreen), allWithPrefix="BBB_")

        org.mergeSamples(targetSpec=gopts("hh_bb#tau#tau", r.kRed), sources=["hh_bbtt"])

        #org.mergeSamples(targetSpec=gopts("tt*w", r.kBlue), sources=["tt0_600.GenWeight"])
        #org.mergeSamples(targetSpec=gopts("tt*1.0", r.kBlack) sources=["tt0_600"])

        org.mergeSamples(targetSpec=gopts("H_c0_pu0",         r.kBlack),   sources=["H_0_3_c0_pu0.GenWeight"])
        org.mergeSamples(targetSpec=gopts("H_c0_pu140",       r.kBlue),    sources=["H_0_3_c0_pu140.GenWeight"])
        org.mergeSamples(targetSpec=gopts("H_c3_pu140",       r.kGreen),   sources=["H_0_3_c3_pu140.GenWeight"])
        org.mergeSamples(targetSpec=gopts("H_c4_pu140",       r.kCyan),    sources=["H_0_3_c4_pu140.GenWeight"])

        org.mergeSamples(targetSpec=gopts("tt_pu0",        r.kBlack),   sources=["tt_0_6_pu0.GenWeight"])
        org.mergeSamples(targetSpec=gopts("tt_pu50",       r.kOrange+7),    sources=["tt_0_6_pu50.GenWeight"])
        org.mergeSamples(targetSpec=gopts("tt_pu140",      r.kBlue),   sources=["tt_0_6_pu140.GenWeight"])

        org.mergeSamples(targetSpec=gopts("tt_c0_pu0",        r.kBlack),   sources=["tt_0_6_c0_pu0.GenWeight"])
        org.mergeSamples(targetSpec=gopts("tt_c0_pu140",      r.kBlue),    sources=["tt_0_6_c0_pu140.GenWeight"])
        org.mergeSamples(targetSpec=gopts("tt_c3_pu140",      r.kGreen),   sources=["tt_0_6_c3_pu140.GenWeight"])
        org.mergeSamples(targetSpec=gopts("tt_c4_pu140",      r.kCyan),    sources=["tt_0_6_c4_pu140.GenWeight"])
        org.mergeSamples(targetSpec=gopts("hh_bbtt_c3_pu140", r.kRed),     sources=["hh_bbtt_c3_pu140"])
        org.mergeSamples(targetSpec=gopts("hh_bbtt_c4_pu140", r.kMagenta), sources=["hh_bbtt_c4_pu140"])

        #org.mergeSamples(targetSpec=gopts("hh_bbtt_c4_pu140",    r.kGreen), sources=["hh_bbtt_c4_pu140"])
        #org.mergeSamples(targetSpec=gopts("rho<80",     r.kBlack), sources=["hh_bbtt_c4_pu140.rho.le.80"])
        #org.mergeSamples(targetSpec=gopts("90<rho<100", r.kRed),   sources=["hh_bbtt_c4_pu140.90.le.rho.le.100"])
        #org.mergeSamples(targetSpec=gopts("110<rho",    r.kBlue),  sources=["hh_bbtt_c4_pu140.110.le.rho"])

        org.scale(1.0/fb)
        #org.scale(toPdf=True)

        supy.plotter(org,
                     pdfFileName=self.pdfFileName(org.tag),
                     printImperfectCalcPageIfEmpty=False,
                     printXs=True,
                     blackList=["lumiHisto", "xsHisto", "nJobsHisto"],
                     rowColors=[r.kBlack, r.kViolet+4],

                     doLog=False,
                     showStatBox=False,
                     latexYieldTable=False,
                     #samplesForRatios=("hh_bb#tau#tau", "tt"),
                     sampleLabelsForRatios=("hh", "tt"),
                     foms=[{"value": lambda x, y: x/y,
                            "uncRel": lambda x, y, xUnc, yUnc: math.sqrt((xUnc/x)**2 + (yUnc/y)**2),
                            "label": lambda x, y:"%s/%s" % (x, y),
                            },
                           #{"value": lambda x,y: x/(y**0.5),
                           # "uncRel": lambda x, y, xUnc, yUnc: math.sqrt((xUnc/x)**2 + (yUnc/y/2.)**2),
                           # "label": lambda x,y: "%s/sqrt(%s)" % (x, y),
                           # },
                           #{"value": lambda x, y: x/(((a*y)**2+y)**0.5),
                           # "uncRel": lambda x, y, xUnc, yUnc: math.sqrt((xUnc/x)**2 +\
                           #                                              (yUnc*(2*a*a*y+1)/(a*a*y*y+y)/2.)**2\
                           #                                              ),
                           # "label": lambda x,y: "%s/r(%s+%s^2/%3.0f)" % (x, y, y, 1/a/a),
                           # },
                           ],
                     ).plotAll()
Ejemplo n.º 41
0
 def conclude(self,pars):
     org = self.organizer(pars, verbose = True )
     supy.plotter(org, pdfFileName = self.pdfFileName(org.tag), doLog=False ).plotAll()