Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-23 09:20:59

0001 
0002 {
0003    gROOT->Reset();
0004 
0005    // Draw histograms fill by Geant4 TestEm11 simulation
0006    TFile f1("./19um-local.root");
0007    TH1D* h1 = (TH1D*) f1.Get("h12");
0008    h1->SetTitle("Angular distribution of 15.7 MeV e- after 19um Au foil");
0009    //h1->SetTitle("Angular distribution of 15.7 MeV e- after 9um Au foil");   
0010    h1->GetXaxis()->SetTitle("theta (deg)");
0011    h1->GetYaxis()->SetTitle("dN/dOmega");
0012    h1->SetStats(kFALSE);  // Eliminate statistics box
0013    h1->SetLineColor(kOrange);
0014    h1->Draw("HIST");
0015    
0016    TFile f2("./19um-opt3.root");
0017    TH1D* h2 = (TH1D*) f2.Get("h12");
0018    h2->SetStats(kFALSE);  // Eliminate statistics box
0019    h2->SetLineColor(kBlue);
0020    h2->Draw("SAME HIST");
0021    
0022    TFile f3("./19um-opt4.root");
0023    TH1D* h3 = (TH1D*) f3.Get("h12");
0024    h3->SetStats(kFALSE);  // Eliminate statistics box
0025    h3->SetLineColor(kGreen);
0026    h3->Draw("SAME HIST"); 
0027      
0028 /* data
0029 * angle distribution of  15.7 MeV electrons
0030 * transmitted through thin gold foils.
0031 * A.O.Hanson et al. Phys.Rev.84 (1951) page 634.
0032 */
0033 
0034    ifstream in;
0035    in.open("./19um-wwols.ascii");
0036    //in.open("./9um-wwols.ascii");
0037    
0038    TMarker *pt;
0039    Double_t x, y;
0040    // First indicate number of data
0041    int nbdata = 0;
0042    in >> nbdata;
0043    for ( int i = 0 ; i < nbdata ; i++ ) {
0044       in >> x >> y ;
0045       if (!in.good()) break;
0046       pt = new TMarker(x,y,23); // 23 for triangle-down TMarker
0047       pt->SetMarkerColor(kMagenta);
0048       pt->Draw();
0049    }
0050    in.close();
0051 
0052    // Print the histograms legend
0053    TLegend* legend = new TLegend(0.6,0.5,0.8,0.68);
0054    legend->AddEntry(h1,"local ","l");
0055    legend->AddEntry(h2,"opt3 ","l");
0056    legend->AddEntry(h3,"opt4","l");      
0057    legend->AddEntry(pt,"Hanson data","P");
0058    legend->Draw();
0059 }