43 h->GetXaxis()->SetTitleOffset(1.3);
44 h->GetXaxis()->SetTitleColor(1);
45 h->GetXaxis()->SetTitleFont(42);
46 h->GetXaxis()->SetLabelSize(0.045);
47 h->GetXaxis()->SetTitleSize(0.045);
50 h->GetYaxis()->SetTitleOffset(offy);
51 h->GetYaxis()->SetTitleFont(42);
52 h->GetYaxis()->SetLabelSize(0.045);
53 h->GetYaxis()->SetTitleSize(0.045);
60 int trapmap_barrel(
double steps=100,
double phst=500,
double pmax=6.0,
double H=2,
double rd=0.48)
62 double mass[5]={0.000511,0.10566,0.13957,0.493677,0.938272};
71 TCanvas *
c1=
new TCanvas(
"c1",
"c1",800,600);
77 double Pi=3.141592653589793;
82 double thtmin=15,thtmax=150;
84 double thtsteps=steps;
88 double pbin=(pmax-pmin)/psteps;
89 double thtbin=(thtmax-thtmin)/thtsteps;
91 TH1F *hftht2=
new TH1F(
"hftht2",
"part total refl no curvature",(
int)thtsteps+1,thtmin-0.5*thtbin,thtmax+0.5*thtbin);
92 hftht2->SetLineColor(2);
98 sprintf(tmp,
"hacc%d",i);
99 hacc[
i]=
new TH2F(tmp,title[i],(
int)psteps+1,pmin-0.5*pbin,pmax+0.5*pbin,(
int)thtsteps+1,thtmin-0.5*thtbin,thtmax+0.5*thtbin);
100 hacc[
i]->SetMaximum(1);
104 double tht_tref=asin(1./n);
105 cout <<tht_tref/3.1416*180<<endl;
113 for (pid=0;pid<5;pid++){
114 cout <<
"pid="<<pid<<endl;
115 for (ip=0;ip<=psteps;ip++)
117 double p=pmin+ip*pbin;
119 double cthetac=
sqrt(mass[pid]*mass[pid]+p*p)/(p*
n);
121 if (cthetac<=1) thetac=
acos(cthetac);
127 for (
double itht=thtmin;itht<=thtmax;itht+=thtbin)
132 double phistsize=Pi*2/phisteps;
136 double pt = p*
sin(tht);
137 double r = pt/(0.3*H);
138 if (2*r<rd)
continue;
139 double alpha = asin(rd/(2*r));
141 for( phi=0;phi<2*
Pi;phi+=phistsize)
143 TVector3
v1(1,
sin(phi)*tan(thc),
cos(phi)*tan(thc));
151 double ang=v1.Angle(v2);
152 double ang2=v1.Angle(v3);
154 if (ang>Pi/2) ang=
fabs(ang-Pi);
155 if (ang2>Pi/2) ang2=
fabs(ang2-Pi);
157 if (ang>=tht_tref && ang2>=tht_tref) ++
count;
160 hacc[
pid]->Fill(p,itht,count/phisteps);
167 for (pid=0;pid<5;pid++)
170 hacc[
pid]->Draw(opt);
174 TFile *
f=
new TFile(
"trapfrac_barrel.root",
"recreate");
175 for (pid=0;pid<5;pid++)
friend F32vec4 acos(const F32vec4 &a)
friend F32vec4 cos(const F32vec4 &a)
friend F32vec4 sqrt(const F32vec4 &a)
friend F32vec4 sin(const F32vec4 &a)
TString pt(TString pts, TString exts="px py pz")
int trapmap_barrel(double steps=100, double phst=500, double pmax=6.0, double H=2, double rd=0.48)
void config_histo(TH1 *h, TString tx, TString ty)
TString tht(TString pts, TString exts="px py pz")
friend F32vec4 fabs(const F32vec4 &a)