-
Notifications
You must be signed in to change notification settings - Fork 6
Afb plot #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Afb plot #6
Conversation
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") |
There was a problem hiding this comment.
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"] |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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"] |
There was a problem hiding this comment.
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") |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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': |
There was a problem hiding this comment.
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"] |
There was a problem hiding this comment.
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()) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
plotAllMCFlavor.py
Outdated
| args.backgrounds = ["Wjets","Other","DrellYan"] | ||
|
|
||
| #args.backgrounds = ["Wjets","Other","DrellYan"] | ||
| args.backgrounds = ["DrellYan","Other"] |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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.
No description provided.