LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
plotDend.C
Go to the documentation of this file.
1 // -------------------------------------------------------------------
2 // -------------------------------------------------------------------
3 //
4 // *********************************************************************
5 // To execute this macro under ROOT,
6 // launch ROOT (usually type 'root' at your machine's prompt)
7 // This macro needs Dend3DEdep.out file :
8 // *********************************************************************
9 {
10 gROOT->Reset();
11 gStyle->SetOptStat(0000);
12 
13 c1 = new TCanvas ("c1","",20,20,1200,600);
14 c1->Divide(2,1);
15 
16 Int_t ncols=0;
17 Int_t nlines = 0;
18 
19 FILE * fp = fopen("Dend3DEdep.out","r");
20 Float_t posX, posY, posZ ;
21 Float_t distB, distA, EdepR, DoseR;
22 Float_t distMaxA = -1e-9;
23 Float_t distMaxB = -1e-9;
24 Float_t edepMax = -1e-9;
25 Float_t doseMax = -1e-9;
26 Float_t edepMin = 1e9;
27 Float_t doseMin = 1e9;
28 
29 h1 = new TProfile("Energy", "Energy deposits (keV) in dendritic compartments",1000,-1000,1000,0.001,1000);
30 h2 = new TProfile("Dose", "Dose deposits (Gy) in dendritic compartments",1000,-1000,1000,0.001,1000);
31 while (1)
32  {
33  ncols = fscanf(fp," %f %f %f %f %f %f %f",&posX, &posY, &posZ, &distA, &distB, &EdepR, &DoseR);
34  if (ncols < 0) break;
35  if (distMaxA < distA ) distMaxA = distA ;
36  if (distMaxB < distB ) distMaxB = distB ;
37  if (edepMax < EdepR ) edepMax = EdepR ;
38  if (doseMax < DoseR ) doseMax = DoseR ;
39  if (edepMin > EdepR ) edepMin = EdepR ;
40  if (doseMin > DoseR ) doseMin = DoseR ;
41  // ....
42  h1->Fill(-distB, EdepR); // Basal dendrite
43  h1->Fill(distA, EdepR); // Apical dendrite
44  h2->Fill(-distB, DoseR);
45  h2->Fill(distA, DoseR);
46  nlines++;
47  }
48 fclose(fp);
49 cout << " Max and Min Energy deposits (keV) == " << edepMax << " ; "<< edepMin<<endl;
50 cout << " Max and Min Dose deposits (Gy) == " << doseMax << " ; "<< doseMin<<endl;
51 cout << " Maximum Basal Distance (um) == " << distMaxB << " "<<endl;
52 cout << " Maximum Apical Distance (um) == " << distMaxA << " "<<endl;
53 
54 c1->cd(1);
55 h1->Draw("P");
56 //gPad->SetLogy();
57 h1->SetMarkerSize(2);
58 h1->SetMarkerColor(4);
59 h1->SetMarkerStyle(27);
60 h1->SetFillStyle(3005);
61 //h1->GetYaxis()->SetTitle("Energy deposits in basal and apical dendrite (keV)");
62 h1->GetXaxis()->SetTitle("Distance from Soma (um)");
63 h1->GetYaxis()->SetRangeUser(edepMin, edepMax+3.);
64 if (distMaxB > 0.)
65 {
66  TLatex text(-distMaxB,edepMax-1.,"Basal");
67  text.DrawClone();
68 }
69 if (distMaxA > 0.)
70 {
71  TLatex text(distMaxA/3.,edepMax-2.,"Apical");
72  text.DrawClone();
73 }
74 h1->GetXaxis()->SetRangeUser(-distMaxB-10., distMaxA+10.);
75 //h1->Fit("gaus");
76 
77 c1->cd(2);
78 h2->Draw("P");
79 //gPad->SetLogy();
80 h2->SetMarkerSize(2);
81 h2->SetMarkerColor(kRed);
82 h2->SetMarkerStyle(27);
83 h2->SetFillStyle(3005);
84 //h2->GetYaxis()->SetTitle("Dose deposits in basal and apical dendrite (Gy)");
85 h2->GetXaxis()->SetTitle("Distance from Soma (um)");
86 h2->GetYaxis()->SetRangeUser(doseMin, doseMax+0.3);
87 if (distMaxB > 0.)
88 {
89  TLatex text(-distMaxB,doseMax-0.1,"Basal");
90  text.DrawClone();
91 }
92 if (distMaxA > 0.)
93 {
94  TLatex text(distMaxA/3.,doseMax-0.2,"Apical");
95  text.DrawClone();
96 }
97 h2->GetXaxis()->SetRangeUser(-distMaxB-10., distMaxA+10.);
98 
99 }
100 
Float_t posZ
Definition: plotDend.C:20
fclose(fp)
Float_t EdepR
Definition: plotDend.C:21
c1
Definition: plotDend.C:13
h1
Definition: plotDend.C:29
Float_t posY
Definition: plotDend.C:20
h2
Definition: plotDend.C:30
Int_t nlines
Definition: plotDend.C:17
Float_t edepMin
Definition: plotDend.C:26
Float_t doseMin
Definition: plotDend.C:27
Float_t DoseR
Definition: plotDend.C:21
Float_t distB
Definition: plotDend.C:21
FILE * fp
Definition: plotDend.C:19
Float_t distMaxA
Definition: plotDend.C:22
Int_t ncols
Definition: plotDend.C:16
Float_t distMaxB
Definition: plotDend.C:23
Float_t posX
Definition: plotDend.C:20
Float_t e
Definition: plot.C:35
Float_t doseMax
Definition: plotDend.C:25
Float_t distA
Definition: plotDend.C:21
Float_t edepMax
Definition: plotDend.C:24