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] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

Diff markup

Differences between /examples/extended/medical/dna/AuNP/plot.C (Version 11.3.0) and /examples/extended/medical/dna/AuNP/plot.C (Version 8.1.p1)


  1                                                     1 
  2 void BinLogX(TH1* h)                              
  3 {                                                 
  4         TAxis *axis = h->GetXaxis();              
  5         int bins = axis->GetNbins();              
  6                                                   
  7         Axis_t from      = axis->GetXmin();       
  8         Axis_t to        = axis->GetXmax();       
  9         Axis_t width     = (to - from) / bins;    
 10         Axis_t *new_bins = new Axis_t[bins + 1    
 11                                                   
 12         for (int i = 0; i <= bins; i++) {         
 13                 new_bins[i] = TMath::Power(10,    
 14         }                                         
 15         axis->Set(bins, new_bins);                
 16         delete []new_bins;                        
 17 }                                                 
 18                                                   
 19                                                   
 20 void plot(){                                      
 21                                                   
 22         double dens = 1000;//kg/m3                
 23                                                   
 24         double R =50;                             
 25                                                   
 26         //TFile *fin           = new TFile("Au    
 27         TFile *fin           = new TFile("AuNP    
 28         TH1F *h1neve         = (TH1F*)fin->Get    
 29         TH1F *h1Edep         = (TH1F*)fin->Get    
 30         TH1F *h1secnp_cha    = (TH1F*)fin->Get    
 31         TH1F *h1secnp_nut    = (TH1F*)fin->Get    
 32         TH1F *h1secnpsurf_cha= (TH1F*)fin->Get    
 33         TH1F *h1secnpsurf_nut= (TH1F*)fin->Get    
 34         TH1F *h1sec_cha      = (TH1F*)fin->Get    
 35         TH1F *h1sec_nut      = (TH1F*)fin->Get    
 36         TH1F *h1chem_0       = (TH1F*)fin->Get    
 37         TH1F *h1chem_1       = (TH1F*)fin->Get    
 38         TH1F *h1chem_2       = (TH1F*)fin->Get    
 39         TH1F *h1chem_3       = (TH1F*)fin->Get    
 40         TH1F *h1chem_4       = (TH1F*)fin->Get    
 41         TH1F *h1chem_5       = (TH1F*)fin->Get    
 42         TH1F *h1chem_6       = (TH1F*)fin->Get    
 43         TH1F *h1chem_7       = (TH1F*)fin->Get    
 44                                                   
 45         TH2F *h2Edep         = (TH2F*)fin->Get    
 46         TH2F *h2sec2_cha     = (TH2F*)fin->Get    
 47         TH2F *h2sec2_nut     = (TH2F*)fin->Get    
 48                                                   
 49         double neve = h1neve->GetBinContent(1)    
 50         h1Edep         ->Scale(1./neve);          
 51         h1secnp_cha    ->Scale(1./neve);          
 52         h1secnp_nut    ->Scale(1./neve);          
 53         h1secnpsurf_cha->Scale(1./neve);          
 54         h1secnpsurf_nut->Scale(1./neve);          
 55         h1sec_cha      ->Scale(1./neve);          
 56         h1sec_nut      ->Scale(1./neve);          
 57         h1chem_0       ->Scale(1./neve);          
 58         h1chem_1       ->Scale(1./neve);          
 59         h1chem_2       ->Scale(1./neve);          
 60         h1chem_3       ->Scale(1./neve);          
 61         h1chem_4       ->Scale(1./neve);          
 62         h1chem_5       ->Scale(1./neve);          
 63         h1chem_6       ->Scale(1./neve);          
 64         h1chem_7       ->Scale(1./neve);          
 65         h2Edep         ->Scale(1./neve);          
 66         h2sec2_cha     ->Scale(1./neve);          
 67         h2sec2_nut     ->Scale(1./neve);          
 68                                                   
 69         double val_cha=0;                         
 70         double err_cha=0;                         
 71         double val_nut=0;                         
 72         double err_nut=0;                         
 73                                                   
 74         int NR = h1sec_cha  -> GetNbinsX();       
 75         TH1D *h1sec_tot = new TH1D("h1Sec_tot"    
 76         BinLogX(h1sec_tot);                       
 77         for(int i=0;i<NR;i++){                    
 78                 val_cha = h1sec_cha->GetBinCon    
 79                 err_cha = h1sec_cha->GetBinErr    
 80                 val_nut = h1sec_nut->GetBinCon    
 81                 err_nut = h1sec_nut->GetBinErr    
 82                 //val_cha = h1sec_cha->GetBinC    
 83                 //err_cha = h1sec_cha->GetBinE    
 84                 //val_nut = h1sec_nut->GetBinC    
 85                 //err_nut = h1sec_nut->GetBinE    
 86                 h1sec_cha  -> SetBinContent(i+    
 87                 h1sec_cha  -> SetBinError  (i+    
 88                 h1sec_nut  -> SetBinContent(i+    
 89                 h1sec_nut  -> SetBinError  (i+    
 90                 h1sec_tot  -> SetBinContent(i+    
 91                 h1sec_tot  -> SetBinError  (i+    
 92         }                                         
 93                                                   
 94         TH1D *h1chem_tot = new TH1D("h1Chem_to    
 95         BinLogX(h1chem_tot);                      
 96         for(int i=0;i<NR;i++){                    
 97                 double val_0 = h1chem_0->GetBi    
 98                 double val_1 = h1chem_1->GetBi    
 99                 double val_2 = h1chem_2->GetBi    
100                 double val_3 = h1chem_3->GetBi    
101                 double val_4 = h1chem_4->GetBi    
102                 double val_5 = h1chem_5->GetBi    
103                 double val_6 = h1chem_6->GetBi    
104                 double val_7 = h1chem_7->GetBi    
105                 double err_0 = h1chem_0->GetBi    
106                 double err_1 = h1chem_1->GetBi    
107                 double err_2 = h1chem_2->GetBi    
108                 double err_3 = h1chem_3->GetBi    
109                 double err_4 = h1chem_4->GetBi    
110                 double err_5 = h1chem_5->GetBi    
111                 double err_6 = h1chem_6->GetBi    
112                 double err_7 = h1chem_7->GetBi    
113                 h1chem_tot  -> SetBinContent(i    
114                 h1chem_tot  -> SetBinError  (i    
115         }                                         
116                                                   
117                                                   
118         NR = h1secnp_cha -> GetNbinsX();          
119         TH1D *h1secnp_tot     = new TH1D("h1Se    
120         BinLogX(h1secnp_tot);                     
121         NR = h1secnpsurf_cha -> GetNbinsX();      
122         TH1D *h1secnpsurf_tot = new TH1D("h1Se    
123         BinLogX(h1secnpsurf_tot);                 
124         for(int i=0;i<NR;i++){                    
125                 val_cha = h1secnp_cha->GetBinC    
126                 err_cha = h1secnp_cha->GetBinE    
127                 val_nut = h1secnp_nut->GetBinC    
128                 err_nut = h1secnp_nut->GetBinE    
129                 //val_cha = h1secnp_cha->GetBi    
130                 //err_cha = h1secnp_cha->GetBi    
131                 //val_nut = h1secnp_nut->GetBi    
132                 //err_nut = h1secnp_nut->GetBi    
133                 h1secnp_cha -> SetBinContent(i    
134                 h1secnp_cha -> SetBinError  (i    
135                 h1secnp_nut -> SetBinContent(i    
136                 h1secnp_nut -> SetBinError  (i    
137                 h1secnp_tot -> SetBinContent(i    
138                 h1secnp_tot -> SetBinError  (i    
139                                                   
140                                                   
141                 val_cha = h1secnpsurf_cha->Get    
142                 err_cha = h1secnpsurf_cha->Get    
143                 val_nut = h1secnpsurf_nut->Get    
144                 err_nut = h1secnpsurf_nut->Get    
145                 //val_cha = h1secnpsurf_cha->G    
146                 //err_cha = h1secnpsurf_cha->G    
147                 //val_nut = h1secnpsurf_nut->G    
148                 //err_nut = h1secnpsurf_nut->G    
149                 h1secnpsurf_cha -> SetBinConte    
150                 h1secnpsurf_cha -> SetBinError    
151                 h1secnpsurf_nut -> SetBinConte    
152                 h1secnpsurf_nut -> SetBinError    
153                 h1secnpsurf_tot -> SetBinConte    
154                 h1secnpsurf_tot -> SetBinError    
155                                                   
156         }                                         
157                                                   
158         NR = h1Edep  -> GetNbinsX();              
159         for(int i=0;i<NR;i++){                    
160                 double rmax = h1Edep->GetXaxis    
161                 double rmin = h1Edep->GetXaxis    
162                 double vol  = 4./3.*TMath::Pi(    
163                 double mass = dens*vol;           
164                 h1Edep  -> SetBinContent(i+1,h    
165                 h1Edep  -> SetBinError  (i+1,h    
166         }                                         
167                                                   
168                                                   
169         int Nazm =h2Edep->GetXaxis()->GetNbins    
170         NR   =h2Edep->GetYaxis()->GetNbins()-1    
171         double    Rmax =h2Edep->GetYaxis()->Ge    
172         TH2D *h2Edep_pol = new TH2D("h2Edep_po    
173         for(int i=0;i<Nazm;i++){                  
174                 for(int j=0;j<NR;j++){            
175                         double height = 10*1.E    
176                         double rmax = h2Edep_p    
177                         double rmin = h2Edep_p    
178                         double vol  = (TMath::    
179                         double mass = dens*vol    
180                         h2Edep_pol->SetBinCont    
181                 }                                 
182         }                                         
183         int NRX = h2sec2_cha->GetXaxis()->GetN    
184         int NRY = h2sec2_cha->GetYaxis()->GetN    
185         TH2D *h2sec2_tot = (TH2D*)h2sec2_cha->    
186         for(int i=0;i<NRX;i++){                   
187                 for(int j=0;j<NRY;j++){           
188                         val_cha = h2sec2_cha->    
189                         val_nut = h2sec2_nut->    
190                         h2sec2_tot->SetBinCont    
191                 }                                 
192         }                                         
193                                                   
194                                                   
195                                                   
196                                                   
197                                                   
198                                                   
199                                                   
200         TCanvas *cedep = new TCanvas("cedep","    
201         cedep->cd(1)->SetTheta(90);               
202         cedep->cd(1)->SetPhi(0);                  
203         cedep->cd(1)->SetLogz();                  
204         h2Edep_pol->RebinX(6);                    
205         h2Edep_pol->RebinY(10);                   
206         //h2Edep_pol->SetAxisRange(0,1000,"Y")    
207         h2Edep_pol->SetAxisRange(0,150,"Y");      
208         h2Edep_pol->SetTitle("");                 
209         h2Edep_pol->SetXTitle("Angle [deg]");     
210         h2Edep_pol->Draw("surf1POL");             
211                                                   
212         TCanvas *cedepsec = new TCanvas("cedep    
213         cedepsec->Divide(2,1);                    
214         cedepsec->cd(1)->SetLogy();               
215         cedepsec->cd(1)->SetLogx();               
216         h1Edep->SetYTitle("Energy Deposite [Gy    
217         h1Edep->SetXTitle("Distance from NP ce    
218         h1Edep->SetMaximum(100);                  
219         h1Edep->SetMinimum(0.0000000001);         
220         h1Edep->SetAxisRange(0,1000000);          
221         h1Edep->Draw();                           
222         cedepsec->cd(2)->SetLogy();               
223         cedepsec->cd(2)->SetLogx();               
224         h1sec_tot->SetLineColor(kBlack);          
225         h1sec_cha->SetLineColor(kRed);            
226         h1sec_nut->SetLineColor(kBlue);           
227         h1sec_tot->SetMarkerColor(kBlack);        
228         h1sec_cha->SetMarkerColor(kRed);          
229         h1sec_nut->SetMarkerColor(kBlue);         
230         h1sec_tot->SetAxisRange(0,1000000);       
231         h1sec_tot->SetMaximum(10);                
232         h1sec_tot->SetMinimum(0.000001);          
233         h1sec_tot->SetTitle ("Number of Genera    
234         h1sec_tot->SetYTitle("N/nm/event");       
235         h1sec_tot->SetXTitle("Distance from NP    
236         //h1sec_cha->Draw("sameL");               
237         //h1sec_nut->Draw("sameL");               
238         h1sec_tot->Draw();                        
239         //cedepsec->cd(3)->SetLogy();             
240         //cedepsec->cd(3)->SetLogx();             
241         //h1chem_tot->SetLineColor  (kBlack);     
242         //h1chem_tot->SetMarkerColor(kBlack);     
243         //h1chem_tot->SetAxisRange(0,1000000);    
244         //h1chem_tot->SetMaximum(10);             
245         //h1chem_tot->SetMinimum(0.000001);       
246         //h1chem_tot->SetTitle ("Number of Gen    
247         //h1chem_tot->SetYTitle("N/nm/event");    
248         //h1chem_tot->SetXTitle("Distance from    
249         //h1chem_tot->Draw();                     
250                                                   
251                                                   
252         TCanvas *csec = new TCanvas("csec","cs    
253         csec->Divide(3,1);                        
254         csec->cd(1)->SetLogx();                   
255         csec->cd(1)->SetLogy();                   
256         h1secnp_tot->SetLineColor(kBlack);        
257         h1secnp_cha->SetLineColor(kRed);          
258         h1secnp_nut->SetLineColor(kBlue);         
259         h1secnp_tot->SetMarkerColor(kBlack);      
260         h1secnp_cha->SetMarkerColor(kRed);        
261         h1secnp_nut->SetMarkerColor(kBlue);       
262         h1secnp_tot->RebinX(10);                  
263         h1secnp_tot->Scale(1./10.);               
264         h1secnp_tot->SetMaximum(20);              
265         h1secnp_tot->SetMinimum(0.000000001);     
266         h1secnp_tot->SetAxisRange(1,1.E6);        
267         h1secnp_tot->SetTitle ("Secondary Ener    
268         h1secnp_tot->SetYTitle("N/event");        
269         h1secnp_tot->SetXTitle("Secandary Ener    
270         //h1secnp_cha->DrawCopy();                
271         //h1secnp_nut->DrawCopy("same");          
272         h1secnp_tot->DrawCopy();                  
273         csec->cd(2)->SetLogx();                   
274         csec->cd(2)->SetLogy();                   
275         h1secnpsurf_tot->SetLineColor(kBlack);    
276         h1secnpsurf_cha->SetLineColor(kRed);      
277         h1secnpsurf_nut->SetLineColor(kBlue);     
278         h1secnpsurf_tot->SetMarkerColor(kBlack    
279         h1secnpsurf_cha->SetMarkerColor(kRed);    
280         h1secnpsurf_nut->SetMarkerColor(kBlue)    
281         h1secnpsurf_tot->RebinX(10);              
282         h1secnpsurf_tot->Scale(1./10.);           
283         h1secnpsurf_tot->SetMaximum(20);          
284         h1secnpsurf_tot->SetMinimum(0.00000000    
285         h1secnpsurf_tot->SetAxisRange(1,1.E6);    
286         h1secnpsurf_tot->SetTitle ("Secondary     
287         h1secnpsurf_tot->SetYTitle("N/event");    
288         h1secnpsurf_tot->SetXTitle("Secandary     
289         //h1secnpsurf_cha->DrawCopy();            
290         //h1secnpsurf_nut->DrawCopy("same");      
291         h1secnpsurf_tot->DrawCopy();              
292         csec->cd(3)->SetLogy();                   
293         h2sec2_tot->SetTitle ("Secondary Energ    
294         h2sec2_tot->SetYTitle("Secondary Energ    
295         h2sec2_tot->SetXTitle("Distance from N    
296         h2sec2_tot->GetXaxis()->SetRange(0,100    
297         h2sec2_tot->Draw("colz");                 
298                                                   
299 }                                                 
300                                                   
301