Difference: RfunctionsInRoot (1 vs. 3)

Revision 32013-06-06 - boeglinw

Line: 1 to 1
 
META TOPICPARENT name="WernerBoeglin"
-- WernerBoeglin - 2013-04-30
Line: 43 to 43
 

META FILEATTACHMENT attachment="root_rfn.tar.gz" attr="" comment="" date="1367334073" name="root_rfn.tar.gz" path="root_rfn.tar.gz" size="8969019" user="boeglinw" version="1"
Added:
>
>
META TOPICMOVED by="boeglinw" date="1370528264" from="Main.RunctionsInRoot" to="Main.RfunctionsInRoot"

Revision 22013-05-19 - boeglinw

Line: 1 to 1
 
META TOPICPARENT name="WernerBoeglin"
-- WernerBoeglin - 2013-04-30
Changed:
<
<

Using R-functions in Root

>
>

Using Rfunctions in Root

  To install do the following:

Revision 12013-04-30 - boeglinw

Line: 1 to 1
Added:
>
>
META TOPICPARENT name="WernerBoeglin"
-- WernerBoeglin - 2013-04-30

Using R-functions 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.

META FILEATTACHMENT attachment="root_rfn.tar.gz" attr="" comment="" date="1367334073" name="root_rfn.tar.gz" path="root_rfn.tar.gz" size="8969019" user="boeglinw" version="1"
 
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