Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-23 09:22:10

0001 // -------------------------------------------------------------------
0002 // -------------------------------------------------------------------
0003 //
0004 // *********************************************************************
0005 // To execute this macro under ROOT after your simulation ended, 
0006 //   1 - launch ROOT (usually type 'root' at your machine's prompt)
0007 //   2 - type '.X plot.C' at the ROOT session prompt
0008 //   3 - OR type directly 'root plot.C'
0009 // *********************************************************************
0010 
0011 {
0012 gROOT->Reset();
0013 
0014 gStyle->SetPalette(1);
0015 gROOT->SetStyle("Plain");
0016 gStyle->SetOptStat(000000);
0017     
0018 c1 = new TCanvas ("c1","",60,60,800,800);
0019 c1->Divide(1,1);
0020 
0021 FILE * fp = fopen("s.txt","r");
0022 
0023 Float_t radius,E,thick,sc,ssc,sn,ssn;
0024 Int_t ncols = 0;
0025 Int_t nlines = 0;
0026 
0027 TNtuple *ntuple = new TNtuple("ntuple","s","radius:thick:E:sc:ssc:sn:ssn");
0028 while (1) 
0029 {
0030   ncols = fscanf(fp,"%f %f %f %f %f %f %f",&radius,&thick,&E,&sc,&ssc,&sn,&ssn);
0031   if (ncols < 0) break;
0032   ntuple->Fill(radius,thick,E,sc,ssc,sn,ssn);
0033   nlines++;
0034 }
0035 fclose(fp);
0036  
0037 c1->cd(1);
0038 gPad->SetLogx();
0039 gPad->SetLogy();
0040 
0041 TH2F * h2 = new TH2F ("h2","",2,99.999,1e4,2,1e0,1e3);
0042 h2->Draw();
0043 
0044 ntuple->SetMarkerStyle(24);
0045 ntuple->SetMarkerSize(1.);
0046 ntuple->Draw("sc:E","","LPsame");
0047 
0048 ntuple->SetMarkerStyle(20);
0049 ntuple->SetMarkerSize(1.);
0050 ntuple->Draw("sn:E","","LPsame");
0051 
0052 h2->GetXaxis()->SetLabelSize(0.025);
0053 h2->GetYaxis()->SetLabelSize(0.025);
0054 h2->GetXaxis()->SetTitleSize(0.035);
0055 h2->GetYaxis()->SetTitleSize(0.035);
0056 h2->GetXaxis()->SetTitleOffset(1.4);
0057 h2->GetYaxis()->SetTitleOffset(1.4);
0058 h2->GetXaxis()->SetTitle("E (eV)");
0059 h2->GetYaxis()->SetTitle("S (Gy/Bq.s)");
0060 
0061 TText *pt1 = new TText(200,200,"Cytoplasm");
0062 pt1->Draw("SAME");
0063 
0064 TText *pt2 = new TText(400,15,"Nucleus");
0065 pt2->Draw("SAME");
0066 
0067 }