Changeset 13030 for trunk/FACT++


Ignore:
Timestamp:
03/09/12 16:49:23 (13 years ago)
Author:
tbretz
Message:
Debugged a few issues like too long comments and a missing check.
File:
1 edited

Legend:

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

    r12997 r13030  
    1212    fFile.AddColumnInt("EventNum", "uint32", "FAD board event counter");
    1313    fFile.AddColumnInt("TriggerNum", "uint32", "FTM board trigger counter");
    14     fFile.AddColumnShort("TriggerType", "uint16");
    15     fFile.AddColumnInt("NumBoards", "uint32");
    16     fFile.AddColumnByte(4, "Errors");
    17     fFile.AddColumnInt("SoftTrig");
     14    fFile.AddColumnShort("TriggerType", "uint16", "FTM board trigger type");
     15    fFile.AddColumnInt("NumBoards", "uint32", "Number of connected boards");
     16    fFile.AddColumnByte(4, "Errors", "Communication error counters");
     17    fFile.AddColumnInt("SoftTrig", "(not yet implemented)");
    1818    fFile.AddColumnInt(2, "UnixTimeUTC", "uint32", "Unix time seconds and microseconds");
    19     fFile.AddColumnInt(NBOARDS, "BoardTime", "uint32");
     19    fFile.AddColumnInt(NBOARDS, "BoardTime", "uint32", "Board internal time counter");
    2020    fFile.AddColumnShort(NPIX, "StartCellData", "uint32", "DRS4 start cell of readout");
    2121    fFile.AddColumnShort(NTMARK, "StartCellTimeMarker", "uint32", "DRS4 start cell of readout time marker");
    22     fFile.AddColumnShort(h->NPix*h->Nroi, "Data", "int16");
    23     fFile.AddColumnShort(h->NTm*realRoiTM, "TimeMarker", "int16");
     22    fFile.AddColumnShort(h->NPix*h->Nroi, "Data", "int16", "Digitized data");
     23    fFile.AddColumnShort(h->NTm*realRoiTM, "TimeMarker", "int16", "Digitized time marker - if available");
    2424
    2525    const size_t sz = (h->NPix*h->Nroi + h->NTm*realRoiTM)*2;
     
    4646    fFile.SetStr(  "TIMESYS",  "UTC",                "Time system");
    4747    fFile.SetStr(  "TIMEUNIT", "d",                  "Time given in days w.r.t. to MJDREF");
    48     fFile.SetInt(  "MJDREF",   40587,                "Store times in UNIX time (for convenience, seconds since 1970/1/1)");
     48    fFile.SetInt(  "MJDREF",   40587,                "MJD to UNIX time (seconds since 1970/1/1)");
    4949    //WriteKey("CONTACT",   PACKAGE_BUGREPORT, "Current package maintainer");
    5050    //WriteKey("URL",       PACKAGE_URL, "Current repositiory location");
     
    6161
    6262    const uint16_t realOffset = (h->NroiTM > h->Nroi) ?  h->NroiTM - 2*h->Nroi : 0;
    63     fFile.SetInt("TMSHIFT",  realOffset,  "Shift of the start of the time marker readout wrt to data");
     63    fFile.SetInt("TMSHIFT",  realOffset,  "Shift of marker readout w.r.t. to data");
    6464
    6565    //FIXME should we also put the start and stop time of the received data ?
    6666    //now the events header related variables
    67     fFile.SetStr("CAMERA",   "MGeomCamFACT", "");
    68     fFile.SetStr("DAQ",      "DRS4",         "");
     67    fFile.SetStr("CAMERA",   "MGeomCamFACT", "MARS camera geometry class");
     68    fFile.SetStr("DAQ",      "DRS4",         "Data acquisition type");
    6969    fFile.SetInt("ADCRANGE", 2000,        "Dynamic range in mV");
    7070    fFile.SetInt("ADC",      12,          "Resolution in bits");
     
    242242    }
    243243
    244     ostringstream str;
    245     str << "fstream::write() failed for '" << fFileName << "': " << strerror(errno) << " [errno=" << errno << "]";
    246     Error(str);
    247 
    248     return false;
     244    if (!fFile)
     245    {
     246        ostringstream str;
     247        str << "fstream::write() failed for '" << fFileName << "': " << strerror(errno) << " [errno=" << errno << "]";
     248        Error(str);
     249        return false;
     250    }
     251
     252    return true;
    249253}
    250254
     
    258262
    259263    fFile.SetInt("TSTARTI",  uint32_t(floor(start.UnixDate())),
    260                  "Time when first event received (integral part)");
     264                 "Time when first evt received (integral part)");
    261265    fFile.SetFloat("TSTARTF",  fmod(start.UnixDate(), 1),
    262                    "Time when first event received (fractional part)");
     266                   "Time when first evt received (fractional part)");
    263267    fFile.SetInt("TSTOPI",   uint32_t(floor(stop.UnixDate())),
    264                  "Time when last event received (integral part)");
     268                 "Time when last evt received (integral part)");
    265269    fFile.SetFloat("TSTOPF",   fmod(stop.UnixDate(), 1),
    266                    "Time when last event received (fractional part)");
     270                   "Time when last evt received (fractional part)");
    267271    fFile.SetStr("DATE-OBS", start.Iso(),
    268272                 "Time when first event received");
     
    270274                 "Time when last event received");
    271275
    272     fFile.SetInt("NTRG",     fTriggerCounter[0], "Number of physics triggers written");
    273     fFile.SetInt("NTRGPED",  fTriggerCounter[1], "Number of pure pedestal triggers written");
    274     fFile.SetInt("NTRGLPE",  fTriggerCounter[2], "Number of external light pulser triggers written");
    275     fFile.SetInt("NTRGTIM",  fTriggerCounter[3], "Number of time calibration triggers written");
    276     fFile.SetInt("NTRGLPI",  fTriggerCounter[4], "Number of internal light pulser triggers written");
    277     fFile.SetInt("NTRGEXT1", fTriggerCounter[5], "Number of triggers from ext1 written");
    278     fFile.SetInt("NTRGEXT2", fTriggerCounter[6], "Number of triggers from ext2 written");
    279     fFile.SetInt("NTRGMISC", fTriggerCounter[7], "Number of triggers belonging to no other category written");
     276    fFile.SetInt("NTRG",     fTriggerCounter[0], "No of physics triggers written");
     277    fFile.SetInt("NTRGPED",  fTriggerCounter[1], "No of pure pedestal triggers written");
     278    fFile.SetInt("NTRGLPE",  fTriggerCounter[2], "No of external light pulser triggers written");
     279    fFile.SetInt("NTRGTIM",  fTriggerCounter[3], "No of time calibration triggers written");
     280    fFile.SetInt("NTRGLPI",  fTriggerCounter[4], "No of internal light pulser triggers written");
     281    fFile.SetInt("NTRGEXT1", fTriggerCounter[5], "No of triggers from ext1 written");
     282    fFile.SetInt("NTRGEXT2", fTriggerCounter[6], "No of triggers from ext2 written");
     283    fFile.SetInt("NTRGMISC", fTriggerCounter[7], "No of all other triggers");
    280284}
    281285
Note: See TracChangeset for help on using the changeset viewer.