Changeset 16055


Ignore:
Timestamp:
05/22/13 22:40:10 (11 years ago)
Author:
tbretz
Message:
Replaced the pointer argument when opening a file or writing an event by a const-reference.
Location:
trunk/FACT++/src
Files:
10 edited

Legend:

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

    r15628 r16055  
    8989}
    9090
    91 bool DataCalib::Open(const RUN_HEAD* h, const FAD::RunDescription &d)
    92 {
    93     if (h->NPix != 1440)
     91bool DataCalib::Open(const RUN_HEAD &h, const FAD::RunDescription &d)
     92{
     93    if (h.NPix != 1440)
    9494    {
    9595        Error("Number of pixels in header for run "+to_string(GetRunId())+" not 1440.");
     
    109109    }
    110110
    111     if (fData.fStep!=2 && h->Nroi != 1024)
     111    if (fData.fStep!=2 && h.Nroi != 1024)
    112112    {
    113113        ostringstream msg;
    114         msg << "Region of interest of run " << GetRunId() << " not 1024, but " << h->Nroi << " in step " << fData.fStep <<  " ... as it ought to be.";
     114        msg << "Region of interest of run " << GetRunId() << " not 1024, but " << h.Nroi << " in step " << fData.fStep <<  " ... as it ought to be.";
    115115        Error(msg);
    116116        return false;
     
    121121    // We don't check consistency over several boards because this is done
    122122    // by the eventCheck routine already
    123     for (int i=0; i<h->NBoard; i++)
    124     {
    125         const PEVNT_HEADER &hh = h->FADhead[i];
     123    for (int i=0; i<h.NBoard; i++)
     124    {
     125        const PEVNT_HEADER &hh = h.FADhead[i];
    126126
    127127        if (hh.start_package_flag==0)
     
    164164    fProcessing = true;
    165165
    166     const bool hastm = h->Nroi<=512 && h->NroiTM>=2*h->Nroi;
     166    const bool hastm = h.Nroi<=512 && h.NroiTM>=2*h.Nroi;
    167167
    168168    Reset();
    169     InitSize(hastm ? 1600 : 1440, h->Nroi);
     169    InitSize(hastm ? 1600 : 1440, h.Nroi);
    170170
    171171    fData.fRoi   = fNumSamples;
     
    175175}
    176176
    177 bool DataCalib::WriteEvt(const EVENT *e)
     177bool DataCalib::WriteEvt(const EVENT &e)
    178178{
    179179    // FIXME: SET StartPix to 0 if StartPix is -1
     
    181181    if (fData.fStep==0)
    182182    {
    183         AddRel(e->Adc_Data, e->StartPix);
     183        AddRel(e.Adc_Data, e.StartPix);
    184184    }
    185185    if (fData.fStep==1)
    186186    {
    187         AddRel(e->Adc_Data, e->StartPix, fData.fOffset.data(), fData.fNumOffset);
     187        AddRel(e.Adc_Data, e.StartPix, fData.fOffset.data(), fData.fNumOffset);
    188188    }
    189189    if (fData.fStep==2)
    190190    {
    191         AddAbs(e->Adc_Data, e->StartPix, fData.fOffset.data(), fData.fNumOffset);
     191        AddAbs(e.Adc_Data, e.StartPix, fData.fOffset.data(), fData.fNumOffset);
    192192    }
    193193
  • trunk/FACT++/src/DataCalib.h

    r15628 r16055  
    3737    static void Update(DimDescribedService &dim, DimDescribedService &runs);
    3838
    39     bool Open(const RUN_HEAD* h, const FAD::RunDescription &d);
    40     bool WriteEvt(const EVENT *e);
     39    bool Open(const RUN_HEAD &h, const FAD::RunDescription &d);
     40    bool WriteEvt(const EVENT &e);
    4141    bool Close(const RUN_TAIL * = 0);
    4242
     
    5151    static bool IsValid() { return fData.IsValid(); }
    5252    static int  GetStep() { return fData.fStep; }
     53
     54    static const DrsCalibration &GetCalibration() { return fData; }
    5355};
    5456
  • trunk/FACT++/src/DataProcessorImp.cc

    r15628 r16055  
    4545// =======================================================================
    4646
    47 bool DataDump::Open(const RUN_HEAD* h, const FAD::RunDescription &)
     47bool DataDump::Open(const RUN_HEAD &h, const FAD::RunDescription &)
    4848{
    4949    fFileName = "/dev/null";
     
    5252    str << this << " - "
    5353        << "OPEN_FILE #" << GetRunId() << ":"
    54         << " Ver=" << h->Version
    55         << " Typ=" << h->RunType
    56         << " Nb="  << h->NBoard
    57         << " Np="  << h->NPix
    58         << " NTm=" << h->NTm
    59         << " roi=" << h->Nroi;
     54        << " Ver=" << h.Version
     55        << " Typ=" << h.RunType
     56        << " Nb="  << h.NBoard
     57        << " Np="  << h.NPix
     58        << " NTm=" << h.NTm
     59        << " roi=" << h.Nroi;
    6060
    6161    Debug(str);
     
    6666}
    6767
    68 bool DataDump::WriteEvt(const EVENT *e)
     68bool DataDump::WriteEvt(const EVENT &e)
    6969{
    7070    const Time now;
     
    7575
    7676    ostringstream str;
    77     str << this << " - EVENT #" << e->EventNum << " / " << e->TriggerNum;
     77    str << this << " - EVENT #" << e.EventNum << " / " << e.TriggerNum;
    7878    Debug(str);
    7979
     
    9393// =======================================================================
    9494
    95 bool DataDebug::WriteEvt(const EVENT *e)
     95bool DataDebug::WriteEvt(const EVENT &e)
    9696{
    97     cout << "WRITE_EVENT #" << GetRunId() << " (" << e->EventNum << ")" << endl;
    98     cout << " Typ=" << e->TriggerType << endl;
    99     cout << " roi=" << e->Roi << endl;
    100     cout << " trg=" << e->SoftTrig << endl;
    101     cout << " tim=" << e->PCTime << endl;
     97    cout << "WRITE_EVENT #" << GetRunId() << " (" << e.EventNum << ")" << endl;
     98    cout << " Typ=" << e.TriggerType << endl;
     99    cout << " roi=" << e.Roi << endl;
     100    cout << " trg=" << e.SoftTrig << endl;
     101    cout << " tim=" << e.PCTime << endl;
    102102
    103103    return true;
  • trunk/FACT++/src/DataProcessorImp.h

    r15628 r16055  
    44#include "MessageImp.h"
    55
    6 struct _RUN_HEAD;
     6struct RUN_HEAD;
    77struct _EVENT;
    88struct _RUN_TAIL;
     
    1313};
    1414
    15 typedef struct _RUN_HEAD RUN_HEAD;
    1615typedef struct _EVENT    EVENT;
    1716typedef struct _RUN_TAIL RUN_TAIL;
     
    2019{
    2120    std::string fPath;
    22     uint64_t    fNight;
     21    uint32_t    fNight;
    2322    uint32_t    fRunId;
    2423
     
    3635    virtual ~DataProcessorImp() { }
    3736
    38     virtual bool Open(const RUN_HEAD* h, const FAD::RunDescription &desc) = 0;
    39     virtual bool WriteEvt(const EVENT *) = 0;
     37    virtual bool Open(const RUN_HEAD &h, const FAD::RunDescription &desc) = 0;
     38    virtual bool WriteEvt(const EVENT &) = 0;
    4039    virtual bool Close(const RUN_TAIL * = 0) = 0;
    4140
     
    4342
    4443    std::string GetPath() const { return fPath; }
     44    uint32_t    GetNight() const { return fNight; }
    4545    uint32_t    GetRunId() const { return fRunId; }
    4646
     
    6161    DataDump(const std::string &path, uint64_t night, uint32_t id, MessageImp &imp) : DataProcessorImp(path, night, id, imp) { }
    6262
    63     bool Open(const RUN_HEAD* h, const FAD::RunDescription &d);
    64     bool WriteEvt(const EVENT *e);
     63    bool Open(const RUN_HEAD &h, const FAD::RunDescription &d);
     64    bool WriteEvt(const EVENT &e);
    6565    bool Close(const RUN_TAIL * = 0);
    6666};
     
    7171    DataDebug(const std::string &path, uint64_t night, uint32_t id, MessageImp &imp) : DataDump(path, night, id, imp) { }
    7272
    73     bool WriteEvt(const EVENT *e);
     73    bool WriteEvt(const EVENT &e);
    7474};
    7575
  • trunk/FACT++/src/DataWriteFits.cc

    r15628 r16055  
    3232//! @param h a pointer to the RUN_HEAD structure that contains the informations relative to this run
    3333//
    34 bool DataWriteFits::Open(const RUN_HEAD* h, const FAD::RunDescription &d)
     34bool DataWriteFits::Open(const RUN_HEAD &h, const FAD::RunDescription &d)
    3535{
    3636    if (fConv)
     
    4040    }
    4141
    42     const int16_t realRoiTM = (h->NroiTM >= 2*h->Nroi && h->Nroi<=512) ? h->Nroi : 0;
     42    const int16_t realRoiTM = (h.NroiTM >= 2*h.Nroi && h.Nroi<=512) ? h.Nroi : 0;
    4343
    4444    fFile.AddColumn('I', "EventNum");
     
    5252    fFile.AddColumn('S', "StartCellData",       NPIX);
    5353    fFile.AddColumn('S', "StartCellTimeMarker", NTMARK);
    54     fFile.AddColumn('S', "Data",                h->NPix*h->Nroi);       
    55     fFile.AddColumn('S', "TimeMarker",          h->NTm*realRoiTM);
     54    fFile.AddColumn('S', "Data",                h.NPix*h.Nroi);
     55    fFile.AddColumn('S', "TimeMarker",          h.NTm*realRoiTM);
    5656
    5757    // Write length of physical pipeline (1024)
    5858    fConv = new Converter(Converter::ToFormat(fFile.GetColumnTypes()));
    5959
    60     const size_t sz = (h->NPix*h->Nroi + h->NTm*realRoiTM)*2;
     60    const size_t sz = (h.NPix*h.Nroi + h.NTm*realRoiTM)*2;
    6161    if (fConv->GetSize()-sz+4!=sizeof(EVENT))
    6262    {
     
    8686    try
    8787    {
    88         fFile.WriteKey("BLDVER",   h->Version,  "Builder version");
     88        fFile.WriteKey("BLDVER",   h.Version,  "Builder version");
    8989        fFile.WriteKey("RUNID",    GetRunId(),  "Run number");
    90 //        fFile.WriteKey("RUNTYPE",  h->RunType,  "Type of run");
    91         fFile.WriteKey("NBOARD",   h->NBoard,   "Number of acquisition boards");
    92         fFile.WriteKey("NPIX",     h->NPix,     "Number of pixels");
    93         fFile.WriteKey("NTMARK",   h->NTm,      "Number of time marker channels");
     90//        fFile.WriteKey("RUNTYPE",  h.RunType,  "Type of run");
     91        fFile.WriteKey("NBOARD",   h.NBoard,   "Number of acquisition boards");
     92        fFile.WriteKey("NPIX",     h.NPix,     "Number of pixels");
     93        fFile.WriteKey("NTMARK",   h.NTm,      "Number of time marker channels");
    9494        fFile.WriteKey("NCELLS",   1024,        "Maximum number of slices per pixels");
    95         fFile.WriteKey("NROI",     h->Nroi,     "Number of slices per pixels");
     95        fFile.WriteKey("NROI",     h.Nroi,     "Number of slices per pixels");
    9696        fFile.WriteKey("NROITM",   realRoiTM,   "Number of slices per time-marker");
    9797
    98         const uint16_t realOffset = (h->NroiTM > h->Nroi) ?  h->NroiTM - 2*h->Nroi : 0;
     98        const uint16_t realOffset = (h.NroiTM > h.Nroi) ?  h.NroiTM - 2*h.Nroi : 0;
    9999        fFile.WriteKey("TMSHIFT",  realOffset,  "Shift of the start of the time marker readout wrt to data");
    100100
     
    119119        // DAC
    120120
    121         for (int i=0; i<h->NBoard; i++)
     121        for (int i=0; i<h.NBoard; i++)
    122122        {
    123             const PEVNT_HEADER &hh = h->FADhead[i];
     123            const PEVNT_HEADER &hh = h.FADhead[i];
    124124
    125125            // Header values whihc won't change during the run
     
    133133
    134134        // FIXME: Calculate average ref clock frequency
    135         for (int i=0; i<h->NBoard; i++)
     135        for (int i=0; i<h.NBoard; i++)
    136136        {
    137             const PEVNT_HEADER &hh = h->FADhead[i];
     137            const PEVNT_HEADER &hh = h.FADhead[i];
    138138
    139139            if (hh.start_package_flag==0)
     
    158158        double avg = 0;
    159159        int    cnt = 0;
    160         for (int i=0; i<h->NBoard; i++)
     160        for (int i=0; i<h.NBoard; i++)
    161161        {
    162             const PEVNT_HEADER &hh = h->FADhead[i];
     162            const PEVNT_HEADER &hh = h.FADhead[i];
    163163
    164164            if (hh.start_package_flag==0)
     
    198198//! @param e the pointer to the EVENT
    199199//
    200 bool DataWriteFits::WriteEvt(const EVENT *e)
     200bool DataWriteFits::WriteEvt(const EVENT &e)
    201201{
    202202    if (!fFile.AddRow())
    203203        return false;
    204204
    205     if (e->TriggerType && !(e->TriggerType & FAD::EventHeader::kAll))
     205    if (e.TriggerType && !(e.TriggerType & FAD::EventHeader::kAll))
    206206        fTriggerCounter[0]++;
    207     else  if ((e->TriggerType&FAD::EventHeader::kPedestal) && !(e->TriggerType&FAD::EventHeader::kTIM))
     207    else  if ((e.TriggerType&FAD::EventHeader::kPedestal) && !(e.TriggerType&FAD::EventHeader::kTIM))
    208208        fTriggerCounter[1]++;
    209     else if (e->TriggerType & FAD::EventHeader::kLPext)
     209    else if (e.TriggerType & FAD::EventHeader::kLPext)
    210210        fTriggerCounter[2]++;
    211     else if (e->TriggerType & (FAD::EventHeader::kTIM|FAD::EventHeader::kPedestal))
     211    else if (e.TriggerType & (FAD::EventHeader::kTIM|FAD::EventHeader::kPedestal))
    212212        fTriggerCounter[3]++;
    213     else if (e->TriggerType & FAD::EventHeader::kLPint)
     213    else if (e.TriggerType & FAD::EventHeader::kLPint)
    214214        fTriggerCounter[4]++;
    215     else if (e->TriggerType & FAD::EventHeader::kExt1)
     215    else if (e.TriggerType & FAD::EventHeader::kExt1)
    216216        fTriggerCounter[5]++;
    217     else if (e->TriggerType & FAD::EventHeader::kExt2)
     217    else if (e.TriggerType & FAD::EventHeader::kExt2)
    218218        fTriggerCounter[6]++;
    219219    else
    220220        fTriggerCounter[7]++;
    221221
    222     memcpy(fTstop, &e->PCTime, 2*sizeof(uint32_t));
     222    memcpy(fTstop, &e.PCTime, 2*sizeof(uint32_t));
    223223    if (fTstart[0]==0)
    224224        memcpy(fTstart, fTstop, 2*sizeof(uint32_t));
    225225
    226     const int realRoiTM = (e->RoiTM > e->Roi) ? e->Roi : 0;
    227     const size_t sz = sizeof(EVENT) + sizeof(e->StartPix)*e->Roi+sizeof(e->StartTM)*realRoiTM; //ETIENNE from RoiTm to Roi
    228 
    229     const vector<char> data = fConv->ToFits(reinterpret_cast<const char*>(e)+4, sz-4);
     226    const int realRoiTM = (e.RoiTM > e.Roi) ? e.Roi : 0;
     227    const size_t sz = sizeof(EVENT) + sizeof(e.StartPix)*e.Roi+sizeof(e.StartTM)*realRoiTM; //ETIENNE from RoiTm to Roi
     228
     229    const vector<char> data = fConv->ToFits(reinterpret_cast<const char*>(&e)+4, sz-4);
    230230
    231231    return fFile.WriteData(data.data(), data.size());
  • trunk/FACT++/src/DataWriteFits.h

    r15628 r16055  
    3535    ~DataWriteFits();
    3636
    37     bool Open(const RUN_HEAD* h, const FAD::RunDescription &d);
    38     bool WriteEvt(const EVENT *e);
     37    bool Open(const RUN_HEAD &h, const FAD::RunDescription &d);
     38    bool WriteEvt(const EVENT &e);
    3939    bool Close(const RUN_TAIL *rt = 0);
    4040};
  • trunk/FACT++/src/DataWriteFits2.cc

    r15628 r16055  
    11#include "DataWriteFits2.h"
     2
     3#include <boost/filesystem.hpp>
    24
    35#include "HeadersFAD.h"
     
    2426}
    2527
    26 void DataWriteFits2::WriteHeader(const RUN_HEAD* h, const FAD::RunDescription &d)
    27 {
    28     const int16_t realRoiTM = (h->NroiTM >= 2*h->Nroi && h->Nroi<=512) ? h->Nroi : 0;
     28void DataWriteFits2::WriteHeader(const RUN_HEAD &h, const FAD::RunDescription &d)
     29{
     30    const int16_t realRoiTM = (h.NroiTM >= 2*h.Nroi && h.Nroi<=512) ? h.Nroi : 0;
    2931
    3032    fFile.AddColumnInt("EventNum", "uint32", "FAD board event counter");
     
    3840    fFile.AddColumnShort(NPIX, "StartCellData", "uint16", "DRS4 start cell of readout");
    3941    fFile.AddColumnShort(NTMARK, "StartCellTimeMarker", "uint16", "DRS4 start cell of readout time marker");
    40     fFile.AddColumnShort(h->NPix*h->Nroi, "Data", "int16", "Digitized data");
    41     fFile.AddColumnShort(h->NTm*realRoiTM, "TimeMarker", "int16", "Digitized time marker - if available");
    42 
    43     const size_t sz = (h->NPix*h->Nroi + h->NTm*realRoiTM)*2;
     42    fFile.AddColumnShort(h.NPix*h.Nroi, "Data", "int16", "Digitized data");
     43    fFile.AddColumnShort(h.NTm*realRoiTM, "TimeMarker", "int16", "Digitized time marker - if available");
     44
     45    const size_t sz = (h.NPix*h.Nroi + h.NTm*realRoiTM)*2;
    4446    if (fFile.GetBytesPerRow()-sz+4!=sizeof(EVENT))
    4547    {
     
    5456
    5557    // ================ Header keys for raw-data =================
    56     fFile.SetInt("BLDVER",   h->Version,  "Builder version");
     58    fFile.SetInt("BLDVER",   h.Version,  "Builder version");
    5759    fFile.SetInt("RUNID",    GetRunId(),  "Run number");
    58     fFile.SetInt("NBOARD",   h->NBoard,   "Number of acquisition boards");
    59     fFile.SetInt("NPIX",     h->NPix,     "Number of pixels");
    60     fFile.SetInt("NTMARK",   h->NTm,      "Number of time marker channels");
     60    fFile.SetInt("NBOARD",   h.NBoard,   "Number of acquisition boards");
     61    fFile.SetInt("NPIX",     h.NPix,     "Number of pixels");
     62    fFile.SetInt("NTMARK",   h.NTm,      "Number of time marker channels");
    6163    fFile.SetInt("NCELLS",   1024,        "Maximum number of slices per pixels");
    62     fFile.SetInt("NROI",     h->Nroi,     "Number of slices per pixels");
     64    fFile.SetInt("NROI",     h.Nroi,     "Number of slices per pixels");
    6365    fFile.SetInt("NROITM",   realRoiTM,   "Number of slices per time-marker");
    6466
    65     const uint16_t realOffset = (h->NroiTM > h->Nroi) ?  h->NroiTM - 2*h->Nroi : 0;
     67    const uint16_t realOffset = (h.NroiTM > h.Nroi) ?  h.NroiTM - 2*h.Nroi : 0;
    6668    fFile.SetInt("TMSHIFT",  realOffset,  "Shift of marker readout w.r.t. to data");
    6769
     
    8688    // DAC
    8789
    88     for (int i=0; i<h->NBoard; i++)
    89     {
    90         const PEVNT_HEADER &hh = h->FADhead[i];
     90    for (int i=0; i<h.NBoard; i++)
     91    {
     92        const PEVNT_HEADER &hh = h.FADhead[i];
    9193
    9294        ostringstream sout;
     
    100102
    101103    // FIXME: Calculate average ref clock frequency
    102     for (int i=0; i<h->NBoard; i++)
    103     {
    104         const PEVNT_HEADER &hh = h->FADhead[i];
     104    for (int i=0; i<h.NBoard; i++)
     105    {
     106        const PEVNT_HEADER &hh = h.FADhead[i];
    105107
    106108        if (hh.start_package_flag==0)
     
    124126    double avg = 0;
    125127    int    cnt = 0;
    126     for (int i=0; i<h->NBoard; i++)
    127     {
    128         const PEVNT_HEADER &hh = h->FADhead[i];
     128    for (int i=0; i<h.NBoard; i++)
     129    {
     130        const PEVNT_HEADER &hh = h.FADhead[i];
    129131
    130132        if (hh.start_package_flag==0)
     
    160162//! @param h a pointer to the RUN_HEAD structure that contains the informations relative to this run
    161163//
    162 bool DataWriteFits2::Open(const RUN_HEAD* h, const FAD::RunDescription &d)
     164bool DataWriteFits2::Open(const RUN_HEAD &h, const FAD::RunDescription &d)
    163165{
    164166    //Form filename, based on runid and run-type
    165167    fFileName = FormFileName("fits");
    166168
     169    if (boost::filesystem::exists(fFileName))
     170    {
     171        Error("ofits - file '"+fFileName+"' already exists.");
     172        return false;
     173    }
     174
    167175    try
    168176    {
     
    209217//! @param e the pointer to the EVENT
    210218//
    211 bool DataWriteFits2::WriteEvt(const EVENT *e)
    212 {
    213     if (e->TriggerType && !(e->TriggerType & FAD::EventHeader::kAll))
     219bool DataWriteFits2::WriteEvt(const EVENT &e)
     220{
     221    if (e.TriggerType && !(e.TriggerType & FAD::EventHeader::kAll))
    214222        fTriggerCounter[0]++;
    215     else  if ((e->TriggerType&FAD::EventHeader::kPedestal) && !(e->TriggerType&FAD::EventHeader::kTIM))
     223    else  if ((e.TriggerType&FAD::EventHeader::kPedestal) && !(e.TriggerType&FAD::EventHeader::kTIM))
    216224        fTriggerCounter[1]++;
    217     else if (e->TriggerType & FAD::EventHeader::kLPext)
     225    else if (e.TriggerType & FAD::EventHeader::kLPext)
    218226        fTriggerCounter[2]++;
    219     else if (e->TriggerType & (FAD::EventHeader::kTIM|FAD::EventHeader::kPedestal))
     227    else if (e.TriggerType & (FAD::EventHeader::kTIM|FAD::EventHeader::kPedestal))
    220228        fTriggerCounter[3]++;
    221     else if (e->TriggerType & FAD::EventHeader::kLPint)
     229    else if (e.TriggerType & FAD::EventHeader::kLPint)
    222230        fTriggerCounter[4]++;
    223     else if (e->TriggerType & FAD::EventHeader::kExt1)
     231    else if (e.TriggerType & FAD::EventHeader::kExt1)
    224232        fTriggerCounter[5]++;
    225     else if (e->TriggerType & FAD::EventHeader::kExt2)
     233    else if (e.TriggerType & FAD::EventHeader::kExt2)
    226234        fTriggerCounter[6]++;
    227235    else
    228236        fTriggerCounter[7]++;
    229237
    230     memcpy(fTstop, &e->PCTime, 2*sizeof(uint32_t));
     238    memcpy(fTstop, &e.PCTime, 2*sizeof(uint32_t));
    231239    if (fTstart[0]==0)
    232240        memcpy(fTstart, fTstop, 2*sizeof(uint32_t));
    233241
    234     const int realRoiTM = (e->RoiTM > e->Roi) ? e->Roi : 0;
    235     const size_t sz = sizeof(EVENT) + sizeof(e->StartPix)*e->Roi+sizeof(e->StartTM)*realRoiTM; //ETIENNE from RoiTm to Roi
    236 
    237     try
    238     {
    239         fFile.WriteRow(reinterpret_cast<const char*>(e)+4, sz-4);
     242    const int realRoiTM = (e.RoiTM > e.Roi) ? e.Roi : 0;
     243    const size_t sz = sizeof(EVENT) + sizeof(e.StartPix)*e.Roi+sizeof(e.StartTM)*realRoiTM; //ETIENNE from RoiTm to Roi
     244
     245    try
     246    {
     247        fFile.WriteRow(reinterpret_cast<const char*>(&e)+4, sz-4);
    240248    }
    241249    catch (const exception &ex)
  • trunk/FACT++/src/DataWriteFits2.h

    r15628 r16055  
    1616    uint32_t fTstop[2];
    1717
    18     void WriteHeader(const RUN_HEAD* h, const FAD::RunDescription &d);
     18    void WriteHeader(const RUN_HEAD &h, const FAD::RunDescription &d);
    1919    void WriteFooter(const RUN_TAIL *rt);
    2020
     
    2727    }
    2828
    29     bool Open(const RUN_HEAD* h, const FAD::RunDescription &d);
    30     bool WriteEvt(const EVENT *e);
     29    bool Open(const RUN_HEAD &h, const FAD::RunDescription &d);
     30    bool WriteEvt(const EVENT &e);
    3131    bool Close(const RUN_TAIL *rt = 0);
    3232
  • trunk/FACT++/src/DataWriteRaw.cc

    r15628 r16055  
    1919}
    2020
    21 bool DataWriteRaw::Open(const RUN_HEAD *h, const FAD::RunDescription &)
     21bool DataWriteRaw::Open(const RUN_HEAD &h, const FAD::RunDescription &)
    2222{
    2323    const string name = FormFileName("bin");
     
    5252
    5353    WriteBlockHeader(kRunHeader, 1, 0, sizeof(RUN_HEAD)-sizeof(PEVNT_HEADER*));
    54     fOut.write(reinterpret_cast<const char*>(h), sizeof(RUN_HEAD)-sizeof(PEVNT_HEADER*));
     54    fOut.write(reinterpret_cast<const char*>(&h), sizeof(RUN_HEAD)-sizeof(PEVNT_HEADER*));
    5555
    5656    for (int i=0; i<40; i++)
    5757    {
    5858        WriteBlockHeader(kBoardHeader, 1, i, sizeof(PEVNT_HEADER));
    59         fOut.write(reinterpret_cast<const char*>(h->FADhead+i), sizeof(PEVNT_HEADER));
     59        fOut.write(reinterpret_cast<const char*>(h.FADhead+i), sizeof(PEVNT_HEADER));
    6060    }
    6161
     
    7979}
    8080
    81 bool DataWriteRaw::WriteEvt(const EVENT *evt)
     81bool DataWriteRaw::WriteEvt(const EVENT &e)
    8282{
    83     const int sh = sizeof(EVENT)-2 + NPIX*evt->Roi*2;
     83    const int sh = sizeof(EVENT)-2 + NPIX*e.Roi*2;
    8484
    8585    WriteBlockHeader(kEvent, 1, fCounter++, sh);
    86     fOut.write(reinterpret_cast<const char*>(evt)+2, sh);
     86    fOut.write(reinterpret_cast<const char*>(&e)+2, sh);
    8787    return true;
    8888}
  • trunk/FACT++/src/DataWriteRaw.h

    r15628 r16055  
    8181    };
    8282
    83     bool Open(const RUN_HEAD *h, const FAD::RunDescription &d);
    84     bool WriteEvt(const EVENT *evt);
     83    bool Open(const RUN_HEAD &h, const FAD::RunDescription &d);
     84    bool WriteEvt(const EVENT &evt);
    8585    bool Close(const RUN_TAIL *tail= 0);
    8686};
Note: See TracChangeset for help on using the changeset viewer.