Changeset 16584 for trunk


Ignore:
Timestamp:
06/02/13 15:50:15 (11 years ago)
Author:
tbretz
Message:
Removed Errors and SoftTrig; let the runClose access the RUN_CTRL (to update the calibration constants); the whole memory is now reset in initMemory at once.
File:
1 edited

Legend:

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

    r16569 r16584  
    5757bool runOpen(const EVT_CTRL2 &evt);
    5858bool runWrite(const EVT_CTRL2 &evt);
    59 void runClose();
     59void runClose(RUN_CTRL2 &run);
    6060void applyCalib(const EVT_CTRL2 &evt, const size_t &size);
    6161void factOut(int severity, const char *message);
     
    104104            max_inuse = inuse;
    105105
    106         void *mem = NULL;
    107 
    108106        if (memory.empty())
    109107        {
    110108            // No free slot available, allocate a new one
    111109            allocated += MAX_TOT_MEM;
    112             mem = new char[MAX_TOT_MEM];
    113         }
    114         else
    115         {
    116             // Get the next free slot from the stack and return it
    117             const std::lock_guard<std::mutex> lock(mtx);
    118             mem = memory.front();
    119             memory.pop_front();
    120         }
    121 
    122         memset(mem, 0, MAX_HEAD_MEM);
     110            return  new char[MAX_TOT_MEM];
     111        }
     112
     113        // Get the next free slot from the stack and return it
     114        const std::lock_guard<std::mutex> lock(mtx);
     115
     116        void *mem = memory.front();
     117        memory.pop_front();
    123118        return mem;
    124119    };
     
    595590        }
    596591
    597         // count for inconsistencies
    598         if (evt->trgNum != rd.H.trigger_id)
    599             evt->Errors[0]++;
    600         if (evt->trgTyp != rd.H.trigger_type)
    601             evt->Errors[2]++;
    602 
    603592        // It is maybe not likely, but the header of this board might have
    604593        // arrived earlier. (We could also update the run-info, but
     
    852841        return;
    853842
    854     runClose();
     843    runClose(run);
    855844    run.fileStat = kFileClosed;
    856845
     
    892881        event->NumBoards = evt->nBoard;
    893882
    894         event->Errors[0] = evt->Errors[0];
    895         event->Errors[1] = evt->Errors[1];
    896         event->Errors[2] = evt->Errors[2];
    897         event->Errors[3] = evt->Errors[3];
    898 
    899         event->PCTime    = evt->time.tv_sec;
    900         event->PCUsec    = evt->time.tv_usec;
     883        event->PCTime = evt->time.tv_sec;
     884        event->PCUsec = evt->time.tv_usec;
    901885
    902886        for (int ib=0; ib<NBOARDS; ib++)
Note: See TracChangeset for help on using the changeset viewer.