plotDend.C
Go to the documentation of this file.
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 
17 Int_t ncols=0;
18 Int_t nlines = 0;
19 
20 FILE * fp = fopen("Dend3DEdep.out","r");
21 Float_t posX, posY, posZ ;
22 Float_t distB, distA, EdepR, DoseR;
23 Float_t distMaxA = -1e-9;
24 Float_t distMaxB = -1e-9;
25 Float_t edepMax = -1e-9;
26 Float_t doseMax = -1e-9;
27 Float_t edepMin = 1e9;
28 Float_t doseMin = 1e9;
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
fclose(fp)
enum BeamMode kRed
Float_t EdepR
Definition: plotDend.C:22
c1
Definition: plotDend.C:14
h1
Definition: plotDend.C:30
Float_t posY
Definition: plotDend.C:21
h2
Definition: plotDend.C:31
Int_t nlines
Definition: plotDend.C:18
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
Definition: plotDend.C:20
Float_t distMaxA
Definition: plotDend.C:23
OStream cout
Definition: OStream.cxx:6
Int_t ncols
Definition: plotDend.C:17
Float_t distMaxB
Definition: plotDend.C:24
Float_t posX
Definition: plotDend.C:21
Float_t e
Definition: plot.C:35
Float_t doseMax
Definition: plotDend.C:26
Float_t distA
Definition: plotDend.C:22
Float_t edepMax
Definition: plotDend.C:25