er  dev
showBeam.cxx
1 #if !defined(__CLING__)
2 
3 
4 //#include "../install/include/conversion/ConvertRepackedToCalibrated.h"
5 //#include "../install/include/data/DetEventCommon.h"
6 #include "TFile.h"
7 //#include "TTree.h"
8 #include "TChain.h"
9 #include "TCanvas.h"
10 
11 #include "~/Acculinna/ER/beamtime/data/ERBeamTimeEventHeader.h"
12 
13 
14 #include <iostream>
15 
16 using std::cout;
17 using std::endl;
18 
19 #endif
20 
21 void showBeam() {
22 
23  TString inFile = "he8_10_0010.reco.root";
24  TString inPath = "~/Acculinna/ER/showBeam_VC/reco/";
25 
26  TFile *fr = new TFile(inPath + inFile);
27  TTree *tr = (TTree*)fr->Get("reco");
28 
29  TFile *frIn = new TFile("~/Acculinna/ER/showBeam_VC/analysed/he8_10_0010.Digi.root");
30  TTree *trIn = (TTree*)frIn->Get("er");
31  tr->AddFriend(trIn);
32 
33 // tr->StartViewer();
34 // trIn->StartViewer();
35 
37 // c1
39 
40  TCanvas *c1 = new TCanvas("c1", "diagnostics", 1000, 1000);
41  c1->Divide(2,2);
42 
43  c1->cd(1);
44  tr->Draw("trigger", "");
45  c1->Update();
46 
47  c1->cd(2);
48 // tr->Draw("BeamDetMWPCDigiY1.fWireNb:BeamDetMWPCDigiX1.fWireNb", "Length$(BeamDetMWPCDigiX1)>0 && Length$(BeamDetMWPCDigiY1)>0", "col");
49  tr->Draw("BeamDetMWPCDigiY1.fWireNb:BeamDetMWPCDigiX1.fWireNb", "BeamDetMWPCDigiY1.fWireNb", "col");
50  c1->Update();
51 
52  c1->cd(3);
53 // tr->Draw("Length$(BeamDetMWPCDigiX1)", "Length$(BeamDetMWPCDigiX1)>0");
54 
55  c1->cd(4);
56 // tr->Draw("Length$(BeamDetMWPCDigiY1)", "Length$(BeamDetMWPCDigiY1)>0");
57 
59 // c2
61 
62  TCanvas *c2 = new TCanvas("c2", "MWPC projections", 1500, 1000);
63  c2->Divide(3,2);
64 
65  c2->cd(1);
66  tr->Draw("trigger", "");
67  tr->Draw("BeamDetMWPCDigiY1.fWireNb:BeamDetMWPCDigiX1.fWireNb", "trigger==2 && BeamDetMWPCDigiY1.fWireNb>0", "col");
68  c2->Update();
69 
70  c2->cd(4);
71  // tr->Draw("BeamDetMWPCDigiY1.fWireNb:BeamDetMWPCDigiX1.fWireNb", "Length$(BeamDetMWPCDigiX1)>0 && Length$(BeamDetMWPCDigiY1)>0", "col");
72  tr->Draw("BeamDetMWPCDigiY1.fWireNb:BeamDetMWPCDigiX1.fWireNb", "trigger==3 && BeamDetMWPCDigiY1.fWireNb>0", "col");
73  c2->Update();
74 
75 
76  c2->cd(2);
77  tr->Draw("BeamDetMWPCDigiY2.fWireNb:BeamDetMWPCDigiX2.fWireNb", "trigger==2 && BeamDetMWPCDigiY2.fWireNb>0", "col");
78  c2->Update();
79 
80  c2->cd(5);
81  tr->Draw("BeamDetMWPCDigiY2.fWireNb:BeamDetMWPCDigiX2.fWireNb", "trigger==3 && BeamDetMWPCDigiY2.fWireNb>0", "col");
82  c2->Update();
83 
84  c2->cd(3);
85  tr->Draw("fYt:fXt", "trigger==2 && fYt>-40. && fXt>-40.");
86  tr->SetMarkerColor(kRed);
87  tr->Draw("fYt:fXt", "trigger==2 && ( (fYt)^2 + (fXt)^2 ) < 8.^2", "same");
88  c2->Update();
89 
90  c2->cd(6);
91  tr->SetMarkerColor(kBlack);
92  tr->Draw("fYt:fXt", "trigger==3 && fYt>-40. && fXt>-40.");
93  tr->SetMarkerColor(kRed);
94  tr->Draw("fYt:fXt", "trigger==3 && ( (fYt-2)^2 + (fXt+3)^2 ) < 9.^2", "same");
95  c2->Update();
96 
97 }
98