159 const Double_t dxbin = (0.17-0.13)/40;
160 const Double_t sigma = 0.0012;
163 Double_t fdm5(Double_t *xx, Double_t *par)
166 if (x <= 0.13957)
return 0;
167 Double_t xp3 = (x-par[3])*(x-par[3]);
168 Double_t res = dxbin*(par[0]*TMath::Power(x-0.13957, par[1])
169 + par[2] / 2.5066/par[4]*TMath::Exp(-xp3/2/par[4]/par[4]));
174 Double_t fdm2(Double_t *xx, Double_t *par)
177 if (x <= 0.13957)
return 0;
178 Double_t xp3 = (x-0.1454)*(x-0.1454);
179 Double_t res = dxbin*(par[0]*TMath::Power(x-0.13957, 0.25)
180 + par[1] / 2.5066/sigma*TMath::Exp(-xp3/2/sigma/sigma));
185 void h1analysis::Begin(TTree * )
196 TString option = GetOption();
197 Info(
"Begin",
"starting h1analysis with process option: %s", option.Data());
200 if (fChain) fChain->SetEntryList(0);
201 delete gDirectory->GetList()->FindObject(
"elist");
204 if (option.Contains(
"fillList")) {
206 elist =
new TEntryList(
"elist",
"H1 selection from Cut");
209 fInput->Add(
new TNamed(
"fillList",
""));
215 Info(
"Begin",
"creating an entry-list");
218 if (option.Contains(
"useList")) {
224 TFile f(
"elist.root");
225 elist = (TEntryList*)f.Get(
"elist");
226 if (elist) elist->SetDirectory(0);
232 void h1analysis::SlaveBegin(TTree *tree)
243 TString option = GetOption();
245 "starting h1analysis with process option: %s (tree: %p)", option.Data(), tree);
248 hdmd =
new TH1F(
"hdmd",
"dm_d",40,0.13,0.17);
249 h2 =
new TH2F(
"h2",
"ptD0 vs dm_d",30,0.135,0.165,30,-3,6);
255 if (option.Contains(
"fillList")) {
259 if ((elist = (TEntryList *) fInput->FindObject(
"elist")))
261 elist = (TEntryList *) elist->Clone();
268 if (fillList) Info(
"SlaveBegin",
"creating an entry-list");
269 if (option.Contains(
"useList")) useList = kTRUE;
273 Bool_t h1analysis::Process(Long64_t entry)
284 b_md0_d->GetEntry(entry);
if (TMath::Abs(md0_d-1.8646) >= 0.04)
return kFALSE;
285 b_ptds_d->GetEntry(entry);
if (ptds_d <= 2.5)
return kFALSE;
286 b_etads_d->GetEntry(entry);
if (TMath::Abs(etads_d) >= 1.5)
return kFALSE;
287 b_ik->GetEntry(entry); ik--;
288 b_ipi->GetEntry(entry); ipi--;
289 b_ntracks->GetEntry(entry);
290 b_nhitrp->GetEntry(entry);
291 if (nhitrp[ik]*nhitrp[ipi] <= 1)
return kFALSE;
292 b_rend->GetEntry(entry);
293 b_rstart->GetEntry(entry);
294 if (rend[ik] -rstart[ik] <= 22)
return kFALSE;
295 if (rend[ipi]-rstart[ipi] <= 22)
return kFALSE;
296 b_nlhk->GetEntry(entry);
if (nlhk[ik] <= 0.1)
return kFALSE;
297 b_nlhpi->GetEntry(entry);
if (nlhpi[ipi] <= 0.1)
return kFALSE;
298 b_ipis->GetEntry(entry); ipis--;
if (nlhpi[ipis] <= 0.1)
return kFALSE;
299 b_njets->GetEntry(entry);
if (njets < 1)
return kFALSE;
302 if (fillList) elist->Enter(entry);
306 b_dm_d->GetEntry(entry);
307 b_rpd0_t->GetEntry(entry);
308 b_ptd0_d->GetEntry(entry);
312 h2->Fill(dm_d,rpd0_t/0.029979*1.8646/ptd0_d);
322 void h1analysis::SlaveTerminate()
328 void h1analysis::Terminate()
332 hdmd =
dynamic_cast<TH1F*
>(fOutput->FindObject(
"hdmd"));
333 h2 =
dynamic_cast<TH2F*
>(fOutput->FindObject(
"h2"));
335 if (hdmd == 0 || h2 == 0) {
336 Error(
"Terminate",
"hdmd = %p , h2 = %p", hdmd, h2);
342 TCanvas *c1 =
new TCanvas(
"c1",
"h1analysis analysis",10,10,800,600);
343 c1->SetBottomMargin(0.15);
344 hdmd->GetXaxis()->SetTitle(
"m_{K#pi#pi} - m_{K#pi}[GeV/c^{2}]");
345 hdmd->GetXaxis()->SetTitleOffset(1.4);
348 if (gROOT->GetListOfFunctions()->FindObject(
"f5"))
349 delete gROOT->GetFunction(
"f5");
350 TF1 *f5 =
new TF1(
"f5",fdm5,0.139,0.17,5);
351 f5->SetParameters(1000000, .25, 2000, .1454, .001);
352 hdmd->Fit(
"f5",
"lr");
355 gStyle->SetOptFit(0);
356 gStyle->SetOptStat(1100);
357 TCanvas *c2 =
new TCanvas(
"c2",
"tauD0",100,100,800,600);
359 c2->SetBottomMargin(0.15);
365 if (gROOT->GetListOfFunctions()->FindObject(
"f2"))
366 delete gROOT->GetFunction(
"f2");
367 TF1 *f2 =
new TF1(
"f2",fdm2,0.139,0.17,2);
368 f2->SetParameters(10000, 10);
369 h2->FitSlicesX(f2,0,-1,1,
"qln");
370 TH1D *h2_1 = (TH1D*)gDirectory->Get(
"h2_1");
371 h2_1->GetXaxis()->SetTitle(
"#tau[ps]");
372 h2_1->SetMarkerStyle(21);
375 TLine *line =
new TLine(0,0,0,c2->GetUymax());
380 TPaveStats *psdmd = (TPaveStats *)hdmd->GetListOfFunctions()->FindObject(
"stats");
381 psdmd->SetOptStat(1110);
387 elist =
dynamic_cast<TEntryList*
>(fOutput->FindObject(
"elist"));
389 Printf(
"Entry list 'elist' created:");
391 TFile efile(
"elist.root",
"recreate");
394 Error(
"Terminate",
"entry list requested but not found in output");
398 if (!fInput) Info(
"Terminate",
"processed %lld events", fProcessed);