Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

lStdHep::Event Class Reference

Collaboration diagram for lStdHep::Event:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Event ()
 ~Event ()
void cleanup (void)
long read (lStdHep &ls)
long printHeader (FILE *fp)
long print (FILE *fp)

Public Attributes

long isEmpty
long blockid
long ntot
const char * version
long evtnum
long storenum
long runnum
long trigMask
long nBlocks
long dimBlocks
long nNTuples
long dimNTuples
long * blockIds
long * ptrBlocks
long nevhep
long nhep
long * isthep
long * idhep
long * jmohep
long * jdahep
double * phep
double * vhep
long bnevtreq
long bnevtgen
long bnevtwrt
double bstdecom
double bstdxsec
double bstdseed1
double bstdseed2
long enevtreq
long enevtgen
long enevtwrt
double estdecom
double estdxsec
double estdseed1
double estdseed2

Constructor & Destructor Documentation

lStdHep::Event::Event  ) 
 

Definition at line 367 of file lStdHep.cc.

References lStdHep::blockIds, lStdHep::ntot, and lStdHep::version.

00367                     :
00368    isEmpty(1), blockid(0), ntot(0), version(0), blockIds(0),
00369    ptrBlocks(0), nevhep(0), nhep(0), isthep(0), idhep(0),
00370    jmohep(0), jdahep(0), phep(0), vhep(0) 
00371 {
00372    return;
00373 }

lStdHep::Event::~Event  ) 
 

Definition at line 375 of file lStdHep.cc.

References cleanup().

00376 {
00377    cleanup();
00378 };


Member Function Documentation

void lStdHep::Event::cleanup void   ) 
 

Definition at line 380 of file lStdHep.cc.

References blockid, blockIds, idhep, isEmpty, isthep, jdahep, jmohep, nevhep, nhep, ntot, phep, ptrBlocks, version, and vhep.

Referenced by read(), and ~Event().

00381 {
00382    delete [] version;     version   = 0;
00383    delete [] ptrBlocks;   ptrBlocks = 0;
00384    delete [] blockIds;    blockIds  = 0;
00385    delete [] isthep;      isthep    = 0;
00386    delete [] idhep;       idhep     = 0;
00387    delete [] jmohep;      jmohep    = 0;
00388    delete [] jdahep;      jdahep    = 0;
00389    delete [] phep;        phep      = 0;
00390    delete [] vhep;        vhep      = 0;
00391    blockid = ntot = nevhep = nhep = 0;
00392    isEmpty = 1;
00393    return;
00394 }

long lStdHep::Event::print FILE *  fp  ) 
 

Definition at line 514 of file lStdHep.cc.

References nevhep, and nhep.

Referenced by lStdHep::printEvent().

00515 {
00516    fprintf(fp, "   Event: nevhep: %ld, nhep: %ld\n", nevhep, nhep);
00517    return(0);
00518 }

long lStdHep::Event::printHeader FILE *  fp  ) 
 

Definition at line 495 of file lStdHep.cc.

References blockid, blockIds, dimBlocks, dimNTuples, evtnum, nBlocks, nNTuples, ntot, ptrBlocks, runnum, storenum, trigMask, and version.

Referenced by lStdHep::printEventHeader().

00496 {
00497    fprintf(fp, "  EventHeader: blockid: %ld, ntot: %ld, version: %s\n", blockid, ntot, version);
00498    fprintf(fp, "             : evtnum: %ld, storenum: %ld, runnum: %ld, trigMask: %ld, nBlocks: %ld, dimBlocks: %ld\n",
00499            evtnum, storenum, runnum, trigMask, nBlocks, dimBlocks);
00500    fprintf(fp, "             : nNTuples: %ld, dimNTuples: %ld\n", nNTuples, dimNTuples);
00501 
00502    for (int i = 0; i < nBlocks; i++) {
00503       const char *labels[9] = {"Event", "Off-track arrays", "Off-track struct", "Trace arrays",
00504                                "Event with multiple interactions", "Begin run", "End run", "StdHepCXX",
00505                                "Unknown" };
00506       int j = blockIds[i] - 101;
00507       if ((j < 0) || (j > 8)) j = 8;
00508       fprintf(fp, "             : %d: blockIds %ld (%s) ptrBlocks %ld\n",
00509               i, blockIds[i], labels[j], ptrBlocks[i]);
00510    }
00511    return(0);
00512 }

long lStdHep::Event::read lStdHep ls  ) 
 

Definition at line 396 of file lStdHep.cc.

References blockid, blockIds, bnevtgen, bnevtreq, bnevtwrt, bstdecom, bstdseed1, bstdseed2, bstdxsec, cleanup(), dimBlocks, dimNTuples, enevtgen, enevtreq, enevtwrt, estdecom, estdseed1, estdseed2, estdxsec, evtnum, lXDR::getError(), idhep, isEmpty, isthep, jdahep, jmohep, LSH_EVENTHEADER, LSH_NOEVENT, LSH_NOTSUPPORTED, LSH_OFFTRACKARRAYS, LSH_OFFTRACKSTRUCT, LSH_STDHEP, LSH_STDHEPBEG, LSH_STDHEPCXX, LSH_STDHEPEND, LSH_STDHEPM, LSH_TRACEARRAYS, nBlocks, nevhep, nhep, nNTuples, ntot, phep, ptrBlocks, lXDR::readDouble(), lXDR::readDoubleArray(), lXDR::readFloat(), lXDR::readLong(), lXDR::readLongArray(), lXDR::readString(), runnum, lXDR::setError(), storenum, trigMask, version, and vhep.

Referenced by lStdHep::readEvent().

00397 {
00398 //
00399 // Read event header
00400 //
00401    long len;
00402 
00403    cleanup();
00404 
00405    blockid = ls.readLong();
00406    ntot    = ls.readLong();
00407    if(version) {
00408      delete[] version; // avoid leaking memory... GL040817
00409      version=NULL;
00410    }
00411    version = ls.readString(len);
00412    if (blockid != LSH_EVENTHEADER) ls.setError(LSH_NOEVENT);
00413 
00414    evtnum    = ls.readLong();
00415    storenum  = ls.readLong();
00416    runnum    = ls.readLong();
00417    trigMask  = ls.readLong();
00418    nBlocks   = ls.readLong();
00419    dimBlocks = ls.readLong();
00420 
00421    if (*version == '2') {
00422       nNTuples = ls.readLong();
00423       dimNTuples = ls.readLong();
00424       if (dimBlocks) {
00425          blockIds  = ls.readLongArray(len);
00426          ptrBlocks = ls.readLongArray(len);
00427       }
00428       if (dimNTuples) {
00429          ls.setError(LSH_NOTSUPPORTED);
00430          return(ls.getError());
00431       }
00432    }
00433    else {
00434       nNTuples   = 0;
00435       dimNTuples = 0;
00436       blockIds   = ls.readLongArray(len);
00437       ptrBlocks  = ls.readLongArray(len);
00438    }
00439 //
00440 // Read event
00441 //
00442    for (int i = 0; i < nBlocks; i++) {
00443       blockid = ls.readLong();
00444       ntot    = ls.readLong();
00445       if(version) {
00446         delete[] version; // avoid leaking memory... GL040817
00447         version=NULL;
00448       }
00449       version = ls.readString(len);
00450 
00451       isEmpty = 0;
00452       switch (blockIds[i]) {
00453          case LSH_STDHEP          : // 101
00454             nevhep = ls.readLong();
00455             nhep   = ls.readLong();
00456             isthep = ls.readLongArray(len);
00457             idhep  = ls.readLongArray(len);
00458             jmohep = ls.readLongArray(len);
00459             jdahep = ls.readLongArray(len);
00460             phep   = ls.readDoubleArray(len);
00461             vhep   = ls.readDoubleArray(len);
00462             break;
00463          case LSH_OFFTRACKARRAYS  : // 102
00464          case LSH_OFFTRACKSTRUCT  : // 103
00465          case LSH_TRACEARRAYS     : // 104
00466          case LSH_STDHEPM         : // 105
00467             break;
00468          case LSH_STDHEPBEG       : // 106
00469             bnevtreq  = ls.readLong();
00470             bnevtgen  = ls.readLong();
00471             bnevtwrt  = ls.readLong();
00472             bstdecom  = ls.readFloat();
00473             bstdxsec  = ls.readFloat();
00474             bstdseed1 = ls.readDouble();
00475             bstdseed2 = ls.readDouble();
00476             isEmpty  = 1;
00477             break;
00478          case LSH_STDHEPEND       : // 107
00479             enevtreq  = ls.readLong();
00480             enevtgen  = ls.readLong();
00481             enevtwrt  = ls.readLong();
00482             estdecom  = ls.readFloat();
00483             estdxsec  = ls.readFloat();
00484             estdseed1 = ls.readDouble();
00485             estdseed2 = ls.readDouble();
00486             isEmpty = 1;
00487             break;
00488          case LSH_STDHEPCXX       : // 108
00489             break;
00490       }
00491    }
00492    return(ls.getError());
00493 };


Member Data Documentation

long lStdHep::Event::blockid
 

Definition at line 303 of file lStdHep.hh.

Referenced by lStdHep::blockId(), cleanup(), printHeader(), and read().

long* lStdHep::Event::blockIds
 

Definition at line 317 of file lStdHep.hh.

Referenced by cleanup(), printHeader(), and read().

long lStdHep::Event::bnevtgen
 

Definition at line 334 of file lStdHep.hh.

Referenced by read().

long lStdHep::Event::bnevtreq
 

Definition at line 333 of file lStdHep.hh.

Referenced by read().

long lStdHep::Event::bnevtwrt
 

Definition at line 335 of file lStdHep.hh.

Referenced by read().

double lStdHep::Event::bstdecom
 

Definition at line 336 of file lStdHep.hh.

Referenced by read().

double lStdHep::Event::bstdseed1
 

Definition at line 338 of file lStdHep.hh.

Referenced by read().

double lStdHep::Event::bstdseed2
 

Definition at line 339 of file lStdHep.hh.

Referenced by read().

double lStdHep::Event::bstdxsec
 

Definition at line 337 of file lStdHep.hh.

Referenced by read().

long lStdHep::Event::dimBlocks
 

Definition at line 314 of file lStdHep.hh.

Referenced by printHeader(), and read().

long lStdHep::Event::dimNTuples
 

Definition at line 316 of file lStdHep.hh.

Referenced by printHeader(), and read().

long lStdHep::Event::enevtgen
 

Definition at line 344 of file lStdHep.hh.

Referenced by read().

long lStdHep::Event::enevtreq
 

Definition at line 343 of file lStdHep.hh.

Referenced by read().

long lStdHep::Event::enevtwrt
 

Definition at line 345 of file lStdHep.hh.

Referenced by read().

double lStdHep::Event::estdecom
 

Definition at line 346 of file lStdHep.hh.

Referenced by read().

double lStdHep::Event::estdseed1
 

Definition at line 348 of file lStdHep.hh.

Referenced by read().

double lStdHep::Event::estdseed2
 

Definition at line 349 of file lStdHep.hh.

Referenced by read().

double lStdHep::Event::estdxsec
 

Definition at line 347 of file lStdHep.hh.

Referenced by read().

long lStdHep::Event::evtnum
 

Definition at line 309 of file lStdHep.hh.

Referenced by printHeader(), and read().

long* lStdHep::Event::idhep
 

Definition at line 325 of file lStdHep.hh.

Referenced by cleanup(), lStdHep::pid(), read(), and lStdHep::setPid().

long lStdHep::Event::isEmpty
 

Definition at line 299 of file lStdHep.hh.

Referenced by cleanup(), read(), and lStdHep::readEvent().

long* lStdHep::Event::isthep
 

Definition at line 324 of file lStdHep.hh.

Referenced by cleanup(), read(), lStdHep::setStatus(), and lStdHep::status().

long* lStdHep::Event::jdahep
 

Definition at line 327 of file lStdHep.hh.

Referenced by cleanup(), lStdHep::daughter1(), lStdHep::daughter2(), read(), lStdHep::setDaughter1(), and lStdHep::setDaughter2().

long* lStdHep::Event::jmohep
 

Definition at line 326 of file lStdHep.hh.

Referenced by cleanup(), lStdHep::mother1(), lStdHep::mother2(), read(), lStdHep::setMother1(), and lStdHep::setMother2().

long lStdHep::Event::nBlocks
 

Definition at line 313 of file lStdHep.hh.

Referenced by printHeader(), and read().

long lStdHep::Event::nevhep
 

Definition at line 322 of file lStdHep.hh.

Referenced by cleanup(), lStdHep::evtNum(), lStdHep::getEvent(), print(), read(), and lStdHep::setEvtNum().

long lStdHep::Event::nhep
 

Definition at line 323 of file lStdHep.hh.

Referenced by cleanup(), lStdHep::getEvent(), lStdHep::nTracks(), print(), lStdHep::printTrack(), read(), lStdHep::setEvent(), and lStdHep::setNTracks().

long lStdHep::Event::nNTuples
 

Definition at line 315 of file lStdHep.hh.

Referenced by printHeader(), and read().

long lStdHep::Event::ntot
 

Definition at line 304 of file lStdHep.hh.

Referenced by cleanup(), printHeader(), and read().

double* lStdHep::Event::phep
 

Definition at line 328 of file lStdHep.hh.

Referenced by cleanup(), lStdHep::E(), lStdHep::M(), lStdHep::Px(), lStdHep::Py(), lStdHep::Pz(), read(), lStdHep::setE(), lStdHep::setM(), lStdHep::setPx(), lStdHep::setPy(), and lStdHep::setPz().

long* lStdHep::Event::ptrBlocks
 

Definition at line 318 of file lStdHep.hh.

Referenced by cleanup(), printHeader(), and read().

long lStdHep::Event::runnum
 

Definition at line 311 of file lStdHep.hh.

Referenced by printHeader(), read(), and lStdHep::runNum().

long lStdHep::Event::storenum
 

Definition at line 310 of file lStdHep.hh.

Referenced by printHeader(), and read().

long lStdHep::Event::trigMask
 

Definition at line 312 of file lStdHep.hh.

Referenced by printHeader(), and read().

const char* lStdHep::Event::version
 

Definition at line 305 of file lStdHep.hh.

Referenced by cleanup(), printHeader(), and read().

double* lStdHep::Event::vhep
 

Definition at line 329 of file lStdHep.hh.

Referenced by cleanup(), read(), lStdHep::setT(), lStdHep::setX(), lStdHep::setY(), lStdHep::setZ(), lStdHep::T(), lStdHep::X(), lStdHep::Y(), and lStdHep::Z().


The documentation for this class was generated from the following files:
Generated on Thu Oct 7 18:45:09 2004 for LCDG4 by doxygen 1.3.4