Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 09:19:57

0001 {
0002 
0003 //Open File where data has been stored!
0004 TFile* f = new TFile("radioprotection_NEW.root");
0005 TDirectory* dir = (TDirectory*)f->Get("radioprotection_ntuple"); 
0006 
0007 TTree * ntuple1 = (TTree*)dir->Get("101");
0008 TTree * ntuple2 = (TTree*)dir->Get("102");
0009 TTree * ntuple3 = (TTree*)dir->Get("103");
0010 
0011 int numberOfBinsX = 500;
0012 int numberOfBinsY = 500;
0013 int numberOfBinsZ = 500;
0014 
0015 int Xmin = 0;
0016 int Xmax = 1000;
0017 int Ymin = 0;
0018 int Ymax = 1000;
0019 int Zmin = 0;
0020 int Zmax = 1000;
0021 
0022 //the type of histogram, how many variable, min and max values plus size of bins
0023 TH1F* edep1DistributionPrimary = new TH1F("h0", "Primary Particle Energy Spectrum; Energy (Mev);Frequency",
0024                      numberOfBinsX, Xmin, Xmax);       //Edep // binning, xmin, xmax, along x direction
0025 
0026 //the type of histogram, how many variable, min and max values plus size of bins
0027 TH1F* edep1Distribution = new TH1F("h1", "Energy deposition; Edep (kev);Frequency",
0028                      numberOfBinsX, Xmin, Xmax);       //Edep // binning, xmin, xmax, along x direction
0029 
0030 
0031 TH2F* edep2DDistribution = new TH2F("h2", "Energy deposited by Ions; Z; Edep (keV)", 
0032                      numberOfBinsX, Xmin, Xmax,    // Z     // binning, xmin, xmax, along x direction
0033                      numberOfBinsY, Ymin, Ymax);    //Edep   // binning, xmin, xmax, along y direction
0034 
0035 
0036 TH3F* edep3DDistribution = new TH3F("h3", "3Dedep; Edep (keV) ; A; Z", 
0037                      numberOfBinsX, Xmin, Xmin,  // edep  // binning, xmin, xmax, along x direction
0038                      numberOfBinsY, Ymin, Ymax,     // A     //binning, xmin, xmax, along y direction
0039                      numberOfBinsZ, Zmin, Zmax);    // Z     //binning, xmin, xmax, along z direction
0040 
0041 
0042 //Plot Primary Energy of Incident Particle
0043 ntuple1->Draw("Ek>>h0","","");
0044 //Plot Energy Deposition within SV
0045 //ntuple2.Draw("edep>>h1", "", "");
0046 //Plot 2D/3D Histogram of energy with particle type using A and Z
0047 //ntuple3.Draw("Z:edep>>h2", "", "");
0048 //ntuple3.Draw("Z:A:edep>>h3", "", "");
0049 }