Geant4  10.02.p03
egs4.C File Reference

Go to the source code of this file.

Functions

TFile f ("./93ref0.root")
 
h1d SetTitle ("30 GeV e- on 20 X0 Fe : energy dep, longit profil")
 
h1d GetXaxis () -> SetTitle("depth (X0)")
 
h1d GetYaxis () -> SetTitle("(100/E0) (dE/dt)")
 
h1d SetStats (kFALSE)
 
h1d Draw ("HIST")
 
in open ("pdg.ascii")
 
 while (1)
 
in close ()
 
h1f SetLineColor (2)
 
h1f Draw ("SAME")
 
legend AddEntry (h1d,"93ref0","l")
 
legend AddEntry (h1f,"EGS4","L")
 
legend Draw ()
 

Variables

TH1D * h1d = (TH1D*) f.Get("4")
 
ifstream in
 
int nb_bins = 40
 
float x_min = 0
 
float x_max = 20
 
TH1F * h1f = new TH1F("h1f","",nb_bins,x_min,x_max)
 
Float_t x
 
Float_t y
 
TLegend * legend = new TLegend(0.65,0.55,0.85,0.68)
 

Function Documentation

◆ AddEntry() [1/2]

legend AddEntry ( h1d  ,
"93ref0"  ,
"l"   
)

◆ AddEntry() [2/2]

legend AddEntry ( h1f  ,
"EGS4"  ,
"L"   
)

◆ close()

in close ( )

◆ Draw() [1/3]

h1d Draw ( "HIST"  )

◆ Draw() [2/3]

h1f Draw ( "SAME"  )

◆ Draw() [3/3]

legend Draw ( )

◆ f()

TFile f ( "./93ref0.root"  )

◆ GetXaxis()

h1d GetXaxis ( ) -> SetTitle("depth (X0)")

◆ GetYaxis()

h1d GetYaxis ( ) -> SetTitle("(100/E0) (dE/dt)")

◆ open()

in open ( "pdg.ascii"  )

◆ SetLineColor()

h1f SetLineColor ( )

◆ SetStats()

h1d SetStats ( kFALSE  )

◆ SetTitle()

h1d SetTitle ( "30 GeV e- on 20 X0 Fe : energy  dep,
longit profil"   
)

◆ while()

while ( )

Definition at line 24 of file egs4.C.

24  {
25  in >> x >> y ;
26  if (!in.good()) break;
27  h1f->Fill(x,y);
28  }
ifstream in
Definition: egs4.C:14
Float_t x
Definition: egs4.C:23
Float_t y
Definition: egs4.C:23
TH1F * h1f
Definition: egs4.C:21

Variable Documentation

◆ h1d

TH1D* h1d = (TH1D*) f.Get("4")

Definition at line 6 of file egs4.C.

◆ h1f

TH1F* h1f = new TH1F("h1f","",nb_bins,x_min,x_max)

Definition at line 21 of file egs4.C.

◆ in

ifstream in

Definition at line 14 of file egs4.C.

◆ legend

TLegend* legend = new TLegend(0.65,0.55,0.85,0.68)

Definition at line 36 of file egs4.C.

◆ nb_bins

int nb_bins = 40

Definition at line 18 of file egs4.C.

◆ x

Float_t x

Definition at line 23 of file egs4.C.

◆ x_max

float x_max = 20

Definition at line 20 of file egs4.C.

◆ x_min

float x_min = 0

Definition at line 19 of file egs4.C.

◆ y

Float_t y

Definition at line 23 of file egs4.C.