Back to home page

EIC code displayed by LXR

 
 

    


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

0001 
0002 {
0003    gROOT->Reset();
0004 
0005    // Draw histograms fill by Geant4 TestEm11 simulation
0006    TFile f1("./Ta_1000keV_opt3.root");
0007    TH1D* h1 = (TH1D*) f1.Get("8");
0008    h1->SetTitle("Depth dose distribution of 1000 keV e- in Ta");
0009    h1->GetXaxis()->SetTitle("Edep (Mev.cm2/g) along x/r0                    x/r0");
0010    h1->GetYaxis()->SetTitle("MeV*cm2/g");
0011    h1->SetStats(kFALSE);  // Eliminate statistics box
0012    h1->SetLineColor(4);   // blue
0013    h1->Draw("HIST");
0014 /*   
0015    TFile f2("./Ta.1000keV.opt2.root");
0016    TH1D* h2 = (TH1D*) f2.Get("8");
0017    h2->SetStats(kFALSE);  // Eliminate statistics box
0018    h2->SetLineColor(3);   // green
0019    h2->Draw("SAME HIST");
0020 */   
0021 /* data
0022 * G.J.Lockwood et al.
0023 *     Sandia report SAND79-0414.UC-34a, February 1987
0024 * O.Kadri et al. NIM B 258 (2007) 381
0025 */
0026 
0027    ifstream in;
0028    in.open("./data/Ta_1000keV.ascii");
0029 
0030    TMarker *pt;
0031    Double_t x, y;
0032    // First indicate number of data
0033    int nbdata = 0;
0034    in >> nbdata;
0035    for ( int i = 0 ; i < nbdata ; i++ ) {
0036       in >> x >> y ;
0037       if (!in.good()) break;
0038       pt = new TMarker(x,y,22); // 22 for triangle TMatker
0039       pt->SetMarkerColor(kRed);
0040       pt->Draw();
0041    }
0042    in.close();
0043 
0044    // Print the histograms legend
0045    TLegend* legend = new TLegend(0.6,0.55,0.8,0.68);
0046    legend->AddEntry(h1,"ref10-opt3 ","l");
0047    ////legend->AddEntry(h2,"ref10-opt2 ","l");   
0048    legend->AddEntry(pt,"Sandia data","P");
0049    legend->Draw();
0050 }