30 lXDR(filename, open_for_write),
31 ntot(0),version(0),title(0),comment(0),date(0),closingDate(0),numevts_expect(0),numevts(0),
32 firstTable(0),dimTable(0),nNTuples(0),nBlocks(0),blockIds(0),blockNames(0)
52 for (
int i = 0; i <
nBlocks; i++) {
62 if (fp == 0) fp = stdout;
64 fprintf(fp,
"====== File Header ===========\n");
65 fprintf(fp,
" total blocks: %ld\n",
ntot);
66 fprintf(fp,
" version: %s\n",
version);
67 fprintf(fp,
" title: %s\n",
title);
68 fprintf(fp,
" comment: %s\n",
comment);
69 fprintf(fp,
" date: %s",
date);
72 fprintf(fp,
" events: %ld\n",
numevts);
74 fprintf(fp,
" dimTable: %ld\n",
dimTable);
75 fprintf(fp,
" nNTuples: %ld\n",
nNTuples);
76 fprintf(fp,
" nBlocks: %ld\n",
nBlocks);
77 if (
nBlocks) fprintf(fp,
" block names:\n");
78 for (
int i = 0; i <
nBlocks; i++) {
81 fprintf(fp,
"=============================\n");
87 if (fp == 0) fp = stdout;
94 if (fp == 0) fp = stdout;
95 event.printHeader(fp);
101 if (fp == 0) fp = stdout;
108 if (fp == 0) fp = stdout;
110 fprintf(fp,
" Track: id: %ld, vtx: (%g, %g, %g, %g), mom: (%g, %g, %g, %g, %g)\n",
112 fprintf(fp,
" Track: wgt: %g, alpha QED: %g, alpha QCD: %g, idrup: %ld\n",
120 if (fp == 0) fp = stdout;
126 if (fp == 0) fp = stdout;
180 lse.
evtNum =
event.nevhep;
183 for (
int i = 0; i <
event.nhep; i++) {
227 if ((strcmp(
version,
"2.00") == 0) || (strcmp(
version,
"1.00") == 0)) {
269 for (
int i = 0; i <
event.nhep; i++) {
297 isEmpty(1), ievt(0), blockid(0), ntot(0), version(0),
298 nextlocator(-3), numEvts(0), evtnums(0),
299 storenums(0), runnums(0), trigMasks(0), ptrEvents(0)
313 delete [] evtnums; evtnums = 0;
314 delete [] storenums; storenums = 0;
315 delete [] runnums; runnums = 0;
316 delete [] trigMasks; trigMasks = 0;
317 delete [] ptrEvents; ptrEvents = 0;
319 ievt =
ntot = blockid = numEvts = 0;
344 if (numEvts > 0) isEmpty = 0;
350 fprintf(fp,
" EventTable: blockid: %ld, ntot: %ld, version: %s\n", blockid,
ntot,
version);
351 fprintf(fp,
" EventTable: nextlocator: %ld, numEvts: %ld\n", nextlocator, numEvts);
352 for (
int i = 0; i < numEvts; i++) {
353 fprintf(fp,
" EventTable: %d: evtnums %ld storenums %ld runnums %ld trigMasks %ld ptrEvents %ld\n",
354 i, evtnums[i], storenums[i], runnums[i], trigMasks[i], ptrEvents[i]);
356 fprintf(fp,
" EventTable: etc.\n");
366 ptrBlocks(0),nevhep(0),nhep(0),isthep(0),idhep(0),jmohep(0),jdahep(0),phep(0),
368 bnevtreq(0),bnevtgen(0),bnevtwrt(0),bstdecom(0),bstdxsec(0),bstdseed1(0),bstdseed2(0),
369 enevtreq(0),enevtgen(0),enevtwrt(0),estdecom(0),estdxsec(0),estdseed1(0),estdseed2(0)
383 delete [] ptrBlocks; ptrBlocks = 0;
385 delete [] isthep; isthep = 0;
386 delete [] idhep; idhep = 0;
387 delete [] jmohep; jmohep = 0;
388 delete [] jdahep; jdahep = 0;
389 delete [] phep; phep = 0;
390 delete [] vhep; vhep = 0;
392 delete [] spin; spin = 0;
394 blockid =
ntot = nevhep = nhep = 0;
441 for (
int i = 0; i <
nBlocks; i++) {
452 if (isthep)
delete [] isthep;
454 if (idhep)
delete [] idhep;
456 if (jmohep)
delete [] jmohep;
458 if (jdahep)
delete [] jdahep;
460 if (phep)
delete [] phep;
462 if (vhep)
delete [] vhep;
468 if (isthep)
delete [] isthep;
470 if (idhep)
delete [] idhep;
472 if (jmohep)
delete [] jmohep;
474 if (jdahep)
delete [] jdahep;
476 if (phep)
delete [] phep;
478 if (vhep)
delete [] vhep;
488 if (spin)
delete [] spin;
528 fprintf(fp,
" EventHeader: blockid: %ld, ntot: %ld, version: %s\n", blockid,
ntot,
version);
529 fprintf(fp,
" : evtnum: %ld, storenum: %ld, runnum: %ld, trigMask: %ld, nBlocks: %ld, dimBlocks: %ld\n",
531 fprintf(fp,
" : nNTuples: %ld, dimNTuples: %ld\n",
nNTuples, dimNTuples);
533 for (
int i = 0; i <
nBlocks; i++) {
534 const char *labels[10] = {
"Event",
"Off-track arrays",
"Off-track struct",
"Trace arrays",
535 "Event with multiple interactions",
"Begin run",
"End run",
"StdHepCXX",
536 "EventV4",
"Unknown" };
539 if ((j < 0) || (j > 9)) j = 9;
540 fprintf(fp,
" : %d: blockIds %ld (%s) ptrBlocks %ld\n",
541 i,
blockIds[i], labels[j], ptrBlocks[i]);
548 fprintf(fp,
" Event: nevhep: %ld, nhep: %ld\n", nevhep, nhep);
long mother2(int i) const
void setDaughter1(int i, long n)
double alphaQCD(void) const
long filePosition(long pos=-1)
long getEvent(lStdEvent &lse) const
long daughter1(int i) const
void printBeginRunRecord(FILE *fp=0)
void printFileHeader(FILE *fp=0)
void setPid(int i, long aPid)
long mother1(int i) const
double scale(int i, int j) const
void printTrack(int i, FILE *fp=0)
long daughter2(int i) const
#define LSH_OFFTRACKSTRUCT
double alphaQED(void) const
void printEventTable(FILE *fp=0)
void printEvent(FILE *fp=0)
void setPx(int i, double px)
void setT(int i, double t)
void setError(long error)
void setDaughter2(int i, long n)
void printEndRunRecord(FILE *fp=0)
long printHeader(FILE *fp)
void setY(int i, double y)
lStdHep(const char *filename=0, bool open_for_write=false)
void setX(int i, double x)
long * readLongArray(long &length)
#define LSH_EVTABLECORRUPT
void setM(int i, double m)
void setE(int i, double e)
double * readDoubleArray(long &length)
void setPz(int i, double pz)
long readFileHeader(void)
void setPy(int i, double py)
void setZ(int i, double z)
void setStatus(int i, long s)
long setEvent(const lStdEvent &lse)
void setMother1(int i, long n)
#define LSH_OFFTRACKARRAYS
long getError(void) const
const char * readString(long &length)
long colorflow(int i, int j) const
void printEventHeader(FILE *fp=0)
double eventweight(void) const
void setMother2(int i, long n)