Sample Tag Queries

Physics Queries

The purpose of this page is to provide illustrative examples of how to formulate physics queries addressed to the ATLAS tag database. These first exercises are based upon sample selections proposed by Tom LeCompte.

CAVEAT: The emphasis here is upon the WHERE clauses (selection predicates). The FROM statements are often incomplete in that they have been oversimplified for the sake of readability to illustrate selection from a single stream, even when equivalent selections from multiple streams are required.

An impressive number of these queries require selection from multiple (all) streams. It is straightforward in the case of exclusive streams to provide an all-events collection and to address such queries to this collection, but such a collection has not yet been built. For now, we (equivalently) repeat the query against each exclusive stream, and concatenate the results with an SQL UNION ALL.

Note to streaming model evaluators: In the case of exclusive streams, we do not need the less-efficient UNION or DISTINCT or related operators, because each event appears exactly once. In the case of inclusive streams, such operators do not help much (except for informational queries), because in result sets that include references to persistent data, events written to more than one stream are not duplicates, and hence would not be removed by application of the database-provided uniqueness operators.

Q1. ...every event with an electron with at least 25 GeV of pT.

A1.


Try this query? Click here:
Plot as a histogram? (Thanks, Julius.) Click here

Note 1: Because not every event with a 25-GeV electron passes the L2_e25i trigger, this query must really be addressed to all streams. (To avoid duplicates, exclusive streams are useful here.)

Note 2: The correctness of this solution relies upon two assumptions about the code that fills the tags:

  1. that LooseElectronPt[1-4] are filled in descending order of ABS(pt);
  2. that LooseElectronPt1 is set to 0 when there are no electrons.

If the latter is not true, then the where clause must include a check on NLooseElectron, e.g.,

WHERE NLooseElectron > 0 AND ABS(LooseElectronPt1) > 25000

Question to database optimizers: Is Oracle's query plan the same whether we use


WHERE ABS(LooseElectronPt1)>25000 

or 

WHERE LooseElectronPt1 > 25000 OR LooseElectronPt1 < -25000?

Q2. ...every event that passed the 25 GeV electron trigger.

A2.


Try this query? Click here:

Note: Surprisingly enough, it turns out that it is not true that every event that passed the 25-GeV electron trigger made it into the inclusive electron stream. An all-streams query is needed to discover this, and to recover the events missing from the inclusive electron stream. Again, exclusive streams are helpful here.

Q3....every event with a 25 GeV electron that failed the 25 GeV electron trigger.


Try this query? Click here:

Note 1: This is another query that requires selection across all streams, though we illustrate it with the simpler query of the inclusive electron stream alone.

Note 2: in general, we need to AND this selection predicate with a check whether L2_e25i is active. In the streaming tests, this is not an issue, because the same trigger menu was used for all runs. We should return to these exercises when we have a design for checking run-level or {run, lumi block}-level tables for active triggers.

Q4....every event with a 25 GeV electron that passed a trigger other than the 25 GeV electron trigger.

A4.

Note that this is not the same as Q3: we must add to the result set of Q3 the events that satisfied L2_e25i and another trigger at the same time.


Try this query? Click here:

Note 1: This kind of operation ("any trigger other than xxx") should become a bit easier with bit representations, in that checking whether L2_TriggerDecisionWordN is greater than 0 checks 32 bits simultaneously.

Note 2: Again, this is an all-streams query, for which exclusive streaming would be helpful.

Q5. ...every event with two leptons (electrons or muons) with pT > 25 GeV and the same charge.

A5.


Try this query? Click here:

Deferred (...another all-streams query...)

Q6. ...every event with one good electron (> 25 GeV) and either another electron with the opposite charge and pT > 25 GeV or a photon with pT > 25 GeV.

A6.


Try this query? Click here:

The above is yet another all-streams query, illustrated on the inclusive electron stream.

Q7. ...every event with a 25 GeV muon, at least 25 GeV of missing ET (corrected for the muon), on the good run list, and recorded between April and June.

A7.


Try this query? Click here:

This is a first-level selection. I omitted the April-June part (streams test data were all April-June, but at worst it is conceptually no different than the quality check. I doubt that there is sufficient information in the tags to correct the missing ET for the muon.

Q8. ...every event with 3 leptons above 25 GeV, with either the two same sign leptons above 30 GeV or with 50 GeV of missing ET.

A8.


Try this query? Click here:

This is doable, but painful, in SQL.

Q9. ...every event with at least one b-jet and at least one lepton (pT > 10 GeV) such that the lepton is within 15 degrees of the jet axis.


Try this query? Click here:

Deferred.

Q10. ...the five events with the largest missing ET.

A10.


Try this query? Click here:

This solution could be needlessly expensive if Oracle's query execution plan is naive.

Q11. ...the five events with exactly two jets and the largest difference in ET between the two jets.

A11.


Try this query? Click here:

I am using JetPt, not JetEt, here, because that is what is in the tags.

-- DavidMalon - 07 Jun 2007

Edit | Attach | Watch | Print version | History: r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r1 - 2008-04-18 - DavidMalon
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Main All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback