#include <lStdHep.hh>
Inheritance diagram for lStdHep:


Public Member Functions | |
| lStdHep (const char *filename=0, bool open_for_write=false) | |
| virtual | ~lStdHep () |
| bool | more (void) |
| long | readEvent (void) |
| long | getEvent (lStdEvent &lse) const |
| long | readEvent (lStdEvent &lse) |
| long | blockId () const |
| long | nTracks (void) const |
| long | evtNum (void) const |
| long | runNum (void) const |
| double | X (int i) const |
| double | Y (int i) const |
| double | Z (int i) const |
| double | T (int i) const |
| double | Px (int i) const |
| double | Py (int i) const |
| double | Pz (int i) const |
| double | E (int i) const |
| double | M (int i) const |
| long | pid (int i) const |
| long | status (int i) const |
| long | mother1 (int i) const |
| long | mother2 (int i) const |
| long | daughter1 (int i) const |
| long | daughter2 (int i) const |
| long | writeEvent (void) |
| long | setEvent (const lStdEvent &lse) |
| long | writeEvent (lStdEvent &lse) |
| void | setNTracks (long n) |
| void | setEvtNum (long n) |
| void | setX (int i, double x) |
| void | setY (int i, double y) |
| void | setZ (int i, double z) |
| void | setT (int i, double t) |
| void | setPx (int i, double px) |
| void | setPy (int i, double py) |
| void | setPz (int i, double pz) |
| void | setE (int i, double e) |
| void | setM (int i, double m) |
| void | setPid (int i, long pid) |
| void | setStatus (int i, long s) |
| void | setMother1 (int i, long n) |
| void | setMother2 (int i, long n) |
| void | setDaughter1 (int i, long n) |
| void | setDaughter2 (int i, long n) |
| void | printFileHeader (FILE *fp=0) |
| void | printBeginRunRecord (FILE *fp=0) |
| void | printEndRunRecord (FILE *fp=0) |
| void | printEventTable (FILE *fp=0) |
| void | printEventHeader (FILE *fp=0) |
| void | printEvent (FILE *fp=0) |
| void | printTrack (int i, FILE *fp=0) |
Static Public Member Functions | |
| int | getMajor (void) |
| int | getMinor (void) |
| const char * | getText (void) |
Private Types | |
| enum | { MAJOR = 1, MINOR = 0, DAY = 23, MONTH = 10, YEAR = 2003 } |
Private Member Functions | |
| lStdHep (const lStdHep &) | |
| lStdHep & | operator= (const lStdHep &) |
| long | readFileHeader (void) |
Private Attributes | |
| bool | moreEvents |
| long | ntot |
| const char * | version |
| const char * | title |
| const char * | comment |
| const char * | date |
| const char * | closingDate |
| long | numevts_expect |
| long | numevts |
| long | firstTable |
| long | dimTable |
| long | nNTuples |
| long | nBlocks |
| long * | blockIds |
| const char ** | blockNames |
| EventTable | eventTable |
| Event | event |
|
|
Definition at line 101 of file lStdHep.hh.
|
|
||||||||||||
|
Definition at line 27 of file lStdHep.cc. References LSH_NOTSUPPORTED, readFileHeader(), and lXDR::setError().
00027 : lXDR(filename, open_for_write), 00028 moreEvents(true), version(0), title(0), comment(0), date(0), closingDate(0), blockIds(0), 00029 blockNames(0) 00030 00031 { 00032 if (open_for_write) { 00033 setError(LSH_NOTSUPPORTED); 00034 } 00035 else { 00036 readFileHeader(); 00037 } 00038 return; 00039 } |
|
|
|
|
|
Definition at line 41 of file lStdHep.cc. References blockIds, blockNames, closingDate, comment, date, nBlocks, title, and version.
00042 {
00043 delete [] version;
00044 delete [] date;
00045 delete [] closingDate;
00046 delete [] comment;
00047 delete [] title;
00048 delete [] blockIds;
00049 if (blockNames) {
00050 for (int i = 0; i < nBlocks; i++) {
00051 delete [] blockNames[i];
00052 }
00053 delete [] blockNames;
00054 }
00055 return;
00056 }
|
|
|
Definition at line 158 of file lStdHep.hh. References lStdHep::Event::blockid, and event.
|
|
|
Definition at line 176 of file lStdHep.hh. References event, and lStdHep::Event::jdahep. Referenced by getEvent(), LCDG4readStdFile::MakeMcParts(), and setEvent().
|
|
|
Definition at line 177 of file lStdHep.hh. References event, and lStdHep::Event::jdahep. Referenced by getEvent(), LCDG4readStdFile::MakeMcParts(), and setEvent().
|
|
|
Definition at line 170 of file lStdHep.hh. References event, and lStdHep::Event::phep. Referenced by getEvent(), LCDG4readStdFile::MakeMcParts(), printTrack(), and setEvent().
|
|
|
Definition at line 160 of file lStdHep.hh. References event, and lStdHep::Event::nevhep.
|
|
|
Definition at line 172 of file lStdHep.cc. References daughter1(), lStdTrack::daughter1, daughter2(), lStdTrack::daughter2, E(), lStdTrack::E, event, lStdEvent::evtNum, lXDR::getError(), LSH_SUCCESS, M(), lStdTrack::M, mother1(), lStdTrack::mother1, mother2(), lStdTrack::mother2, lStdHep::Event::nevhep, lStdHep::Event::nhep, pid(), lStdTrack::pid, Px(), lStdTrack::Px, Py(), lStdTrack::Py, Pz(), lStdTrack::Pz, lStdTrack::status, status(), T(), lStdTrack::T, X(), lStdTrack::X, Y(), lStdTrack::Y, Z(), and lStdTrack::Z. Referenced by readEvent().
00173 {
00174 if (long status = getError() != LSH_SUCCESS) return(status);
00175
00176 lse.evtNum = event.nevhep;
00177
00178 lse.clear();
00179 for (int i = 0; i < event.nhep; i++) {
00180 lStdTrack lst;
00181 lst.X = X(i);
00182 lst.Y = Y(i);
00183 lst.Z = Z(i);
00184 lst.T = T(i);
00185 lst.Px = Px(i);
00186 lst.Py = Py(i);
00187 lst.Pz = Pz(i);
00188 lst.E = E(i);
00189 lst.M = M(i);
00190 lst.pid = pid(i);
00191 lst.status = status(i);
00192 lst.mother1 = mother1(i);
00193 lst.mother2 = mother2(i);
00194 lst.daughter1 = daughter1(i);
00195 lst.daughter2 = daughter2(i);
00196 lse.push_back(lst);
00197 }
00198 return(LSH_SUCCESS);
00199 }
|
|
|
Reimplemented from lXDR. Definition at line 104 of file lStdHep.hh. References MAJOR.
00104 { return(MAJOR); };
|
|
|
Reimplemented from lXDR. Definition at line 105 of file lStdHep.hh. References MINOR.
00105 { return(MINOR); };
|
|
|
Reimplemented from lXDR. Definition at line 106 of file lStdHep.hh. References DAY, MAJOR, MINOR, MONTH, and YEAR.
00106 {
00107 static char buff[80];
00108 sprintf(buff, "lStdHep version %d.%d (%02d.%02d.%d) by W.G.J. Langeveld, SLAC",
00109 MAJOR, MINOR, DAY, MONTH, YEAR);
00110 return(buff);
00111 };
|
|
|
Definition at line 171 of file lStdHep.hh. References event, and lStdHep::Event::phep. Referenced by getEvent(), printTrack(), and setEvent().
|
|
|
Definition at line 126 of file lStdHep.cc. References lXDR::getError(), LSH_SUCCESS, and moreEvents. Referenced by LCDG4readStdFile::ReadEvent().
00127 {
00128 return(moreEvents && (getError() == LSH_SUCCESS));
00129 }
|
|
|
Definition at line 174 of file lStdHep.hh. References event, and lStdHep::Event::jmohep. Referenced by getEvent(), LCDG4readStdFile::MakeMcParts(), and setEvent().
|
|
|
Definition at line 175 of file lStdHep.hh. References event, and lStdHep::Event::jmohep. Referenced by getEvent(), LCDG4readStdFile::MakeMcParts(), and setEvent().
|
|
|
Definition at line 159 of file lStdHep.hh. References event, and lStdHep::Event::nhep. Referenced by LCDG4readStdFile::MakeMcParts(), and LCDG4readStdFile::ReadEvent().
|
|
|
|
|
|
Definition at line 172 of file lStdHep.hh. References event, and lStdHep::Event::idhep. Referenced by getEvent(), LCDG4readStdFile::MakeMcParts(), printTrack(), and setEvent().
|
|
|
Definition at line 114 of file lStdHep.cc.
00115 {
00116 if (fp == 0) fp = stdout;
00117 return;
00118 }
|
|
|
Definition at line 120 of file lStdHep.cc.
00121 {
00122 if (fp == 0) fp = stdout;
00123 return;
00124 }
|
|
|
Definition at line 97 of file lStdHep.cc. References event, and lStdHep::Event::print().
|
|
|
Definition at line 90 of file lStdHep.cc. References event, and lStdHep::Event::printHeader().
00091 {
00092 if (fp == 0) fp = stdout;
00093 event.printHeader(fp);
00094 return;
00095 }
|
|
|
Definition at line 83 of file lStdHep.cc. References eventTable, and lStdHep::EventTable::print().
00084 {
00085 if (fp == 0) fp = stdout;
00086 eventTable.print(fp);
00087 return;
00088 }
|
|
|
Definition at line 58 of file lStdHep.cc. References blockNames, closingDate, comment, date, dimTable, firstTable, nBlocks, nNTuples, ntot, numevts, numevts_expect, title, and version.
00059 {
00060 if (fp == 0) fp = stdout;
00061
00062 fprintf(fp, "====== File Header ===========\n");
00063 fprintf(fp, " total blocks: %ld\n", ntot);
00064 fprintf(fp, " version: %s\n", version);
00065 fprintf(fp, " title: %s\n", title);
00066 fprintf(fp, " comment: %s\n", comment);
00067 fprintf(fp, " date: %s", date);
00068 fprintf(fp, " closing date: %s", closingDate);
00069 fprintf(fp, " expected events: %ld\n", numevts_expect);
00070 fprintf(fp, " events: %ld\n", numevts);
00071 fprintf(fp, " firstTable: %ld\n", firstTable);
00072 fprintf(fp, " dimTable: %ld\n", dimTable);
00073 fprintf(fp, " nNTuples: %ld\n", nNTuples);
00074 fprintf(fp, " nBlocks: %ld\n", nBlocks);
00075 if (nBlocks) fprintf(fp, " block names:\n");
00076 for (int i = 0; i < nBlocks; i++) {
00077 fprintf(fp, " : %s\n", blockNames[i]);
00078 }
00079 fprintf(fp, "=============================\n");
00080 return;
00081 }
|
|
||||||||||||
|
Definition at line 104 of file lStdHep.cc. References E(), event, M(), lStdHep::Event::nhep, pid(), Px(), Py(), Pz(), T(), X(), Y(), and Z().
|
|
|
Definition at line 167 of file lStdHep.hh. References event, and lStdHep::Event::phep. Referenced by getEvent(), LCDG4readStdFile::MakeMcParts(), printTrack(), and setEvent().
|
|
|
Definition at line 168 of file lStdHep.hh. References event, and lStdHep::Event::phep. Referenced by getEvent(), LCDG4readStdFile::MakeMcParts(), printTrack(), and setEvent().
|
|
|
Definition at line 169 of file lStdHep.hh. References event, and lStdHep::Event::phep. Referenced by getEvent(), LCDG4readStdFile::MakeMcParts(), printTrack(), and setEvent().
|
|
|
Definition at line 201 of file lStdHep.cc. References getEvent(), LSH_SUCCESS, readEvent(), and status().
00202 {
00203 long status = readEvent();
00204 if (status != LSH_SUCCESS) return(status);
00205 return(getEvent(lse));
00206 }
|
|
|
Definition at line 131 of file lStdHep.cc. References event, eventTable, lXDR::filePosition(), lXDR::getError(), lStdHep::EventTable::ievt, lStdHep::EventTable::isEmpty, lStdHep::Event::isEmpty, LSH_EVTABLECORRUPT, LSH_SUCCESS, moreEvents, lStdHep::EventTable::nextlocator, lStdHep::EventTable::numEvts, lStdHep::EventTable::ptrEvents, lStdHep::EventTable::read(), lStdHep::Event::read(), and lXDR::setError(). Referenced by readEvent(), and LCDG4readStdFile::ReadEvent().
00132 {
00133 //
00134 // Look for an event or an event table
00135 //
00136 event.isEmpty = 1;
00137 while (1) {
00138 if (eventTable.ievt < eventTable.numEvts) {
00139 if (filePosition(eventTable.ptrEvents[eventTable.ievt]) !=
00140 eventTable.ptrEvents[eventTable.ievt]) return(getError());
00141
00142 if (event.read(*this) != LSH_SUCCESS) return(getError());
00143 eventTable.ievt++;
00144
00145 if (event.isEmpty) continue;
00146 return(getError());
00147 }
00148
00149 eventTable.isEmpty = 1;
00150 while (eventTable.isEmpty) {
00151 if (eventTable.nextlocator == -2) {
00152 //
00153 // This was the last event table, signal quitting. Not an error.
00154 //
00155 moreEvents = false;
00156 return(getError());
00157 }
00158 else if (eventTable.nextlocator == -1) {
00159 setError(LSH_EVTABLECORRUPT);
00160 return(getError());
00161 }
00162 //
00163 // Go to the next event table
00164 //
00165 if (filePosition(eventTable.nextlocator) != eventTable.nextlocator) return(getError());
00166 if (eventTable.read(*this) != LSH_SUCCESS) return(getError());
00167 }
00168 }
00169 return(getError());
00170 }
|
|
|
Definition at line 208 of file lStdHep.cc. References blockIds, blockNames, closingDate, comment, date, dimTable, eventTable, firstTable, lXDR::getError(), LSH_BLOCKERROR, LSH_FILEHEADER, LSH_NOTSUPPORTED, LSH_SUCCESS, moreEvents, nBlocks, nNTuples, ntot, numevts, numevts_expect, lStdHep::EventTable::read(), lXDR::readLong(), lXDR::readLongArray(), lXDR::readString(), lXDR::setError(), title, and version. Referenced by lStdHep().
00209 {
00210 long len, blockid;
00211
00212 blockid = readLong();
00213 if (blockid != LSH_FILEHEADER) {
00214 setError(LSH_BLOCKERROR);
00215 return(getError());
00216 }
00217 ntot = readLong();
00218 if(version) {
00219 delete[] version; // avoid leaking memory... GL040817
00220 version=NULL;
00221 }
00222 version = readString(len);
00223
00224 title = readString(len);
00225 comment = readString(len);
00226 date = readString(len);
00227 if ((strcmp(version, "2.00") == 0) || (strcmp(version, "1.00") == 0)) {
00228 closingDate = new char[len + 1];
00229 strcpy((char *) closingDate, date);
00230 }
00231 else {
00232 closingDate = readString(len);
00233 }
00234
00235 numevts_expect = readLong();
00236 numevts = readLong();
00237 firstTable = readLong();
00238 dimTable = readLong();
00239 nBlocks = readLong();
00240 if (*version != '2') {
00241 nNTuples = 0;
00242 }
00243 else {
00244 nNTuples = readLong();
00245 }
00246
00247 blockIds = readLongArray(nBlocks);
00248 blockNames = new const char *[nBlocks];
00249 for (int i = 0; i < nBlocks; i++) blockNames[i] = readString(len);
00250 if (nNTuples > 0) setError(LSH_NOTSUPPORTED);
00251 //
00252 // Read the first event table
00253 //
00254 if (eventTable.read(*this) != LSH_SUCCESS) moreEvents = 0;
00255 return(getError());
00256 }
|
|
|
Definition at line 161 of file lStdHep.hh. References event, and lStdHep::Event::runnum.
|
|
||||||||||||
|
Definition at line 211 of file lStdHep.hh. References event, and lStdHep::Event::jdahep. Referenced by setEvent().
|
|
||||||||||||
|
Definition at line 212 of file lStdHep.hh. References event, and lStdHep::Event::jdahep. Referenced by setEvent().
|
|
||||||||||||
|
Definition at line 205 of file lStdHep.hh. References event, and lStdHep::Event::phep. Referenced by setEvent().
|
|
|
Definition at line 263 of file lStdHep.cc. References daughter1(), daughter2(), E(), event, lStdEvent::evtNum, LSH_SUCCESS, M(), mother1(), mother2(), lStdHep::Event::nhep, pid(), Px(), Py(), Pz(), setDaughter1(), setDaughter2(), setE(), setEvtNum(), setM(), setMother1(), setMother2(), setNTracks(), setPid(), setPx(), setPy(), setPz(), setStatus(), setT(), setX(), setY(), setZ(), status(), T(), X(), Y(), and Z(). Referenced by writeEvent().
00264 {
00265 // ***************set up event buffer!
00266 setNTracks(lse.size());
00267 setEvtNum(lse.evtNum);
00268
00269 for (int i = 0; i < event.nhep; i++) {
00270 setX (i, lse[i].X);
00271 setY (i, lse[i].Y);
00272 setZ (i, lse[i].Z);
00273 setT (i, lse[i].T);
00274 setPx (i, lse[i].Px);
00275 setPy (i, lse[i].Py);
00276 setPz (i, lse[i].Pz);
00277 setE (i, lse[i].E);
00278 setM (i, lse[i].M);
00279 setPid (i, lse[i].pid);
00280 setStatus (i, lse[i].status);
00281 setMother1 (i, lse[i].mother1);
00282 setMother2 (i, lse[i].mother2);
00283 setDaughter1(i, lse[i].daughter1);
00284 setDaughter2(i, lse[i].daughter2);
00285 }
00286 return(LSH_SUCCESS);
00287 }
|
|
|
Definition at line 196 of file lStdHep.hh. References event, and lStdHep::Event::nevhep. Referenced by setEvent().
|
|
||||||||||||
|
Definition at line 206 of file lStdHep.hh. References event, and lStdHep::Event::phep. Referenced by setEvent().
|
|
||||||||||||
|
Definition at line 209 of file lStdHep.hh. References event, and lStdHep::Event::jmohep. Referenced by setEvent().
|
|
||||||||||||
|
Definition at line 210 of file lStdHep.hh. References event, and lStdHep::Event::jmohep. Referenced by setEvent().
|
|
|
Definition at line 195 of file lStdHep.hh. References event, and lStdHep::Event::nhep. Referenced by setEvent().
|
|
||||||||||||
|
Definition at line 207 of file lStdHep.hh. References event, and lStdHep::Event::idhep. Referenced by setEvent().
|
|
||||||||||||
|
Definition at line 202 of file lStdHep.hh. References event, and lStdHep::Event::phep. Referenced by setEvent().
|
|
||||||||||||
|
Definition at line 203 of file lStdHep.hh. References event, and lStdHep::Event::phep. Referenced by setEvent().
|
|
||||||||||||
|
Definition at line 204 of file lStdHep.hh. References event, and lStdHep::Event::phep. Referenced by setEvent().
|
|
||||||||||||
|
Definition at line 208 of file lStdHep.hh. References event, and lStdHep::Event::isthep. Referenced by setEvent().
|
|
||||||||||||
|
Definition at line 201 of file lStdHep.hh. References event, and lStdHep::Event::vhep. Referenced by setEvent().
|
|
||||||||||||
|
Definition at line 198 of file lStdHep.hh. References event, and lStdHep::Event::vhep. Referenced by setEvent().
|
|
||||||||||||
|
Definition at line 199 of file lStdHep.hh. References event, and lStdHep::Event::vhep. Referenced by setEvent().
|
|
||||||||||||
|
Definition at line 200 of file lStdHep.hh. References event, and lStdHep::Event::vhep. Referenced by setEvent().
|
|
|
Definition at line 173 of file lStdHep.hh. References event, and lStdHep::Event::isthep. Referenced by getEvent(), LCDG4readStdFile::MakeMcParts(), readEvent(), setEvent(), and writeEvent().
|
|
|
Definition at line 166 of file lStdHep.hh. References event, and lStdHep::Event::vhep. Referenced by getEvent(), printTrack(), and setEvent().
|
|
|
Definition at line 289 of file lStdHep.cc. References LSH_SUCCESS, setEvent(), status(), and writeEvent().
00290 {
00291 long status = writeEvent();
00292 if (status != LSH_SUCCESS) return(status);
00293 return(setEvent(lse));
00294 }
|
|
|
Definition at line 258 of file lStdHep.cc. References LSH_NOTSUPPORTED. Referenced by writeEvent().
00259 {
00260 return(LSH_NOTSUPPORTED);
00261 }
|
|
|
Definition at line 163 of file lStdHep.hh. References event, and lStdHep::Event::vhep. Referenced by getEvent(), LCDG4readStdFile::MakeMcParts(), printTrack(), and setEvent().
|
|
|
Definition at line 164 of file lStdHep.hh. References event, and lStdHep::Event::vhep. Referenced by getEvent(), LCDG4readStdFile::MakeMcParts(), printTrack(), and setEvent().
|
|
|
Definition at line 165 of file lStdHep.hh. References event, and lStdHep::Event::vhep. Referenced by getEvent(), LCDG4readStdFile::MakeMcParts(), printTrack(), and setEvent().
|
|
|
Definition at line 244 of file lStdHep.hh. Referenced by lStdHep::Event::Event(), readFileHeader(), and ~lStdHep(). |
|
|
Definition at line 245 of file lStdHep.hh. Referenced by printFileHeader(), readFileHeader(), and ~lStdHep(). |
|
|
Definition at line 236 of file lStdHep.hh. Referenced by printFileHeader(), readFileHeader(), and ~lStdHep(). |
|
|
Definition at line 234 of file lStdHep.hh. Referenced by printFileHeader(), readFileHeader(), and ~lStdHep(). |
|
|
Definition at line 235 of file lStdHep.hh. Referenced by printFileHeader(), readFileHeader(), and ~lStdHep(). |
|
|
Definition at line 241 of file lStdHep.hh. Referenced by printFileHeader(), and readFileHeader(). |
|
|
Definition at line 351 of file lStdHep.hh. Referenced by blockId(), daughter1(), daughter2(), E(), evtNum(), getEvent(), M(), mother1(), mother2(), nTracks(), pid(), printEvent(), printEventHeader(), printTrack(), Px(), Py(), Pz(), readEvent(), runNum(), setDaughter1(), setDaughter2(), setE(), setEvent(), setEvtNum(), setM(), setMother1(), setMother2(), setNTracks(), setPid(), setPx(), setPy(), setPz(), setStatus(), setT(), setX(), setY(), setZ(), status(), T(), X(), Y(), and Z(). |
|
|
Definition at line 284 of file lStdHep.hh. Referenced by printEventTable(), readEvent(), and readFileHeader(). |
|
|
Definition at line 240 of file lStdHep.hh. Referenced by printFileHeader(), and readFileHeader(). |
|
|
Definition at line 227 of file lStdHep.hh. Referenced by more(), readEvent(), and readFileHeader(). |
|
|
Definition at line 243 of file lStdHep.hh. Referenced by printFileHeader(), readFileHeader(), and ~lStdHep(). |
|
|
Definition at line 242 of file lStdHep.hh. Referenced by printFileHeader(), and readFileHeader(). |
|
|
Definition at line 231 of file lStdHep.hh. Referenced by lStdHep::Event::Event(), printFileHeader(), and readFileHeader(). |
|
|
Definition at line 239 of file lStdHep.hh. Referenced by printFileHeader(), and readFileHeader(). |
|
|
Definition at line 238 of file lStdHep.hh. Referenced by printFileHeader(), and readFileHeader(). |
|
|
Definition at line 233 of file lStdHep.hh. Referenced by printFileHeader(), readFileHeader(), and ~lStdHep(). |
|
|
Definition at line 232 of file lStdHep.hh. Referenced by lStdHep::Event::Event(), printFileHeader(), readFileHeader(), and ~lStdHep(). |
1.3.4