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.4 Reading an n-tuple.<br />

1: NTuplePtr nt(ntupleSvc(), "/NTUPLES/FILE1/ROW_WISE/2");<br />

2: if ( nt ) {<br />

3: long count = 0;<br />

4: NTuple::Item px, py, pz;<br />

5: status = nt->item("px", px);<br />

6: status = nt->item("py", py);<br />

7: status = nt->item("pz", pz);<br />

8: nt->attachSelector(new SelectStatement("pz>0 And px>0"));<br />

9: // Access the N tuple row by row and print the first 10 tracks<br />

10: while ( ntupleSvc()->readRecord(nt.ptr()).isSuccess() ) {<br />

11: log

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

Saved successfully!

Ooh no, something went wrong!