[Halld-offline] Making REST skims
Paul Mattione
pmatt at jlab.org
Mon Feb 11 21:47:05 EST 2013
I've just checked code into the repository that allows users to create skimmed hddm files in the REST format (I moved the core REST-writing code from the danarest plugin to libraries/HDDM/DEventWriterREST.cc). To use it, you need to check out new versions of the HDDM and DANA libraries (and check out the danarest plugin as well to keep it up to date).
In short, just add these lines to your plugin:
vector<const DEventWriterREST*> locEventWriterRESTVector;
locEventLoop->Get(locEventWriterRESTVector);
locEventWriterRESTVector[0]->Write_RESTEvent(locEventLoop, "b1pi");
And it will save the event in the REST format in a file called "dana_rest_b1pi.hddm."
Also, you can simultaneously skim events to several different REST files within the same plugin, even during multi-threaded execution. E.g.:
if((locNumPositiveTracks >= 2) && (locNumNegativeTracks >= 2))
locEventWriterRESTVector[0]->Write_RESTEvent(locEventLoop, "2+_2-");
if((locNumPositiveTracks >= 3) && (locNumNegativeTracks >= 2))
locEventWriterRESTVector[0]->Write_RESTEvent(locEventLoop, "3+_2-");
will create two different skims, dana_rest_2+_2-.hddm and dana_rest_3+_2-.hddm, containing REST events with those track topologies.
- Paul
More information about the Halld-offline
mailing list