User Tools

Site Tools


computing:tbrowse

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
computing:tbrowse [2017/02/27 16:30] iwncomputing:tbrowse [2017/03/02 20:14] iwn
Line 1: Line 1:
-Macro that opens a ''TBrowser'' and defines some functions. It can be run using ''root myMacro.C''+Underneath is a macro that opens a ''TBrowser'' and defines some usefull functions. It can be run using ''root myMacro.C'' or with a predefined function 
 +<code> 
 +function TBrowse { root -l "$@" ~/macros/myMacro.C;
 +</code> 
 +Run the function in the command line with ''TBrowse analysis.root''. To open all root files in the current directory: ''TBrowse *.root'', even quicker: ''TBrowse *t''.
  
 <code - myMacro.C> <code - myMacro.C>
Line 8: Line 12:
 } }
  
-void range(TH1* hist, double xmin, double xmax) +void norm(TH1* hist){ 
-{+    hist->Scale(1./hist->Integral()); 
 +    hist->Draw(); 
 +
 + 
 +void range(TH1* hist, double xmin, double xmax){
     hist->GetXaxis()->SetRangeUser(xmin,xmax);     hist->GetXaxis()->SetRangeUser(xmin,xmax);
     hist->Draw();     hist->Draw();
 } }
  
-double meanRange(TH1* hist, double xmin, double xmax) +double meanRange(TH1* hist, double xmin, double xmax){
-{+
     hist->GetXaxis()->SetRangeUser(xmin,xmax);     hist->GetXaxis()->SetRangeUser(xmin,xmax);
     return hist->GetMean(1);     return hist->GetMean(1);
 } }
  
-double integrate(TH1* hist, double xmin, double xmax) +double integrate(TH1* hist, double xmin, double xmax){
-{+
     hist->GetXaxis()->SetRangeUser(xmin,xmax);     hist->GetXaxis()->SetRangeUser(xmin,xmax);
     return hist->Integral();     return hist->Integral();
-} 
- 
-void norm(TH1* hist) 
-{ 
-    hist->Scale(1./hist->Integral()); 
-    hist->Draw(); 
 } }
 </code> </code>
computing/tbrowse.txt · Last modified: 2017/03/02 20:14 by iwn