- Timestamp:
- 05/08/15 12:32:23 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Corsika7405Compatibility/mcorsika/MCorsikaRead.cc
r14892 r18179 290 290 status = fInFormat->Read(buffer, 272 * sizeof(Float_t)); 291 291 status = fRunHeader->ReadEventHeader(buffer); 292 //std::cout << "\x1b[31;1m EVTH Header: \x1b[0m"; 293 //fRunHeader->Print(nullptr); 292 294 break; 293 295 } … … 329 331 Int_t MCorsikaRead::ReadTelescopePosition() 330 332 { 331 333 if (!fInFormat->Read(&fNumTelescopes, 4)) return kERROR; 332 334 333 335 if (fTelescopeIdx>=fNumTelescopes) … … 474 476 Int_t MCorsikaRead::Process() 475 477 { 478 //std::cout << "Process \n\n" << std::endl; 476 479 while (1) // loop for multiple input files 477 480 { 481 //std::cout << "OuterLoop \n\n" << std::endl; 482 478 483 if (fInFormat) 479 484 { … … 492 497 493 498 Int_t status = kTRUE; 499 500 //std::cout << "||||ReadState: " << fReadState 501 // << " Block: " << fBlockType << "\n\n" << std::endl; 502 494 503 switch (fBlockType) 495 504 { … … 500 509 501 510 case 1201: // telescope position 511 // std::cout << "TelescopPos ||||||" << std::endl; 502 512 status = ReadTelescopePosition(); 503 513 break; … … 505 515 case 1202: // the event header 506 516 Float_t buffer[272]; 517 static int asd = 0; 518 // std::cout << "EventHeader |||||| " << ++asd << std::endl; 507 519 if (!fInFormat->Read(buffer, 272 * sizeof(Float_t))) 508 520 return kFALSE; … … 511 523 { 512 524 fRunHeader->ReadEventHeader(buffer); 513 fRunHeader->Print();525 //fRunHeader->Print(); 514 526 } 515 527 516 528 status = fEvtHeader->ReadEvt(buffer); 529 530 //fEvtHeader->Print(); 531 //std::cout << "TotReuse: " << fEvtHeader->GetTotReuse(); 532 517 533 if (fArrayIdx >= (Int_t)fEvtHeader->GetTotReuse()) 518 534 { … … 527 543 528 544 case 1204: // top level block for one array (only for eventio data) 545 // std::cout << "EventIO1 |||||||" << std::endl; 529 546 if (fArrayIdx < 0 || fArrayIdx == fBlockIdentifier) 530 547 { … … 535 552 // skip this array of telescopes 536 553 fInFormat->Seek(fBlockLength); 537 554 std::cout << "Skip Array!" << std::endl; 538 555 break; 539 556 … … 541 558 case 1205: // eventio data 542 559 { 560 // std::cout << "EventIO2 |||||||" << std::endl; 543 561 Int_t telIdx = fBlockIdentifier % 1000; 544 if (fBlockVersion == 0 && 545 (fTelescopeIdx < 0 || fTelescopeIdx == telIdx) ) 546 { 562 // std::cout << "TelIDX: " << telIdx << " fTelescopeIdx:" << fTelescopeIdx 563 // << " fBlockVersion" << fBlockVersion << std::endl; 564 565 if (fBlockVersion == 0 && (fTelescopeIdx < 0 || fTelescopeIdx == telIdx) ) 566 { 547 567 status = fEvent->ReadEventIoEvt(fInFormat); 568 569 //std::cout << " ArrayIdx:" << fBlockIdentifier / 1000.0 << std::endl; 548 570 549 571 Int_t arrayIdx = fBlockIdentifier / 1000; … … 560 582 else 561 583 // skip this telescope 584 { 562 585 fInFormat->Seek(fBlockLength); 586 587 std::cout << "Skip this telescope!" << std::endl; 588 } 563 589 } 564 590 break; 565 591 566 592 case 1209: // the event end 593 // std::cout << "EventEnd ||||||" << std::endl; 567 594 status = fEvtHeader->ReadEvtEnd(fInFormat); 568 595 … … 581 608 582 609 case 1210: // the run end 610 //std::cout << "RunEnd ||||||" << std::endl; 583 611 status = fRunHeader->ReadEvtEnd(fInFormat, kTRUE); 584 612 fNumEvents += fRunHeader->GetNumEvents(); … … 594 622 595 623 case 1105: // event block of raw format 624 static int NmrEventBlock = 0; 625 //std::cout << "EventBlock ||||||" << ++NmrEventBlock << std::endl; 596 626 if (fReadState == 2 || fReadState == 10) 597 627 { … … 607 637 608 638 case 1109: // save corsika events 639 //std::cout << "SaveCorsika ||||||" << std::endl; 609 640 fEvtHeader->InitXY(); 610 641 status = fEvent->ReadCorsikaEvt(&fRawEvemtBuffer[0], … … 630 661 default: 631 662 // unknown block, we skip it 663 std::cout << "UnknownBlock " << fBlockType << std::endl; 632 664 fReadState = 15; 633 665 fInFormat->Seek(fBlockLength); 634 666 635 667 } 668 669 std::cout << "Status: " << status << std::endl; 636 670 637 671 if (status != kTRUE) … … 640 674 641 675 Int_t headerStatus = ReadNextBlockHeader(); 676 677 std::cout << "Header Status: " << headerStatus << std::endl; 678 679 642 680 if (headerStatus == kFALSE) 643 681 // end of file
Note:
See TracChangeset
for help on using the changeset viewer.