- Timestamp:
- Apr 22, 2014, 12:11:37 PM (11 years ago)
- Branches:
- ImprovedOutputFile, Timing, dual_readout, llp, master
- Children:
- 33689ef
- Parents:
- 7e4da42
- Location:
- classes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
classes/DelphesSTDHEPReader.cc
r7e4da42 rf59b6d75 88 88 TObjArray *partonOutputArray) 89 89 { 90 bool skipNTuples = false;91 92 90 if(feof(fInputFile)) return kFALSE; 93 91 … … 96 94 SkipBytes(4); 97 95 98 xdr_string(fInputXDR, &fBuffer, 100);99 if(strncmp(fBuffer, "2.00", 4) == 0)100 {101 skipNTuples = true;102 }103 104 96 if(fBlockType == EVENTTABLE) 105 97 { … … 108 100 else if(fBlockType == EVENTHEADER) 109 101 { 110 Read STDHEPHeader(skipNTuples);102 ReadEventHeader(); 111 103 } 112 104 else if(fBlockType == MCFIO_STDHEPBEG || … … 189 181 else version = UNKNOWN; 190 182 191 if 183 if(version == UNKNOWN) 192 184 { 193 185 throw runtime_error("Unknown file format version."); … … 198 190 SkipArray(1); 199 191 200 if 192 if(version == V21) 201 193 { 202 194 SkipArray(1); … … 243 235 void DelphesSTDHEPReader::ReadEventTable() 244 236 { 245 SkipBytes(8); 246 247 SkipArray(4); 248 SkipArray(4); 249 SkipArray(4); 250 SkipArray(4); 251 SkipArray(4); 252 } 253 254 //--------------------------------------------------------------------------- 255 256 void DelphesSTDHEPReader::ReadSTDHEPHeader(bool skipNTuples) 257 { 237 // version 238 xdr_string(fInputXDR, &fBuffer, 100); 239 if(strncmp(fBuffer, "1.00", 4) == 0) 240 { 241 SkipBytes(8); 242 243 SkipArray(4); 244 SkipArray(4); 245 SkipArray(4); 246 SkipArray(4); 247 SkipArray(4); 248 } 249 else if(strncmp(fBuffer, "2.00", 4) == 0) 250 { 251 SkipBytes(12); 252 253 SkipArray(4); 254 SkipArray(4); 255 SkipArray(4); 256 SkipArray(4); 257 SkipArray(8); 258 } 259 } 260 261 //--------------------------------------------------------------------------- 262 263 void DelphesSTDHEPReader::ReadEventHeader() 264 { 265 bool skipNTuples = false; 266 u_int skipSize = 4; 267 268 // version 269 xdr_string(fInputXDR, &fBuffer, 100); 270 if(strncmp(fBuffer, "2.00", 4) == 0) 271 { 272 skipNTuples = true; 273 } 274 else if(strncmp(fBuffer, "3.00", 4) == 0) 275 { 276 skipNTuples = true; 277 skipSize = 8; 278 } 279 258 280 SkipBytes(20); 259 281 … … 272 294 { 273 295 SkipArray(4); 274 SkipArray( 4);296 SkipArray(skipSize); 275 297 } 276 298 … … 279 301 { 280 302 SkipArray(4); 281 SkipArray( 4);303 SkipArray(skipSize); 282 304 } 283 305 } … … 287 309 void DelphesSTDHEPReader::ReadSTDCM1() 288 310 { 311 // version 312 xdr_string(fInputXDR, &fBuffer, 100); 313 289 314 // skip 5*4 + 2*8 = 36 bytes 290 315 SkipBytes(36); … … 313 338 { 314 339 u_int idhepSize, isthepSize, jmohepSize, jdahepSize, phepSize, vhepSize; 340 341 // version 342 xdr_string(fInputXDR, &fBuffer, 100); 315 343 316 344 // Extracting the event number … … 357 385 { 358 386 u_int number; 387 388 // version 389 xdr_string(fInputXDR, &fBuffer, 100); 359 390 360 391 // Extracting the event weight -
classes/DelphesSTDHEPReader.h
r7e4da42 rf59b6d75 68 68 void ReadFileHeader(); 69 69 void ReadEventTable(); 70 void Read STDHEPHeader(bool skipNTuples);70 void ReadEventHeader(); 71 71 void ReadSTDCM1(); 72 72 void ReadSTDHEP();
Note:
See TracChangeset
for help on using the changeset viewer.