DØ "How To" Guide to
How To Analyze a DST
| Page updated August 20, 2002 |
This document contains a semi-random collection of examples of how to analyze the DØ DST.
The following code snipets show examples of how to get at information. It is left as an exercise to the reader to figure out what include files are needed (hint - you need at least the includes of the objects described below, which you can find by following the links).
TKey<ChargedParticleChunk> chKey;
THandle<ChargedParticleChunk> chChunk = chKey.find(event);
if ( chChunk.is_valid() ) { ... }
vector<ChargedParticle>::const_iterator chpartPtr;
const vector<ChargedParticle>* chparts = chpartChunk->getParticles();
for ( chpartPtr = chparts->begin(); chpartPtr != chparts->end(); chpartPtr++ ) { ... }
ChargedParticle::GtrIndex gtrackIndex = chpartPtr->gtrackindex();
LinkPtr<GTrackChunk, GTrack> gtrackPtr(gtrackIndex);
if ( gtrackPtr->is_valid() ) { ... }
const ETrack etrack = chpartPtr->get_etrack();
float r_dca = etrack.get_vector(SurfDCA::IRSIGNED);
float z_dca = etrack.get_vector(SurfDCA::IZ);
float phi_dca = etrack.get_vector(SurfDCA::IPHID);
float tanlam_dca = etrack.get_vector(SurfDCA::ITLM);
float qpt_dca = etrack.get_vector(SurfDCA::IQPT);
const D0Track d0track(*gtrackPtr);
int nHits = d0track.num_hits();
int nMeas = gtrackPtr->get_num_measurements();
TKey<VertexCollChunk> vtxKey;
THandle<VertexCollChunk> vtxChunk = vtxKey.find(event);
if ( vtxChunk.is_valid() ) { ... }
xyz[0] = vtx->get_vertexpos()(0);
// x
xyz[1] = vtx->get_vertexpos()(1);
// y
xyz[2] = vtx->get_vertexpos()(2);
// z
TKey<CalDataChunk> calKey;
THandle<CalDataChunk> calChunk = calKey.find(event);
if ( calChunk.is_valid() ) { ... }
const CalData* calDataPtr = calChunk->getCalData(xyz);
if ( calDataPtr != NULL ) {
list <const CalCell*> cellList;
calDataPtr->getCells(cellList);
list <const CalCell*>::iterator cellItr;
for (cellItr = cellList.begin(); cellItr != cellList.end(); cellItr++) {
const CalCell* cellPtr = *cellItr;
if ( cellPtr != NULL ) {
float e = cellPtr->E();
float pt = cellPtr->pT();
float phi = cellPtr->phi();
float eta = cellPtr->eta();
CellAddress address = cellPtr->address();
int ieta = address.ieta();
int iphi = address.iphi();
int ilyr = address.layer();
...
TKey<MissingETChunk> metKey;
THandle<MissingETChunk> metChunk = metKey.find(event);
if ( metChunk.is_valid() ) { ... }
MissingET* metPtr = metChunk.ptr()->getMissingET();
if ( metPtr != NULL ) {
float mex;
float mey;
metPtr->getMExy(mex, mey);
float met = metPtr->getMET();
...
This page maintained by Harry Melanson