62 auto leg =
new TLegend(0.2, 0.2, 0.6, 0.5);
71 leg->SetHeader(
"Parameters:",
"L");
73 leg->AddEntry((
TObject*)0,
Form(
"S / B = %4.3f #pm %4.3f", S / B, dSB),
"");
100 Double_t x = (2.0 * xx[0] - fA - fB) / (fB - fA);
101 int order = fT.size();
105 return p[0] + x * p[1];
110 fT[
i + 1] = 2 * x * fT[
i] - fT[
i - 1];
113 for (
int i = 1;
i <= order; ++
i) {
128 Double_t result = p[0] * T0 + p[1] * T1 + p[2] * T2;
142 Double_t T3 = 4.0 * x * x * x - 3.0 * x;
143 Double_t result = p[0] * T0 + p[1] * T1 + p[2] * T2 + p[3] * T3;
157 Double_t T3 = 4.0 * x * x * x - 3.0 * x;
158 Double_t T4 = 8.0 * x * x * x * x - 8.0 * x * x + 1.0;
159 Double_t result = p[0] * T0 + p[1] * T1 + p[2] * T2 + p[3] * T3 + p[4] * T4;
167 Double_t arg = (x[0] - par[1]) / par[2];
188 vector<Float_t> values;
189 vector<Float_t> errors;
190 for (
Int_t i = leftBin;
i < rightBin;
i++) {
203 for (
Int_t i = leftBin;
i < rightBin;
i++) {
206 T += values[
i - leftBin];
243 TString inputFileName =
"/home/merz/data/h3l_sim/h3lSelect_XeCsI_3.8AGeV_mb_4mln.root",
244 TString outputFileName =
"/home/merz/data/h3l_sim/h3lPhys_XeCsI_3.8AGeV_mb_4mln.root")
247 if (
gSystem->AccessPathName(inputFileName))
250 TH1F* hTime =
new TH1F(
"hTime",
"Lifetime distribution of ^{3}He + #pi^{-}; time, ns; Counter", 100, 0, 0.6);
251 TH1F* hPt =
new TH1F(
"hPt",
"Pt distribution of ^{3}He + #pi^{-}; P_{t}, GeV/c; Counter", 100, 0, 2.2);
252 TH1F* hY =
new TH1F(
"hY",
"Rapidity distribution of ^{3}He + #pi^{-}; y; Counter", 100, 1, 2.2);
254 "hInvMassTotal",
"Invariant mass; Invariant mass of ^{3}He + #pi^{-}, GeV/c^{2}; Counter", 25, 2.95, 3.05);
255 hInvMassTotal->
Sumw2();
260 const Float_t tMin[tN] = {0.02, 0.05, 0.09, 0.20};
261 const Float_t tMax[tN] = {0.05, 0.09, 0.20, 0.62};
262 const Float_t effTime[tN] = {1.0, 1.0, 1.0, 1.0};
266 TH1F* hInvMassTime[tN];
270 "Invariant mass; Invariant mass of ^{3}He + #pi^{-}, GeV/c^{2}; Counter", 25, 2.95, 3.05);
302 cout <<
"File: " << inputFileName << endl;
318 while (myReader.
Next()) {
320 if (evId % 100000 == 0)
321 printf(
"evId = %d\n", evId);
328 lPos.
SetXYZM(Px1[
i], Py1[
i], Pz1[
i], 2.8094135);
329 lNeg.
SetXYZM(Px2[
i], Py2[
i], Pz2[
i], 0.1395704);
331 Float_t tau = path[
i] * 2.992 / lH3l.
P() / 29.9172;
340 hInvMassTotal->
Fill(
m);
342 for (
Int_t j = 0; j < tN; j++) {
343 if (tau > tMin[j] && tau < tMax[j]) {
344 hInvMassTime[j]->
Fill(
m);
367 TFile outFile(outputFileName,
"recreate");
381 cout << hInvMassTotal->
GetName() <<
":\t" << S <<
"\t" << dS <<
"\t" << SIGN <<
"\t" << dSIGN <<
"\t" << dSIGN_OLD
382 <<
"\t" << B <<
"\t" << dB << endl;
384 hInvMassTotal->
Write();
395 dSIGN_OLD = 1.0 / (2 * T) *
TMath::Sqrt((T + B) * (T + B) + 4 * B * T);
396 dSIGN = 0.5 *
TMath::Sqrt(1 + 12 * T * B / (T + B) / (T + B));
397 cout << hInvMassTime[
i]->
GetName() <<
":\t" << S <<
"\t" << dS <<
"\t" << SIGN <<
"\t" << dSIGN <<
"\t"
398 << dSIGN_OLD <<
"\t" << B <<
"\t" << dB << endl;
399 gLifeTimeTot->
SetPoint(
i, 0.5 * (tMax[
i] + tMin[
i]), hInvMassTime[
i]->GetEntries());
400 gLifeTimeSig->
SetPoint(
i, 0.5 * (tMax[
i] + tMin[
i]), S);
402 gLifeTimeSigEff->
SetPoint(
i, 0.5 * (tMax[
i] + tMin[
i]), S / effTime[
i]);
407 gLifeTimeTot->
SetName(
"gLifeTimeTot");
412 gLifeTimeSig->
SetName(
"gLifeTimeSig");
413 gLifeTimeSig->
Fit(
"expo",
"R",
"", 0.0, 0.5);
415 gLifeTimeSigEff->
SetName(
"gLifeTimeSigEff");
416 gLifeTimeSigEff->
Fit(
"expo");
417 gLifeTimeTot->
Write();
418 gLifeTimeSig->
Write();
419 gLifeTimeSigEff->
Write();
char * Form(const char *fmt,...)
R__EXTERN TStyle * gStyle
R__EXTERN TSystem * gSystem
std::size_t GetSize() const
virtual void SetTitleOffset(Float_t offset=1)
virtual void SetTitleFont(Style_t font=62)
virtual void SetLabelFont(Style_t font=62)
virtual void SetTitleSize(Float_t size=0.04)
virtual void SetLineStyle(Style_t lstyle)
virtual void SetLineColor(Color_t lcolor)
virtual void SetMarkerColor(Color_t mcolor=1)
virtual void SetMarkerStyle(Style_t mstyle=1)
virtual void SetMarkerSize(Size_t msize=1)
virtual void SetRangeUser(Double_t ufirst, Double_t ulast)
virtual Double_t GetParameter(const TString &name) const
virtual void SetNpx(Int_t npx=100)
virtual void SetParLimits(Int_t ipar, Double_t parmin, Double_t parmax)
virtual Double_t GetParError(const char *name) const
virtual Double_t Eval(Double_t x, Double_t y=0, Double_t z=0, Double_t t=0) const
virtual void SetParameter(const TString &name, Double_t value)
virtual void FixParameter(Int_t ipar, Double_t value)
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault, Int_t netopt=0)
void Close(Option_t *option="") override
virtual void SetPointError(Double_t ex, Double_t ey)
virtual void SetPoint(Int_t i, Double_t x, Double_t y)
virtual TFitResultPtr Fit(const char *formula, Option_t *option="", Option_t *goption="", Axis_t xmin=0, Axis_t xmax=0)
void SetName(const char *name="") override
virtual Double_t GetBinCenter(Int_t bin) const
void SetTitle(const char *title) override
virtual Double_t GetBinError(Int_t bin) const
virtual TFitResultPtr Fit(const char *formula, Option_t *option="", Option_t *goption="", Double_t xmin=0, Double_t xmax=0)
virtual void SetBinError(Int_t bin, Double_t error)
void Draw(Option_t *option="") override
virtual Int_t Fill(const char *name, Double_t w)
virtual void SetMinimum(Double_t minimum=-1111)
virtual void SetBinContent(Int_t bin, Double_t content)
virtual Double_t GetEntries() const
virtual TF1 * GetFunction(const char *name) const
virtual Double_t GetBinContent(Int_t bin) const
virtual void Sumw2(Bool_t flag=kTRUE)
Double_t Rapidity() const
void SetXYZM(Double_t x, Double_t y, Double_t z, Double_t m)
virtual void SetTitle(const char *title="")
const char * GetName() const override
virtual Int_t Write(const char *name=nullptr, Int_t option=0, Int_t bufsize=0)
Double_t backgroundChe(Double_t *xx, Double_t *p)
void fitator(TH1F *h, Double_t &Tout, Double_t &Bout)
Double_t backgroundChe4(Double_t *xx, Double_t *p)
Double_t gausPeak(Double_t *x, Double_t *par)
Double_t backgroundChe2(Double_t *xx, Double_t *p)
void h3l_phys(TString inputFileName="/home/merz/data/h3l_sim/h3lSelect_XeCsI_3.8AGeV_mb_4mln.root", TString outputFileName="/home/merz/data/h3l_sim/h3lPhys_XeCsI_3.8AGeV_mb_4mln.root")
void DrawNicePlot(TH1F *h, Int_t S, Float_t B)
Double_t backgroundChe3(Double_t *xx, Double_t *p)
Double_t fitFunction(Double_t *x, Double_t *par)
Double_t Sqrt(Double_t x)