Professional Documents
Culture Documents
Simulation Tools Experiment Repot
Simulation Tools Experiment Repot
Simulation Tools
supervised by
Dr. Satyajit Jena
0.1 Aim:
To briefly study the Monte-Carlo Technique and to create a Gaussian and
Poissonian random number distribution using ROOT.
0.2 Brief:
ROOT is a data processing framework, used worldwide by scientists working
on high energy physics to analyze their data and to do simulations. Originally
written as an object-oriented program in FORTRAN, ROOT was created by
the team at CERN but was later re-written in C++ and now has applications
in other fields such as astronomy and big data analysis.A feature unique to
ROOT is the data container named Tree, with its subdivisions branches
and leaves.
When the iteration was small, we got a very crude form of the Gaussian.
When the iteration value was high, the Gaussian curve was observed
finely. It might be because eventually, we must have covered all the
points in the initial plot.
0.3 Observation:
A plot of tan x and tan x/x was made as a practice step. A Gaussian function
was defined using TF1 as g2. Using the random points taken from the
TH1 function, we made a histogram. We then repeated the same for a
Poisson Distribution.
1
Listing 1: tan x tan (x/x) Gaussian & Poisson Distribution
{
t1>D i v i d e ( 2 , 3 ) ;
t1>cd ( 1 ) ;
p1>Draw ( ) ;
t1>cd ( 2 ) ;
p2>Draw ( ) ;
t1>cd ( 3 ) ;
k>Draw ( ) ;
t1>cd ( 4 ) ;
s>Draw ( ) ;
t1>cd ( 5 ) ;
2
a1>F i l l ( a>GetRandom ( ) ) ;
}
a>Draw ( ) ;
t1>cd ( 6 ) ;
a1>Draw ( ) ;
}
3
Two Gaussian histograms were plotted with dierent mean and variance.
The two histograms were added using ROOT. The blue colored plot is the
corresponding final result.
t1>D i v i d e ( 2 , 3 ) ;
t1>cd ( 1 ) ;
p1>Draw ( ) ;
t1>cd ( 2 ) ;
p2>Draw ( ) ;
t1>cd ( 3 ) ;
k>Draw ( ) ;
t1>cd ( 4 ) ;
s>Draw ( ) ;
t1>cd ( 5 ) ;
4
TF1 a = new TF1( a , TMath : : P o i s s o n ( x , 3 ) , 1 0 , 1 0 ) ;
TH1F a1 = new TH1F( a1 , P o i s s o n , 1 0 0 0 0 , 1 0 , 1 0 ) ;
f or ( int j = 0 ; j <1000000; j ++){
a1>F i l l ( a>GetRandom ( ) ) ;
}
a>Draw ( ) ;
t1>cd ( 6 ) ;
a1>Draw ( ) ;
}
0.4 Conclusion:
We successfully carried out examples of Monte Carlo Method using ROOT.
***