Functions | Variables
leana.C File Reference
#include "TCanvas.h"
#include "TChain.h"
#include "TCut.h"
#include "TLine.h"
#include "TFile.h"
#include "TF1.h"
#include "TH1D.h"
#include "TStyle.h"
#include <cmath>

Go to the source code of this file.

Functions

TCut goodclust ("dplanex<(nx+ny) &&""dplaney<(nx+ny) &&""dcellx<(nx+ny) &&""dcelly<(nx+ny) &&""(nx>(nx+ny)/4) &&""(ny>(nx+ny)/4)")
 
TCut all_michel ("dstop<40&&tstop<20")
 
TCut all_michel_na ("dstopna<40&&tstopna<20")
 
TCut clean_michel ("dstop<30&&tstop>3&&tstop<10")
 
TCut clean_michel_na ("dstopna<30&&tstopna>3&&tstopna<10")
 
TCut spall (!all_michel &&"dperp<50.0")
 
TCut spallna (!all_michel_na &&"dperpna<50.0")
 
int leana ()
 
void make_slice_sz ()
 
void make_1hitadc ()
 
void make_nhitc ()
 
void make_selectgoodclust ()
 
void make_selectgoodclust2 ()
 
void make_2hitq ()
 
void make_dpdc3hitc ()
 
void make_dpdc45itc ()
 
void make_goodclust ()
 
void make_goodclust_adc ()
 
void make_dstop ()
 
void make_tstop ()
 
void make_qstop ()
 
void make_nhitstop ()
 
void make_spalld ()
 
void make_spallq ()
 
void make_spallt8mev ()
 

Variables

TFile * file =0
 
TChain * le =0
 
TH1D * fSliceSz =0
 
TH1D * f1HitADC =0
 
TH1D * gsQstopData =0
 
TH1D * gsQstopCalc =0
 

Function Documentation

TCut all_michel ( )
TCut all_michel_na ( )
TCut clean_michel ( )

Referenced by make_nhitstop(), and make_qstop().

TCut clean_michel_na ( )

Referenced by make_nhitstop(), and make_qstop().

TCut goodclust ( )
int leana ( )

Definition at line 36 of file leana.C.

References f1HitADC, file, fSliceSz, and le.

37 {
38  file = TFile::Open("./scratch/leana.root");
39  le = (TChain*)file->FindObjectAny("le");
40  fSliceSz = (TH1D*)file->FindObjectAny("fSliceSz");
41  f1HitADC = (TH1D*)file->FindObjectAny("f1HitADC");
42  return 0;
43 }
TFile * file
Definition: leana.C:11
TH1D * fSliceSz
Definition: leana.C:13
TChain * le
Definition: leana.C:12
TH1D * f1HitADC
Definition: leana.C:14
void make_1hitadc ( )

Definition at line 58 of file leana.C.

References make_cached_def::e2, MakeMiniprodValidationCuts::f, and f1HitADC.

59 {
60  gStyle->SetOptFit();
61  TCanvas* adc1hitc = new TCanvas("adc1hitc","adc1hitc");
62  adc1hitc->SetLogx();
63  adc1hitc->SetLogy();
64  TF1* f = new TF1("powerlaw","[0]*pow(x,[1])");
65  f->SetParameter(0,2e10);
66  f->SetParameter(0,-2.0);
67  f1HitADC->Fit(f,"","",200,3000);
68  f1HitADC->GetXaxis()->SetRangeUser(10,10000);
69  f1HitADC->SetMinimum(1e2);
70  f1HitADC->SetMaximum(1e8);
71  f1HitADC->Draw();
72 
73  adc1hitc->Print("adc1hit.pdf");
74 }
TH1D * f1HitADC
Definition: leana.C:14
void make_2hitq ( )

Definition at line 147 of file leana.C.

References plot_validation_datamc::c, om::cout, allTimeWatchdog::endl, f1HitADC, check_time_usage::float, goodclust(), h1, h2, MECModelEnuComparisons::i, and le.

148 {
149  TCanvas* c = new TCanvas("2hitclustc","2hitclustc");
150 
151  TH1D* h1 = new TH1D("q2hitclusth",";Summed ADC;Two hit clusters",
152  8192, -0.5, 8191.5);
153 
154  TH1D* h2 = new TH1D("q2hitcoinh",";Summed ADC;Two hit clusters",
155  8192, -0.5, 8191.5);
156 
157  le->Draw("qx+qy >> q2hitclusth",goodclust&&"(nx+ny==2)");
158 
159  for (unsigned int i=0; i<h1->Integral(); ++i) {
160  h2->Fill(f1HitADC->GetRandom()+f1HitADC->GetRandom());
161  if (i%1000==0) std::cout << (float)(100*i)/h1->Integral() << std::endl;
162  }
163 
164  c->SetLogy();
165  c->SetLogx();
166  c->SetGridx();
167  c->SetGridy();
168  h2->GetXaxis()->SetRangeUser(10,10000);
169  h2->SetLineColor(2);
170  h2->Draw();
171  h1->Draw("same");
172 }
TCut goodclust("dplanex<(nx+ny) &&""dplaney<(nx+ny) &&""dcellx<(nx+ny) &&""dcelly<(nx+ny) &&""(nx>(nx+ny)/4) &&""(ny>(nx+ny)/4)")
OStream cout
Definition: OStream.cxx:6
TH1F * h2
Definition: plot.C:45
TH1F * h1
TChain * le
Definition: leana.C:12
TH1D * f1HitADC
Definition: leana.C:14
void make_dpdc3hitc ( )

Definition at line 176 of file leana.C.

References le.

177 {
178  TCanvas* dpdc3hitc = new TCanvas("dpdc3hitc","dpdc3hitc");
179  dpdc3hitc->Divide(2,2);
180  dpdc3hitc->cd(1);
181  gPad->SetLogy();
182  TH1D* dplanexh = new TH1D("dplanexh",";x-view #Delta_{plane}",21,-0.5,20.5);
183  le->Draw("dplanex >> dplanexh","nx+ny==3");
184 
185  dpdc3hitc->cd(2);
186  gPad->SetLogy();
187  TH1D* dcellxh = new TH1D("dcellxh",";x-view #Delta_{cell}",21,-0.5,20.5);
188  le->Draw("dcellx >> dcellxh","nx+ny==3");
189 
190  dpdc3hitc->cd(3);
191  gPad->SetLogy();
192  TH1D* dplaneyh = new TH1D("dplaneyh",";y-view #Delta_{plane}",21,-0.5,20.5);
193  le->Draw("dplaney >> dplaneyh","nx+ny==3");
194 
195  dpdc3hitc->cd(4);
196  gPad->SetLogy();
197  TH1D* dcellyh = new TH1D("dcellyh",";y-view #Delta_{cell}",21,-0.5,20.5);
198  le->Draw("dcelly >> dcellyh","nx+ny==3");
199 
200  dpdc3hitc->Print("dpdc3hitc.pdf");
201 }
TChain * le
Definition: leana.C:12
void make_dpdc45itc ( )

Definition at line 205 of file leana.C.

References le.

206 {
207  TCanvas* dpdc45hitc = new TCanvas("dpdc45hitc","dpdc45hitc");
208  dpdc45hitc->Divide(2,2);
209  dpdc45hitc->cd(1);
210  gPad->SetLogy();
211  TH1D* dplanexh = new TH1D("dplanexh",";x-view #Delta_{plane}",21,-0.5,20.5);
212  le->Draw("dplanex >> dplanexh","(nx+ny==4)||(nx+ny)==5");
213 
214  dpdc45hitc->cd(2);
215  gPad->SetLogy();
216  TH1D* dcellxh = new TH1D("dcellxh",";x-view #Delta_{cell}",21,-0.5,20.5);
217  le->Draw("dcellx >> dcellxh","(nx+ny==4)||(nx+ny)==5");
218 
219  dpdc45hitc->cd(3);
220  gPad->SetLogy();
221  TH1D* dplaneyh = new TH1D("dplaneyh",";y-view #Delta_{plane}",21,-0.5,20.5);
222  le->Draw("dplaney >> dplaneyh","(nx+ny==4)||(nx+ny)==5");
223 
224  dpdc45hitc->cd(4);
225  gPad->SetLogy();
226  TH1D* dcellyh = new TH1D("dcellyh",";y-view #Delta_{cell}",21,-0.5,20.5);
227 
228  le->Draw("dcelly >> dcellyh","(nx+ny==4)||(nx+ny)==5");
229 
230  dpdc45hitc->Print("dpdc45hitc.pdf");
231 }
TChain * le
Definition: leana.C:12
void make_dstop ( )

Definition at line 272 of file leana.C.

References goodclust(), and le.

273 {
274  TH1D* dstoph = new TH1D("dstoph",
275  ";Distance to muon end point [cm];clusters/cm",
276  500,0.0,500.0);
277  TH1D* dstophna = new TH1D("dstophna",
278  ";Distance to muon end point [cm];clusters/cm",
279  500,0.0,500.0);
280  gStyle->SetOptStat(0);
281  TCanvas* dstopc = new TCanvas("dstopc","dstopc");
282  le->Draw("dstop >> dstoph", goodclust);
283  le->Draw("dstopna >> dstophna",goodclust);
284 
285  dstoph->Draw();
286  dstophna->SetLineColor(2);
287  dstophna->Draw("same");
288 
289  dstopc->Print("dstop.pdf");
290 }
TCut goodclust("dplanex<(nx+ny) &&""dplaney<(nx+ny) &&""dcellx<(nx+ny) &&""dcelly<(nx+ny) &&""(nx>(nx+ny)/4) &&""(ny>(nx+ny)/4)")
TChain * le
Definition: leana.C:12
void make_goodclust ( )

Definition at line 235 of file leana.C.

References goodclust(), and le.

236 {
237  TH1D* allclusth = new TH1D("allclusth", ";N_{hit}",11,-0.5,10.5);
238  TH1D* goodclusth = new TH1D("goodclusth",";N_{hit}",11,-0.5,10.5);
239 
240  le->Draw("nx+ny >> allclusth");
241  le->Draw("nx+ny >> goodclusth",goodclust);
242 
243  TCanvas* goodclustc = new TCanvas("goodclustc","goodclustc");
244  goodclustc->SetLogy();
245  allclusth->SetMaximum(1e7);
246  allclusth->SetMinimum(1e4);
247  allclusth->Draw();
248  goodclusth->SetLineColor(2);
249  goodclusth->Draw("same");
250 
251  goodclustc->Print("goodclustc.pdf");
252 }
TCut goodclust("dplanex<(nx+ny) &&""dplaney<(nx+ny) &&""dcellx<(nx+ny) &&""dcelly<(nx+ny) &&""(nx>(nx+ny)/4) &&""(ny>(nx+ny)/4)")
TChain * le
Definition: leana.C:12
void make_goodclust_adc ( )

Definition at line 256 of file leana.C.

References goodclust(), and le.

257 {
258  TCanvas* goodclust_adc_c = new TCanvas("goodclust_adc_c",
259  "goodclust_adc_c");
260  goodclust_adc_c->SetLogy();
261  TH1D* goodclust_adch = new TH1D("goodclust_adch",
262  ";Summed ADC;clusters/15 ADC",
263  1300,10.0,19510.0);
264 
265  le->Draw("qx+qy >> goodclust_adch",goodclust);
266 
267  goodclust_adc_c->Print("goodclust_adc.pdf");
268 }
TCut goodclust("dplanex<(nx+ny) &&""dplaney<(nx+ny) &&""dcellx<(nx+ny) &&""dcelly<(nx+ny) &&""(nx>(nx+ny)/4) &&""(ny>(nx+ny)/4)")
TChain * le
Definition: leana.C:12
void make_nhitc ( )

Definition at line 78 of file leana.C.

References le, and nhith.

79 {
80  TCanvas* nhitc = new TCanvas("nhitc","nhitc");
81  nhitc->SetLogy();
82  TH1D* nhith = new TH1D("nhith",";Nhit",11,-0.5,10.5);
83  le->Draw("nx+ny >> nhith");
84 
85  nhitc->Print("nhitc.pdf");
86 }
TH1F * nhith
TChain * le
Definition: leana.C:12
void make_nhitstop ( )

Definition at line 391 of file leana.C.

References clean_michel(), clean_michel_na(), goodclust(), kOrange, and le.

392 {
393  TH1D* nhitstoph = new TH1D("nhitstoph",";N_{hit};Michel Candidates",
394  11,-0.5,10.5);
395  TH1D* nhitstophna = new TH1D("nhitstophna",";N_{hit};Michel Candidates",
396  11,-0.5,10.5);
397 
398  TCanvas* nhitstopc = new TCanvas("nhitstopc","nhitstopc");
399 
400  le->Draw("nx+ny >> nhitstoph", goodclust&&clean_michel);
401  le->Draw("nx+ny >> nhitstophna",goodclust&&clean_michel_na);
402 
403  nhitstopc->SetLogy(1);
404  nhitstoph->Draw();
405  nhitstophna->SetLineColor(kOrange);
406  nhitstophna->Draw("same");
407 }
enum BeamMode kOrange
TCut clean_michel_na("dstopna<30&&tstopna>3&&tstopna<10")
TCut goodclust("dplanex<(nx+ny) &&""dplaney<(nx+ny) &&""dcellx<(nx+ny) &&""dcelly<(nx+ny) &&""(nx>(nx+ny)/4) &&""(ny>(nx+ny)/4)")
TChain * le
Definition: leana.C:12
TCut clean_michel("dstop<30&&tstop>3&&tstop<10")
void make_qstop ( )

Definition at line 330 of file leana.C.

References calc, clean_michel(), clean_michel_na(), E, goodclust(), gsQstopData, kOrange, kRed, and le.

331 {
332  TH1D* qstoph = new TH1D("qstoph",";Summed ADC;Michel Candidates",
333  250,0.0,2500.0);
334  TH1D* qstophna = new TH1D("qstophna",";Summed ADC;Michel Candidates",
335  250,0.0,2500.0);
336 
337  TCanvas* qstopc = new TCanvas("qstopc","qstopc",800,800*4/3);
338 
339  le->Draw("qx+qy >> qstoph", goodclust&&clean_michel);
340  le->Draw("qx+qy >> qstophna",goodclust&&clean_michel_na);
341 
342  qstoph->SetMarkerStyle(20);
343  qstoph->SetMarkerSize(0.8);
344  qstoph->GetYaxis()->SetTitleOffset(1.5);
345  qstoph->Draw("e");
346 
347  // FCN=261.768 FROM MINOS
348  // EXT PARAMETER PARABOLIC MINOS ERRORS
349  // NO. NAME VALUE ERROR NEGATIVE POSITIVE
350  // 1 N 3.39948e+04 1.88164e+02 -1.87839e+02 1.88542e+02
351  // 2 adc/MeV 4.20948e-02 1.27728e-06
352  // 3 a 3.25360e-01 2.21426e-03 -4.91862e-03 2.62735e-03
353  // 4 b 6.07107e-10 3.26916e-02 at limit 3.16406e-02
354  extern void book_qstopcalc(int,int,int);
355  extern TH1D* get_qstopcalc();
356  extern void set_qstopcalc(double,double,double,double);
357  extern void make_qstopcalc();
358  book_qstopcalc(250,0,2500);
359 
360  set_qstopcalc(3.39948E4,4.20948E-2,0.001,0.0);
361  make_qstopcalc();
362  TH1D* theo = new TH1D(*get_qstopcalc());
363 
364  set_qstopcalc(3.39948E4,4.20948E-2,3.25360E-1,0.0);
365  make_qstopcalc();
366  TH1D* calc = get_qstopcalc();
367 
368  calc->SetLineWidth(2);
369  calc->SetLineColor(2);
370  calc->Draw("l,same");
371 
372  theo->Scale(calc->GetMaximum()/theo->GetMaximum());
373  theo->SetLineStyle(3);
374  theo->SetLineColor(kRed);
375  theo->SetLineWidth(2);
376  theo->Draw("l,same");
377 
378  qstophna->SetLineWidth(2);
379  qstophna->SetLineColor(kOrange);
380  qstophna->SetFillStyle(3003);
381  qstophna->SetFillColor(kOrange);
382  qstophna->Draw("same");
383 
384  gsQstopData = qstoph;
385 
386  qstopc->Print("qstop.pdf");
387 }
enum BeamMode kOrange
enum BeamMode kRed
TCut clean_michel_na("dstopna<30&&tstopna>3&&tstopna<10")
osc::OscCalcDumb calc
TCut goodclust("dplanex<(nx+ny) &&""dplaney<(nx+ny) &&""dcellx<(nx+ny) &&""dcelly<(nx+ny) &&""(nx>(nx+ny)/4) &&""(ny>(nx+ny)/4)")
TH1D * gsQstopData
Definition: leana.C:327
Float_t E
Definition: plot.C:20
TChain * le
Definition: leana.C:12
TCut clean_michel("dstop<30&&tstop>3&&tstop<10")
void make_selectgoodclust ( )

Definition at line 90 of file leana.C.

References plot_validation_datamc::c, h1, h2, h3, and le.

91 {
92  TH1D* h1 = new TH1D("dplanex",
93  ";#Delta^{plane}_{X} - N_{hit}",
94  221,-20.5,200.5);
95  TH1D* h2 = new TH1D("dplaney",
96  ";#Delta^{plane}_{Y} - N_{hit}",
97  151,-20.5,130.5);
98  TH1D* h3 = new TH1D("dcellx",
99  ";#Delta^{cell}_{X} - N_{hit}",
100  86,-20.5,65.5);
101  TH1D* h4 = new TH1D("dcelly",
102  ";#Delta^{cell}_{Y} - N_{hit}",
103  121,-20.5,100.5);
104 
105  le->Draw("dplanex-(nx+ny) >> dplanex","nx>0&&ny>0");
106  le->Draw("dplaney-(nx+ny) >> dplaney","nx>0&&ny>0");
107  le->Draw("dcellx-(nx+ny) >> dcellx", "nx>0&&ny>0");
108  le->Draw("dcelly-(nx+ny) >> dcelly", "nx>0&&ny>0");
109 
110  gStyle->SetOptStat(1111);
111  TCanvas* c = new TCanvas("selectgoodclust","selectgoodclust",700,500);
112  c->Divide(2,2);
113  c->cd(1); gPad->SetLogy(1); h1->Draw();
114  c->cd(2); gPad->SetLogy(1); h2->Draw();
115  c->cd(3); gPad->SetLogy(1); h3->Draw();
116  c->cd(4); gPad->SetLogy(1); h4->Draw();
117 
118  c->Print("selectgoodclust.pdf");
119 }
TH1F * h3
Definition: berger.C:36
TH1F * h2
Definition: plot.C:45
TH1F * h1
TChain * le
Definition: leana.C:12
void make_selectgoodclust2 ( )

Definition at line 123 of file leana.C.

References plot_validation_datamc::c, h1, h2, and le.

124 {
125  TH1D* h1 = new TH1D("nxfrac",";N_{X}/N_{hit}",100,0.0,1.0);
126  TH1D* h2 = new TH1D("nyfrac",";N_{Y}/N_{hit}",100,0.0,1.0);
127 
128  TCanvas* c = new TCanvas("selectgoodclust2","selectgoodclust2");
129 
130  c->Divide(2,1);
131 
132  c->cd(1);
133  gPad->SetLogy();
134  le->Draw("nx/(nx+ny) >> nxfrac","nx>0&&ny>0");
135  h1->Draw();
136 
137  c->cd(2);
138  gPad->SetLogy();
139  le->Draw("ny/(nx+ny) >> nyfrac","nx>0&&ny>0");
140  h2->Draw();
141 
142  c->Print("selectgoodclust2.pdf");
143 }
TH1F * h2
Definition: plot.C:45
TH1F * h1
TChain * le
Definition: leana.C:12
void make_slice_sz ( )

Definition at line 47 of file leana.C.

References fSliceSz.

48 {
49  TCanvas* slice_sz = new TCanvas("slice_sz","slice_sz");
50  slice_sz->SetLogy();
51  fSliceSz->Draw();
52 
53  slice_sz->Print("slice_sz.pdf");
54 }
TH1D * fSliceSz
Definition: leana.C:13
void make_spalld ( )

Definition at line 411 of file leana.C.

References all_michel(), all_michel_na(), demo5::c1, demo5::c2, goodclust(), h1, h2, h3, kRed, le, and zero().

412 {
413  TH1D* h1 = new TH1D("spalld",
414  ";Distance to muon track [cm]",
415  200,0.0,200.0);
416 
417  TH1D* h2 = new TH1D("spalldna",
418  ";Distance to muon track [cm]",
419  200,0.0,200.0);
420  TH1D* h3 = new TH1D(*h1);
421 
422  h1->Sumw2();
423  h2->Sumw2();
424  h3->Sumw2();
425 
426  le->Draw("dperp >> spalld", goodclust&&!all_michel);
427  le->Draw("dperpna >> spalldna",goodclust&&!all_michel_na);
428 
429  TCanvas* c1 = new TCanvas("spalld1","spalld1",800*3/4,1200*3/4);
430  h1->SetMarkerStyle(20);
431  h1->SetMarkerSize(0.8);
432  h2->SetLineColor(kRed);
433  h1->SetMinimum(0);
434  h1->Draw("hist");
435  h2->Draw("same,hist");
436 
437  TCanvas* c2 = new TCanvas("spalld2","spalld2",800*3/4,1200*3/4);
438  h3->Add(h1,1);
439  h3->Add(h2,-1);
440  h3->SetMarkerStyle(20);
441  h3->SetMarkerSize(0.8);
442  h3->Draw("e");
443  TLine* zero = new TLine(0,0,200,0);
444  zero->SetLineStyle(2);
445  zero->Draw();
446 }
enum BeamMode kRed
TH1F * h3
Definition: berger.C:36
TCut goodclust("dplanex<(nx+ny) &&""dplaney<(nx+ny) &&""dcellx<(nx+ny) &&""dcelly<(nx+ny) &&""(nx>(nx+ny)/4) &&""(ny>(nx+ny)/4)")
c2
Definition: demo5.py:33
TCut all_michel_na("dstopna<40&&tstopna<20")
TCut all_michel("dstop<40&&tstop<20")
TH1F * h2
Definition: plot.C:45
TH1F * h1
TChain * le
Definition: leana.C:12
c1
Definition: demo5.py:24
auto zero()
Definition: PMNS.cxx:55
void make_spallq ( )

Definition at line 450 of file leana.C.

References all_michel(), all_michel_na(), demo5::c1, demo5::c2, goodclust(), h1, h2, h3, kRed, le, and zero().

451 {
452  TH1D* h1 = new TH1D("spallq",
453  ";ADC/24",
454  100,0.0,100.0);
455 
456  TH1D* h2 = new TH1D("spallqna",
457  ";ADC/24",
458  100,0.0,100.0);
459  TH1D* h3 = new TH1D(*h1);
460 
461  h1->Sumw2();
462  h2->Sumw2();
463  h3->Sumw2();
464 
465  le->Draw("(qx+qy)/24 >> spallq", goodclust&&!all_michel&&"dperp<40");
466  le->Draw("(qx+qy)/24 >> spallqna",goodclust&&!all_michel_na&&"dperpna<40");
467 
468  TCanvas* c1 = new TCanvas("spallq1","spallq1");
469  c1->SetGridx();
470  c1->SetGridy();
471  h1->SetMarkerStyle(20);
472  h1->SetMarkerSize(0.8);
473  h2->SetLineColor(kRed);
474  h1->SetMinimum(0);
475  h1->Draw("hist");
476  h2->Draw("same,hist");
477 
478  TCanvas* c2 = new TCanvas("spallq2","spallq2");
479  c2->SetGridx();
480  c2->SetGridy();
481  h3->Add(h1,1);
482  h3->Add(h2,-1);
483  h3->SetMarkerStyle(20);
484  h3->SetMarkerSize(0.8);
485  h3->Draw("e");
486  TLine* zero = new TLine(0,0,100,0);
487  zero->SetLineStyle(2);
488  zero->Draw();
489 }
enum BeamMode kRed
TH1F * h3
Definition: berger.C:36
TCut goodclust("dplanex<(nx+ny) &&""dplaney<(nx+ny) &&""dcellx<(nx+ny) &&""dcelly<(nx+ny) &&""(nx>(nx+ny)/4) &&""(ny>(nx+ny)/4)")
c2
Definition: demo5.py:33
TCut all_michel_na("dstopna<40&&tstopna<20")
TCut all_michel("dstop<40&&tstop<20")
TH1F * h2
Definition: plot.C:45
TH1F * h1
TChain * le
Definition: leana.C:12
c1
Definition: demo5.py:24
auto zero()
Definition: PMNS.cxx:55
void make_spallt8mev ( )

Definition at line 493 of file leana.C.

References all_michel(), all_michel_na(), demo5::c1, demo5::c2, chisquared::c3, chisquared::c4, goodclust(), h1, h2, h3, PandAna.reco_validation.add_data::h5, kRed, le, and zero().

494 {
495  TH1D* h1 = new TH1D("spallt8mev",
496  ";Time to muon track [#musec];Events/100 ns",
497  500,0.0,50.0);
498  TH1D* h2 = new TH1D("spallt8mevna",
499  ";Time to muon track [#musec];Events/100 ns",
500  500,0.0,50.0);
501  TH1D* h3 = new TH1D(*h1);
502 
503  TH1D* h4 = new TH1D("spalltc8mev",
504  ";Time to muon track [#musec];Events/10 #musec",
505  10,0.0,500.0);
506  TH1D* h5 = new TH1D("spalltc8mevna",
507  ";Time to muon track [#musec];Events/10 #musec",
508  10,0.0,500.0);
509  TH1D* h6 = new TH1D(*h4);
510 
511  h1->Sumw2();
512  h2->Sumw2();
513  h3->Sumw2();
514  h4->Sumw2();
515  h5->Sumw2();
516  h6->Sumw2();
517 
518  // Select things close to muon tracks and <~8 MeV (8*24 ADC/MeV)
519  TCut spallc ("dperp<40&&(qx+qy)<192");
520  TCut spallnac("dperpna<40&&(qx+qy)<192");
521 
522  le->Draw("tperp >> spallt8mev", goodclust&&!all_michel&&spallc);
523  le->Draw("tperpna >> spallt8mevna",goodclust&&!all_michel_na&&spallnac);
524 
525  le->Draw("tperp >> spalltc8mev", goodclust&&!all_michel&&spallc);
526  le->Draw("tperpna >> spalltc8mevna",goodclust&&!all_michel_na&&spallnac);
527 
528  TCanvas* c1 = new TCanvas("spallt8mev1","spallt8mev1");
529  h1->SetMarkerStyle(20);
530  h1->SetMarkerSize(0.8);
531  h2->SetLineColor(kRed);
532  h1->SetMinimum(0);
533  h1->Draw("hist");
534  h2->Draw("same,hist");
535 
536  TCanvas* c2 = new TCanvas("spallt8mev2","spallt8mev2");
537  h3->Add(h1,1);
538  h3->Add(h2,-1);
539  h3->SetMarkerStyle(20);
540  h3->SetMarkerSize(0.8);
541  h3->Draw("e");
542  TLine* zero = new TLine(0,0,200,0);
543  zero->SetLineStyle(2);
544  zero->Draw();
545 
546  TCanvas* c3 = new TCanvas("spallt8mev3","spallt8mev3");
547  h4->SetMarkerStyle(20);
548  h4->SetMarkerSize(0.8);
549  h5->SetLineColor(kRed);
550  h4->SetMinimum(0);
551  h4->Draw("hist");
552  h5->Draw("same,hist");
553 
554  TCanvas* c4 = new TCanvas("spallt8mev4","spallt8mev4");
555  h6->Add(h4,1);
556  h6->Add(h5,-1);
557  h6->SetMarkerStyle(20);
558  h6->SetMarkerSize(0.8);
559  h6->Draw("e");
560  // TLine* zero = new TLine(0,0,200,0);
561  // zero->SetLineStyle(2);
562  // zero->Draw();
563 }
enum BeamMode kRed
TH1F * h3
Definition: berger.C:36
TCut goodclust("dplanex<(nx+ny) &&""dplaney<(nx+ny) &&""dcellx<(nx+ny) &&""dcelly<(nx+ny) &&""(nx>(nx+ny)/4) &&""(ny>(nx+ny)/4)")
c2
Definition: demo5.py:33
TCut all_michel_na("dstopna<40&&tstopna<20")
TCut all_michel("dstop<40&&tstop<20")
TH1F * h2
Definition: plot.C:45
TH1F * h1
TChain * le
Definition: leana.C:12
c1
Definition: demo5.py:24
auto zero()
Definition: PMNS.cxx:55
void make_tstop ( )

Definition at line 294 of file leana.C.

References MakeMiniprodValidationCuts::f, goodclust(), kOrange, and le.

295 {
296  TH1D* tstoph = new TH1D("tstoph",
297  ";Time to muon [#musec];clusters/0.1#musec",
298  400,0.0,40.0);
299  TH1D* tstophna = new TH1D("tstophna",
300  ";Time to muon [#musec];clusters/0.1#musec",
301  400,0.0,40.0);
302  gStyle->SetOptStat(0);
303  gStyle->SetOptFit(1);
304  TCanvas* tstopc = new TCanvas("tstopc","tstopc",800,800*4/3);
305  tstopc->SetLogy();
306  le->Draw("tstop >> tstoph", goodclust&&"dstop<30.0&&t>40&&(qx+qy)>300");
307  le->Draw("tstopna >> tstophna",goodclust&&"dstopna<30.0&&t>40&&(qx+py)>300");
308 
309  TF1* f = new TF1("f","[0]*exp(-x/[1])",0.0,40.0);
310  f->SetParameter(0,1e4);
311  f->SetParameter(1,2.0);
312  tstoph->Fit(f,"","",3.0,40.0);
313 
314  tstoph->SetMarkerStyle(20);
315  tstoph->SetMarkerSize(0.8);
316  tstoph->GetYaxis()->SetTitleOffset(1.5);
317  tstoph->Draw("e");
318  tstophna->SetLineColor(kOrange);
319  tstophna->SetLineWidth(2);
320  tstophna->Draw("same");
321 
322  tstopc->Print("tstop.pdf");
323 }
enum BeamMode kOrange
TCut goodclust("dplanex<(nx+ny) &&""dplaney<(nx+ny) &&""dcellx<(nx+ny) &&""dcelly<(nx+ny) &&""(nx>(nx+ny)/4) &&""(ny>(nx+ny)/4)")
TChain * le
Definition: leana.C:12
TCut spall ( )
TCut spallna ( )

Variable Documentation

TH1D* f1HitADC =0

Definition at line 14 of file leana.C.

Referenced by leana(), make_1hitadc(), and make_2hitq().

TFile* file =0

Definition at line 11 of file leana.C.

Referenced by leana().

TH1D* fSliceSz =0

Definition at line 13 of file leana.C.

Referenced by leana(), and make_slice_sz().

TH1D* gsQstopCalc =0

Definition at line 328 of file leana.C.

TH1D* gsQstopData =0

Definition at line 327 of file leana.C.

Referenced by make_qstop().

TChain* le =0