23.05.2014 Views

Athena Developer Guide

Athena Developer Guide

Athena Developer Guide

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Athena</strong><br />

Chapter 12 N-tuple and Event Collection facilities Version/Issue: 2.0.0<br />

Listing 12.3 Job options for writing out an event collection<br />

1: ApplicationMgr.OutStream = { "Sequencer/EvtCollection" };<br />

2:<br />

3: EvtCollection.Members = { "EvtCollectionWrite/Selector",<br />

"EvtCollectionStream/Writer"};<br />

4: Writer.ItemList = { "/NTUPLES/EvtColl/Collection" };<br />

5: NTupleSvc.Output = { "EvtColl DATAFILE='MyEvtCollection.root'<br />

OPT='NEW' TYP='ROOT'" };<br />

12.3.2 Reading Events using Event Collections<br />

Reading event collections as the input for further event processing in <strong>Athena</strong> is transparent. The main<br />

change is the specification of the input data to the event selector:<br />

Listing 12.4 Connecting an address tag to an n-tuple.<br />

1: EventSelector.Input = {<br />

2: "COLLECTION='Collection' ADDRESS=’Address’<br />

DATAFILE='MyEvtCollection.root' TYP='ROOT' SEL='(Ntrack>80)'<br />

FUN='EvtCollectionSelector'"<br />

3: };<br />

These tags need some explanation:<br />

• COLLECTION<br />

Specifies the sub-path of the n-tuple used to write the collection. If the n-tuple which was<br />

written was called e.g. "/NTUPLES/FILE1/Collection", the value of this tag must be<br />

"Collection".<br />

• ADDRESS (optional)<br />

Specifies the name of the n-tuple tag which was used to store the opaque address to be used to<br />

retrieve the event data later. This is an optional tag, the default value is "Address". Please<br />

use this default value when writing, conventions are useful!<br />

• SEL (optional):<br />

Specifies the selection string used for the first stage pre-selection. The syntax depends on the<br />

database implementation; it can be:<br />

• SQL like, if the event collection was written using ODBC.<br />

Example: (NTrack>200 AND Energy>200)<br />

• C++ like, if the event collection was written using ROOT.<br />

Example: (NTrack>200 && Energy>200).<br />

Note that event collections written with ROOT also accept the SQL operators ’AND’<br />

instead of ’&&’ as well as ’OR’ instead of ’||’. Other SQL operators are not<br />

supported.<br />

page 91

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!