Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
plotDend.C
이 파일의 문서화 페이지로 가기
1 // -------------------------------------------------------------------
2 // $Id: plotDend.C $
3 // -------------------------------------------------------------------
4 //
5 // *********************************************************************
6 // To execute this macro under ROOT,
7 // launch ROOT (usually type 'root' at your machine's prompt)
8 // This macro needs Dend3DEdep.out file :
9 // *********************************************************************
10 {
11 gROOT->Reset();
12 gStyle->SetOptStat(0000);
13 
14 c1 = new TCanvas ("c1","",20,20,1200,600);
15 c1->Divide(2,1);
16 
19 
20 FILE * fp = fopen("Dend3DEdep.out","r");
29 
30 h1 = new TProfile("Energy", "Energy deposits (keV) in dendritic compartments",1000,-1000,1000,0.001,1000);
31 h2 = new TProfile("Dose", "Dose deposits (Gy) in dendritic compartments",1000,-1000,1000,0.001,1000);
32 while (1)
33  {
34  ncols = fscanf(fp," %f %f %f %f %f %f %f",&posX, &posY, &posZ, &distA, &distB, &EdepR, &DoseR);
35  if (ncols < 0) break;
36  if (distMaxA < distA ) distMaxA = distA ;
37  if (distMaxB < distB ) distMaxB = distB ;
38  if (edepMax < EdepR ) edepMax = EdepR ;
39  if (doseMax < DoseR ) doseMax = DoseR ;
40  if (edepMin > EdepR ) edepMin = EdepR ;
41  if (doseMin > DoseR ) doseMin = DoseR ;
42  // ....
43  h1->Fill(-distB, EdepR); // Basal dendrite
44  h1->Fill(distA, EdepR); // Apical dendrite
45  h2->Fill(-distB, DoseR);
46  h2->Fill(distA, DoseR);
47  nlines++;
48  }
49 fclose(fp);
50 cout << " Max and Min Energy deposits (keV) == " << edepMax << " ; "<< edepMin<<endl;
51 cout << " Max and Min Dose deposits (Gy) == " << doseMax << " ; "<< doseMin<<endl;
52 cout << " Maximum Basal Distance (um) == " << distMaxB << " "<<endl;
53 cout << " Maximum Apical Distance (um) == " << distMaxA << " "<<endl;
54 
55 c1->cd(1);
56 h1->Draw("P");
57 //gPad->SetLogy();
58 h1->SetMarkerSize(2);
59 h1->SetMarkerColor(4);
60 h1->SetMarkerStyle(27);
61 h1->SetFillStyle(3005);
62 //h1->GetYaxis()->SetTitle("Energy deposits in basal and apical dendrite (keV)");
63 h1->GetXaxis()->SetTitle("Distance from Soma (um)");
64 h1->GetYaxis()->SetRangeUser(edepMin, edepMax+3.);
65 if (distMaxB > 0.)
66 {
67  TLatex text(-distMaxB,edepMax-1.,"Basal");
68  text.DrawClone();
69 }
70 if (distMaxA > 0.)
71 {
72  TLatex text(distMaxA/3.,edepMax-2.,"Apical");
73  text.DrawClone();
74 }
75 h1->GetXaxis()->SetRangeUser(-distMaxB-10., distMaxA+10.);
76 //h1->Fit("gaus");
77 
78 c1->cd(2);
79 h2->Draw("P");
80 //gPad->SetLogy();
81 h2->SetMarkerSize(2);
82 h2->SetMarkerColor(kRed);
83 h2->SetMarkerStyle(27);
84 h2->SetFillStyle(3005);
85 //h2->GetYaxis()->SetTitle("Dose deposits in basal and apical dendrite (Gy)");
86 h2->GetXaxis()->SetTitle("Distance from Soma (um)");
87 h2->GetYaxis()->SetRangeUser(doseMin, doseMax+0.3);
88 if (distMaxB > 0.)
89 {
90  TLatex text(-distMaxB,doseMax-0.1,"Basal");
91  text.DrawClone();
92 }
93 if (distMaxA > 0.)
94 {
95  TLatex text(distMaxA/3.,doseMax-0.2,"Apical");
96  text.DrawClone();
97 }
98 h2->GetXaxis()->SetRangeUser(-distMaxB-10., distMaxA+10.);
99 
100 }
101 
Float_t posZ
Definition: plotDend.C:21
Float_t EdepR
Definition: plotDend.C:22
Float_t posY
Definition: plotDend.C:21
nlines
G4float Float_t
fclose(fg1)
G4int Int_t
Float_t edepMin
Definition: plotDend.C:27
Float_t doseMin
Definition: plotDend.C:28
Float_t DoseR
Definition: plotDend.C:22
Float_t distB
Definition: plotDend.C:22
FILE * fp
Float_t distMaxA
Definition: plotDend.C:23
TH1F * h2
TH1F * h1
Float_t distMaxB
Definition: plotDend.C:24
Float_t posX
Definition: plotDend.C:21
Float_t doseMax
Definition: plotDend.C:26
Float_t distA
Definition: plotDend.C:22
Int_t ncols
Float_t edepMax
Definition: plotDend.C:25