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");
39 TCut
x1cut(
"abs(x1)<100");
40 TCut
z1cut(
"280<z1 && z1<1200");
51 TCut
intime(
"tave>=217.0 && tave<=227.8");
52 TCut
outtime(
"(tave>0.0&&tave<200.0) || (tave>250.0&&tave<450.0)");
58 TLatex* tx =
new TLatex(0.1, .93,
label);
59 tx->SetTextColor(kBlack);
61 tx->SetTextSize(1/30.);
69 TLatex*
prelim =
new TLatex(.9, .93,
"NOvA Preliminary");
70 prelim->SetTextColor(
kBlue);
72 prelim->SetTextSize(1/30.);
73 prelim->SetTextAlign(32);
79 histo->GetXaxis()->CenterTitle();
80 histo->GetYaxis()->CenterTitle();
81 histo->GetZaxis()->CenterTitle();
90 nhith =
new TH1F(
"nhith",
";N_{hit};Events",101,-0.5,100.5);
92 ch.Project(
"nhith",
"nhit",
run);
97 gStyle->SetOptStat(0);
99 TCanvas* nhitc =
new TCanvas(
"nhitc",
"nhitc",800,600);
107 TLine* nhitl =
new TLine(25.0, 0, 25.0,
nhith->GetMaximum());
108 nhitl->SetLineStyle(3);
111 double ya2 = 0.75*
log10(
nhith->GetMaximum())+0.9;
112 double ya3 =
pow(10,0.5*(ya1+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);
120 TText* tx2 =
new TText(30.0, ya3,
"selected");
121 tx2->SetTextFont(42);
122 tx2->SetTextAlign(12);
123 tx2->SetTextSize(0.035);
128 nhitc->SaveAs(
"cana_nhit.pdf");
129 nhitc->SaveAs(
"cana_nhit.png");
137 y1h =
new TH1F(
"y1h",
";upper end y location (cm); Events / cm",
143 gStyle->SetOptStat(0);
145 TCanvas* y1c =
new TCanvas(
"y1c",
"y1c",800,600);
152 TLine* y1l =
new TLine(150.0, 0, 150.0,
y1h->GetMaximum());
153 y1l->SetLineStyle(3);
155 double ya1 = 0.66*
y1h->GetMaximum();
156 double ya2 = 0.60*
y1h->GetMaximum();
157 double ya3 = 0.5*(ya1+ya2);
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);
166 TText* tx2 =
new TText(110.0,ya3,
"selected");
167 tx2->SetTextAlign(32);
168 tx2->SetTextFont(42);
169 tx2->SetTextSize(0.035);
172 y1c->SaveAs(
"cana_y1c.pdf");
173 y1c->SaveAs(
"cana_y1c.png");
181 x1h =
new TH1F(
"x1h",
";upper end x location (cm); Events / cm",
187 gStyle->SetOptStat(0);
189 TCanvas* x1c =
new TCanvas(
"x1c",
"x1c",800,600);
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);
202 double ya1 = 0.66*
x1h->GetMaximum();
203 double ya2 = 0.60*
x1h->GetMaximum();
204 double ya3 = 0.5*(ya1+ya2);
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);
211 TText* tx2 =
new TText(0.0,ya3,
"selected");
212 tx2->SetTextFont(42);
213 tx2->SetTextAlign(22);
214 tx2->SetTextSize(0.035);
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);
224 x1c->SaveAs(
"cana_x1c.pdf");
225 x1c->SaveAs(
"cana_x1c.png");
233 z1h =
new TH1F(
"z1h",
";upper end z location (cm); Events / 10 cm",
239 gStyle->SetOptStat(0);
241 TCanvas* z1c =
new TCanvas(
"z1c",
"z1c",800,600);
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);
254 double ya1 = 0.66*
z1h->GetMaximum();
255 double ya2 = 0.60*
z1h->GetMaximum();
256 double ya3 = 0.5*(ya1+ya2);
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);
263 TText* tx2 =
new TText(700.0,ya3,
"selected");
264 tx2->SetTextFont(42);
265 tx2->SetTextAlign(22);
266 tx2->SetTextSize(0.035);
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);
276 z1c->SaveAs(
"cana_z1c.pdf");
277 z1c->SaveAs(
"cana_z1c.png");
287 ";cos #theta_{NuMI}; Events / 0.05",
290 ";cos #theta_{NuMI}; Events / 0.05",
299 gStyle->SetOptStat(0);
301 TCanvas* cosnumic =
new TCanvas(
"cosnumic",
"cosnumic",800,600);
319 TLine*
a1 =
new TLine(x1+0.08, 1.12*y1, x1+0.03, 1.01*y1);
321 a1->SetLineColor(
kRed);
324 TText* tx1 =
new TText(x1+0.09, 1.14*y1,
"out of time tracks");
325 tx1->SetTextColor(
kRed);
331 TLine*
a2 =
new TLine(x1-0.04, 1.01*y1, x1-0.08, 1.12*y1);
333 a2->SetLineColor(kBlack);
336 TText* tx2 =
new TText(x1-0.06, 1.20*y1,
"in time tracks");
337 tx2->SetTextAlign(31);
338 tx2->SetTextColor(kBlack);
343 cosnumic->SaveAs(
"cana_cosnumic.pdf");
344 cosnumic->SaveAs(
"cana_cosnumic.png");
353 ";NDOS event time [#musec];Events / 2 #musec",
355 ch.Project(
"tavewideh",
"tave",
canacuts);
359 gStyle->SetOptStat(0);
361 TCanvas* cana_tave_wide =
362 new TCanvas(
"cana_tave_wide",
"cana_tave_wide",800,600);
371 double splusb =
tavewideh->Integral(i1,i2);
375 b *= (
float)(i2-i1+1)/50.0;
376 double fom = (splusb-
b)/
sqrt(b);
389 cana_tave_wide->SaveAs(
"cana_tave_wide.pdf");
390 cana_tave_wide->SaveAs(
"cana_tave_wide.png");
403 gStyle->SetOptStat(0);
406 ";NDOS event time [#musec];Events / 50 nsec",
410 ch.Project(
"tavezoomh",
"tave",
canacuts);
426 if (t<0.0)
return 0.0;
434 if (ttmp<0.0)
return 0.0;
495 static int ifirst = 1;
506 static double last_sigma = 0.0;
507 if (last_sigma != sigma) {
542 sum += ni*(
log(ni/nui)-1);
550 void fcn(
int&,
double*,
double&
f,
double*
p,
int)
562 minuit.SetPrintLevel(-99);
564 minuit.mnparm(0,
"bkg", 1
e-3, 1
e-4, 0, 10.0, ierr);
565 minuit.mnparm(1,
"sf", 1
e-3, 1
e-4, 0, 10.0, ierr);
566 minuit.mnparm(2,
"t0", 1
e-3, 1
e-4, 0, 10.0, ierr);
567 minuit.mnparm(3,
"sigt", 1
e-3, 1
e-4, 0, 10.0, ierr);
569 double chi2best = 99E99;
580 minuit.mnparm(2,
"t0", t0, 1
e-3, 0.0, 500.0, ierr);
581 minuit.FixParameter(2);
583 minuit.mnparm(3,
"sigt", 0.512/
sqrt(12)/
sqrt(25), 1
e-3, 0.0, 500.0, ierr);
584 minuit.FixParameter(3);
588 double fmin, fedm, errdef;
589 int npari, nparx, istat;
590 minuit.mnstat(fmin,fedm,errdef,npari,nparx,istat);
597 double val, err, xlolim, xuplim;
600 static TString
bkg(
"bkg");
601 minuit.mnpout(0, bkg, val, err, xlolim, xuplim, iuint);
605 static TString sf(
"sf");
606 minuit.mnpout(1, sf, val, err, xlolim, xuplim, iuint);
610 static TString t0s(
"t0");
611 minuit.mnpout(2, t0s, val, err, xlolim, xuplim, iuint);
615 static TString sigt(
"sigt");
616 minuit.mnpout(3, sigt, val, err, xlolim, xuplim, iuint);
634 TCanvas* time_zoom_drawc =
635 new TCanvas(
"time_zoom_drawc",
636 "time_zoom_drawc",800,600);
649 TLegend *tleg =
new TLegend(0.15,0.75,0.43,0.85);
650 tleg->SetTextFont(42);
651 tleg->SetTextSize(0.04);
657 time_zoom_drawc->SaveAs(
"cana_time_zoom.png");
658 time_zoom_drawc->SaveAs(
"cana_time_zoom.pdf");
fvar< T > fmin(const fvar< T > &x1, const fvar< T > &x2)
TCut intime("tave>=217.0 && tave<=227.8")
void make_time_profile(double b, double f, double t0, double sigma)
void proj_all(TChain &ch)
Float_t y1[n_points_granero]
void Preliminary()
Put NOvA Preliminary on plots.
void time_zoom_proj(TChain &ch)
Float_t x1[n_points_granero]
void fcn(int &, double *, double &f, double *p, int)
TCut run("run>=15071&&run<=15131")
TCut x1cut("abs(x1)<100")
TCut z1cut("280<z1 && z1<1200")
TCut canacuts(run &&fiducial &&activity &&cosnumi)
void cosnumi_proj(TChain &ch)
static const double spill_length
double Gaus(TH1D *h, double &err, bool isTruth)
static const double dt_batch
void nhit_proj(TChain &ch)
static const double dt_gap
static const double dt_cycle
fvar< T > floor(const fvar< T > &x)
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 make_template(double sigma)
void time_wide_proj(TChain &ch)
TCut fiducial(x1cut &&y1cut &&z1cut)
double spill_profile(double t)