META TOPICPARENT |
name="WernerBoeglin" |
-- WernerBoeglin - 2013-04-30
Using R-functions in Root
To install do the following:
- root_rfn.tar.gz: extract the tar file, it creates a directory: root_rfn
- cd there and run make
- run the command: root macros/mkrfn : this will create the root files which contain the r-function cut data
- 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" |
|