forked from sultamehr/MAT_IncPions
-
Notifications
You must be signed in to change notification settings - Fork 9
Exercise B: The Closure Test
christian2nguyen edited this page Jun 7, 2021
·
34 revisions
- “You must not fool yourself, and you are the easiest person to fool" -Feynman
- The closure test gives the collaboration confidence that your cross-section script is correctly working and doesn't have any lurking bugs giving bad results. This is done by showing that your differential cross-section results are equal to an external MINERvA cross-section script where both differential cross-sections are based on your signal definition. For this exercise, the closure test is performed by comparing the simulation (GENIE Minerva-v1 tune) differential cross-section produced by
ExtractCrossSection
(pretending it's your personal method) to the simulation (GENIE Minerva-v1 tune) differential cross-section produced byGENIEXSECEXTRACT
(MINERvA's standardized method).
- Create a text file with the paths to each MC root files - that is practice your vim and terminal command skills.
I do something like
ls <path> > filenameMC.txt
then I add the full path to each line using visual mode in vim. - From the Event Rate step you should have produced an MC root file, with this root file you want to extract a cross-section using ExtractCrossSection , by running this command
ExtractCrossSection 1 runEventLoopMC.root runEventLoopMC.root
- You want to now use
GENIEXSECEXTRACT
to extract a cross-section to compare too. In the /test directory you runrunXSecLooper MCTextFile.txt
- Once you have two root files, one from runXSecLooper (GENIEXSECEXTRACT) and the other from ExtractCrossSection (Your cross-section script) you want to check that they produce the same result (to about 0.1%) the easiest way to do this visually is to make a ratio plot of the cross-sections. Typically, you'll use your own plotting scripts and make "pretty plots", but you can also do this quickly by using Root interactively.
- First you want to open root with two attached root files, this can be done by
root -l file1.root file2.root
- Next you want to make a histogram object so you can perform operations on it. The Root files are label as _file0, _file1, ...
- These objects(_fileN) are TFiles and you can perform c++ operations just as in a script
- From each object you want to get the histogram (MnvH1D) that is the cross-section and take the ratio and draw() it!
- you can look here, https://root.cern.ch/doc/master/classTH1D.html or here https://cdcvs.fnal.gov/redmine/projects/minerva-sw/repository/entry/AnalysisFramework/Ana/PlotUtils/PlotUtils/MnvH1D.h to see the c++ operations for the histograms.
- This is the step you show to the whole collaboration to show that your analysis closes. You could skip straight to this step and maybe even succeed if you're lucky. But you'd have a lot of debugging to do if you failed. Most analyses do fail step 2 the first time they try to run it.
- Possible reasons and checks why your closure test would fail
- Signal definitions are not identical
- Unfolding is not closing
- Your "MC bkg" subtraction is not correct Normalization issues will come in a few varieties
- your fiducial volumes in the analysis and GXSEC aren't identical
- you used the wrong flux
- you used the wrong number of planes for the number of targets
- Wrong splines (would be a small effect I suspect)
- to make ratio interactively
_file0->cd()
auto denominator = (PlotUtils::MnvH1D*)(gDirectory->Get("nameofhist1"))
_file1->cd()
auto numerator = (PlotUtils::MnvH1D*)(gDirectory->Get("nameofhist2"))
numerator->Divide(numerator, denominator)
numerator->Draw()