23 gSystem->Load(
"libgroot");
28 double Maxphi = -9999;
29 for (
int i=0;
i<128;
i++)
34 if (phi < Minphi) Minphi =
phi;
35 if (phi > Maxphi) Maxphi =
phi;
40 int NBINS = int( (Maxphi - Minphi)/dPhi + 1.5 );
41 cout << NBINS << endl;
42 double left = Minphi - 0.5*dPhi;
43 double right = Maxphi + 0.5*dPhi;
44 BlobFit =
new TF1(
"BlobFit",
"[0]*exp(-(x-[1])*(x-[1])/(2*[2]*[2]))", left, right);
45 BlobPos =
new TH1D(
"BlobPos",
"BlobPos", NBINS, left, right);
46 BlobSigma =
new TH1D(
"BlobSigma",
"BlobSigma", 250, 0.0, 8.0
E-3);
47 BlobSigmaGen =
new TH1D(
"BlobSigmaGen",
"BlobSigmaGen", 250, 0.0, 8.0
E-3);
49 BlobPosition =
new TH1D(
"BlobPosition",
"BlobPosition", NBINS*10, left, right);
50 BlobCharge =
new TH1D(
"BlobCharge",
"BlobCharge", 256, 0, 2000);
52 ChargeQuality =
new TH2D(
"ChargeQuality",
"ChargeQuality", 256, 0, 2000, 256, 0, 2000);
53 MeanQuality =
new TH2D(
"MeanQuality",
"MeanQuality", NBINS*10, left, right, NBINS*10, left, right);
54 SigmaQuality =
new TH2D(
"SigmaQuality",
"SigmaQuality", 250, 0.0, 8.0
E-3, 250, 0.0, 8.0
E-3);
57 MeanDiffBeforeNoise =
new TH1D(
"MeanDiffBeforeNoise",
"MeanDiffBeforeNoise", 300, -dPhi, dPhi);
64 double sqrt2pi = 2.506628275;
65 NORMGAUSS =
new TF1(
"NORMGAUSS",
"[0]*0.00396825/([2]*2.506628275)*exp(-(x-[1])*(x-[1])/(2*[2]*[2]))", left, right);
84 double BlobSigmaMean = 25.1e-4;
85 double BlobSigmaSigma = 2.0e-4*4.1/4.66;
87 double BlobLandauMPV = 326.8;
88 double BlobLandauSigma = 135.1;
92 double MEAN = (left + 0.1*(right-
left)) + 0.8*(right-
left)*randy.Rndm();
95 double SIGMA = randy.Gaus(BlobSigmaMean, BlobSigmaSigma);
98 double CHARGE = randy.Landau(BlobLandauMPV, BlobLandauSigma);
113 double max =
BlobPos->GetMaximum();
115 double sigma = 0.003;
116 if (sigma < dPhi/3.0) sigma = dPhi/3.0;
117 if (sigma > 5.0*dPhi) sigma = 5.0*dPhi;
121 BlobFit->SetParameter(2,sigma);
123 BlobFit->SetParLimits(0, max/2.0, 3.0*max);
124 BlobFit->SetParLimits(1, mean-1.0*dPhi, mean+1.0*dPhi);
125 BlobFit->SetParLimits(2, 0.0007, 0.0055);
129 double FITTEDCHARGE =
BlobFit->GetParameter(0)*
BlobFit->GetParameter(2)*sqrt2pi/dPhi;
130 double FITTEDMEAN =
BlobFit->GetParameter(1);
131 double FITTEDSIGMA =
BlobFit->GetParameter(2);
143 double oldheight =
BlobPos->GetBinContent(
j);
144 double newheight = oldheight + randy.Gaus(0,NOISE);
145 BlobPos->SetBinContent(
j,newheight);
151 if (sigma < dPhi/3.0) sigma = dPhi/3.0;
152 if (sigma > 5.0*dPhi) sigma = 5.0*dPhi;
156 BlobFit->SetParameter(2,sigma);
158 BlobFit->SetParLimits(0, max/2.0, 3.0*max);
159 BlobFit->SetParLimits(1, mean-1.0*dPhi, mean+1.0*dPhi);
160 BlobFit->SetParLimits(2, 0.0007, 0.0055);
164 double REFITTEDCHARGE =
BlobFit->GetParameter(0)*
BlobFit->GetParameter(2)*sqrt2pi;
165 double REFITTEDMEAN =
BlobFit->GetParameter(1);
166 double REFITTEDSIGMA =
BlobFit->GetParameter(2);