[Halld-offline] merging hits from multiple files now available in mcsmear

Richard Jones richard.t.jones at uconn.edu
Wed Mar 22 00:23:01 EDT 2017


Hello Thomas and all,

I have submitted a pull request that includes new capability in mcsmear to
merge hits from multiple files into the newly smeared output file. The
syntax for this is illustrated by the following example.

$ mcsmear [all of the former options] simfile.hddm bgfile1.hddm:1.8
 bgfile2.hddm:2

In this example, simfile.hddm is from a simulation run of hdgeant or
hdgeant4, and bgfile1.hddm [bgfile2.hddm] is a standard hddm_s file with
background hits to be merged into simfile_smeared.hddm as it is written.
The colon-number suffix appended to bgfile1.hddm [bgfile2.hddm] tells
mcsmear that hits from events in these files are to be merged into the
events in simfile.hddm after the simfile events have been smeared. No
smearing is applied to the bgfile1 or bgfile2 events. The real number 1.8
in the bgfile1.hddm suffix is interpreted as a Poisson mean, and a Poisson
random number of events from bgfile1 with mean 1.8 are merged into each
output event in simfile_smeared.hddm. The integer 2 in the suffix for
bgfile2.hddm tells mcsmear to merge exactly 2 events from bgfile2 into each
event read from simfile.hddm. Simply appending a decimal point to the 2, as
in bgfile2.hddm:2. would force the 2 to be interpreted as a Poisson mean
instead of a fixed event ratio.

If all you want to do is to merge hits from multiple events into a single
stream, I provided a null event generator called nullgen that you can use
to inject empty events in the place of simfile.hddm, as in the next example
below.

$ nullgen -r 30592 -n 1000 -o null1000.hddm
$ mcsmear null1000.hddm bgfile1.hddm:1 bgfile2.hddm:1

This command produces a file null1000_smeared.hddm which contains the first
1000 events from bgfile1.hddm merged 1-to-1 with the first 1000 events from
bgfile2.hddm. In conjunction with the new evio-hddm converter you wrote, it
is now possible to generate arbitrary merges of different types of events.

-Richarrd Jones
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.jlab.org/pipermail/halld-offline/attachments/20170322/d152469a/attachment.html>


More information about the Halld-offline mailing list