-- WernerBoeglin - 2013-04-30

Using Rfunctions in Root

To install do the following:

  1. root_rfn.tar.gz: extract the tar file, it creates a directory: root_rfn
  2. cd there and run make
  3. run the command: root macros/mkrfn : this will create the root files which contain the r-function cut data
  4. copy the file rfn.root to the directory where you run your analysis
To use the new objects in your script:

// load rfn library

gSystem->Load("./libRfn2.so");

// get rfn root-file contains all r-functions

TFile *r_file = new TFile("./rfn.root");

// get the proper r-function objects

// new righ arm collimator out

THaRfn rfn_r_o = (THaRfn)r_file->Get("2002042616-0-1");

// new left arm collimator out

THaRfn rfn_l_o = (THaRfn)r_file->Get("2002042616-0-0");

now the r-functions can be evaluated:

// calculate r-values using MCEEP output variables

// you need to do the proper unit conversions:

Float_t c2m = 0.01; // convert cm to m
Float_t m2r = 0.001; // convert mrad to rad
Float_t p2f = 0.01; //convert % to fraction
re = rfn_l_o->Eval(Y_E_TG*c2m,DP_E_TG*p2f,TH_E_TG*m2r,PH_E_TG*m2r);
rp = rfn_r_o->Eval(Y_P_TG*c2m,DP_P_TG*p2f,TH_P_TG*m2r,PH_P_TG*m2r);

make a histogram and remember re < 0. is outside the acceptance.

Topic attachments
I Attachment History Action Size Date Who Comment
Unknown file formatgz root_rfn.tar.gz r1 manage 8758.8 K 2013-04-30 - 15:01 UnknownUser  
Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r3 - 2013-06-06 - boeglinw
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback