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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.1)


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