Geant4  10.02.p03
plottest35.C File Reference

Go to the source code of this file.

Functions

c1 SetGridx ()
 
c1 SetGridy ()
 
c1 SetLogx ()
 
c1 SetLogy ()
 
 for (int i=0;i< n;i++)
 
input_file_1 cd ()
 
input_file_1 ls ()
 
t1 SetBranchAddress ("Energy", &energy)
 
t1 SetBranchAddress ("Weight", &weight)
 
cout<< t1-> GetEntries ()
 
h_2 SetLineStyle (kDashed)
 
h_2 SetLineColor (kBlue)
 
h_2 Draw ()
 
h_1 Draw ("same")
 
c1 Update ()
 
c1 Print ("./test35.png")
 
input_file_1 Close ()
 

Variables

TFile * input_file_2 = new TFile("test35b.root")
 
TCanvas * c1 = new TCanvas("c1", "test35", 200, 10, 700, 500)
 
int n = 41
 
float bin [41]
 
TH1 * h_1 = new TH1D("unbiased","Source spectrum",40,bin)
 
TH1 * h_2 = new TH1D("biased","Source spectrum",40,bin)
 
double energy
 
double weight
 
TTree * t1 = (TTree *) input_file_1->Get("MyTuple")
 
TTree * t2 = (TTree *) input_file_2->Get("MyTuple")
 

Function Documentation

◆ cd()

input_file_1 cd ( )

◆ Close()

input_file_1 Close ( )

◆ Draw() [1/2]

h_2 Draw ( )

◆ Draw() [2/2]

h_1 Draw ( "same"  )

◆ for()

for ( )

Definition at line 16 of file plottest35.C.

16  {
17  bin[i] =pow(10,(-2+0.1*i));
18  }
float bin[41]
Definition: plottest35.C:14

◆ GetEntries()

cout<<t1-> GetEntries ( )

Definition at line 29 of file plottest35.C.

30  {
31  t1.GetEntry(i);
32  // cout << energy << " " << weight << endl;
33  h_1->Fill(energy,weight);
34  }
TTree * t1
Definition: plottest35.C:26
TH1 * h_1
Definition: plottest35.C:20
double weight
Definition: plottest35.C:25
double energy
Definition: plottest35.C:25

◆ ls()

input_file_1 ls ( )
Here is the caller graph for this function:

◆ Print()

c1 Print ( "./test35.png"  )

◆ SetBranchAddress() [1/2]

t2 SetBranchAddress ( "Energy"  ,
energy 
)

◆ SetBranchAddress() [2/2]

t2 SetBranchAddress ( "Weight"  ,
weight 
)

◆ SetGridx()

c1 SetGridx ( )

◆ SetGridy()

c1 SetGridy ( )

◆ SetLineColor()

h_2 SetLineColor ( kBlue  )

◆ SetLineStyle()

h_2 SetLineStyle ( kDashed  )

◆ SetLogx()

c1 SetLogx ( )
Here is the caller graph for this function:

◆ SetLogy()

c1 SetLogy ( )

◆ Update()

c1 Update ( )

Variable Documentation

◆ bin

float bin[41]

Definition at line 14 of file plottest35.C.

◆ c1

TCanvas* c1 = new TCanvas("c1", "test35", 200, 10, 700, 500)

Definition at line 6 of file plottest35.C.

◆ energy

double energy

Definition at line 25 of file plottest35.C.

◆ h_1

TH1* h_1 = new TH1D("unbiased","Source spectrum",40,bin)

Definition at line 20 of file plottest35.C.

◆ h_2

TH1* h_2 = new TH1D("biased","Source spectrum",40,bin)

Definition at line 21 of file plottest35.C.

◆ input_file_2

TFile* input_file_2 = new TFile("test35b.root")

Definition at line 4 of file plottest35.C.

◆ n

int n = 41

Definition at line 13 of file plottest35.C.

◆ t1

TTree* t1 = (TTree *) input_file_1->Get("MyTuple")

Definition at line 26 of file plottest35.C.

◆ t2

TTree* t2 = (TTree *) input_file_2->Get("MyTuple")

Definition at line 36 of file plottest35.C.

◆ weight

double weight

Definition at line 25 of file plottest35.C.