20 const Double_t dxbin = (0.17-0.13)/40;
21 const Double_t sigma = 0.0012;
24 Double_t fdm5(Double_t *xx, Double_t *par)
27 if (x <= 0.13957)
return 0;
28 Double_t xp3 = (x-par[3])*(x-par[3]);
29 Double_t res = dxbin*(par[0]*TMath::Power(x-0.13957, par[1])
30 + par[2] / 2.5066/par[4]*TMath::Exp(-xp3/2/par[4]/par[4]));
35 Double_t fdm2(Double_t *xx, Double_t *par)
38 if (x <= 0.13957)
return 0;
39 Double_t xp3 = (x-0.1454)*(x-0.1454);
40 Double_t res = dxbin*(par[0]*TMath::Power(x-0.13957, 0.25)
41 + par[1] / 2.5066/sigma*TMath::Exp(-xp3/2/sigma/sigma));
45 Bool_t h1analysisTreeReader::Process(Long64_t entry){
48 myTreeReader.SetLocalEntry(entry);
53 if (TMath::Abs(*fMd0_d-1.8646) >= 0.04)
return kFALSE;
54 if (*fPtds_d <= 2.5)
return kFALSE;
55 if (TMath::Abs(*fEtads_d) >= 1.5)
return kFALSE;
60 if (fNhitrp.At(*fIk)* fNhitrp.At(*fIpi) <= 1)
return kFALSE;
63 if (fRend.At(*fIk) -fRstart.At(*fIk) <= 22)
return kFALSE;
64 if (fRend.At(*fIpi)-fRstart.At(*fIpi) <= 22)
return kFALSE;
65 if (fNlhk.At(*fIk) <= 0.1)
return kFALSE;
66 if (fNlhpi.At(*fIpi) <= 0.1)
return kFALSE;
67 (*fIpis)--;
if (fNlhpi.At(*fIpis) <= 0.1)
return kFALSE;
68 if (*fNjets < 1)
return kFALSE;
71 if (fillList) elist->Enter(entry);
75 h2->Fill(*fDm_d,*fRpd0_t/0.029979*1.8646/ *fPtd0_d);
80 void h1analysisTreeReader::Begin(TTree* ) {
89 TString option = GetOption();
90 Info(
"Begin",
"starting h1analysis with process option: %s", option.Data());
92 delete gDirectory->GetList()->FindObject(
"elist");
95 if (option.Contains(
"fillList")) {
97 elist =
new TEntryList(
"elist",
"H1 selection from Cut");
100 fInput->Add(
new TNamed(
"fillList",
""));
106 Info(
"Begin",
"creating an entry-list");
109 if (option.Contains(
"useList")) {
115 TFile f(
"elist.root");
116 elist = (TEntryList*)f.Get(
"elist");
117 if (elist) elist->SetDirectory(0);
122 void h1analysisTreeReader::SlaveBegin(TTree *myTree){
132 TString option = GetOption();
134 "starting h1analysis with process option: %s (tree: %p)", option.Data(), myTree);
137 hdmd =
new TH1F(
"hdmd",
"Dm_d",40,0.13,0.17);
138 h2 =
new TH2F(
"h2",
"ptD0 vs Dm_d",30,0.135,0.165,30,-3,6);
144 if (option.Contains(
"fillList")) {
148 if ((elist = (TEntryList *) fInput->FindObject(
"elist")))
150 elist = (TEntryList *) elist->Clone();
157 if (fillList) Info(
"SlaveBegin",
"creating an entry-list");
158 if (option.Contains(
"useList")) useList = kTRUE;
161 void h1analysisTreeReader::Terminate() {
164 hdmd =
dynamic_cast<TH1F*
>(fOutput->FindObject(
"hdmd"));
165 h2 =
dynamic_cast<TH2F*
>(fOutput->FindObject(
"h2"));
167 if (hdmd == 0 || h2 == 0) {
168 Error(
"Terminate",
"hdmd = %p , h2 = %p", hdmd, h2);
174 TCanvas *c1 =
new TCanvas(
"c1",
"h1analysis analysis",10,10,800,600);
175 c1->SetBottomMargin(0.15);
176 hdmd->GetXaxis()->SetTitle(
"m_{K#pi#pi} - m_{K#pi}[GeV/c^{2}]");
177 hdmd->GetXaxis()->SetTitleOffset(1.4);
180 if (gROOT->GetListOfFunctions()->FindObject(
"f5"))
181 delete gROOT->GetFunction(
"f5");
182 TF1 *f5 =
new TF1(
"f5",fdm5,0.139,0.17,5);
183 f5->SetParameters(1000000, .25, 2000, .1454, .001);
184 hdmd->Fit(
"f5",
"lr");
187 gStyle->SetOptFit(0);
188 gStyle->SetOptStat(1100);
189 TCanvas *c2 =
new TCanvas(
"c2",
"tauD0",100,100,800,600);
191 c2->SetBottomMargin(0.15);
197 if (gROOT->GetListOfFunctions()->FindObject(
"f2"))
198 delete gROOT->GetFunction(
"f2");
199 TF1 *f2 =
new TF1(
"f2",fdm2,0.139,0.17,2);
200 f2->SetParameters(10000, 10);
201 h2->FitSlicesX(f2,0,-1,1,
"qln");
202 TH1D *h2_1 = (TH1D*)gDirectory->Get(
"h2_1");
203 h2_1->GetXaxis()->SetTitle(
"#tau[ps]");
204 h2_1->SetMarkerStyle(21);
207 TLine *line =
new TLine(0,0,0,c2->GetUymax());
212 TPaveStats *psdmd = (TPaveStats *)hdmd->GetListOfFunctions()->FindObject(
"stats");
213 psdmd->SetOptStat(1110);
219 elist =
dynamic_cast<TEntryList*
>(fOutput->FindObject(
"elist"));
221 Printf(
"Entry list 'elist' created:");
223 TFile efile(
"elist.root",
"recreate");
226 Error(
"Terminate",
"entry list requested but not found in output");
230 if (!fInput) Info(
"Terminate",
"processed %lld events", fProcessed);
233 void h1analysisTreeReader::SlaveTerminate(){
237 Bool_t h1analysisTreeReader::Notify() {
241 Info(
"Notify",
"processing file: %s",myTreeReader.GetTree()->GetCurrentFile()->GetName());
243 if (elist && myTreeReader.GetTree()) {
245 elist->SetTree(myTreeReader.GetTree());
246 }
else if (useList) {
247 myTreeReader.GetTree()->SetEntryList(elist);