Hi all,
I checked some new codes into CVS for TBLCut. For those who are interested
in using the codes, please see the three files:
TBLCut_test.cc, Cuttest.C, Cuttest_OP.C
The first one is compiled into libBlast.so and can be called after you
load the library, and open a ntuple/ttree, and execute the following
command: TBLCut::Init(ntp) in with ntp is a pointer to your ntuple or
ttree. you can then invoke : TOF_COINC::test_IO() which will print out a
screenful of 0 and 1's which means a certain cut is false or true.
Cuttest.C is a almost identicl copy of the TOF_COINC::test_IO() source
code, but in a root Macro, which you can invoke in an interactive session,
the same with Cuttest_OP.C.
Cuttest_OP.C tests a bunch of logical/arithmetic operations, for instance
you can do TOF_HIT('l', 12) && TOF_HIT('r',3) which means left 12 in
coincidence with right 3, which in turn is identical to TOF_COINC(12, 3).
the first arguement of TOF_HIT/CC_HIT is a char literal, so USE
SINGLE QUITE please. It accepts upper case, lower case and a number, i.e.
TOF_HIT('l',12) == TOF_HIT('L',12) == TOF_HIT(0,12). by the way, == is
defined for TBLCut and all its subclasses.
I will check in another test script to test the use of TBLCut in the root
Draw methods in no time.
There are a lot of comments in those scripts, most importantly I mark whatever
is not working as I invisioned. I wanted to make those cuts look as
close to built-in types as possible, yet still a bit away from this
goal. Some of these bugs I know how to fix, some
I know why, some(mainly root interpreter related) remain misery, for
instance, in an interactive session, you can not convert the cut objects
into a double (through the operator double()) implicitly, so you must
write if ((double)cut) do something, while in compiled codes, compiler
convert it for you, so we can use this prettier syntax: if (cut) do
something. Root does not call user defined operators either so instead of
if (TOF_HIT('l', 12)[i]) do something with the ith event, one has to call
a function: if (TOF_HIT('l', 12).Eval(i)) which is not very built-in-type
look.
This archive was generated by hypermail 2.1.2 : Mon Feb 24 2014 - 14:07:28 EST