[d2n-analysis-talk] New BeamTrip code for BigBite
Diana Parno
dparno at cmu.edu
Wed Dec 8 23:49:11 EST 2010
I've finished the new-model code to look for beam trips in BigBite
data and generate files with the necessary cuts. If you (most likely
Dave and/or Matt) are interested, check out
/home/dseymour/beamtrip/08Dec
on the d2n machine.
I've added two useful bits of code, both in the above directory. The
first one is, I hope, of general use in other applications. The second
might make a good template for other uses.
ChainRunFilesBB.C takes three arguments: the path in which it can find
your root files, the name of the tree you want (e.g. "T" or
"EVBBITE"), and the run number you're looking at. It returns a pointer
to a chain of all the trees from all the root files it found in that
path for that run number. It is smart enough to figure out how many
root files there are without you having to tell it (and returns NULL
if there are none). Currently, the file name and loops are set up for
my farm-replayed files, in which root files are numbered first by run
number, then by which CODA file their data is from, then by how many
previous root files there have been for that CODA file. It should be
easily adaptable to other replay methods -- e.g., just remove the
inner loop if the CODA file is not part of your numbering scheme.
generate_bt_cuts.pl takes two arguments, both run numbers. It calls
the BeamTrip main function in analyzer batch mode. Beam trip cut files
and plots are then generated for all the run numbers from the first
argument to the second argument, inclusive. Things that would normally
be printed to screen are instead printed to BeamTripBB.log. If I want
to generate beam trips for the runs from 2045 to 2049, I therefore
invoke this single command:
./generate_bt_cuts.pl 2045 2049
The BeamTripBB class itself has been changed in a couple of ways:
1. The main loop used to read in a list of run information from a file
and find beam trips only for runs that were explicitly listed. Now,
the loop goes from the first run number argument to the second one,
and uses ChainRunFilesBB.C to (1) determine whether there is any data
(if not, it moves on to the next run), and to (2) put together all the
data for a given run.
2. The method for finding beam trips now writes fit results to the
file bt_database/log.dat. The output to the log file tells whether the
fit found a mean in a reasonable range of the most-likely beam current
(and requires that beam current to be greater than 1). The log file
also contains the most likely beam current, the mean from the fit, the
sigma from the fit, and the size of the cut (that is, the threshold's
distance from the mean). The log file should make it simple to plot
these values on a run-by-run basis and (perhaps) quickly pull out runs
where the fits went wrong.
Best,
Diana
More information about the d2n-analysis-talk
mailing list