breakpoint.C
Go to the documentation of this file.
1 //
2 // Find hits that have been extrapolated outside the detector (far det assumed)
3 //
4 void find_bad_hits()
5 {
6  std::cout << "Hits occur outside the detector in these events:\n";
7  hits0->Scan("run:evt","abs(x)>1500||abs(y)>1500||z<0||z>6000");
8 }
9 
10 //......................................................................
11 //
12 // Plot hit locations - distinguish between detector and interpolated
13 // hits. "hits0" are in the detector frame. The views are plotted
14 // twice, once with detector hits drawn first and then with the
15 // interpolated hits drawn first. This makes sure that one of the
16 // views has the zoom required to show all the hits and potentially
17 // catch outlier hits.
18 //
19 void plot_hits0(int run, int evt, int trk)
20 {
21  char cuts1[256], cuts2[256];
22  sprintf(cuts1,"run==%d&&evt==%d&&trk==%d&&v==0",run, evt, trk);
23  sprintf(cuts2,"run==%d&&evt==%d&&trk==%d&&v==1",run, evt, trk);
24 
25  TCanvas* c1 = new TCanvas("hits0_xview_1","hits0_xview_1");
26  hits0->SetMarkerStyle(20); hits0->Draw("x:z",cuts1);
27  hits0->SetMarkerStyle(24); hits0->Draw("x:z",cuts2,"same");
28 
29  TCanvas* c2 = new TCanvas("hits0_xview_1","hits0_xview_2");
30  hits0->SetMarkerStyle(24); hits0->Draw("x:z",cuts2);
31  hits0->SetMarkerStyle(20); hits0->Draw("x:z",cuts1,"same");
32 
33  TCanvas* c3 = new TCanvas("hits0_yview_1","hits0_yview_1");
34  hits0->SetMarkerStyle(20); hits0->Draw("y:z",cuts2);
35  hits0->SetMarkerStyle(24); hits0->Draw("y:z",cuts1,"same");
36 
37  TCanvas* c4 = new TCanvas("hits0_yview_2","hits0_yview_2");
38  hits0->SetMarkerStyle(24); hits0->Draw("y:z",cuts1);
39  hits0->SetMarkerStyle(20); hits0->Draw("y:z",cuts2,"same");
40 }
41 
42 //......................................................................
43 
44 void plot_hits1(int run, int evt, int trk)
45 {
46  char cuts[256];
47  sprintf(cuts,"run==%d&&evt==%d&&trk==%d",run, evt, trk);
48  TCut xview("v==0");
49  TCut yview("v==1");
50 
51  fit1->SetMarkerColor(kRed);
52 
53  static TCanvas* c1 = new TCanvas("hits1_xview_1","hits1_xview_1");
54  static TCanvas* c2 = new TCanvas("hits1_xview_2","hits1_xview_2");
55  static TCanvas* c3 = new TCanvas("hits1_yview_1","hits1_yview_1");
56  static TCanvas* c4 = new TCanvas("hits1_yview_2","hits1_yview_2");
57 
58  c1->cd();
59  hits1->SetMarkerStyle(20); hits1->Draw("x:z",cuts&&xview);
60  hits1->SetMarkerStyle(24); hits1->Draw("x:z",cuts&&yview,"same");
61  fit1-> SetMarkerStyle(27); fit1-> Draw("x:z",cuts,"same");
62 
63  c2->cd();
64  hits1->SetMarkerStyle(20); hits1->Draw("x:z",cuts&&xview);
65  hits1->SetMarkerStyle(24); hits1->Draw("x:z",cuts&&yview,"same");
66  fit1-> SetMarkerStyle(27); fit1-> Draw("x:z",cuts,"same");
67 
68  c3->cd();
69  hits1->SetMarkerStyle(20); hits1->Draw("y:z",cuts&&yview);
70  hits1->SetMarkerStyle(24); hits1->Draw("y:z",cuts&&xview,"same");
71  fit1-> SetMarkerStyle(28); fit1-> Draw("y:z",cuts,"same");
72 
73  c4->cd();
74  hits1->SetMarkerStyle(20); hits1->Draw("y:z",cuts&&yview);
75  hits1->SetMarkerStyle(24); hits1->Draw("y:z",cuts&&xview,"same");
76  fit1-> SetMarkerStyle(28); fit1-> Draw("y:z",cuts,"same");
77 }
78 
79 ////////////////////////////////////////////////////////////////////////
tree Draw("slc.nhit")
enum BeamMode kRed
fVtxDx SetMarkerStyle(20)
void plot_hits0(int run, int evt, int trk)
Definition: breakpoint.C:19
c2
Definition: demo5.py:33
Track finder for cosmic rays.
void plot_hits1(int run, int evt, int trk)
Definition: breakpoint.C:44
int evt
Definition: run.py:1
OStream cout
Definition: OStream.cxx:6
c1
Definition: demo5.py:24
void find_bad_hits()
Definition: breakpoint.C:4