Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-22 09:41:02

0001 // *********************************************************************
0002 // To execute this macro under ROOT, 
0003 //   1 - launch ROOT (usually type 'root' at your machine's prompt)
0004 //   2 - type '.X plot.C' at the ROOT session prompt
0005 // *********************************************************************
0006 {
0007 gROOT->Reset();
0008 gStyle->SetPalette(1);
0009 gROOT->SetStyle("Plain");
0010 Double_t scale;
0011     
0012 c1 = new TCanvas ("c1","",20,20,1000,500);
0013 c1->Divide(2,1);
0014 
0015 //system ("rm -rf microelectronics.root");
0016 //system ("hadd microelectronics.root microelectronics_*.root");
0017 
0018 TFile f("microelectronics.root"); 
0019 
0020 TNtuple* ntuple;
0021 ntuple = (TNtuple*)f.Get("microelectronics"); 
0022      
0023 c1->cd(1);
0024   gStyle->SetOptStat(000000);
0025   
0026   // All
0027   ntuple->Draw("flagProcess","","B");
0028   ntuple->SetFillColor(2);
0029   
0030   // Elastic
0031   ntuple->Draw("flagProcess","flagProcess==11","same");
0032   ntuple->SetFillColor(3); 
0033   
0034   // Ionisation
0035   ntuple->Draw("flagProcess","flagProcess==12||flagProcess==14||flagProcess==15||flagProcess==16||flagProcess==17","same");
0036   ntuple->SetFillColor(4);
0037   
0038   gPad->SetLogy();
0039 
0040 c1->cd(2);
0041 
0042   // Electrons
0043   ntuple->SetMarkerColor(2);
0044   ntuple->Draw("x:y:z/1000","flagParticle==1");
0045 
0046   // Protons
0047   ntuple->SetMarkerColor(4);
0048   ntuple->SetMarkerSize(4);
0049   ntuple->Draw("x:y:z/1000","flagParticle==2","same");
0050 
0051   // Ions
0052   ntuple->SetMarkerColor(3);
0053   ntuple->SetMarkerSize(3);
0054   ntuple->Draw("x:y:z/1000","flagParticle==3","same");
0055   
0056 }