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.
File:
1 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
Note: See TracChangeset for help on using the changeset viewer.