This page provides instructions on how to collect Trigger statistics on a BaBar analysis. The primary goal of these instructions is to support the Trigger statistics/efficiency survey that is currently being conducted to explore possibilities of a tighter L1 Trigger to be used for future high luminosity data taking in Run 6 and beyond.
Please send questions/comments to the Trigger Software HyperNews or contact Rainer Bartoldus.
Quick links: [Introduction] [Building your application] [Running the tool] [Understanding the output]
As PEP-II is approaching higher luminosities, the BaBar Level 1 trigger rate is getting closer to the DAQ bandwidth limit of about 5 kHz. Prompted by this, the Trigger group has started a project to study possible new Level 1 configurations that can keep the L1 rate below the limit, while preserving most, if not all, relevant physics.
The first step in this is to conduct a survey of as broad a range of analyses as possible in order to get a comprehensive picture of which of our triggers are the most critical, which may be less so, and to learn about any inefficiencies or vulnerabilities that may already exist. The aim of this first survey is to identify a list of analyses that are the most sensitive to the trigger configuration. The plan is then to use those as benchmark analyses for any refinements in a second phase.
To this end, we have produced a tool that can be run at the Beta-level and that will collect statistics on L1 trigger lines, their efficiencies and correlations. In the following, I will give some guidance as to how to run this tool on a concrete analysis data sample.
An initial technical discussion of the tool and the histograms it produces can be found in the Trigger Software HyperNews. The kick-off of the project was announced in a plenary talk at the Montreal Collaboration meeting. A review of the plan and a look at some first results was given at the following September Collaboration meeting.
Treating current directory as a test release based on 18.6.4 TrgConfig V01-08-00 (Release uses V01-07-00) TrgParser V00-24-00 (Release uses V00-20-00) TrgTools V00-10-02 (Release uses V00-05-00)Depending on what application you are going to build with this, you might have to check out and rebuild other packages that depend on these. You can run the checkdep command to find all possible dependencies. Note that TrgConfig is a low-level package and therefore checkdep will report many dependencies related to online and simulation that are probably not relevant for your analysis application. For example, if your application were BetaMiniUserApp, no extra packages would be needed. But you should be careful not to produce an inconsistent build. If unsure, add everything that checkdep reports, or contact me.
Treating current directory as a test release based on 18.6.4 PackageList V00-13-23 (Release uses V00-11-01) TrgUser V00-00-00 (not in Release)With these, run
$ gmake TrgUser.binand this will create the TrgUserMiniApp executable.
#include <TrgTools/TrgStatisticsSequence.hh> ... TrgStatisticsSequence( this );Then add these lines to your tcl:
sourceFoundFile TrgTools/TrgStatisticsSequence.tcl path append MyPath TrgStatisticsSequenceYou want to put the sequence on a path that sees (only) the selected events. Replace MyPath here with whatever is appropriate.
workdir> BbkSPModes --modenum 5936 : Mode : Decfile : Generator : Filter : Run Type : : 5936 : gamgam-pipi.flat.2.1-4.5gev.tcl : continuum : : 2-photon -> pi+ pi-; 2.1 < W < 4.5 GeV :Retrieve the corresponding tcl file as usual:
workdir> BbkDatasetTcl SP-5936 BbkDatasetTcl: wrote SP-5936.tcl Selected 3 collections, 11000/11000 events, ~0.0/pb, from bbkr18 at slacThen create a tcl snippet like the following:
set NEvents 10000 # this is used by TrgUserMiniApp.tcl set MCTruth true sourceFoundFile SP-5936.tcl sourceFoundFile TrgUser/TrgUserMiniApp.tclSave this in, say myTrgUserMiniApp.tcl. Then run the job as usual:
workdir> TrgUserMiniApp myTrgUserMiniApp.tcl >& myTrgUserMiniApp.log &You probably want to run this in a batch queue.
Upon completion, this will leave a ROOT file in your workdir called TriggerStatistics.root.
module talk TrgStatisticsModule outputFile set "myTrgStatistics-[exec date +%Y%m%d-%H%M].root" exitYou may find it useful to append an identifier for your analysis, decay channel and/or mode number to the file name. This will also help us to distinguish the output from various analyses.
Note: this currently only works if you check out the tag
TrgTools V00-10-02(which is not in analysis-32) and rebuild your application (or TrgUserMiniApp) as described above.
There is a way out. If you perform the main part of your event selection at the ROOT/ntuple level, what you need to do is identify your signal events and write out their event timestamps. Timestamps are often referred to as the upper and lower event id. If you don't know what these are, ask someone in your group.
You will then be able to feed these timestamps back to a filter module on the statistics sequence than runs before the statistics module. You will still run over the entire signal collection that way, but trigger statistics will only be accumulated for events that you pre-selected from your ROOT/ntuple analysis. In this case you don't need your own analysis application. TrgUserMiniApp can do the timestamp filtering. All you need is to save the timestamps to a flat file.
If you think this is the only way for you to participate in the survey, please get in touch with me, and I will post further instructions.
There is a ROOT macro that comes with the TrgTools package, that, in its default mode, creates a postscript file with four pages per L1 trigger configuration. You can create this postscript file like this:
workdir> bbrroot -b -q `searchFile TrgTools/TriggerStatistics.C`'("TriggerStatistics.root","ps")'
Note that this command didn't work for some people. In that case, start root, then type:
root> .L {proper_path}/TriggerStatistics.C
root> TriggerStatistics("TriggerStatistics.root","ps")
Substitute your own filename for TriggerStatistics.root if
you changed it. (Watch out for the proper quotes. The first pair of
backquotes is to localize the macro in your test or underlying release
directory. The second set of quotes protects the parentheses and
double quotes around the file name string.)
As said, if your collection spans several different L1 configurations, you get one set of plots for each one. Let's just look at the first set. But first we need to recap briefly what the trigger lines and trigger line categories that are plotted are.
The next up to eight lines are auxiliary triggers that come either through one of the four external inputs in the Fast Control Gate Module (FCGM), or are generated in the Fast Control Partition Master (FCPM). One of the latter group is the random 1 Hz trigger called cyclic1.
Example: The lines "3B&2A&2Z", B*&1A&1Z' and 1B are all pure DCT lines. Likewise, 2E, EM*>, 3M&M* are pure EMT. Whereas the lines 1Y&1B, M*&5U and 2Zt&1A&1M are mixed.
For example, 2Zt (two z-tracks with tight vertex cuts), B* (two short tracks back to back), 2B&1A (two short tracks, one long) are all 2-particle lines, whereas 1B (one short track), 1Y&1B (one backward calorimeter tower and one short track) are 1-particle lines. These three categories are also complementary for all triggered events.
The four plots you see all show efficiencies of individual trigger lines, or of combinations of trigger lines, normalized to 1000. When an entry reads 999, it means that the given line, or combination of lines, fired on average 999 times for every 1000 events.
The first plot shows overall trigger line rates (in yellow) with their exclusive contributions overlaid (in red). The overall line rates quantify how many times (per 1000 events) a given line or category fired, regardless of the other lines in the event. The exclusive contributions describe how many times an event was triggered on just the given trigger line, with all other lines off. This directly tells us how many events we would lose if we turned off the specific line or category.
Here are some quick things you may want to look for yourself. They can all be read from the first plot called Trigger Line Rates.
| Created: 31-Aug-2006 | Expiry date: 31-Aug-2008 |
| Last update: 06-Aug-2007, by Kim Hojeong |