User Tools

Site Tools


software:analysis

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
software:analysis [2020/04/21 06:32] himusersoftware:analysis [2022/01/14 18:44] (current) – external edit 127.0.0.1
Line 1: Line 1:
-====== Analysis ======+===== Analysis tools =====
  
-There are already several files which help you to analyse root files from primasoft:+===Novosibirsk function===
  
-  - PrimaSimAnalysis (can be found here: /geant4/src/PRIMASimAnalysis.cc, /geant4/include/PRIMASimAnalysis.hh) +The Novosibirsk function is typically used to fit monoenergetic electromagnetic calorimeter spectra
-  - Config file for Analysis (examples can be found here: /geant4/sim_ana_utilities/ana_default.conf) +Explanations on this function are given here {{ :software:novosibirsk.pdf |}}.
-  - Rootmacros (examples can be found here: /geant4/rootmacros)+
  
 +A C++ code snippet to calculate the function using ROOT classes is given below. The interface is chosen to be usable with the ROOT fitting routines, e.g. ''TH1::Fit()''. It takes two arrays as input. From the first one only the first element is used as ''x'', From the second array, the values of the fit parameters are taken.
  
- +  #include "TMath.h"  
-This is what they do: +   
- +  /  p[0] = normalisation constant    
-== PrimaSimAnalysis == +       p[1] peak position    
-  * Sorts hits into clusters  +       p[2] sigma (energy  resolution)    
-  * Single crystal threshold is applied. The value van be set in the config filedefault is 2 MeV. This is analogue the to hit detection threshold in a measurement. +       p[3] eta (asymmetry parameter)    
-  * Different crystal-setups can be used. The setp can be chosen in the config file, default is to use all 786 crystals+       p[4] constant background   
-      * all crystals are used (768) +  * 
-      the inner 640 crystals are used symmetrically (640) +  double novosibirsk(double *xdouble *p)  
-      * the inner 640 crystals are used in an oval shape (640_oval+  {    
-      * the inner 560 crystals are used symmetrically (560+     double xi=2.35482004503094933e+00; 
-  * ff +     double Y=(x[0]-p[1])*p[3]/p[2]; 
-  3 functions are left empty (BeginOfRun(), DoEvent(), EndOfRun()). These need to be defined in the rootmacro +   
- +     if(Y>=1return p[4]; 
- +   
- +     double lnX = log1. - Y );    
-== Rootmacro == +     double s0  = 2/xi*TMath::ASinH(p[3]*xi*0.5);    
-  execute a rootmacro (here: test.C): <code> +     double s02 = s0*s0;    
-root -l rootmacros/test.C+ +     
-</code> +     double f p[0]*exp ( -0.5/s02 lnX*lnX - 0.5*s02+ p[4]     
-  in the rootmacros the functions BeginOfRun(), DoEvent() and EndOfRun() need to be defined, please have a look at the examples +     return f;  
-  in OpenTreeFiles() you can define the root file which will be analysed and you can optionally choose a config file: <code> c.OpenTreeFiles("test_bwec.root","sim_ana_utilities/ana_default.conf");  </code>If the path is relative and not absolute for the root and config file, pay attention that the relative path changes when you execute the rootmacro from a different folder. +  
-  * test.C is a basic example +
-  * energy_res.C and acceptance.C are more advanced exaples +
software/analysis.1587450741.txt.gz · Last modified: 2022/01/14 18:44 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki