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10.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/electromagnetic/TestEm6/plot_hist.C (Version 11.3.0) and /examples/extended/electromagnetic/TestEm6/plot_hist.C (Version 8.3.p2)


  1 {                                                   1 
  2   gROOT->Reset();                                 
  3                                                   
  4   // Draw histos filled by Geant4 simulation      
  5   //                                              
  6                                                   
  7   double minE  = 40;                              
  8   double maxE  = 10000;                           
  9   double minY  = 1e-2; //c1                       
 10   double maxY  = 1e+2; //c1                       
 11   double minY1 = 1e-8; //c2                       
 12   double maxY1 = 1;    //c2                       
 13                                                   
 14   //file open                                     
 15   //                                              
 16   TFile f("testem6_0.root");                      
 17                                                   
 18   //CrossSectionPerAtom                           
 19   //                                              
 20   TH1D* h7 = (TH1D*)f.Get("h7");  //ee to MuMu    
 21   TH1D* h8 = (TH1D*)f.Get("h8");  //ee to gamm    
 22   TH1D* h9 = (TH1D*)f.Get("h9");  //ee to Hadr    
 23   TH1D* h10 = (TH1D*)f.Get("h10"); //ee to gam    
 24   TH1D* h11 = (TH1D*)f.Get("h11"); //ee to MuM    
 25   //CrossSectionPerVolume                         
 26   //                                              
 27   TH1D* h12 = (TH1D*)f.Get("h12"); //eBrem        
 28   TH1D* h13 = (TH1D*)f.Get("h13"); //eIoni        
 29   TH1D* h14 = (TH1D*)f.Get("h14"); //ee to MuM    
 30   TH1D* h15 = (TH1D*)f.Get("h15"); //ee to gam    
 31   TH1D* h16 = (TH1D*)f.Get("h16"); //ee to Had    
 32   //R ratio                                       
 33   //                                              
 34   TH1D* h17 = (TH1D*)f.Get("h17"); //R            
 35                                                   
 36   //c1                                            
 37   //                                              
 38   TCanvas* c1 = new TCanvas("c1", "  ");          
 39   gPad->SetLogy();                                
 40   h7->SetMinimum(minY);                           
 41   h7->SetMaximum(maxY);                           
 42   h7->GetXaxis()->SetLimits(std::log10(minE),s    
 43   h7->SetTitle("Comparison of e+ Annihilation     
 44   h7->GetXaxis()->SetTickLength(0);               
 45   h7->GetXaxis()->SetLabelOffset(999);            
 46   h7->GetYaxis()->SetTitle("microbarn");          
 47                                                   
 48   h7->SetLineColor(kRed);                         
 49   h9->SetLineColor(kBlue);                        
 50   h11->SetMarkerColor(kRed);                      
 51   h11->SetMarkerStyle(22);                        
 52   h10->SetMarkerStyle(22);                        
 53                                                   
 54   c1->cd();                                       
 55   h7->Draw("HIST");                               
 56   h8->Draw("HIST SAME");                          
 57   h9->Draw("HIST SAME");                          
 58   h10->Draw("HIST P SAME");                       
 59   h11->Draw("HIST P SAME");                       
 60                                                   
 61   TGaxis *xaxis = new TGaxis(std::log10(minE),    
 62   xaxis->SetTitle("GeV");                         
 63   xaxis->Draw();                                  
 64                                                   
 65   gStyle->SetOptStat(0);                          
 66                                                   
 67   TLegend* leg = new TLegend(0.78,0.59,0.98,0.    
 68   leg->AddEntry(h8,"to 2 gammas","l");            
 69   leg->AddEntry(h7,"to MuPair","l");              
 70   leg->AddEntry(h9,"to Hadrons","l");             
 71   leg->Draw();                                    
 72                                                   
 73   //c2                                            
 74   //                                              
 75   TCanvas* c2 = new TCanvas("c2", "  ");          
 76   c2->cd();                                       
 77                                                   
 78   gPad->SetLogy();                                
 79   h15->SetMinimum(minY1);                         
 80   h15->SetMaximum(maxY1);                         
 81   h15->GetXaxis()->SetLimits(std::log10(minE),    
 82   h15->SetTitle("Comparison of EM Processes(to    
 83   h15->GetXaxis()->SetTickLength(0);              
 84   h15->GetXaxis()->SetLabelOffset(999);           
 85   h15->GetYaxis()->SetTitle("1/mm");              
 86                                                   
 87   h12->SetLineColor(6);                           
 88   h13->SetLineColor(kGreen);                      
 89   h14->SetLineColor(kRed);                        
 90   h16->SetLineColor(kBlue);                       
 91                                                   
 92   c2->cd();                                       
 93   h15->Draw("HIST");                              
 94   h13->Draw("HIST SAME");                         
 95   h14->Draw("HIST SAME");                         
 96   h12->Draw("HIST SAME");                         
 97   h16->Draw("HIST SAME");                         
 98                                                   
 99   TGaxis *xaxis1 = new TGaxis(std::log10(minE)    
100   xaxis1->SetTitle("GeV");                        
101   xaxis1->Draw();                                 
102                                                   
103   gStyle->SetOptStat(0);                          
104                                                   
105   TLegend* leg1 = new TLegend(0.78,0.59,0.98,0    
106   leg1->AddEntry(h15,"to 2 gammas","l");          
107   leg1->AddEntry(h14,"to MuPair","l");            
108   leg1->AddEntry(h16,"to Hadrons","l");           
109   leg1->AddEntry(h12,"Bremsstrahlung","l");       
110   leg1->AddEntry(h13,"Ionization","l");           
111   leg1->Draw();                                   
112 }                                                 
113