Commit 36514ffe authored by dino's avatar dino
Browse files

r1267 replayed on r1216 (last backup) to recover from the loss of gamma01.lnl.it

git-svn-id: svn://gal-serv.lnl.infn.it/agata/trunk/narval_emulator@1267 170316e4-aea8-4b27-aad4-0380ec0519c9
parent 8bbf73c6
......@@ -2,40 +2,83 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(femul)
################################################################
# Type of build
set(CMAKE_BUILD_TYPE "Release")
set( CMAKE_BUILD_TYPE "Release" )
################################################################
# Where FIND_PACKAGE should search "non-distribution" FindXxxx.cmake
set(CMAKE_MODULE_PATH ".")
# Select the off-line version of the actors
ADD_DEFINITIONS(-DNRV_TYPE=NRV_OFFLINE)
set( CMAKE_MODULE_PATH "." )
################################################################
# Set the off-line version of the actors (no NRV_ONLINE for femul)
ADD_DEFINITIONS( -DNRV_TYPE=NRV_OFFLINE )
################################################################
# Select the threads library as THR_NONE, THR_BOOST or THR_STD
if( 1 ) # 0 to select from command line ( e.g. cmake . -DTHR_TYPE=THR_STD )
set( THR_TYPE THR_STD ) # default
endif()
if( NOT DEFINED THR_TYPE ) # in case default not set and nothing given from command line
set( THR_TYPE THR_NONE )
endif()
if( THR_TYPE STREQUAL THR_NONE)
message( "Not Using threads ==> ${THR_TYPE}" )
elseif(THR_TYPE STREQUAL THR_BOOST)
message( "Using boost::thread ==> ${THR_TYPE}" )
FIND_PACKAGE(Boost)
MESSAGE("Boost Dirs: ${Boost_INCLUDE_DIR} ${Boost_LIBRARY_DIRS}")
SET(BOOST_LIBRARIES "-L${Boost_LIBRARY_DIRS} -lboost_system -lboost_thread")
MESSAGE("Boost Libs: ${BOOST_LIBRARIES}")
elseif(THR_TYPE STREQUAL THR_STD)
message("Using std::thread ==> ${THR_TYPE}" )
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") # should check if compiler supports
SET(CMAKE_CPP_FLAGS "${CMAKE_CPP_FLAGS} -std=c++11")
if( 0 )
# these 3 lines needed if building on anodes at ganil using THR_STD
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libstdc++") # because after updating to gcc 4.7.4 they have not updated libstdc
ADD_DEFINITIONS( -D_GLIBCXX_USE_NANOSLEEP ) # not needed in my Ubuntu 14.04 LTS whith gcc 4.8.2
ADD_DEFINITIONS( -D_GLIBCXX_USE_SCHED_YIELD ) # not needed in my Ubuntu 14.04 LTS whith gcc 4.8.2
endif()
else()
set( THR_TYPE THR_NONE )
message( "Not Using threads ==> ${THR_TYPE}" )
endif()
ADD_DEFINITIONS( -DTHR_TYPE=${THR_TYPE} )
#####################################################
# For the vectorized version of the PSA FOM-loop
if( 1 ) # 0 to disable
ADD_DEFINITIONS(-DUSE_SSE_VERSION)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse4")
endif()
################################################################
# Enable root
ADD_DEFINITIONS(-DTRF_ROOTTREE)
FIND_PACKAGE(ROOT)
MESSAGE("Root Dirs: ${ROOT_INCLUDE_DIR} ${ROOT_LIBRARY_DIR}")
MESSAGE("Root Libs: ${ROOT_LIBRARIES}")
# Find Boost
FIND_PACKAGE(Boost)
MESSAGE("Boost Dirs: ${Boost_INCLUDE_DIR} ${Boost_LIBRARY_DIRS}")
SET(BOOST_LIBRARIES "-L${Boost_LIBRARY_DIRS} -lboost_system -lboost_thread")
MESSAGE("Boost Libs: ${BOOST_LIBRARIES}")
if( 1 ) # 0 to disable
ADD_DEFINITIONS(-DTRF_ROOTTREE)
FIND_PACKAGE(ROOT)
MESSAGE("Root Dirs: ${ROOT_INCLUDE_DIR} ${ROOT_LIBRARY_DIR}")
MESSAGE("Root Libs: ${ROOT_LIBRARIES}")
endif()
# For the vectorized version of the PSA FOM-loop
ADD_DEFINITIONS(-DUSE_SSE_VERSION)
SET(CMAKE_CXX_FLAGS "-msse4")
###################################
###################################
# The sources to build femul
SET(AGADIR "../..")
SET(AGAPRO "..")
SET(ADFDIR "${AGADIR}/agaprodep/adf")
SET(ACTORS "${AGADIR}/agapro")
SET(PRISMA "${AGADIR}/agapro/PRISMA/src/lib_prisma")
SET(FEMDIR "${AGADIR}/agapro/WinCtest")
SET(ACTORS "${AGAPRO}")
SET(PRISMA "${AGAPRO}/PRISMA/src/lib_prisma")
SET(FEMDIR "${AGAPRO}/WinCtest")
INCLUDE_DIRECTORIES(
${ACTORS}/WinCtest
${FEMDIR}
${ACTORS}/common
${ACTORS}/producers/Crystal ${ACTORS}/producers/Crystal/includeATCA
${ACTORS}/producers/AncillaryTCP
......@@ -50,7 +93,7 @@ ${AGADIR}/include
${PRISMA}/include
${Boost_INCLUDE_DIR}
${ROOT_INCLUDE_DIR}
/usr/include/skstream-0.3 /usr/lib/skstream-0.3/include
##/usr/include/skstream-0.3 /usr/lib/skstream-0.3/include # only for NRV_TYPE=NRV_ONLINE which we don't use in femu;
)
SET(actors_SRCS
......@@ -161,9 +204,7 @@ ${PRISMA}/src/zedCalculator.cc
SET(femul_SRCS ${FEMDIR}/femul.cpp ${FEMDIR}/ChainOfActors.cpp ${adf_SRCS} ${actors_SRCS} ${PRISMA_SRCS} )
#SET(LINK_DIRECTORIES ${Boost_LIBRARY_DIRS} ${ROOT_LIBRARY_DIR})
#MESSAGE("LINK_DIRECTORIES: ${LINK_DIRECTORIES}")
#LINK_DIRECTORIES( ${LINK_DIRECTORIES})
###############################################
SET(LINK_LIBRARIES ${BOOST_LIBRARIES} ${ROOT_LIBRARIES})
#MESSAGE("LINK_LIBRARIES: ${LINK_LIBRARIES}")
......@@ -171,4 +212,3 @@ SET(LINK_LIBRARIES ${BOOST_LIBRARIES} ${ROOT_LIBRARIES})
ADD_EXECUTABLE(femul ${femul_SRCS})
TARGET_LINK_LIBRARIES(femul ${LINK_LIBRARIES})
......@@ -54,7 +54,7 @@ void ChainOfActors::Run()
// check EOD condition
if(hasEnded) {
DispatchEOD(); // if successful, sets isClosed
return; // anyway, nothing more to do
return; // in any case, there is nothing more to do
}
// the dispatch buffer is free and the chain can proceed
......@@ -83,12 +83,12 @@ void ChainOfActors::Run()
if(ptrActor->libType == PRODUCER) {
static_cast<NarvalProducer *>(ptrActor->nrvPointer)->process_block(
bufout, size_of_output_buffer/2, &used_of_output_buffer, // use only 1/2 of the input buffer as a quite drastic
&error_code); // way of avoiding buffer overflows in later actors
bufout, (size_of_output_buffer*3)/4, &used_of_output_buffer, // fill only up to 3/4
&error_code);
if(error_code)
hasEnded = true;
if(used_of_output_buffer == 0) {
DoSleep(); // fake if non-threaded
thrYield(); // fake if non-threaded
break;
}
// swap buffers for the next actor
......@@ -103,12 +103,12 @@ void ChainOfActors::Run()
#else
ptrActor->evbPointer->process_block(
#endif
bufout, size_of_output_buffer, &used_of_output_buffer,
bufout, (size_of_output_buffer*3/4), &used_of_output_buffer, // fill only up to 3/4
&error_code);
if(error_code)
hasEnded = true;
if(used_of_output_buffer == 0) {
DoSleep(); // fake if non-threaded
thrYield(); // fake if non-threaded
break;
}
// swap buffers for the next actor
......@@ -190,26 +190,25 @@ void ChainOfActors::Run()
}
}
// the new version with all chains running in parallel
void ChainOfActors::Dispatch()
{
// Lock destination chain (dummy action if !runThreaded)
if(!thisLocker->Lock(myIndex)) {
DoSleep(); // fake if non-threaded
thrYield(); // fake if non-threaded
return;
}
int used1=thisLocker->GetDataSize(myIndex);
if(!used1) {
if(used1 == 0) { // refill only if no rest data in exchange buffer
thisLocker->StoreData(myIndex, (char*)dispatchBuff, dispatchSize);
int used2=thisLocker->GetDataSize(myIndex);
dispatchSize = 0;
dispatchSize = 0; // StoreData guaranteed to take all data
dispatchFlag = false;
thisLocker->Unlock(myIndex);
}
else {
thisLocker->Unlock(myIndex);
DoSleep(); // fake if non-threaded
thrYield(); // fake if non-threaded
}
}
......@@ -228,40 +227,31 @@ void ChainOfActors::DispatchEOD()
}
// Lock destination chain (dummy action if !runThreaded)
thisLocker->Lock(myIndex);
if(!thisLocker->Lock(myIndex)) {
thrYield(); // fake if non-threaded
return;
}
// build an EOD message with the right key
UInt_t i4dat[kEodKeySize] = {sizeof(i4dat), 0, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF};
i4dat[1] = ptrBuilder->uKeyIn[indQueue];
int used1=thisLocker->GetDataSize(myIndex);
UInt_t i4dat[5];
SetMessageEOD(i4dat);
thisLocker->AddData(myIndex, (char*)i4dat, sizeof(i4dat));
thisLocker->AddData(myIndex, (char*)i4dat, sizeof(i4dat)); // bytes
int used2=thisLocker->GetDataSize(myIndex);
dispatchSize = 0;
isClosed = true;
thisLocker->Unlock(myIndex);
}
void ChainOfActors::DoSleep(int mseconds) {
statDoSleep++;
#ifdef WCT_THREADED
if(runThreaded) {
#if 0
//isSleeping = true;
boost::this_thread::sleep(boost::posix_time::milliseconds(mseconds));
//isSleeping = false;
#else
boost::this_thread::yield();
#endif
//isSleeping = true;
thrSleep(mseconds);
//isSleeping = false;
}
#endif
}
bool ChainOfActors::SetMessageEOD(UInt_t mess[5])
{
mess[0] = 20;
mess[1] = ptrBuilder->uKeyIn[indQueue];
mess[2] = 0xFFFFFFFF;
mess[3] = 0xFFFFFFFF;
mess[4] = 0xFFFFFFFF;
return true;
}
......@@ -29,7 +29,7 @@ public:
int myIndex; // numeric identifier of the chain
std::string confDir; // the configuration directory of all actors of this chain
int numActors; // number of actors in the chain
std::vector<actor> theActors; // actor: NONE; BUILDER; PRODUCER; FILTER; CONSUMER; DISPATCHER
std::vector<actor> theActors; // actor: NONE; BUILDER; PRODUCER; FILTER; CONSUMER; DISPATCHER
UInt_t ioBuffsSize; // size, in bytes, of the buffers
char *ioBuffs[2]; // IO buffers. Input/Output type toggles along the execution type
bool runThreaded; // chain runs in its own thread
......@@ -52,8 +52,8 @@ public:
int indActor; // the actor being run (or the last one in case of error)
actor *ptrActor; // the actor being run
int statStarted; // how many times the chain has been called
int statCounted; // how many time the chain has been completed successfully
int statDoSleep; // how many time could not lock the exchange buffer
int statCounted; // how many times the chain has been completed successfully
int statDoSleep; // how many times could not lock the exchange buffer
ChainOfActors(int id = -1) : myIndex(id), numActors(0), runThreaded(false),
hasBuilder(false), indBuilder(-1), pchBuilder(NULL),
......@@ -72,7 +72,6 @@ public:
void Dispatch();
void DispatchEOD();
void DoSleep(int mseconds = 10);
bool SetMessageEOD(UInt_t mess[5]);
};
#endif // CHAINOFACTORS_H_INCLUDED
This diff is collapsed.
......@@ -46,7 +46,7 @@
Optimization="0"
EnableIntrinsicFunctions="true"
AdditionalIncludeDirectories="..\WinCtest;..\common;..\producers\Crystal;..\producers\Crystal\includeATCA;..\producers\AncillaryTCP;..\filters\Preprocessing;..\filters\Ancillary;..\filters\Ancillary\includeVME;..\filters\PSA;..\filters\PSA\includePSA;..\filters\Tracking;..\filters\Tracking\includeOFT;..\filters\Tracking\includeMGT;..\filters\PostPSA;..\builders;..\filters\Global;..\..\include;..\PRISMA\src\lib_prisma\include;C:\Boost\boost_1_55_0;C:\root\include"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;NRV_TYPE=NRV_OFFLINE;TRF_ROOTTREE"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;NRV_TYPE=NRV_OFFLINE;THR_TYPE=THR_BOOST"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
......@@ -284,7 +284,7 @@
EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="1"
AdditionalIncludeDirectories="..\PRISMA\src\lib_prisma\include;C:\Boost\boost_1_55_0;..\common;..\producers\Crystal;..\producers\Crystal\includeATCA;..\producers\AncillaryTCP;..\filters\Preprocessing;..\filters\Preprocessing\includePreprocessing;..\filters\Ancillary;..\filters\Ancillary\includeVME;..\filters\PSA;..\filters\PSA\includePSA;..\filters\Tracking;..\filters\Tracking\includeOFT;..\filters\Tracking\includeMGT;..\builders;C:\root\include;..\filters\PostPSA;..\filters\Global;..\..\include"
PreprocessorDefinitions="WIN64;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;NRV_TYPE=NRV_OFFLINE"
PreprocessorDefinitions="WIN64;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;NRV_TYPE=NRV_OFFLINE;THR_TYPE=THR_BOOST"
ExceptionHandling="1"
RuntimeLibrary="2"
BufferSecurityCheck="false"
......@@ -360,10 +360,6 @@
RelativePath=".\femul.cpp"
>
</File>
<File
RelativePath="..\..\agaprodep\adf\MetaFrame.cpp"
>
</File>
</Filter>
<Filter
Name="filters"
......@@ -722,6 +718,10 @@
RelativePath="..\..\agaprodep\adf\DotConf.cpp"
>
</File>
<File
RelativePath="..\..\include\standalone\Env.h"
>
</File>
<File
RelativePath="..\..\agaprodep\adf\FactoryItem.cpp"
>
......@@ -758,6 +758,10 @@
RelativePath="..\..\agaprodep\adf\KeyFactory.cpp"
>
</File>
<File
RelativePath="..\..\agaprodep\adf\MetaFrame.cpp"
>
</File>
<File
RelativePath="..\..\agaprodep\adf\MetaFrame.icpp"
>
......
This diff is collapsed.
......@@ -53,7 +53,7 @@ public:
bool bTstampCorrection;
std::vector<int> vCorrection;
Bool_t useEventNumber;
//Bool_t useEventNumber;
ULong64_t timeout;
ULong64_t sumbusL; // lower value of the time window ( see comments in CheckEvent_Tstamp() )
ULong64_t sumbusR; // upper value of the time window
......@@ -88,25 +88,21 @@ public:
EventQueue *evQue;
UInt_t *evQueEvts; // number of events at the input of Process()
Int_t *isGood;
Int_t *isGood; // 0 not valid; 1 valid and move to output; -1 valid but discard
ChainLocker **inQueLocker;
Bool_t *inQueLocked;
UInt_t *inQueIndex; // points to the not yet read data
UInt_t *statKeys;
ULong64_t minTstamp;
UInt_t minEvnum;
ULong64_t oldTstamp;
UInt_t minChain;
UInt_t errState;
UInt_t noBuild1;
UInt_t noBuild2;
//UInt_t numKeys;
Int_t numKeys;
Int_t numKeys;
bool fUseMultiHist;
CycleServer cServer; // manager of cyclic operations for this EventBuilder
public:
......@@ -123,7 +119,6 @@ public:
bool setChain(int ichain, ChainLocker * pLock) {
inQueLocker[ichain] = pLock;
inQueLocked[ichain] = false;
return true;
}
......@@ -157,7 +152,6 @@ public:
void PrintStat();
void PrintDFAgentKeys(std::string str);
void CheckEvent_Evnum();
void CheckEvent_Tstamp();
// called as a PRODUCER that has to take care of its input queues
......@@ -190,15 +184,17 @@ protected:
virtual Int_t AlgoInitialise() {return 0;}
#ifdef EVB_MULTIHIST
MultiHistGroup hGroup; // used to record the pointers of all defined MultiHist spectra
MultiHist<unsigned int> *EvbSpecTdiff;
MultiHist<unsigned int> *EvbSpecTAC;
MultiHist<unsigned int> *EvbSpecRate;
std::pair<int, int> *EvbTqueue; // detID and timestamp of the front events, to produce the pairwise TAC spectra
sAppend<UInt_t> *sTstamps; // time differences among the event queues seen by the tstamp-based event builder
void InitMultiHist();
MultiHistGroup hGroup; // used to record the pointers of all defined MultiHist spectra
MultiHist<unsigned int> *EvbSpecSbus; // distribution of timestmp of accepted events
sAppend<UInt_t> *sTstamps; // fDetails_b1 LM of timestamp differences for the queues as seen by the event builder
MultiHist<unsigned int> *EvbSpecRate; // "" spectrum of timestamp differences (ms) seen by the event builder
//evQueue::sTstDiff // fDetails_b2 LM of timestamp differences for each queue
MultiHist<unsigned int> *EvbSpecTAC; // fDetails_b3
std::pair<int, int> *EvbTqueue; // "" detID and timestamp of the front events, to produce the pairwise TAC spectra
MultiHist<unsigned int> *EvbSpecStep; // accepted_events / time_slot
void InitMultiHist(bool reset=false);
#else
void InitMultiHist() {}
void InitMultiHist(bool reset=false) {fUseMultiHist = false;}
#endif //EVB_MULTIHIST
};
......
#include <iostream>
#include <algorithm>
#include "EventQueue.h"
#include "commonDefs.h"
using namespace std;
#define WHICH_TSTDIFF 0 // list mode of timestamp differences written in: 0==AddData 1==moveOut
#define TSTDIFF_LM_TYPE 0 // list mode of timestamp differences produced in: 0-addData(...) or 1-moveOut(...)
#define EXCLUDE_TST_ZERO // discard events with timestamp=0; count them as errors
//#define CHECK_DETAILS // DEBUG
const bool doReorderEvents = true; // fix timestamp inversion events while they are inserted into the queue
UInt_t EventQueue::addData(UInt_t * i4dat, UInt_t n4dat, Int_t tstCorr)
{
if(EodInserted) // no data can be inserted on a closed queue
return 0; // in which case the data is simply discarded
//UInt_t wrong = 0;
//UInt_t count1 = countEvents();
#ifdef CHECK_DETAILS
UInt_t wrong = 0;
UInt_t count1 = countEvents();
#endif
// if not enough room for the new events
// shift existing eventss to beginning of buffer
if(indNext+n4dat >= validSize) {
// try to reshuffle
if(indFirst && indNext) {
endCount++;
int mm = 0;
......@@ -26,84 +35,110 @@ UInt_t EventQueue::addData(UInt_t * i4dat, UInt_t n4dat, Int_t tstCorr)
indFirst = 0;
indNext = mm;
}
//UInt_t count2 = countEvents();
//if(count2 != count1)
// wrong++;
// will try instead to take what is possible
//if(indNext+n4dat > kQueueSize)
// return false;
#ifdef CHECK_DETAILS
UInt_t count2 = countEvents();
if(count2 != count1)
wrong++;
#endif
}
// take new events
UInt_t i4Add = 0;
UInt_t added = 0;
while(n4dat > 0) {
int i4len = i4dat[0]/4;
if( i4dat[1] == inpKey ) { //copy only valid frames
if(indNext+i4len >= validSize) {
break; // input queue full
}
// check if frame is valid
if( i4dat[1] != inpKey ) {
if( i4dat[1]!=kMetaSync && i4dat[1]!=kMetaEof)
badKeys++; // counted as errors if not meta:sync or meta:eof
i4dat += i4len; // remove event from input
n4dat -= i4len;
continue;
}
ULong64_t tstNew = getTstamp(i4dat + 3);
#ifdef EXCLUDE_TST_ZERO
// check timestamp
if( tstNew == 0 ) {
errCount++; // counted as errors
i4dat += i4len; // remove event from input
n4dat -= i4len;
continue;
}
#endif
// check if enough space to copy event
if(indNext+i4len >= validSize) {
break; // input queue full
}
#if TSTDIFF_LM_TYPE == 0
if(sTstDiff)
addTstDiff(tstNew); // LM produced with original time stamp value
#endif
tstNew += tstCorr; // apply timestamp correction
if(tstNew < tstLast)
errCount++; // timestamp inversions counted as errors
if(!doReorderEvents || tstNew >= tstLast || numEvts==0) {
// don't care, or no inversion, or queue is empty
memcpy(data+indNext, i4dat, i4len*sizeof(UInt_t));
indLast = indNext;
indNext += i4len;
i4Add += i4len;
if(tstCorr)
addTstamp(data + indLast + 3, tstCorr);
#if WHICH_TSTDIFF == 0
if(sTstDiff)
addTstDiff(getTstamp(data + indLast + 3));
#endif
numEvts++;
added++;
addTstamp(data + indNext + 3, tstCorr);
indLast = indNext;
}
else {
// We should check here if this frame is of interest (e.g. conf: or meta:eof)
// If we allow it to go through (as we probably should) it has to be rechecked in EventBuilder::process_block
// If it is meta:eof let's change its evnumber and timestamp to maxval
//if(i4dat[1] == 0xFA001100 && i4dat[0] == 20) {
// if(indNext+i4len >= validSize) {
// break; // input queue full
// }
// i4dat[2] = 0xFFFFFFFF;
// i4dat[3] = 0xFFFFFFFF;
// i4dat[4] = 0xFFFFFFFF;
// // copy the frame
// memcpy(data+indNext, i4dat, i4len*sizeof(UInt_t));
// indLast = indNext;
// indNext += i4len;
// i4Add += i4len;
// if(tstCorr)
// addTstamp(data + indLast + 3, tstCorr);
// numEvts++;
// added++;
//}
badKeys++;
// insert the event into the right place, of course only respect to the events that are still in the input queue
UInt_t indInsert = insertPoint(tstNew);
memmove(data+indInsert+i4len, data+indInsert, (indNext-indInsert)*sizeof(UInt_t)); // overlapping regions
memcpy(data+indInsert, i4dat, i4len*sizeof(UInt_t));
if(tstCorr)
addTstamp(data + indInsert + 3, tstCorr);
indLast += i4len;
}
i4dat += i4len;
indNext = indLast + data[indLast]/4; // updated after each insert
tstLast = getTstamp(data + indLast + 3); // ""
i4Add += i4len;
numEvts++;
added++;
i4dat += i4len; // remove this event from the input buffer
n4dat -= i4len;
}
//UInt_t count3 = countEvents();
//if(count3 != count1+added)
// wrong++;
maxInputSize = max(maxInputSize, i4Add);
maxQueueSize = max(maxQueueSize, indNext-indFirst);
tstFirst = getTstamp(data + indFirst + 3);
evnFirst = getEvnumb(data + indFirst + 2);
tstLast = getTstamp(data + indLast + 3);
evnLast = getEvnumb(data + indLast + 2);
if(tstVeryFirst==0)
tstVeryFirst = tstFirst;
if(tstLast != 0xFFFFFFFFFFFFFFFF)
tstVeryLast = tstLast;
} // while(n4dat > 0)
#ifdef CHECK_DETAILS
UInt_t count3 = countEvents();
if(count3 != count1+added)
wrong++;
#endif
if(numEvts > 0) { // with EXCLUDE_TST_ZERO the input queue could end up being empty
maxInputSize = max(maxInputSize, i4Add);
maxQueueSize = max(maxQueueSize, indNext-indFirst);
tstFirst = getTstamp(data + indFirst + 3); // in principle this is already in place
tstLast = getTstamp(data + indLast + 3); // ""
//evnFirst = getEvnumb(data + indFirst + 2);
//evnLast = getEvnumb(data + indLast + 2);
if(tstVeryFirst==0)
tstVeryFirst = tstFirst;
if(tstLast != 0xFFFFFFFFFFFFFFFFULL)
tstVeryLast = tstLast;
}
return n4dat; // how much is still in the input buffer
}
UInt_t EventQueue::moveOut(UInt_t *dest)
{
#if WHICH_TSTDIFF != 0
#if TSTDIFF_LM_TYPE != 0
if(sTstDiff)
addTstDiff(getTstamp(data + indFirst + 3));
#endif
......@@ -114,48 +149,19 @@ UInt_t EventQueue::moveOut(UInt_t *dest)
if(dest)
memcpy(dest, data+indFirst, size);
numEvts--;
size /= 4;
indFirst += size;