Fork me on GitHub

Changeset 4af92f5 in git


Ignore:
Timestamp:
Jan 22, 2015, 12:04:15 PM (10 years ago)
Author:
Pavel Demin <pavel.demin@…>
Branches:
ImprovedOutputFile, Timing, dual_readout, llp, master
Children:
b55dc12
Parents:
5ed71ed
Message:

add possibility to read multiple STDHEP files from stdin

File:
1 edited

Legend:

Unmodified
Added
Removed
  • classes/DelphesSTDHEPReader.cc

    r5ed71ed r4af92f5  
    7777  fInputFile = inputFile;
    7878  xdrstdio_create(fInputXDR, inputFile, XDR_DECODE);
     79
     80  xdr_int(fInputXDR, &fBlockType);
     81  if(fBlockType != FILEHEADER)
     82  {
     83    throw runtime_error("Header block not found. File is probably corrupted.");
     84  }
     85
     86  SkipBytes(4);
     87
    7988  ReadFileHeader();
    8089}
     
    107116  SkipBytes(4);
    108117
    109   if(fBlockType == EVENTTABLE)
     118  if(fBlockType == FILEHEADER)
     119  {
     120    ReadFileHeader();
     121  }
     122  else if(fBlockType == EVENTTABLE)
    110123  {
    111124    ReadEventTable();
     
    177190  u_int i;
    178191  enum STDHEPVersion {UNKNOWN, V1, V2, V21} version;
    179 
    180   xdr_int(fInputXDR, &fBlockType);
    181   if (fBlockType != FILEHEADER)
    182   {
    183     throw runtime_error("Header block not found. File is probably corrupted.");
    184   }
    185 
    186   SkipBytes(4);
    187192
    188193  // version
Note: See TracChangeset for help on using the changeset viewer.