diff --git a/daq/FEMINOSPacket.cxx b/daq/FEMINOSPacket.cxx index 7997770..fbd9e92 100644 --- a/daq/FEMINOSPacket.cxx +++ b/daq/FEMINOSPacket.cxx @@ -151,10 +151,10 @@ void FEMINOSPacket::DataPacket_Print (uint16_t *fr, const uint16_t &size){ printf("Event_Count %d\n", evC); } else if ((*fr & PFX_4_BIT_CONTENT_MASK) == PFX_END_OF_EVENT){ - uint32_t size_ev = ( GET_EOE_SIZE(*fr)) << 16; + uint32_t size_ev = (( GET_EOE_SIZE(*fr)) << 16 ) & 0xFFFF0000; fr++; sz_rd++; - size_ev |= *fr; + size_ev |= *fr & 0xFFFF; fr++; sz_rd++; printf("----- End of Event ----- (size %d bytes)\n", size); @@ -291,15 +291,18 @@ bool FEMINOSPacket::GetNextEvent(std::deque &buffer, TRestRawSignalEv while (!endOfEvent && !buffer.empty()){ //std::cout<<"Val 0x"< &buffer, TRestRawSignalEv ev_count |= ( buffer.front() << 16); buffer.pop_front(); - //std::cout<<"EvCnt "< &buffer, TRestRawSignalEv //std::cout<<"TimeBin "< &buffer, TRestRawSignalEv } else if ( (buffer.front() & PFX_4_BIT_CONTENT_MASK) == PFX_END_OF_EVENT ){ endOfEvent=true; - //std::cout<<"END OF EVENT "; + //std::cout<<"END OF EVENT "< *FEMA ) { } else { std::unique_lock lock_mem(FEM.mutex_mem); //const std::deque frame (&buf_rcv[1], &buf_rcv[size -1]); - FEM.buffer.insert(FEM.buffer.end(), &buf_rcv[3], &buf_rcv[size -1]);//Skip 2 first words + FEM.buffer.insert(FEM.buffer.end(), &buf_rcv[1], &buf_rcv[size -1]); int bufferSize = FEM.buffer.size(); lock_mem.unlock(); if (verboseLevel >= TRestStringOutput::REST_Verbose_Level::REST_Debug) diff --git a/daq/TRESTDAQFEMINOS.h b/daq/TRESTDAQFEMINOS.h index 1bca79f..9820438 100644 --- a/daq/TRESTDAQFEMINOS.h +++ b/daq/TRESTDAQFEMINOS.h @@ -13,29 +13,11 @@ Based on mclient program from Denis Calvet #define __TREST_DAQ_FEMINOS__ #include "TRESTDAQ.h" -#include "TRESTDAQSocket.h" +#include "FEMProxy.h" #include #include #include -#include - -class FEMProxy : public TRESTDAQSocket { - - public: - FEMProxy(){ } - bool pendingEvent=false; - TRestRawDAQMetadata::FECMetadata fecMetadata; - //std::atomic_int - int cmd_sent=0; - //std::atomic_int - int cmd_rcv=0; - - std::deque buffer; - - inline static std::mutex mutex_socket; - inline static std::mutex mutex_mem; -}; class TRESTDAQFEMINOS : public TRESTDAQ { public: diff --git a/daq/TRESTDAQManager.cxx b/daq/TRESTDAQManager.cxx index 5bc3ea9..a0eb0fe 100644 --- a/daq/TRESTDAQManager.cxx +++ b/daq/TRESTDAQManager.cxx @@ -15,6 +15,7 @@ Control data acquisition via shared memory, should be always running #include "TRESTDAQDCC.h" #include "TRESTDAQDummy.h" #include "TRESTDAQFEMINOS.h" +#include "TRESTDAQARC.h" TRESTDAQManager::TRESTDAQManager() { int shmid; @@ -88,6 +89,8 @@ std::unique_ptr TRESTDAQManager::GetTRESTDAQ (TRestRun* rR, TRestRawDA daq = std::make_unique(rR, dM); } else if (eT->second == daq_metadata_types::electronicsTypes::FEMINOS) { daq = std::make_unique(rR, dM); + } else if (eT->second == daq_metadata_types::electronicsTypes::ARC) { + daq = std::make_unique(rR, dM); } else { std::cout << electronicsType << " not implemented, skipping..." << std::endl; }