cana_time_peak.C
Go to the documentation of this file.
1 #include <iostream>
2 #include <cmath>
3 #include "TArrow.h"
4 #include "TCanvas.h"
5 #include "TChain.h"
6 #include "TCut.h"
7 #include "TH1F.h"
8 #include "TMath.h"
9 #include "TMinuit.h"
10 #include "TStyle.h"
11 #include "TText.h"
12 #include "TLegend.h"
13 #include "TLatex.h"
14 //......................................................................
15 // Usage:
16 // First load a chain ch of cana ntuples using something like:
17 //
18 // root [0] .x cana.C
19 //
20 // Then load this plot macro, project the histograms and make the plots
21 //
22 // root [1] .L cana_time_peak.C+
23 // root [2] proj_all(ch);
24 // root [3] plot_all(ch);
25 //
26 // For plot tweaking it should be possible to repeat these steps:
27 //
28 // root [4] .L cana_time_peak.C
29 // root [5] plot_all(ch);
30 //
31 //......................................................................
32 // Cuts optimized for seeing a time peak. Maximize S/sqrt(B)
33 //
34 const char* label = "NDOS Data, 09/12/13 - 09/27/13";
35 TCut run("run>=15071&&run<=15131");
36 TCut activity("nhit>=25&&nhitx>=3&&nhity>=3");
37 
38 TCut y1cut("y1<150");
39 TCut x1cut("abs(x1)<100");
40 TCut z1cut("280<z1 && z1<1200");
41 TCut fiducial(x1cut&&y1cut&&z1cut);
42 
43 TCut cosnumi("cosnumi>0.95");
45 
46 //......................................................................
47 // Where is the time peak?
48 //
49 double t1 = 217.0;
50 double t2 = 227.8;
51 TCut intime("tave>=217.0 && tave<=227.8");
52 TCut outtime("(tave>0.0&&tave<200.0) || (tave>250.0&&tave<450.0)");
53 double intimet = (t2-t1);
54 double outtimet = 400.0;
55 
56 void NDOSLabel()
57 {
58  TLatex* tx = new TLatex(0.1, .93, label);
59  tx->SetTextColor(kBlack);
60  tx->SetNDC();
61  tx->SetTextSize(1/30.);
62  tx->SetTextAlign(12);
63  tx->Draw();
64 }
65 
66 // Put a "NOvA Preliminary" tag in the corner
68 {
69  TLatex* prelim = new TLatex(.9, .93, "NOvA Preliminary");
70  prelim->SetTextColor(kBlue);
71  prelim->SetNDC();
72  prelim->SetTextSize(1/30.);
73  prelim->SetTextAlign(32);
74  prelim->Draw();
75 }
76 
77 void CenterTitles(TH1* histo)
78 {
79  histo->GetXaxis()->CenterTitle();
80  histo->GetYaxis()->CenterTitle();
81  histo->GetZaxis()->CenterTitle();
82 }
83 
84 //......................................................................
85 // Make plots documenting the cuts used
86 //
87 TH1F* nhith;
88 void nhit_proj(TChain& ch)
89 {
90  nhith = new TH1F("nhith",";N_{hit};Events",101,-0.5,100.5);
91  nhith->SetFillColor(kGreen-10);
92  ch.Project("nhith","nhit", run);
93 }
94 
95 void nhit_plot()
96 {
97  gStyle->SetOptStat(0);
98 
99  TCanvas* nhitc = new TCanvas("nhitc","nhitc",800,600);
100  nhitc->SetLogy();
101 
102  nhith->SetFillColor(kGreen-10);
104  nhith->Draw();
105  Preliminary();
106 
107  TLine* nhitl = new TLine(25.0, 0, 25.0, nhith->GetMaximum());
108  nhitl->SetLineStyle(3);
109  nhitl->Draw();
110  double ya1 = 0.75*log10(nhith->GetMaximum());
111  double ya2 = 0.75*log10(nhith->GetMaximum())+0.9;
112  double ya3 = pow(10,0.5*(ya1+ya2));
113  ya1 = pow(10,ya1);
114  ya2 = pow(10,ya2);
115  TArrow* nhita1 = new TArrow(25.0, ya1, 30.0, ya1, 0.03);
116  TArrow* nhita2 = new TArrow(25.0, ya2, 30.0, ya2, 0.03);
117  nhita1->Draw();
118  nhita2->Draw();
119 
120  TText* tx2 = new TText(30.0, ya3, "selected");
121  tx2->SetTextFont(42);
122  tx2->SetTextAlign(12);
123  tx2->SetTextSize(0.035);
124  tx2->Draw();
125 
126  NDOSLabel();
127 
128  nhitc->SaveAs("cana_nhit.pdf");
129  nhitc->SaveAs("cana_nhit.png");
130 }
131 
132 //......................................................................
133 
134 TH1F* y1h;
135 void y1_proj(TChain& ch)
136 {
137  y1h = new TH1F("y1h",";upper end y location (cm); Events / cm",
138  500,-250,250);
139  ch.Project("y1h","y1", run&&activity);
140 }
141 void y1_plot()
142 {
143  gStyle->SetOptStat(0);
144 
145  TCanvas* y1c = new TCanvas("y1c","y1c",800,600);
146 
147  y1h->SetFillColor(kGreen-10);
148  CenterTitles(y1h);
149  y1h->Draw();
150  Preliminary();
151 
152  TLine* y1l = new TLine(150.0, 0, 150.0, y1h->GetMaximum());
153  y1l->SetLineStyle(3);
154  y1l->Draw();
155  double ya1 = 0.66*y1h->GetMaximum();
156  double ya2 = 0.60*y1h->GetMaximum();
157  double ya3 = 0.5*(ya1+ya2);
158 
159  TArrow* y1a1 = new TArrow(150.0, ya1, 120.0, ya1, 0.03);
160  TArrow* y1a2 = new TArrow(150.0, ya2, 120.0, ya2, 0.03);
161  y1a1->Draw();
162  y1a2->Draw();
163 
164  NDOSLabel();
165 
166  TText* tx2 = new TText(110.0,ya3,"selected");
167  tx2->SetTextAlign(32);
168  tx2->SetTextFont(42);
169  tx2->SetTextSize(0.035);
170  tx2->Draw();
171 
172  y1c->SaveAs("cana_y1c.pdf");
173  y1c->SaveAs("cana_y1c.png");
174 }
175 
176 //......................................................................
177 
178 TH1F* x1h;
179 void x1_proj(TChain& ch)
180 {
181  x1h = new TH1F("x1h",";upper end x location (cm); Events / cm",
182  500,-250,250);
183  ch.Project("x1h","x1", run&&activity&&y1cut);
184 }
185 void x1_plot()
186 {
187  gStyle->SetOptStat(0);
188 
189  TCanvas* x1c = new TCanvas("x1c","x1c",800,600);
190 
191  x1h->SetFillColor(kGreen-10);
192  CenterTitles(x1h);
193  x1h->Draw();
194  Preliminary();
195 
196  TLine* x1l1 = new TLine(-100.0, 0, -100.0, x1h->GetMaximum());
197  TLine* x1l2 = new TLine( 100.0, 0, 100.0, x1h->GetMaximum());
198  x1l1->SetLineStyle(3);
199  x1l2->SetLineStyle(3);
200  x1l1->Draw();
201  x1l2->Draw();
202  double ya1 = 0.66*x1h->GetMaximum();
203  double ya2 = 0.60*x1h->GetMaximum();
204  double ya3 = 0.5*(ya1+ya2);
205 
206  TArrow* x1a1 = new TArrow(-100.0, ya1, -80.0, ya1, 0.02);
207  TArrow* x1a2 = new TArrow(-100.0, ya2, -80.0, ya2, 0.02);
208  x1a1->Draw();
209  x1a2->Draw();
210 
211  TText* tx2 = new TText(0.0,ya3,"selected");
212  tx2->SetTextFont(42);
213  tx2->SetTextAlign(22);
214  tx2->SetTextSize(0.035);
215  tx2->Draw();
216 
217  TArrow* x1a3 = new TArrow(100.0, ya1, 80.0, ya1, 0.025);
218  TArrow* x1a4 = new TArrow(100.0, ya2, 80.0, ya2, 0.025);
219  x1a3->Draw();
220  x1a4->Draw();
221 
222  NDOSLabel();
223 
224  x1c->SaveAs("cana_x1c.pdf");
225  x1c->SaveAs("cana_x1c.png");
226 }
227 
228 //......................................................................
229 
230 TH1F* z1h;
231 void z1_proj(TChain& ch)
232 {
233  z1h = new TH1F("z1h",";upper end z location (cm); Events / 10 cm",
234  140,0,1400);
235  ch.Project("z1h","z1",run&&activity&&y1cut&&x1cut);
236 }
237 void z1_plot()
238 {
239  gStyle->SetOptStat(0);
240 
241  TCanvas* z1c = new TCanvas("z1c","z1c",800,600);
242 
243  z1h->SetFillColor(kGreen-10);
244  CenterTitles(z1h);
245  z1h->Draw();
246  Preliminary();
247 
248  TLine* z1l1 = new TLine( 280.0, 0, 280.0, z1h->GetMaximum());
249  TLine* z1l2 = new TLine(1200.0, 0, 1200.0, z1h->GetMaximum());
250  z1l1->SetLineStyle(3);
251  z1l2->SetLineStyle(3);
252  z1l1->Draw();
253  z1l2->Draw();
254  double ya1 = 0.66*z1h->GetMaximum();
255  double ya2 = 0.60*z1h->GetMaximum();
256  double ya3 = 0.5*(ya1+ya2);
257 
258  TArrow* z1a1 = new TArrow(280.0, ya1, 330.0, ya1, 0.025);
259  TArrow* z1a2 = new TArrow(280.0, ya2, 330.0, ya2, 0.025);
260  z1a1->Draw();
261  z1a2->Draw();
262 
263  TText* tx2 = new TText(700.0,ya3,"selected");
264  tx2->SetTextFont(42);
265  tx2->SetTextAlign(22);
266  tx2->SetTextSize(0.035);
267  tx2->Draw();
268 
269  TArrow* z1a3 = new TArrow(1200.0, ya1, 1150.0, ya1, 0.025);
270  TArrow* z1a4 = new TArrow(1200.0, ya2, 1150.0, ya2, 0.025);
271  z1a3->Draw();
272  z1a4->Draw();
273 
274  NDOSLabel();
275 
276  z1c->SaveAs("cana_z1c.pdf");
277  z1c->SaveAs("cana_z1c.png");
278 }
279 
280 //......................................................................
281 
284 void cosnumi_proj(TChain& ch)
285 {
286  cosnumiinh = new TH1F("cosnumiinh",
287  ";cos #theta_{NuMI}; Events / 0.05",
288  20, 0.0, 1.0);
289  cosnumiouth = new TH1F("cosnumiouth",
290  ";cos #theta_{NuMI}; Events / 0.05",
291  20, 0.0, 1.0);
292  ch.Project("cosnumiinh", "cosnumi",run&&activity&&fiducial&&intime);
293  ch.Project("cosnumiouth","cosnumi",run&&activity&&fiducial&&outtime);
294 
295  cosnumiouth->Scale(intimet/outtimet);
296 }
298 {
299  gStyle->SetOptStat(0);
300 
301  TCanvas* cosnumic = new TCanvas("cosnumic","cosnumic",800,600);
302 
303  cosnumiinh->SetMarkerStyle(20);
304  cosnumiouth->SetLineColor(kRed);
305  cosnumiouth->SetLineWidth(2);
306 
307  cosnumiouth->SetMaximum(cosnumiinh->GetMaximum()+
308  1.5*sqrt(cosnumiinh->GetMaximum()));
309 
311  cosnumiouth->Draw("hist");
312  cosnumiinh-> Draw("same,e");
313 
314  Preliminary();
315 
316  double x1 = cosnumiouth->GetBinCenter(4);
317  double y1 = cosnumiouth->GetBinContent(4);
318 
319  TLine* a1 = new TLine(x1+0.08, 1.12*y1, x1+0.03, 1.01*y1);
320  a1->SetLineWidth(1);
321  a1->SetLineColor(kRed);
322  a1->Draw();
323 
324  TText* tx1 = new TText(x1+0.09, 1.14*y1,"out of time tracks");
325  tx1->SetTextColor(kRed);
326  tx1->Draw();
327 
328  x1 = cosnumiinh->GetBinCenter(18);
329  y1 = cosnumiinh->GetBinContent(18);
330 
331  TLine* a2 = new TLine(x1-0.04, 1.01*y1, x1-0.08, 1.12*y1);
332  a2->SetLineWidth(1);
333  a2->SetLineColor(kBlack);
334  a2->Draw();
335 
336  TText* tx2 = new TText(x1-0.06, 1.20*y1,"in time tracks");
337  tx2->SetTextAlign(31);
338  tx2->SetTextColor(kBlack);
339  tx2->Draw();
340 
341  NDOSLabel();
342 
343  cosnumic->SaveAs("cana_cosnumic.pdf");
344  cosnumic->SaveAs("cana_cosnumic.png");
345 }
346 
347 //......................................................................
348 
349 TH1F* tavewideh;
350 void time_wide_proj(TChain& ch)
351 {
352  tavewideh = new TH1F("tavewideh",
353  ";NDOS event time [#musec];Events / 2 #musec",
354  250,0,500);
355  ch.Project("tavewideh", "tave", canacuts);
356 }
358 {
359  gStyle->SetOptStat(0);
360 
361  TCanvas* cana_tave_wide =
362  new TCanvas("cana_tave_wide","cana_tave_wide",800,600);
363  tavewideh->SetFillColor(kGreen-10);
365  tavewideh->SetMaximum(floor(tavewideh->GetMaximum())+1);
366  tavewideh->Draw();
367  Preliminary();
368 
369  unsigned int i1 = tavewideh->FindBin(t1);
370  unsigned int i2 = tavewideh->FindBin(t2);
371  double splusb = tavewideh->Integral(i1,i2);
372  double b =
373  tavewideh->Integral(i1-25,i1-1) +
374  tavewideh->Integral(i2+1,i2+25);
375  b *= (float)(i2-i1+1)/50.0;
376  double fom = (splusb-b)/sqrt(b);
377  std::cout << "FOM: " << fom << std::endl;
378 
379  NDOSLabel();
380 
381  /*
382  TText* tx4 = new TText(240, 15, "Best fit for NuMI beam spill window");
383  tx4->SetTextFont(32);
384  tx4->SetTextSize(0.035);
385  tx4->SetTextColor(kRed);
386  tx4->Draw();
387  */
388 
389  cana_tave_wide->SaveAs("cana_tave_wide.pdf");
390  cana_tave_wide->SaveAs("cana_tave_wide.png");
391 }
392 
393 //......................................................................
394 
395 TH1F* tavezoomh;
396 int ntbin_per_usec = 20;
398 double zoom_tlo = floor(t1) - 5;
399 double zoom_thi = floor(t2) + 6;
401 void time_zoom_proj(TChain& ch)
402 {
403  gStyle->SetOptStat(0);
404 
405  tavezoomh = new TH1F("tavezoomh",
406  ";NDOS event time [#musec];Events / 50 nsec",
407  zoom_nbin,
408  zoom_tlo,
409  zoom_thi);
410  ch.Project("tavezoomh", "tave", canacuts);
411 }
412 
413 //......................................................................
414 // The NuMI spill time structure for time t in usec. Based on e-mail
415 // exchange with Phil Adamson. This applies to the period starting
416 // September 2013 -- ?
417 //
418 static const int nbatch = 6;
419 static const double dt_batch = 81*18.83E-3;
420 static const double dt_gap = 5*18.83E-3;
421 static const double dt_cycle = dt_batch + dt_gap;
422 static const double spill_length = nbatch*dt_batch + (nbatch-1)*dt_gap;
423 
424 double spill_profile(double t)
425 {
426  if (t<0.0) return 0.0;
427  if (t>spill_length) return 0.0;
428 
429  // Rewind cycle by cycle
430  double ttmp = t;
431  while (ttmp>dt_cycle) ttmp -= dt_cycle;
432 
433  // Check it we are inside the "on" part of the cycle
434  if (ttmp<0.0) return 0.0;
435  if (ttmp>dt_batch) return 0.0;
436 
437  return 1.0;
438 }
439 
440 //......................................................................
441 // Convolve the spill profile with a gaussian to get a template of what
442 // the spill profile should look like
443 //
444 TH1F* template_spillh = 0;
448 void make_template(double sigma)
449 {
450  if (template_spillh!=0) {
451  delete template_spillh;
452  template_spillh = 0;
453  }
454  if (template_spillh==0) {
455  template_tlo =
456  zoom_tbin_sz*floor(-5.0*sigma/zoom_tbin_sz);
457  template_thi =
458  zoom_tbin_sz*
459  floor((spill_length+5.0*sigma)/zoom_tbin_sz+1);
461  template_spillh = new TH1F("tempalte_spillh",";usec",
463  template_tlo,
464  template_thi);
465  }
466 
467  int i, j;
468  double ti, tj;
469  double s, w;
470  for (i=1; i<=template_nbin; ++i) {
471  ti = template_spillh->GetBinCenter(i);
472  s = spill_profile(ti);
473  for (j=1; j<template_nbin; ++j) {
474  tj = template_spillh->GetBinCenter(j);
475  w = TMath::Gaus(ti,tj,sigma);
476 
477  template_spillh->Fill(tj, w*s);
478  }
479  }
480  template_spillh->Scale(template_spillh->GetMaximum());
481 }
482 
483 //......................................................................
484 // Make the fit function for the spill profile. b is the number of
485 // background evnets per bin, p is a scale factor on the signal
486 // strength, and t0 is where the spill should start.
488 void make_time_profile(double b,
489  double f,
490  double t0,
491  double sigma)
492 {
493  int i;
494 
495  static int ifirst = 1;
496  if (ifirst) {
497  time_profileh = new TH1F("time_profileh",
498  ";usec",
499  zoom_nbin,
500  zoom_tlo,
501  zoom_thi);
502  ifirst = 0;
503  }
504  time_profileh->Reset();
505 
506  static double last_sigma = 0.0;
507  if (last_sigma != sigma) {
508  last_sigma = sigma;
509  make_template(sigma);
510  }
511 
512  double s, t;
513  //
514  // Put the background in
515  //
516  for (i=1; i<=time_profileh->GetNbinsX(); ++i) {
517  t = time_profileh->GetBinCenter(i);
518  time_profileh->Fill(t, b);
519  }
520  //
521  // Put the signal in
522  //
523  for (i=1; i<=template_nbin; ++i) {
524  t = template_spillh->GetBinCenter(i);
525  s = template_spillh->GetBinContent(i);
526  time_profileh->Fill(t+t0, f*s);
527  }
528 }
529 
530 //......................................................................
531 
532 double chi2()
533 {
534  int i;
535  double sum = 0;
536  double ni, nui;
537  for (i=1; i<=zoom_nbin; ++i) {
538  nui = time_profileh->GetBinContent(i);
539  ni = tavezoomh-> GetBinContent(i);
540  sum += nui;
541  if (ni>0.0) {
542  sum += ni*(log(ni/nui)-1);
543  }
544  }
545  return 2.0*sum;
546 }
547 
548 //......................................................................
549 
550 void fcn(int&, double*, double& f, double* p, int)
551 {
552  make_time_profile(p[0], p[1], p[2], p[3]);
553  f = chi2();
554 }
555 
556 //......................................................................
557 
558 void minimize()
559 {
560  int ierr;
561  TMinuit minuit;
562  minuit.SetPrintLevel(-99);
563  minuit.SetFCN(fcn);
564  minuit.mnparm(0, "bkg", 1e-3, 1e-4, 0, 10.0, ierr);
565  minuit.mnparm(1, "sf", 1e-3, 1e-4, 0, 10.0, ierr);
566  minuit.mnparm(2, "t0", 1e-3, 1e-4, 0, 10.0, ierr);
567  minuit.mnparm(3, "sigt", 1e-3, 1e-4, 0, 10.0, ierr);
568 
569  double chi2best = 99E99;
570  double p[4];
571  double sigp[4];
572 
573  int i;
574  double t0;
575  double x[zoom_nbin];
576  double y[zoom_nbin];
577  for (i=0; i<zoom_nbin; ++i) {
578  t0 = tavezoomh->GetBinCenter(i+1);
579 
580  minuit.mnparm(2, "t0", t0, 1e-3, 0.0, 500.0, ierr);
581  minuit.FixParameter(2);
582 
583  minuit.mnparm(3, "sigt", 0.512/sqrt(12)/sqrt(25), 1e-3, 0.0, 500.0, ierr);
584  minuit.FixParameter(3);
585 
586  minuit.Migrad();
587 
588  double fmin, fedm, errdef;
589  int npari, nparx, istat;
590  minuit.mnstat(fmin,fedm,errdef,npari,nparx,istat);
591  x[i] = t0;
592  y[i] = fmin;
593  std::cerr << i << "\t" << t0 << "\t" << fmin << std::endl;
594  if (fmin<chi2best) {
595  chi2best = fmin;
596 
597  double val, err, xlolim, xuplim;
598  int iuint;
599 
600  static TString bkg("bkg");
601  minuit.mnpout(0, bkg, val, err, xlolim, xuplim, iuint);
602  p[0] = val;
603  sigp[1] = err;
604 
605  static TString sf("sf");
606  minuit.mnpout(1, sf, val, err, xlolim, xuplim, iuint);
607  p[1] = val;
608  sigp[1] = err;
609 
610  static TString t0s("t0");
611  minuit.mnpout(2, t0s, val, err, xlolim, xuplim, iuint);
612  p[2] = val;
613  sigp[2] = err;
614 
615  static TString sigt("sigt");
616  minuit.mnpout(3, sigt, val, err, xlolim, xuplim, iuint);
617  p[3] = val;
618  sigp[3] = err;
619  }
620  }
621  make_time_profile(p[0], p[1], p[2], p[3]);
622 
623  std::cerr << "chi2 = " << chi2best << std::endl;
624  std::cerr << "Best b = " << p[0] <<" +/- " << sigp[0] << std::endl;
625  std::cerr << "Best sf = " << p[1] <<" +/- " << sigp[1] << std::endl;
626  std::cerr << "Best t0 = " << p[2] <<" +/- " << sigp[2] << std::endl;
627  std::cerr << "Best sigt= " << p[3] <<" +/- " << sigp[3] << std::endl;
628 }
629 
630 //......................................................................
631 
633 {
634  TCanvas* time_zoom_drawc =
635  new TCanvas("time_zoom_drawc",
636  "time_zoom_drawc",800,600);
637  tavezoomh->SetFillColor(kGreen-10);
639  tavezoomh->SetLineWidth(1);
640  tavezoomh->Draw();
641  Preliminary();
642 
643  if (time_profileh) {
644  time_profileh->SetLineWidth(2);
645  time_profileh->SetLineColor(kRed);
646  time_profileh->Draw("same");
647  }
648 
649  TLegend *tleg = new TLegend(0.15,0.75,0.43,0.85);
650  tleg->SetTextFont(42);
651  tleg->SetTextSize(0.04);
652  tleg->AddEntry(time_profileh,"Fit to NuMI Beam Structure");
653  tleg->Draw();
654 
655  NDOSLabel();
656 
657  time_zoom_drawc->SaveAs("cana_time_zoom.png");
658  time_zoom_drawc->SaveAs("cana_time_zoom.pdf");
659 }
660 
661 //......................................................................
662 
663 void proj_all(TChain& ch)
664 {
665 
666  std::cout<<"starting proj"<<std::endl;
667  nhit_proj(ch);
668  std::cout<<"nhit done"<<std::endl;
669  y1_proj(ch);
670  std::cout<<"y1 done"<<std::endl;
671  x1_proj(ch);
672  std::cout<<"x1 done"<<std::endl;
673  z1_proj(ch);
674  std::cout<<"z1 done"<<std::endl;
675  cosnumi_proj(ch);
676  std::cout<<"cosnumi done"<<std::endl;
677  time_wide_proj(ch);
678  std::cout<<"time wide done"<<std::endl;
679  time_zoom_proj(ch);
680  std::cout<<"time zoom done"<<std::endl;
681  minimize();
682  std::cout<<"minimize done"<<std::endl;
683 }
684 
685 //......................................................................
686 
687 void plot_all()
688 {
689  nhit_plot();
690  y1_plot();
691  x1_plot();
692  z1_plot();
693  cosnumi_plot();
694  time_wide_plot();
695  time_zoom_plot();
696 }
697 
698 
699 
700 ////////////////////////////////////////////////////////////////////////
tree Draw("slc.nhit")
fvar< T > fmin(const fvar< T > &x1, const fvar< T > &x2)
Definition: fmin.hpp:14
TCut intime("tave>=217.0 && tave<=227.8")
void make_time_profile(double b, double f, double t0, double sigma)
TH1F * a2
Definition: f2_nu.C:545
void proj_all(TChain &ch)
void x1_plot()
Float_t y1[n_points_granero]
Definition: compare.C:5
void Preliminary()
Put NOvA Preliminary on plots.
void time_zoom_proj(TChain &ch)
Float_t x1[n_points_granero]
Definition: compare.C:5
static const int nbatch
const char * p
Definition: xmltok.h:285
T sqrt(T number)
Definition: d0nt_math.hpp:156
constexpr T pow(T x)
Definition: pow.h:75
void fcn(int &, double *, double &f, double *p, int)
TH1F * x1h
void nhit_plot()
void minimize()
OStream cerr
Definition: OStream.cxx:7
double template_tlo
TH1F * tavezoomh
void y1_proj(TChain &ch)
double zoom_tlo
double chi2()
TCut run("run>=15071&&run<=15131")
void y1_plot()
TCut x1cut("abs(x1)<100")
TCut z1cut("280<z1 && z1<1200")
TCut canacuts(run &&fiducial &&activity &&cosnumi)
void z1_plot()
void cosnumi_proj(TChain &ch)
const char * label
TH1F * cosnumiinh
const XML_Char * s
Definition: expat.h:262
void NDOSLabel()
void time_zoom_plot()
int template_nbin
TH1F * time_profileh
double t1
TH1F * a1
Definition: f2_nu.C:476
double zoom_tbin_sz
void z1_proj(TChain &ch)
TH1F * y1h
double outtimet
TH1F * nhith
TH1F * z1h
static const double spill_length
double Gaus(TH1D *h, double &err, bool isTruth)
Definition: absCal.cxx:489
const double j
Definition: BetheBloch.cxx:29
TH2D * histo
static const double dt_batch
double t2
TLatex * prelim
Definition: Xsec_final.C:133
double sigma(TH1F *hist, double percentile)
Definition: run.py:1
void x1_proj(TChain &ch)
OStream cout
Definition: OStream.cxx:6
TH1F * template_spillh
void nhit_proj(TChain &ch)
int nui
Definition: runWimpSim.h:118
TCut y1cut("y1<150")
void cosnumi_plot()
T log10(T number)
Definition: d0nt_math.hpp:120
void plot_all()
static const double dt_gap
TH1F * tavewideh
static const double dt_cycle
fvar< T > floor(const fvar< T > &x)
Definition: floor.hpp:11
const hit & b
Definition: hits.cxx:21
TCut activity("nhit>=25&&nhitx>=3&&nhity>=3")
TCut outtime("(tave>0.0&&tave<200.0) || (tave>250.0&&tave<450.0)")
TCut cosnumi("cosnumi>0.95")
void CenterTitles(TH1 *histo)
void time_wide_plot()
TH1F * cosnumiouth
int ntbin_per_usec
void make_template(double sigma)
double template_thi
Double_t sum
Definition: plot.C:31
Float_t e
Definition: plot.C:35
double intimet
Float_t w
Definition: plot.C:20
int zoom_nbin
void time_wide_proj(TChain &ch)
TCut fiducial(x1cut &&y1cut &&z1cut)
double zoom_thi
double spill_profile(double t)