ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/HFmon2012/macros/plotHit.C
Revision: 1.1
Committed: Mon Aug 13 14:57:42 2012 UTC (12 years, 8 months ago) by yilmaz
Content type: text/plain
Branch: MAIN
CVS Tags: HEAD
Log Message:
update analysis

File Contents

# Content
1 #include <string>
2 #include <vector>
3 #include <iostream>
4 #include <map>
5 #include <utility>
6
7 #include "HistogramManager.h"
8 #include "Map.h"
9
10 #include "TNtuple.h"
11 #include "TRandom.h"
12
13 #include "TTree.h"
14 #include "TFile.h"
15 #include "TH1I.h"
16 #include "TH1F.h"
17 #include "TH2F.h"
18 #include "TProfile.h"
19 #include "TString.h"
20 #include "TMath.h"
21 #include "TF1.h"
22 #include "TString.h"
23 #include "TCanvas.h"
24 #include "TCut.h"
25
26 #include <fstream>
27 #include <vector>
28 #include <iomanip>
29 #include <iostream>
30
31 #include "Laser.h"
32
33 using namespace std;
34
35 void plotHit(int id = 0, double r = 0.5, double w = 0.15, double n = 0.5, double phase = 0.2){
36
37
38 TH1D* h = new TH1D("h",";Time Slice;Charge #times Arbitrary constant",10,0,10);
39 h->GetXaxis()->CenterTitle();
40 h->GetYaxis()->CenterTitle();
41
42 Laser *laz = new Laser(r, w, n);
43
44 TCanvas* c1 = new TCanvas("c1","c1",400,400);
45
46 laz->fillHit(h,phase);
47
48 double s1 = 0., s2 = 0., s0 = 0, s3 = 0;
49 int its = 0;
50 findPeak(h,s0,s1,s2,s3,its);
51
52 double integral = h->Integral();
53 double wing = (integral-(s1+s2))/integral;
54
55 TLegend* leg = new TLegend(0.6,0.5,0.7,0.9);
56 leg->SetFillColor(0);
57 leg->SetBorderSize(0);
58 leg->SetFillStyle(0);
59 leg->SetTextFont(43);
60 leg->SetTextSize(13);
61 leg->AddEntry(h,Form("input R = %2f",r),"");
62 leg->AddEntry(h,Form("input W = %2f",w),"");
63 leg->AddEntry(h,Form("phase/25ns = %0.1f",phase),"");
64 leg->AddEntry(h,Form("Leakage = %d%s",(int)(100.*wing),"%"),"");
65 leg->Draw();
66
67 c1->Print(Form("SimulatedRaddamSignal_%02d.gif",id));
68
69 TCanvas* c2 = new TCanvas("c2","c2",400,400);
70 laz->Draw();
71
72 leg->AddEntry(laz->f1,"First Reflection");
73 leg->AddEntry(laz->f2,"Second Reflection");
74 leg->AddEntry(laz->fLaser,"Total Signal");
75
76 leg->Draw();
77 c2->Print(Form("SimulatedRaddamHit_%02d.gif",id));
78
79
80 }
81
82
83