Skip to content

Conversation

@minxiyang
Copy link

No description provided.

@minxiyang minxiyang closed this Oct 22, 2019
@minxiyang minxiyang reopened this Oct 22, 2019
plotAfb.py Outdated
#help="use 2017 data and MC.")
#parser.add_argument("-2018", "--2018", action="store_true", dest="use2018", default=False,
#help="use 2018 data and MC.")
os.chdir("/home/yang1452/CIAnalysis/plots")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please do not hardcode something like this here, just add "plots/" to the Canvas.Print() command as in the original plot.py

plotAfb.py Outdated
os.chdir("/home/yang1452/CIAnalysis/plots")
backgrounds = ["Wjets","Other","DrellYan"]
PlotlistPos = ["massPlotBBCSPosNoLog","massPlotBECSPosNoLog","massPlotEleBBCSPosNoLog","massPlotEleBECSPosNoLog","massPlotEleEECSPosNoLog"]
PlotlistNeg = ["massPlotBBCSNegNoLog","massPlotBECSNegNoLog","massPlotEleBBCSNegNoLog","massPlotEleBECSNegNoLog","massPlotEleEECSNegNoLog"]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do not include the EE category for electrons, we do not use endcap-endcap events in that channel

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you still including EE here?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, although I put EE in there, I don't use it in the plot.

plotAfb.py Outdated
#parser.add_argument("-2018", "--2018", action="store_true", dest="use2018", default=False,
#help="use 2018 data and MC.")
os.chdir("/home/yang1452/CIAnalysis/plots")
backgrounds = ["Wjets","Other","DrellYan"]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the WJets sample are a reason for the MC plots being to spikey, just remove it. We know that this background is flat in cos theta*

plotAfb.py Outdated
histTree[flavor][year]["mc"][category].Draw("samehist")
legend.Draw()
#hCanvas.SetLogx()
hCanvas.Print("Distribution of Afb for "+year+" "+flavor+" data "+category+".pdf")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No spaces in file names please, shorten to "Afb_..." and use underscores to separate year, flavor, and category

plotAfb.py Outdated
plotTree["electron"]["BB"]=[plotsPos[2],plotsNeg[2]]
plotTree["electron"]["BE"]=[[plotsPos[3],plotsNeg[3]],[plotsPos[4],plotsNeg[4]]]
for flavor in ["muon","electron"]:
bng=binning(flavor)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The binning is way too fine for this plot. Please define a more suitable binning for the AFB plots.

plotAfb.py Outdated
yMin=0.01
legend=ROOT.TLegend(0.1,0.7,0.4,0.98)
histTree[flavor][year]["data"][category].SetMarkerStyle(3)
histTree[flavor][year]["mc"][category].SetFillColorAlpha(2,0.5)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't use a filled histogram here, just a single line. AFB is just a single number and the filled histogram does not really emphasizes that enough I think.

plotAfb.py Outdated
xMin=histTree[flavor][year]["mc"][category].GetXaxis().GetXmin()
yMax=histTree[flavor][year]["mc"][category].GetBinContent(histTree[flavor][year]["mc"][category].GetMaximumBin())
yMin=0.01
legend=ROOT.TLegend(0.1,0.7,0.4,0.98)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use the legend as it is in plot.py to follow our usual plot style. Also add all the labels like "CMS" and the lumi info and so on from the other plots.



def binning(channel='muon'):
if channel == 'muon':
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please do not break the functionality of other programs! To have a different binning for the AFB plot, please give the function another argument as a switch.

plotAfb.py Outdated
os.chdir("/home/yang1452/CIAnalysis/plots")
backgrounds = ["Wjets","Other","DrellYan"]
PlotlistPos = ["massPlotBBCSPosNoLog","massPlotBECSPosNoLog","massPlotEleBBCSPosNoLog","massPlotEleBECSPosNoLog","massPlotEleEECSPosNoLog"]
PlotlistNeg = ["massPlotBBCSNegNoLog","massPlotBECSNegNoLog","massPlotEleBBCSNegNoLog","massPlotEleBECSNegNoLog","massPlotEleEECSNegNoLog"]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you still including EE here?

plotAfb.py Outdated
tempDenom=tempDenom.Rebin(len(bng) - 1, 'hist_' + uuid.uuid4().hex, array('d', bng))
tempHistAfb=ROOT.TH1D("Afb"+flavor+year+category+dataType,"The distribution of Afb for "+year+" "+flavor+" result",len(binning(flavor))-1 ,array("f",binning(flavor)))
tempHistAfb.Divide(tempNom,tempDenom)
histTree[flavor][year][dataType][category].append(tempHistAfb.Clone())
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like you are not subtracting the 100k TeV samples, right?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used 100 kTeV sample.

el_PUdown_fit=Addstack(el_PUdown)
datamu_fit=Addhist(datamu)
datael_fit=Addhist(datael)
if args.ratio:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whatever editor you are using is causing issues with the indentation here and at other places throughout the document. Can you use an editor that consistently uses tabs to do the indentation in Python?

errmu_fit=Errs_mu_fit[0]["massScale"]**2+(Errs_mu_fit[1]["massScale"]+Errs_mu_fit[2]["massScale"])**2+Errs_mu_fit[0]["resolution"]**2+Errs_mu_fit[1]["resolution"]**2+Errs_mu_fit[2]["resolution"]**2+Errs_mu_fit[0]["ID"]**2+(Errs_mu_fit[1]["ID"]+Errs_mu_fit[2]["ID"])**2
else:
errmu_fit=Errs_mu_fit[0]["massScale"]**2+(Errs_mu_fit[1]["massScale"]+Errs_mu_fit[2]["massScale"])**2+Errs_mu_fit[0]["resolution"]**2+Errs_mu_fit[1]["resolution"]**2+Errs_mu_fit[2]["resolution"]**2+Errs_mu_fit[0]["ID"]**2+Errs_mu_fit[1]["ID"]**2+Errs_mu_fit[2]["ID"]**2
errel_fit=Errs_el_fit[0]["massScale"]**2+Errs_el_fit[0]["pileUp"]**2+Errs_el_fit[1]["massScale"]**2+Errs_el_fit[1]["pileUp"]**2+Errs_el_fit[2]["massScale"]**2+Errs_el_fit[2]["pileUp"]**2
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure the PU uncertainty and mass scale uncertainty for electrons are uncorrelated between the years?

args.backgrounds = ["Wjets","Other","DrellYan"]

#args.backgrounds = ["Wjets","Other","DrellYan"]
args.backgrounds = ["DrellYan","Other"]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does that mean you are not taking jets into account at all? I thought we would be removing it only for the fit.

#err=math.sqrt(datamu.GetBinError(i)**2+scale_mu[i-1]+muval**2*fErr**2)/fval
err=muval*fErr/fval
datamu.SetBinContent(i,muval)
datamu.SetBinError(i,err)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this from one our tests? It looks like you are are using the fit errors only here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants