Import Geant4 9.4.0 source tree
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
{
|
||||
// Use this macro for the visualisation of coefficient computation
|
||||
|
||||
gROOT->Reset();
|
||||
gROOT->SetStyle("Plain");
|
||||
|
||||
@@ -8,130 +10,51 @@
|
||||
c1 = new TCanvas ("c1","",200,10,800,800);
|
||||
c1.Divide(2,2);
|
||||
|
||||
Float_t x,y,z,theta,phi,nrj;
|
||||
Int_t ncols;
|
||||
TFile f("nanobeam.root");
|
||||
|
||||
FILE *fp1 = fopen("./results/profile.txt","r");
|
||||
if (fp1==0) goto jump1;
|
||||
TNtuple* ntuple0;
|
||||
ntuple0 = (TNtuple*)f->Get("ntuple0");
|
||||
|
||||
TNtuple *ntuple1 = new TNtuple("ntuple1","file1","x:y:z");
|
||||
while (1)
|
||||
{
|
||||
ncols = fscanf(fp1,"%f %f %f",&x, &y, &z);
|
||||
if (ncols < 0) break;
|
||||
ntuple1->Fill(x/1000,y/1000,z/1000);
|
||||
}
|
||||
fclose(fp1);
|
||||
|
||||
c1.cd(1);
|
||||
ntuple1->SetMarkerSize(.2);
|
||||
ntuple1->SetMarkerColor(2);
|
||||
ntuple1->SetMarkerStyle(20);
|
||||
ntuple1->Draw("x:y:z","");
|
||||
htemp->GetXaxis()->SetLabelSize(0.025);
|
||||
htemp->GetYaxis()->SetLabelSize(0.025);
|
||||
htemp->GetZaxis()->SetLabelSize(0.025);
|
||||
htemp->GetXaxis()->SetTitleSize(0.035);
|
||||
htemp->GetYaxis()->SetTitleSize(0.035);
|
||||
htemp->GetZaxis()->SetTitleSize(0.035);
|
||||
htemp->GetXaxis()->SetTitleOffset(1.4);
|
||||
htemp->GetYaxis()->SetTitleOffset(1.4);
|
||||
htemp->GetZaxis()->SetTitleOffset(1.4);
|
||||
htemp->GetXaxis()->SetTitle("Z (m)");
|
||||
htemp->GetYaxis()->SetTitle("X (mm)");
|
||||
htemp->GetZaxis()->SetTitle("Y (mm)");
|
||||
htemp->SetTitle("Nanobeam profile");
|
||||
ntuple0->SetMarkerSize(.2);
|
||||
ntuple0->SetMarkerColor(2);
|
||||
ntuple0->SetMarkerStyle(20);
|
||||
ntuple0->Draw("xIn:yIn:zIn","");
|
||||
|
||||
jump1:
|
||||
|
||||
FILE *fp1 = fopen("./results/x.txt","r");
|
||||
if (fp1==0) goto jump2;
|
||||
FILE *fp2 = fopen("./results/y.txt","r");
|
||||
FILE *fp3 = fopen("./results/theta.txt","r");
|
||||
FILE *fp4 = fopen("./results/phi.txt","r");
|
||||
TNtuple *ntuple2 = new TNtuple("ntuple2","file2","x:y:theta:phi");
|
||||
while (1)
|
||||
{
|
||||
ncols = fscanf(fp1,"%f",&x);
|
||||
if (ncols < 0) break;
|
||||
ncols = fscanf(fp2,"%f",&y);
|
||||
ncols = fscanf(fp3,"%f",&theta);
|
||||
ncols = fscanf(fp4,"%f",&phi);
|
||||
ntuple2->Fill(x,y,theta,phi);
|
||||
}
|
||||
fclose(fp1);
|
||||
fclose(fp2);
|
||||
fclose(fp3);
|
||||
fclose(fp4);
|
||||
|
||||
c1.cd(2);
|
||||
c1.cd(2);
|
||||
TNtuple* ntuple2;
|
||||
ntuple2 = (TNtuple*)f->Get("ntuple2");
|
||||
gStyle->SetPalette(1);
|
||||
ntuple2->SetMarkerColor(2);
|
||||
ntuple2->SetMarkerStyle(20);
|
||||
gPad->SetLogz();
|
||||
ntuple2->Draw("y:x","","hcolz");
|
||||
htemp->GetXaxis()->SetLabelSize(0.025);
|
||||
htemp->GetYaxis()->SetLabelSize(0.025);
|
||||
htemp->GetXaxis()->SetTitleSize(0.035);
|
||||
htemp->GetYaxis()->SetTitleSize(0.035);
|
||||
htemp->GetXaxis()->SetTitleOffset(1.4);
|
||||
htemp->GetYaxis()->SetTitleOffset(1.4);
|
||||
htemp->GetXaxis()->SetTitle("X (micrometer)");
|
||||
htemp->GetYaxis()->SetTitle("Y (micrometer)");
|
||||
htemp->SetTitle("Nanobeam image");
|
||||
ntuple2->Draw("yIn:xIn","","hcolz");
|
||||
|
||||
c1.cd(3);
|
||||
gStyle->SetPalette(1);
|
||||
ntuple2->SetMarkerColor(4);
|
||||
ntuple2->SetMarkerStyle(20);
|
||||
gPad->SetLogz();
|
||||
ntuple2->Draw("theta:x","","hcolz");
|
||||
htemp->GetXaxis()->SetLabelSize(0.025);
|
||||
htemp->GetYaxis()->SetLabelSize(0.025);
|
||||
htemp->GetXaxis()->SetTitleSize(0.035);
|
||||
htemp->GetYaxis()->SetTitleSize(0.035);
|
||||
htemp->GetXaxis()->SetTitleOffset(1.4);
|
||||
htemp->GetYaxis()->SetTitleOffset(1.4);
|
||||
htemp->GetXaxis()->SetTitle("X (micrometer)");
|
||||
htemp->GetYaxis()->SetTitle("THETA (mrad)");
|
||||
htemp->SetTitle("Nanobeam image emittance (X,THETA)");
|
||||
ntuple2->Draw("thetaIn:xIn","","hcolz");
|
||||
|
||||
c1.cd(4);
|
||||
gStyle->SetPalette(1);
|
||||
ntuple2->SetMarkerColor(4);
|
||||
ntuple2->SetMarkerStyle(20);
|
||||
gPad->SetLogz();
|
||||
ntuple2->Draw("phi:y","","hcolz");
|
||||
htemp->GetXaxis()->SetLabelSize(0.025);
|
||||
htemp->GetYaxis()->SetLabelSize(0.025);
|
||||
htemp->GetXaxis()->SetTitleSize(0.035);
|
||||
htemp->GetYaxis()->SetTitleSize(0.035);
|
||||
htemp->GetXaxis()->SetTitleOffset(1.4);
|
||||
htemp->GetYaxis()->SetTitleOffset(1.4);
|
||||
htemp->GetXaxis()->SetTitle("Y (micrometer)");
|
||||
htemp->GetYaxis()->SetTitle("PHI (mrad)");
|
||||
htemp->SetTitle("Nanobeam image emittance (Y,PHI)");
|
||||
ntuple2->Draw("phiIn:yIn","","hcolz");
|
||||
|
||||
jump2:
|
||||
FILE *fp3 = fopen("./results/grid.txt","r");
|
||||
if (fp3==0) goto jump3;
|
||||
|
||||
TNtuple *ntuple3 = new TNtuple("ntuple3","file3","x:y:nrj");
|
||||
while (1)
|
||||
{
|
||||
ncols = fscanf(fp3,"%f %f %f",&x, &y, &nrj);
|
||||
if (ncols < 0) break;
|
||||
ntuple3->Fill(x/1000,y/1000,nrj);
|
||||
}
|
||||
fclose(fp3);
|
||||
|
||||
/*
|
||||
c1.cd(1);
|
||||
gStyle->SetPalette(1);
|
||||
ntuple3->SetMarkerSize(.2);
|
||||
ntuple3->SetMarkerColor(2);
|
||||
ntuple3->SetMarkerStyle(20);
|
||||
TNtuple* ntuple1;
|
||||
ntuple1 = (TNtuple*)f->Get("ntuple1");
|
||||
ntuple1->SetMarkerSize(.2);
|
||||
ntuple1->SetMarkerColor(2);
|
||||
ntuple1->SetMarkerStyle(20);
|
||||
gPad->SetLogz();
|
||||
ntuple3->Draw("y:x","","hcolz");
|
||||
ntuple1->Draw("yIn:xIn","","hcolz");
|
||||
htemp->GetXaxis()->SetLabelSize(0.025);
|
||||
htemp->GetYaxis()->SetLabelSize(0.025);
|
||||
htemp->GetXaxis()->SetTitleSize(0.035);
|
||||
@@ -141,6 +64,5 @@ jump2:
|
||||
htemp->GetXaxis()->SetTitle("X (mm)");
|
||||
htemp->GetYaxis()->SetTitle("Y (mm)");
|
||||
htemp->SetTitle("Grid shadow");
|
||||
|
||||
jump3:
|
||||
*/
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user