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5 ] [ 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/pdb4dna/analysis.C (Version 11.3.0) and /examples/extended/medical/dna/pdb4dna/analysis.C (Version 10.7.p2)


  1 // -------------------------------------------      1 // -------------------------------------------------------------------
  2 // -------------------------------------------      2 // -------------------------------------------------------------------
  3                                                     3 
  4 // This macro requires the pdb4dna_output.root      4 // This macro requires the pdb4dna_output.root file generated from PDB4DNA example
  5                                                     5 
  6 {                                                   6 {
  7   gROOT->Reset();                                   7   gROOT->Reset();
  8                                                     8  
  9   gStyle->SetOptStat("em");                         9   gStyle->SetOptStat("em");
 10                                                    10 
 11   TCanvas *c1;                                     11   TCanvas *c1;
 12   TPad *pad1, *pad2, *pad3;                        12   TPad *pad1, *pad2, *pad3;
 13   c1 = new TCanvas("c1","PDB DNA outputs",200,     13   c1 = new TCanvas("c1","PDB DNA outputs",200,10,700,780);
 14   c1->SetFillColor(0);                             14   c1->SetFillColor(0);
 15                                                    15 
 16   pad1 = new TPad("pad1","pad1",0.02,0.52,0.98     16   pad1 = new TPad("pad1","pad1",0.02,0.52,0.98,0.98,21);
 17   pad2 = new TPad("pad2","pad2",0.02,0.02,0.48     17   pad2 = new TPad("pad2","pad2",0.02,0.02,0.48,0.48,21);
 18   pad3 = new TPad("pad3","pad3",0.52,0.02,0.98     18   pad3 = new TPad("pad3","pad3",0.52,0.02,0.98,0.48,21);
 19                                                    19 
 20   pad1->SetFillColor(0);                           20   pad1->SetFillColor(0);
 21   pad1->Draw();                                    21   pad1->Draw();
 22   pad2->SetFillColor(0);                           22   pad2->SetFillColor(0);
 23   pad2->Draw();                                    23   pad2->Draw();
 24   pad3->SetFillColor(0);                           24   pad3->SetFillColor(0);
 25   pad3->Draw();                                    25   pad3->Draw();
 26                                                    26 
 27                                                    27 
 28   TFile f("pdb4dna_output.root");                  28   TFile f("pdb4dna_output.root");
 29                                                    29 
 30   // Draw histograms                               30   // Draw histograms
 31                                                    31 
 32   TH1D* hist1 = (TH1D*)f.Get("1");                 32   TH1D* hist1 = (TH1D*)f.Get("1");
 33   pad1->cd();                                      33   pad1->cd();
 34   hist1->Draw("HIST");                             34   hist1->Draw("HIST");
 35                                                    35 
 36   TH1D* hist2 = (TH1D*)f.Get("2");                 36   TH1D* hist2 = (TH1D*)f.Get("2");
 37   pad2->cd();                                      37   pad2->cd();
 38   hist2->Draw("HIST");                             38   hist2->Draw("HIST");
 39                                                    39 
 40   TH1D* hist3 = (TH1D*)f.Get("3");                 40   TH1D* hist3 = (TH1D*)f.Get("3");
 41   pad3->cd();                                      41   pad3->cd();
 42   hist3->Draw("HIST");                             42   hist3->Draw("HIST");
 43                                                    43 
 44   c1->Modified();                                  44   c1->Modified();
 45   c1->Update();                                    45   c1->Update();
 46                                                    46 
 47                                                    47 
 48   // Read stats to get global quantities           48   // Read stats to get global quantities
 49                                                    49 
 50   double* pdbStats=new double[4];                  50   double* pdbStats=new double[4];
 51                                                    51 
 52   hist1->GetStats(pdbStats);                       52   hist1->GetStats(pdbStats);
 53   cout << "-> Edep in the target : " << pdbSta     53   cout << "-> Edep in the target : " << pdbStats[2]/1E6 << " MeV" << endl;
 54                                                    54 
 55   hist2->GetStats(pdbStats);                       55   hist2->GetStats(pdbStats);
 56   cout << "-> Number of SSB : " << pdbStats[2]     56   cout << "-> Number of SSB : " << pdbStats[2] << endl;
 57                                                    57 
 58   hist3->GetStats(pdbStats);                       58   hist3->GetStats(pdbStats);
 59   cout << "-> Number of DSB : " << pdbStats[2]     59   cout << "-> Number of DSB : " << pdbStats[2] << endl;
 60 }                                                  60 }
 61                                                    61