StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
eeSinglePeak.cxx
1 
12 #include "eeSinglePeak.h"
13 #include <TMath.h>
14 #include <iostream>
15 
16 Double_t eeSinglePeak ( Double_t *X, Double_t *P )
17 {
18  // Shower-shape at shower-max: two gaussians with constrained means
19  // and widths.
20 
21  Double_t x = X[0];
22  Double_t mean = P[1];
23 
24  // Coefficient of first gaussian
25  Double_t a = 1.0-P[3];
26 
27  // Coefficient of second gaussian
28  Double_t b = P[3];
29 
30  // Width of first gaussian
31  Double_t w1 = P[2];
32 
33  // Width of second gaussian
34  Double_t w2 = P[2]*P[4];
35 
36  // Sum of two (normalized) gaussians
37  Double_t g =
38  a * TMath::Gaus( x, mean, w1, kTRUE ) +
39  b * TMath::Gaus( x, mean, w2, kTRUE );
40 
41  return P[0] * g;
42 
43 };
44 
45 Double_t eeDoublePeak ( Double_t *X, Double_t *P )
46 {
47 
48  Double_t P1[] = { P[0], P[1], P[2], P[3], P[4] };
49  Double_t P2[] = { P[5], P[6], P[7], P[8], P[9] };
50 
51  return eeSinglePeak( X, P1 ) + eeSinglePeak( X, P2 );
52 
53 }