Ignore:
Timestamp:
05/08/15 12:32:23 (9 years ago)
Author:
dbaack
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/Corsika7405Compatibility/mcorsika/MCorsikaRead.cc

    r14892 r18179  
    290290                  status = fInFormat->Read(buffer, 272 * sizeof(Float_t));
    291291                  status = fRunHeader->ReadEventHeader(buffer);
     292                  //std::cout << "\x1b[31;1m EVTH Header: \x1b[0m";
     293                  //fRunHeader->Print(nullptr);
    292294                  break;
    293295                  }
     
    329331Int_t MCorsikaRead::ReadTelescopePosition()
    330332{
    331    if (!fInFormat->Read(&fNumTelescopes, 4)) return kERROR;
     333        if (!fInFormat->Read(&fNumTelescopes, 4)) return kERROR;
    332334
    333335   if (fTelescopeIdx>=fNumTelescopes)
     
    474476Int_t MCorsikaRead::Process()
    475477{
     478        //std::cout << "Process \n\n" << std::endl;
    476479   while (1)  // loop for multiple input files
    477480   {
     481           //std::cout << "OuterLoop \n\n" << std::endl;
     482
    478483      if (fInFormat)
    479484      {
     
    492497
    493498         Int_t status = kTRUE;
     499
     500         //std::cout << "||||ReadState: " << fReadState
     501        //               << "  Block: " << fBlockType << "\n\n" << std::endl;
     502
    494503         switch (fBlockType)
    495504            {
     
    500509
    501510            case 1201:       // telescope position
     511            //  std::cout << "TelescopPos ||||||" << std::endl;
    502512               status = ReadTelescopePosition();
    503513               break;
     
    505515            case 1202:  // the event header
    506516               Float_t buffer[272];
     517               static int asd = 0;
     518              // std::cout << "EventHeader |||||| " << ++asd << std::endl;
    507519               if (!fInFormat->Read(buffer, 272 * sizeof(Float_t)))
    508520                  return kFALSE;
     
    511523                  {
    512524                  fRunHeader->ReadEventHeader(buffer);
    513                   fRunHeader->Print();
     525                  //fRunHeader->Print();
    514526                  }
    515527
    516528               status = fEvtHeader->ReadEvt(buffer);
     529
     530               //fEvtHeader->Print();
     531               //std::cout << "TotReuse: " << fEvtHeader->GetTotReuse();
     532
    517533               if (fArrayIdx >= (Int_t)fEvtHeader->GetTotReuse())
    518534                  {
     
    527543
    528544            case 1204: // top level block for one array (only for eventio data)
     545            //  std::cout << "EventIO1 |||||||" << std::endl;
    529546               if (fArrayIdx < 0 || fArrayIdx == fBlockIdentifier)
    530547                  {
     
    535552                  // skip this array of telescopes
    536553                  fInFormat->Seek(fBlockLength);
    537 
     554                   std::cout << "Skip Array!" << std::endl;
    538555               break;
    539556
     
    541558            case 1205: // eventio data
    542559               {
     560              // std::cout << "EventIO2 |||||||" << std::endl;
    543561               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               {
    547567                  status = fEvent->ReadEventIoEvt(fInFormat);
     568
     569                  //std::cout << " ArrayIdx:" << fBlockIdentifier / 1000.0 << std::endl;
    548570
    549571                  Int_t arrayIdx = fBlockIdentifier / 1000;
     
    560582               else
    561583                  // skip this telescope
     584               {
    562585                  fInFormat->Seek(fBlockLength);
     586
     587                   std::cout << "Skip this telescope!" << std::endl;
     588               }
    563589               }
    564590               break;
    565591
    566592            case 1209:  // the event end
     593           //   std::cout << "EventEnd ||||||" << std::endl;
    567594               status = fEvtHeader->ReadEvtEnd(fInFormat);
    568595               
     
    581608
    582609            case 1210:  // the run end
     610                //std::cout << "RunEnd ||||||" << std::endl;
    583611               status = fRunHeader->ReadEvtEnd(fInFormat, kTRUE);
    584612               fNumEvents += fRunHeader->GetNumEvents();
     
    594622
    595623            case 1105:  // event block of raw format
     624                static int NmrEventBlock = 0;
     625                //std::cout << "EventBlock ||||||" << ++NmrEventBlock << std::endl;
    596626               if (fReadState == 2 || fReadState == 10)
    597627                  {
     
    607637
    608638            case 1109:  // save corsika events
     639                //std::cout << "SaveCorsika ||||||" << std::endl;
    609640               fEvtHeader->InitXY();
    610641               status = fEvent->ReadCorsikaEvt(&fRawEvemtBuffer[0],
     
    630661            default:
    631662               // unknown block, we skip it
     663               std::cout << "UnknownBlock " << fBlockType << std::endl;
    632664               fReadState = 15;
    633665               fInFormat->Seek(fBlockLength);
    634666
    635667            }
     668
     669         std::cout << "Status: " << status << std::endl;
    636670
    637671         if (status != kTRUE)
     
    640674
    641675         Int_t headerStatus =  ReadNextBlockHeader();
     676
     677         std::cout << "Header Status: " << headerStatus << std::endl;
     678
     679
    642680         if (headerStatus == kFALSE)
    643681            // end of file
Note: See TracChangeset for help on using the changeset viewer.