Geant4  10.02.p03
tramu.C File Reference

Go to the source code of this file.

Functions

TFile f1 ("./opt3.root")
 
h1 SetTitle ("1 TeV muon in 3 m iron : kinetic energy at exit (GeV)")
 
h1 GetXaxis () -> SetTitle("Ekine (GeV)")
 
h1 GetYaxis () -> SetTitle("nb/GeV")
 
h1 SetStats (kFALSE)
 
h1 SetLineColor (kBlue)
 
h1 Draw ("HIST")
 
in open ("mars14.ascii")
 
 while (1)
 
in close ()
 
h1f SetLineColor (kRed)
 
h1f Draw ("SAME")
 
legend AddEntry (h1,"local (Urban90)","l")
 
legend AddEntry (h1f,"Mars14 simul ","L")
 
legend Draw ()
 

Variables

TH1D * h1 = (TH1D*) f1.Get("10")
 
ifstream in
 
int nb_bins = 100
 
float x_min = 950.
 
float x_max = 1000.
 
TH1F * h1f = new TH1F("h1f","",nb_bins,x_min,x_max)
 
Float_t x
 
Float_t y
 
TLegend * legend = new TLegend(0.2,0.55,0.45,0.70)
 

Function Documentation

◆ AddEntry() [1/2]

legend AddEntry ( h1  ,
"local (Urban90)"  ,
"l"   
)

◆ AddEntry() [2/2]

legend AddEntry ( h1f  ,
"Mars14 simul "  ,
"L"   
)

◆ close()

in close ( )

◆ Draw() [1/3]

h1 Draw ( "HIST"  )

◆ Draw() [2/3]

h1f Draw ( "SAME"  )

◆ Draw() [3/3]

legend Draw ( )

◆ f1()

TFile f1 ( "./opt3.root"  )

◆ GetXaxis()

h1 GetXaxis ( ) -> SetTitle("Ekine (GeV)")

◆ GetYaxis()

h1 GetYaxis ( ) -> SetTitle("nb/GeV")

◆ open()

in open ( "mars14.ascii"  )

◆ SetLineColor() [1/2]

h1 SetLineColor ( kBlue  )

◆ SetLineColor() [2/2]

h1f SetLineColor ( kRed  )

◆ SetStats()

h1 SetStats ( kFALSE  )

◆ SetTitle()

h1 SetTitle ( "1 TeV muon in 3 m iron : kinetic energy at exit (GeV)"  )

◆ while()

while ( )

Definition at line 37 of file tramu.C.

37  {
38  in >> x >> y ;
39  if (!in.good()) break;
40  h1f->Fill(x,y);
41  }
TH1F * h1f
Definition: tramu.C:34
ifstream in
Definition: tramu.C:27
Float_t y
Definition: tramu.C:36
Float_t x
Definition: tramu.C:36

Variable Documentation

◆ h1

TH1D* h1 = (TH1D*) f1.Get("10")

Definition at line 6 of file tramu.C.

◆ h1f

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

Definition at line 34 of file tramu.C.

◆ in

ifstream in

Definition at line 27 of file tramu.C.

◆ legend

TLegend* legend = new TLegend(0.2,0.55,0.45,0.70)

Definition at line 49 of file tramu.C.

◆ nb_bins

int nb_bins = 100

Definition at line 31 of file tramu.C.

◆ x

Float_t x

Definition at line 36 of file tramu.C.

◆ x_max

float x_max = 1000.

Definition at line 33 of file tramu.C.

◆ x_min

float x_min = 950.

Definition at line 32 of file tramu.C.

◆ y

Float_t y

Definition at line 36 of file tramu.C.