## Suggestions for assignment #1

### General Suggestions

You will need to explain some of your calculations on paper, and then have your program perform these calculations. Here are some other more general suggestions.
• I can help you debug your programs. If you have trouble getting your program to compile or you have a specific question about why it behaves in a way that you don't expect, e-mail me your program and I will have a look at it.
• I will be happy to discuss any intermediate results you have and let you know how to judge whether they are reasonable.
• Powers of double precision numbers are calculated using the pow() function, not the '^' character, which is used to represent bit-wise exclusive-or operation. So, the following are equivalent ways to cube a double precision number x
```
#include <math.h>
...
double y = x*x*x;
double y = pow(x,3);    // This function needs the math.h include file

```

### Numbers of events

Try your program out by initially generating a few hundred or a few thousand events to make sure that the histograms are being filled as expected. Then you can increase the number of events to something that gives reasonable statistics but does not take more than a few seconds or minutes to run.

### Ranges for histograms

The assignment requires that you create and fill several histograms. Here are some suggested ranges for these histograms. You are free to choose different binning or ranges, but they should include the most or all of the interesting ranges of the distributions.
1. The first question doesn't require a histogram
2. Neither does the second question
3. In practice, the rejection method will probably be easier than solving for the root of a third order polynomial, which would be necessary in order to apply the inversion method. The resulting distributions will require two histograms. Here are the suggested definitions:
```
TH1F *h_xf = new TH1F("xf","Feynman x",100,0.0,1.0);
TH1F *h_pzcm = new TH1F("pzcm","Pz(D0) in center of mass frame",100,0.0,50.0);

```
4. After boosting the D0 back into the lab frame, it would be hard to imagine that it might have a momentum larger than that of the incident pion... Therefore, a reasonable definition for the histogram of the longitudinal momentum of the D0 in the lab frame would be
```
TH1F *h_pzlab = new TH1F("pzlab","Pz(D0) in lab frame",100,0.0,500.0);

```
5. Since we want to count the number of D0's that decay before travelling 1 cm, a reasonable definition for the decay length is TH1F *h_len = new TH1F("len","D0 decay length in lab frame",100,0.0,2.0);
6. Question 6 doesn't require any computing.
7. Since cos(theta*) ranges from -1 to +1 and theta* ranges from 0 to pi, reasonable histogram definitions are as follows:
```
TH1F *h_costhkcm = new TH1F("costhkcm","cos(theta*) of kaon in D0 rest frame",100,-1.0,1.0);
TH1F *h_thkcm = new TH1F("thkcm","theta* (deg) in D0 rest frame",180,0,180.0);

```
where the angle needs to be converted to degrees before being filled in this histogram.
8. You will find that the angles in the lab frame are really quite small since the boost is large. Reasonable definitions for these angles in degrees are as follows:
```
TH1F *h_thklab = new TH1F("thklab","theta (deg) of kaon in lab frame",100,0.0,5.0);
TH1F *h_thpilab = new TH1F("thpilab","theta (deg) of pion in lab frame",100,0,5.0);

```
9. The D0 has a mass of about 1.8 GeV, so a reasonable range would be
```
TH1F *h_mkpi = new TH1F("mkpi","M(K,pi) in GeV",100,1.6,2.0);

```
10. When the K and pi are accidentally swapped, a very wide distribution results. In this case a reasonable definition is
```
TH1F *h_mkpiswap = new TH1F("mkpiswap","M(K,pi) from wrong mass hypothesis in GeV",100,0.0,5.0);

```
It is also interesting to fill both cases in the same histogram to see how the wrong mass hypotheses result in a fairly broad background that is easily distinguished from the signal obtained with the correct mass hypothesis.