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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/microdosimetry/plot.C (Version 11.3.0) and /examples/extended/medical/dna/microdosimetry/plot.C (Version 11.2.1)


  1 // ------------------------------------------- << 
  2 // ------------------------------------------- << 
  3 //                                             << 
  4 // *******************************************      1 // *********************************************************************
  5 // To execute this macro under ROOT after your <<   2 // To execute this macro under ROOT, 
  6 //   1 - launch ROOT (usually type 'root' at y      3 //   1 - launch ROOT (usually type 'root' at your machine's prompt)
  7 //   2 - type '.X plot.C' at the ROOT session       4 //   2 - type '.X plot.C' at the ROOT session prompt
                                                   >>   5 //   3 - OR directly type 'root plot.C'
  8 // *******************************************      6 // *********************************************************************
  9                                                << 
 10 void plot()                                    << 
 11 {                                                   7 {
 12   gROOT->Reset();                              <<   8 gROOT->Reset();
 13   gStyle->SetPalette(1);                       <<   9 gStyle->SetPalette(1);
 14   gROOT->SetStyle("Plain");                    <<  10 gROOT->SetStyle("Plain");
 15                                                <<  11 Double_t scale;
 16   TCanvas* c1 = new TCanvas ("c1","",20,20,100 <<  12   
 17   c1->Divide(2,1);                             <<  13 c1 = new TCanvas ("c1","",20,20,1000,500);
 18                                                <<  14 c1->Divide(2,1);
 19   // Uncomment if merging should be done       <<  15 
 20   //system ("rm -rf dna.root");                <<  16 system ("rm -rf microdosimetry.root");
 21   //system ("hadd dna.root dna_*.root");       <<  17 system ("hadd -O microdosimetry.root microdosimetry_*.root");
 22                                                <<  18 
 23   TFile* f = new TFile("dna.root");            <<  19 TFile f("microdosimetry.root"); 
 24                                                <<  20 
 25   TNtuple* ntuple;                             <<  21 TNtuple* ntuple;
 26   ntuple = (TNtuple*)f->Get("dna");            <<  22 ntuple = (TNtuple*)f.Get("microdosimetry"); 
 27   bool rowWise = true;                         <<  23      
 28   TBranch* eventBranch = ntuple->FindBranch("r <<  24 c1->cd(1);
 29   if ( ! eventBranch ) rowWise = false;        << 
 30   // std::cout <<  "rowWise: " << rowWise << s << 
 31                                                << 
 32   // Canvas tab 1                              << 
 33   c1->cd(1);                                   << 
 34   gStyle->SetOptStat(000000);                      25   gStyle->SetOptStat(000000);
 35                                                <<  26   
 36   // All                                           27   // All
 37   ntuple->SetFillStyle(1001);                      28   ntuple->SetFillStyle(1001);
 38   ntuple->SetFillColor(2);                         29   ntuple->SetFillColor(2);
 39   ntuple->Draw("flagProcess","","B");              30   ntuple->Draw("flagProcess","","B");
 40                                                <<  31   
 41   // Excitation                                    32   // Excitation
 42   ntuple->SetFillStyle(1001);                      33   ntuple->SetFillStyle(1001);
 43   ntuple->SetFillColor(3);                         34   ntuple->SetFillColor(3);
 44   ntuple->Draw("flagProcess","flagProcess==12|     35   ntuple->Draw("flagProcess","flagProcess==12||flagProcess==15||flagProcess==22||flagProcess==32||flagProcess==42||flagProcess==52||flagProcess==62","Bsame");
 45                                                    36 
 46   // Elastic                                       37   // Elastic
 47   ntuple->SetFillStyle(1001);                      38   ntuple->SetFillStyle(1001);
 48   ntuple->SetFillColor(4);                         39   ntuple->SetFillColor(4);
 49   ntuple->Draw("flagProcess","flagProcess==11|     40   ntuple->Draw("flagProcess","flagProcess==11||flagProcess==21||flagProcess==31||flagProcess==41||flagProcess==51||flagProcess==61||flagProcess==110||flagProcess==210||flagProcess==410||flagProcess==510||flagProcess==710||flagProcess==120||flagProcess==220||flagProcess==420||flagProcess==520||flagProcess==720","Bsame");
 50                                                <<  41   
 51   // Ionisation                                    42   // Ionisation
 52   ntuple->SetFillStyle(1001);                      43   ntuple->SetFillStyle(1001);
 53   ntuple->SetFillColor(5);                         44   ntuple->SetFillColor(5);
 54   ntuple->Draw("flagProcess","flagProcess==13|     45   ntuple->Draw("flagProcess","flagProcess==13||flagProcess==23||flagProcess==33||flagProcess==43||flagProcess==53||flagProcess==63||flagProcess==73||flagProcess==130||flagProcess==230||flagProcess==430||flagProcess==530||flagProcess==730","Bsame");
 55                                                <<  46   
 56   // Charge decrease                               47   // Charge decrease
 57   //ntuple->SetFillStyle(1001);                <<  48   ntuple->SetFillStyle(1001);
 58   //ntuple->SetFillColor(6);                   <<  49   ntuple->SetFillColor(6);
 59   //ntuple->Draw("flagProcess","flagProcess==2 <<  50   ntuple->Draw("flagProcess","flagProcess==24||flagProcess==44||flagProcess==54","Bsame");
 60                                                    51 
 61   // Charge increase                               52   // Charge increase
 62   //ntuple->SetFillStyle(1001);                <<  53   ntuple->SetFillStyle(1001);
 63   //ntuple->SetFillColor(7);                   <<  54   ntuple->SetFillColor(7);
 64   //ntuple->Draw("flagProcess","flagProcess==3 <<  55   ntuple->Draw("flagProcess","flagProcess==35||flagProcess==55||flagProcess==65","Bsame");
 65                                                <<  56   
 66   gPad->SetLogy();                                 57   gPad->SetLogy();
 67                                                    58 
 68   // Canvas tab 2                              <<  59 c1->cd(2);
 69   c1->cd(2);                                   << 
 70                                                    60 
 71   // Electrons                                     61   // Electrons
 72   ntuple->SetMarkerColor(2);                       62   ntuple->SetMarkerColor(2);
 73   ntuple->SetMarkerStyle(20);                  <<  63   ntuple->Draw("x:y:z/1000","flagParticle==1","");
 74   ntuple->SetMarkerSize(.2);                   << 
 75   ntuple->Draw("x:y:z","flagParticle==1");     << 
 76                                                    64 
 77   // Protons, hydrogen                         <<  65   // Protons
 78   ntuple->SetMarkerColor(4);                       66   ntuple->SetMarkerColor(4);
 79   ntuple->Draw("x:y:z","flagParticle==2 || fla <<  67   ntuple->SetMarkerSize(4);
                                                   >>  68   ntuple->Draw("x:y:z/1000","flagParticle==2","same");
                                                   >>  69 
                                                   >>  70   // Hydrogen
                                                   >>  71   ntuple->SetMarkerColor(3);
                                                   >>  72   ntuple->SetMarkerSize(3);
                                                   >>  73   ntuple->Draw("x:y:z/1000","flagParticle==3","same");
                                                   >>  74   
 80 }                                                  75 }
 81                                                    76