Changeset 17657


Ignore:
Timestamp:
04/06/14 13:53:38 (11 years ago)
Author:
tbretz
Message:
Use the trigger counter from the last event when writing the footer data; this might need another update when we start to discarde events due to software triggers and the like; it fixes a problem which occured in cases with fadloss when an inavlid event is posted to the queue and the runClose used that data to write the footer; updated the comments in the FITS header
Location:
trunk/FACT++/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/DataWriteFits.cc

    r17329 r17657  
    188188    }
    189189
    190     // This is a workaround for the missing information in the event builder
    191     fTstart[0] = 0;
    192     fTstop[0]  = 0;
     190    fTstart[0] = h.RunTime;
     191    fTstart[1] = h.RunUsec;
     192
     193    fTstop[0] = 0;
     194    fTstop[1] = 0;
    193195
    194196    fTriggerCounter.fill(0);
     
    208210        return false;
    209211
    210     fTriggerCounter = evt.runCtrl->triggerCounter;
     212    // Remember the counter of the last written event
     213    fTriggerCounter = evt.triggerCounter;
     214
     215    // Remember the time of the last event
     216    fTstop[0] = evt.time.tv_sec;
     217    fTstop[1] = evt.time.tv_usec;
    211218
    212219    const EVENT &e = *evt.fEvent;
    213 
    214     memcpy(fTstop, &e.PCTime, 2*sizeof(uint32_t));
    215     if (fTstart[0]==0)
    216         memcpy(fTstart, fTstop, 2*sizeof(uint32_t));
    217220
    218221    const int realRoiTM = (e.RoiTM > e.Roi) ? e.Roi : 0;
     
    258261                       "Time when last event received");
    259262
    260         fFile.WriteKey("NTRG",     fTriggerCounter[0], "Number of physics triggers written");
    261         fFile.WriteKey("NTRGPED",  fTriggerCounter[1], "Number of pure pedestal triggers written");
    262         fFile.WriteKey("NTRGLPE",  fTriggerCounter[2], "Number of external light pulser triggers written");
    263         fFile.WriteKey("NTRGTIM",  fTriggerCounter[3], "Number of time calibration triggers written");
    264         fFile.WriteKey("NTRGLPI",  fTriggerCounter[4], "Number of internal light pulser triggers written");
    265         fFile.WriteKey("NTRGEXT1", fTriggerCounter[5], "Number of triggers from ext1 written");
    266         fFile.WriteKey("NTRGEXT2", fTriggerCounter[6], "Number of triggers from ext2 written");
    267         fFile.WriteKey("NTRGMISC", fTriggerCounter[7], "Number of triggers belonging to no other category written");
     263        fFile.WriteKey("NTRG",     fTriggerCounter[0], "No of physics triggered events");
     264        fFile.WriteKey("NTRGPED",  fTriggerCounter[1], "No of pure pedestal triggered events");
     265        fFile.WriteKey("NTRGLPE",  fTriggerCounter[2], "No of external light pulser triggered events");
     266        fFile.WriteKey("NTRGTIM",  fTriggerCounter[3], "No of time calibration triggered events");
     267        fFile.WriteKey("NTRGLPI",  fTriggerCounter[4], "No of internal light pulser triggered events");
     268        fFile.WriteKey("NTRGEXT1", fTriggerCounter[5], "No of triggers from ext1 triggered events");
     269        fFile.WriteKey("NTRGEXT2", fTriggerCounter[6], "No of triggers from ext2 triggered events");
     270        fFile.WriteKey("NTRGMISC", fTriggerCounter[7], "No of all other triggered events");
    268271    }
    269272    catch (const CCfits::FitsException &e)
     
    280283//! @param rt the pointer to the RUN_TAIL data structure
    281284//
    282 bool DataWriteFits::Close(const EVT_CTRL2 &evt)
     285bool DataWriteFits::Close(const EVT_CTRL2 &)
    283286{
    284287    if (!fFile.IsOpen())
    285288        return false;
    286289
    287     // Just for safety
    288     fTriggerCounter = evt.triggerCounter;
    289290    WriteFooter();
    290291
  • trunk/FACT++/src/DataWriteFits2.cc

    r17329 r17657  
    249249bool DataWriteFits2::WriteEvt(const EVT_CTRL2 &evt)
    250250{
    251     fTriggerCounter = evt.runCtrl->triggerCounter;
    252 
     251    // Remember the counter of the last written event
     252    fTriggerCounter = evt.triggerCounter;
     253
     254    // Remember the time of the last event
    253255    fTstop[0] = evt.time.tv_sec;
    254256    fTstop[1] = evt.time.tv_usec;
     
    301303                  "Time when last event received");
    302304
    303     fFile->SetInt("NTRG",     fTriggerCounter[0], "No of physics triggers written");
    304     fFile->SetInt("NTRGPED",  fTriggerCounter[1], "No of pure pedestal triggers written");
    305     fFile->SetInt("NTRGLPE",  fTriggerCounter[2], "No of external light pulser triggers written");
    306     fFile->SetInt("NTRGTIM",  fTriggerCounter[3], "No of time calibration triggers written");
    307     fFile->SetInt("NTRGLPI",  fTriggerCounter[4], "No of internal light pulser triggers written");
    308     fFile->SetInt("NTRGEXT1", fTriggerCounter[5], "No of triggers from ext1 written");
    309     fFile->SetInt("NTRGEXT2", fTriggerCounter[6], "No of triggers from ext2 written");
    310     fFile->SetInt("NTRGMISC", fTriggerCounter[7], "No of all other triggers");
     305    fFile->SetInt("NTRG",     fTriggerCounter[0], "No of physics triggered events");
     306    fFile->SetInt("NTRGPED",  fTriggerCounter[1], "No of pure pedestal triggered events");
     307    fFile->SetInt("NTRGLPE",  fTriggerCounter[2], "No of external light pulser triggered events");
     308    fFile->SetInt("NTRGTIM",  fTriggerCounter[3], "No of time calibration triggered events");
     309    fFile->SetInt("NTRGLPI",  fTriggerCounter[4], "No of internal light pulser triggered events");
     310    fFile->SetInt("NTRGEXT1", fTriggerCounter[5], "No of triggers from ext1 triggered events");
     311    fFile->SetInt("NTRGEXT2", fTriggerCounter[6], "No of triggers from ext2 triggered events");
     312    fFile->SetInt("NTRGMISC", fTriggerCounter[7], "No of all other triggered events");
    311313}
    312314
     
    326328    try
    327329    {
    328         // Just for safety
    329         fTriggerCounter = evt.triggerCounter;
    330 
    331330        WriteFooter();
    332331    }
Note: See TracChangeset for help on using the changeset viewer.