Analysis

From Etp
Jump to: navigation, search

Analysis with root

There are many ways to do physics with root, one is shown here:

First, create a .cxx file, e.g. "myanalysis.cxx". You don't want to use CINT (the C-Interpreter). The first lines of your code should include some header files:

 
#include <TFile.h>
#include <TTree.h>
#include <TCanvas.h>
#include <TLegend.h>
#include <TPaveLabel.h>
#include <TStyle.h>
#include <TColor.h>
#include <TGraph.h>
#include <TRandom3.h>

Instead of an "int main()" function, create an "int myanalysis()" function: First, create a .cxx file, e.g. "myanalysis.cxx". You don't want to use CINT (the C-Interpreter).

 
 int myanalysis(){
     // (parts of) your analysis code will be here
     return 0;
 }