- TF1* zenith = new(angle[i]) TF1("zenith",zenithalDisributionFunction, fZenithMin, fZenithMax);
-
- // Fix the momentum dependent coefficients
- zenith->SetParName(0, "a(p)");
- zenith->SetParameter(0, fAp->At(i));
+ sprintf(name, "zenith%d", i+1);
+ sprintf(title, "Zenith distribution, p=%f", fPMin+(Float_t)i);
+ zenith = new(mom[i]) TH1F(name, title, TMath::Abs(TMath::Nint(fZenithMax-fZenithMin)), TMath::Cos(fZenithMax*TMath::Pi()/180), TMath::Cos(fZenithMin*TMath::Pi()/180));
+
+ // Make a loop for the angle and fill the histogram for the weight
+ Int_t steps = 1000;
+ Float_t value = 0;
+ for (Int_t j = 0; j < steps; j++ ) {
+ value = TMath::Cos(fZenithMin*TMath::Pi()/180) + (Float_t)j * ( TMath::Cos(fZenithMax*TMath::Pi()/180) - TMath::Cos(fZenithMin*TMath::Pi()/180))/1000;
+ weight = 1 + fAp->At(i)*(1 - value);
+ zenith->Fill(value, weight);
+ }