[BLAST_ANAWARE] new asmmetry function in util_j.C

From: Jason Seely (seely@MIT.EDU)
Date: Fri Dec 06 2002 - 17:32:20 EST


hey everyone,

i just made a new function for util.C that takes histograms as input and calculates the asymmetries for each bin.  actually, at the moment you can find it in util_j.C because for some reason, i wasn't able to write to the real util.C (i didn't want to play around too much), so maybe chris or someone can merge this in or something.  anyway, if you want to use it, just load util_j.C for now where you would normally load util.C (they are identical, except that util_j.C has the new funciton.)

anyway, assuming you have 3 histograms (which are the same dimension, etc.), h1, h2, asym (these can be any type of histogram that inherits from TH1, so it works for 1 or 2d histograms) just say:

GetAsymmetry(asym, h1, h2)

then asym will be asym = (h1-h2)/(h1+h2).

so the bins in asym are filled with the asymmetries between the corresponding bins of h1 and h2.  if there are no events in h1 or h2, then the asymmetry and error are both set to zero.

it also calculates the errors for the asymmetry, but at the moment it's not quite right (ROOT returns sqrt((1-asym*asym)/(h1+h2)) as the error when it should really be  sqrt((1-asym*asym)/(h1+h2))), but it's a slight overestimate.  i'm working on fixing this, but i thought some people might be able to use this now that we're starting to calculate asymmetries.

have fun,

jason

-- 
--------------------------------------------------------------------
jason seely
26.650.b
massachusetts institute of technology
77 massachusetts avenue
cambridge, ma 02139-4307

email:  seely@mit.edu
phone:  617.253.4772/6734
 html:  web.mit.edu/seely/www
--------------------------------------------------------------------
 



This archive was generated by hypermail 2.1.2 : Mon Feb 24 2014 - 14:07:29 EST