/* * cdccount - an example program for accessing the contents * of events stored in a hddm file. * * Richard Jones * GlueX collaboration * January 10, 2005 * */ #include #include #include "hddm_s.h" int process_event(s_HDDM_t *event); int main(int argc, char **argv) { s_HDDM_t *thisInputEvent = 0; s_iostream_t *thisInputFile = 0; int events_with_hits = 0; int events = 0; int input; for (input=1; inputphysicsEvents->in[0].hitView; if (hits == HDDM_NULL || hits->centralDC == HDDM_NULL || hits->centralDC->cdcTruthPoints == HDDM_NULL) { return 0; } //printf("New event number %d,",event->physicsEvents->in[0].eventNo); //printf(" run number %d\n",event->physicsEvents->in[0].runNo); points = hits->centralDC->cdcTruthPoints; //printf(" found %d cdcTruthPoints!\n",points->mult); int ipoint; int count=0; for (ipoint=0; ipointmult; ipoint++) { s_CdcTruthPoint_t *point = &points->in[ipoint]; if (fabs(point->dradius-19.5) < 0.5e5) { //printf(" dradius=%f,",point->dradius); //printf(" phi=%f,",point->phi); //printf(" primary=%s,",point->primary ? "true":"false"); //printf(" r=%f,",point->r); //printf(" track=%f,",point->track); //printf(" z=%f,",point->z); //printf(" dE/dx=%f\n",point->dEdx * 1e6); } ++count; } return count; }