Changeset 18180 for branches/Corsika7405Compatibility/mcorsika
- Timestamp:
- 05/12/15 19:33:34 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Corsika7405Compatibility/mcorsika/MCorsikaRead.cc
r18179 r18180 54 54 #include "MCorsikaEvtHeader.h" 55 55 56 #include "../msim/MPhotonData.h" 57 56 58 #include "MPhotonEvent.h" 57 59 … … 476 478 Int_t MCorsikaRead::Process() 477 479 { 478 //std::cout << "Process \n\n" << std::endl; 480 fEvent->Clear(); 481 fEvent->Reset(); 482 fEvent->Resize(0); 483 484 485 std::cout << "\n\n MCorsikaRead Process " << std::endl; 479 486 while (1) // loop for multiple input files 480 487 { 481 //std::cout << "OuterLoop \n\n" << std::endl;482 488 483 489 if (fInFormat) … … 498 504 Int_t status = kTRUE; 499 505 500 //std::cout << "||||ReadState: " << fReadState501 // << " Block: " << fBlockType << "\n\n" << std::endl;502 503 506 switch (fBlockType) 504 507 { … … 516 519 Float_t buffer[272]; 517 520 static int asd = 0; 518 // std::cout << "EventHeader |||||| " << ++asd << std::endl;519 521 if (!fInFormat->Read(buffer, 272 * sizeof(Float_t))) 520 522 return kFALSE; … … 528 530 status = fEvtHeader->ReadEvt(buffer); 529 531 530 //fEvtHeader->Print();531 //std::cout << "TotReuse: " << fEvtHeader->GetTotReuse();532 532 533 533 if (fArrayIdx >= (Int_t)fEvtHeader->GetTotReuse()) … … 543 543 544 544 case 1204: // top level block for one array (only for eventio data) 545 // std::cout << "EventIO1 |||||||" << std::endl; 546 if (fArrayIdx < 0 || fArrayIdx == fBlockIdentifier) 545 if (fArrayIdx < 0 || fArrayIdx == fBlockIdentifier) 547 546 { 548 547 fReadState = 4; … … 558 557 case 1205: // eventio data 559 558 { 560 // std::cout << "EventIO2 |||||||" << std::endl;561 559 Int_t telIdx = fBlockIdentifier % 1000; 562 // std::cout << "TelIDX: " << telIdx << " fTelescopeIdx:" << fTelescopeIdx563 // << " fBlockVersion" << fBlockVersion << std::endl;564 560 565 561 if (fBlockVersion == 0 && (fTelescopeIdx < 0 || fTelescopeIdx == telIdx) ) 566 562 { 567 563 status = fEvent->ReadEventIoEvt(fInFormat); 568 569 //std::cout << " ArrayIdx:" << fBlockIdentifier / 1000.0 << std::endl;570 564 571 565 Int_t arrayIdx = fBlockIdentifier / 1000; … … 579 573 fEvent->SimWavelength(fRunHeader->GetWavelengthMin(), 580 574 fRunHeader->GetWavelengthMax()); 575 576 577 bool tmpWeight = false; 578 std::cout << "ReadEventIO Telescope data with " << fEvent->GetNumPhotons() << std::endl; 579 for(int i=0; i<fEvent->GetNumPhotons(); i++) 580 { 581 582 const MPhotonData &ph = (*fEvent)[i]; 583 if(ph.GetWeight() != 1) 584 tmpWeight = true; 585 } 586 if(tmpWeight) 587 std::cout << "CorsikaRead Photon weight != 1" << std::endl; 588 581 589 } 582 590 else … … 591 599 592 600 case 1209: // the event end 593 // std::cout << "EventEnd ||||||" << std::endl;594 601 status = fEvtHeader->ReadEvtEnd(fInFormat); 595 602 … … 608 615 609 616 case 1210: // the run end 610 //std::cout << "RunEnd ||||||" << std::endl; 611 status = fRunHeader->ReadEvtEnd(fInFormat, kTRUE); 617 status = fRunHeader->ReadEvtEnd(fInFormat, kTRUE); 612 618 fNumEvents += fRunHeader->GetNumEvents(); 613 619 //fRunHeader->SetReadyToSave(); … … 637 643 638 644 case 1109: // save corsika events 639 //std::cout << "SaveCorsika ||||||" << std::endl;645 std::cout << "Block1109" << std::endl; 640 646 fEvtHeader->InitXY(); 641 647 status = fEvent->ReadCorsikaEvt(&fRawEvemtBuffer[0], … … 667 673 } 668 674 669 std::cout << "Status: " << status << std::endl;670 671 675 if (status != kTRUE) 672 676 // there was an error while data were read … … 674 678 675 679 Int_t headerStatus = ReadNextBlockHeader(); 676 677 std::cout << "Header Status: " << headerStatus << std::endl;678 679 680 680 681 if (headerStatus == kFALSE)
Note:
See TracChangeset
for help on using the changeset viewer.