forked from Shyam-Uniba/Shyam-Uniba
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmom_resol_tracker_general.C
176 lines (130 loc) · 6.59 KB
/
mom_resol_tracker_general.C
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
// Momentum resolution for charged particles; Assuming Parabolic fits
// Shyam Kumar
// shyam.kumar@cern.ch
#include<TMath.h>
#include <TString.h>
void MultipleScattering(Double_t mp, Double_t momI, Double_t &theta, Double_t effradlen);
// masses in MeV
Double_t mel = 0.51099891; // Mass of electron and positron
Double_t mmu = 105.6583715; // Mass of muons
Double_t mpi = 139.57018; // mass of charged pions
Double_t mk = 493.667; // mass of charged kaons
Double_t mp = 938.272046; // mass of protons and antiprotons
Double_t speed= 3.0e8; //speed of light
Int_t charge=1;
Double_t min_effradlen=0.013; // All Silicon Tracker
Double_t N = 9; // 3 Vtx + 2Barrel + 4Micromegas
Double_t resolution_silicon = 10*1.0e-6/sqrt(12); // pixel resolution in meter
Double_t resolution_micromegas = 150*1.0e-6; // pixel resolution in meter micormegas
Double_t resolution = (5.0*resolution_silicon+4.0*resolution_micromegas)/9.0; // pixel resolution in meter micormegas
Double_t min_length = 0.7747; // Radius of outer Barrel layer-first layer
Double_t magfield = 3.0; // Mag field Eic 3.0 T
Double_t eta = 0.0;
Double_t effradl_vtx = 3.0*0.0005; // Three Vertex layers
Double_t effradl_barrel = 2.0*0.0055; // Two Barrel layers
Double_t effradl_mm = 0.000047; // Micromegas layers
Double_t vtx[3] ={3.3,4.41,5.51};
Double_t Barr[2] = {13.38, 18.0};
Double_t MM[4] = {47.72, 49.57, 75.61, 77.47};
void mom_resol_tracker_general()
{
gStyle->SetTitleSize(0.04,"");
gStyle->SetTitleSize(0.04,"X");
gStyle->SetTitleSize(0.04,"Y");
gStyle->SetTitleOffset(1.05,"Y");
TCanvas *c1 = new TCanvas("c1", "c1",0,52,1400,1000);
c1->SetGridy();
c1->SetMargin(0.12, 0.01 ,0.10,0.07);
std::vector<Double_t> x,y,c,d,e,f;
std::vector<Double_t> mre,mrmu,mrpi,mrk,mrp;
// Formula used is sigmapT/pT = 2.0*sigma_c*pT/0.3*B
// sigma_c^2 = F0/(F0F4-F2^2)
Double_t F0 = 5.0/(resolution_silicon*resolution_silicon)+4.0/(resolution_micromegas*resolution_micromegas);
Double_t F2_Si = 1.0/(resolution_silicon*resolution_silicon)*(vtx[0]*vtx[0]+vtx[1]*vtx[1]+vtx[2]*vtx[2]+Barr[0]*Barr[0]+Barr[1]*Barr[1])*1.0e-4;
Double_t F2_MM = 1.0/(resolution_micromegas*resolution_micromegas)*(MM[0]*MM[0]+MM[1]*MM[1]+MM[2]*MM[2]+MM[3]*MM[3])*1.0e-4;
Double_t F2 = F2_Si+ F2_MM;
Double_t F4_Si = 1.0/(resolution_silicon*resolution_silicon)*(pow(vtx[0],4)+pow(vtx[1],4)+pow(vtx[2],4)+pow(Barr[0],4)+pow(Barr[1],4))*1.0e-8;
Double_t F4_MM = 1.0/(resolution_micromegas*resolution_micromegas)*(pow(MM[0],4)+pow(MM[1],4)+pow(MM[2],4)+pow(MM[3],4))*1.0e-8;
Double_t F4 = F4_Si+ F4_MM;
Double_t sigma_c = sqrt(F0/(F0*F4-F2*F2));
cout<<"Sigma C"<<2.0*sigma_c<<endl;
//--------Muon Bethe Bloch---------------------
for (Int_t pt=350; pt<=10000.;pt=pt+100)
{
x.push_back(pt*0.001);
Double_t p = pt*TMath::CosH(eta);
Double_t theta = 2.0*TMath::ATan(TMath::Exp(-1.0*eta));
Double_t sin_theta = fabs(TMath::Sin(theta));
Double_t length = fabs(min_length/sin_theta);
Double_t effradl_vtx_eta = fabs(effradl_vtx/sin_theta);
Double_t effradl_barrel_eta = fabs(effradl_barrel/sin_theta);
Double_t effradl_mm_eta = fabs(effradl_mm/sin_theta);
Double_t length_vtx = (Barr[0]-vtx[0])*0.01/sin_theta;
Double_t length_barr = (MM[0]-Barr[0])*0.01/sin_theta;
Double_t length_mm = (MM[3]-MM[0])*0.01/sin_theta;
//----Energy of incident particles----------
Double_t ms_pi_vtx=0., ms_pi_barr=0. , ms_pi_mm=0. ;
MultipleScattering(mpi,p,ms_pi_vtx,effradl_vtx_eta);
MultipleScattering(mpi,p,ms_pi_barr,effradl_barrel_eta);
MultipleScattering(mpi,p,ms_pi_mm,effradl_mm_eta);
// Length can be parameterize as a function of eta or theta
// Momentum (pT) measurement error due to multiple scattering
Double_t MSpi=100.*pt*0.001*TMath::Sqrt(720/(N+4))*((length_vtx*ms_pi_vtx/3)+(length_barr*ms_pi_barr/2)+(length_mm*ms_pi_mm/4))/(0.3*magfield*length*length);
// pT resolution due to curvature measurement B = 3.0T
// Double_t pi_pT_resol = 100.*pt*0.001*2.0*sigma_c/(0.3*magfield);
Double_t pi_pT_resol = 100.*pt*0.001*resolution*TMath::Sqrt(720/(N+4))/(0.3*magfield*length*length);
d.push_back(MSpi);
mrpi.push_back(pi_pT_resol);
}
//----------Pion----------------------------------
const Int_t n=x.size();
Double_t a[n], b[n], g[n],h[n];
for(Int_t i=0;i<n;i++)
{
a[i]=x[i];
b[i]=d[i];
g[i] = mrpi[i];
h[i] = TMath::Sqrt(b[i]*b[i]+g[i]*g[i]);
}
TGraph *gr1 = new TGraph(n,a,b);
gr1->SetLineColor(2);
gr1->GetYaxis()->SetRangeUser(0.0, 2.0);
gr1->SetLineWidth(1);
gr1->SetMarkerColor(2);
gr1->SetMarkerStyle(6);
gr1->SetTitle(Form("Transverse Momentum Resolution for #eta = %1.1f",eta));
gr1->GetXaxis()->SetTitle("p_{T} (GeV/c)");
gr1->GetXaxis()->CenterTitle(true);
gr1->GetYaxis()->SetTitle("#frac{#sigma_{p_{T}}}{p_{T}}"); // #sigma_{x} (cm)
gr1->GetYaxis()->CenterTitle(true);
gr1->Draw("ACP");
TGraph *gr2 = new TGraph(n,a,g);
gr2->SetLineWidth(1);
gr2->SetMarkerColor(kMagenta);
gr2->SetLineColor(kMagenta);
gr2->SetMarkerStyle(6);
gr2->Draw("same");
TGraph *gr1sumpi = new TGraph(n,a,h);
gr1sumpi->SetLineWidth(1);
gr1sumpi->SetMarkerColor(kBlack);
gr1sumpi->SetLineColor(kBlack);
gr1sumpi->SetMarkerStyle(6);
gr1sumpi-> SetLineStyle(9);
gr1sumpi->Draw("same");
//--------------Legend Draw----------------------
TLegend *leg_hist = new TLegend(0.65,0.7,0.99,0.93);
leg_hist->SetHeader("Particle in Silicon Tracker");
leg_hist->SetTextFont(42);
leg_hist->SetTextSize(0.04);
leg_hist->AddEntry(gr1,"p_{T} Resol. ( M.S.)","l");
leg_hist->AddEntry(gr2,"p_{T} Resol. (Sagitta)","l");
leg_hist->AddEntry(gr1sumpi,"Sum p_{T} Resol. (Pion)","l");
leg_hist->Draw();
// c1->SaveAs("Mom_resol.Pdf");
}
// This will return theta in radian
void MultipleScattering(Double_t mp, Double_t momI, Double_t &theta, Double_t effradlen){
Double_t En = TMath::Sqrt(mp*mp+momI*momI);
Double_t beta = momI/En;
theta=((13.6*charge)/(beta*momI))*(TMath::Sqrt(effradlen))*(1+0.038*TMath::Log(effradlen)); //*(1+0.038*TMath::Log(effradlen))
}