# Python Exercise 8: Picking a physics cut (15 minutes)

Go back and run the script you created in Exercise 5. If you’ve overwritten it, you can copy my version:

%cp ~seligman/root-class/AnalyzeExercise5.py \$PWD


Note

The chi2 distribution and the scatterplot hint that something interesting may be going on.

The histogram, whose limits I originally got from the command tree1.Draw("chi2"), looks unusual: there’s a peak around 1, but the x-axis extends far beyond that, up to chi2 > 18. Evidently there are some events with a large chi2, but not enough of them to show up on the plot.

On the scatterplot, we can see a dark band that represents the main peak of the chi2 distribution, and a scattering of dots that represents a group of events with anomalously high chi2.

The chi2 represents a confidence level in reconstructing the particle’s trajectory. If chi2 is high, the trajectory reconstruction was poor. It would be acceptable to apply a cut of “chi2 < 1.5”, but let’s see if we can correlate a large chi2 with anything else.

Make a scatterplot of chi2 versus theta. It’s easiest if you just copy the relevant lines from your code in Exercise 7; there’s a file AnalyzeExercise7.py in my area if it will help.

Note

Take a careful look at the scatterplot. It looks like all the large-chi2 values are found in the region theta > 0.15 radians. It may be that our trajectory-finding code has a problem with large angles. Let’s put in both a theta cut and a chi2 cut to be certain we’re looking at a sample of events with good reconstructed trajectories.

Use an if statement to only fill your histograms if chi2 < 1.5 and theta < 0.15. Change the bin limits of your histograms to reflect these cuts; for example, there’s no point to putting bins above 1.5 in your chi2 histograms since you know there won’t be any events in those bins after cuts.

Note

It may help to remember that, in Python, you’ll want something like ( chi2 < 1.5 and theta < 0.15 )

A tip for the future: in a real analysis, you’d probably have to make plots of your results both before and after cuts. A physicist usually wants to see the effects of cuts on their data.

I must confess: I cheated when I pointed you directly to theta as the cause of the high-chi2 events. I knew this because I wrote the program that created the tree. If you want to look at this program yourself, go to the UNIX window and type:

> less ~seligman/root-class/CreateTree.C