Commit 63407da5 authored by dino's avatar dino
Browse files

Added detailed timestamp differences in the off-line event builder

git-svn-id: svn://gal-serv.lnl.infn.it/agata/trunk/narval_emulator@1119 170316e4-aea8-4b27-aad4-0380ec0519c9
parent 9d72f317
......@@ -24,12 +24,14 @@ EventBuilder::EventBuilder(std::string name, unsigned int nch) :
tsumbus = 100;
minFold = 1;
verbose = false;
details = false;
fActualClass = gActualClass = name;
fUseMultiHist = true;
#ifdef EVB_MULTIHIST
EvbSpecTdiff = NULL;
sTstamps = NULL;
#endif //EVB_MULTIHIST
minTstamp = 0;
......@@ -42,6 +44,9 @@ EventBuilder::EventBuilder(std::string name, unsigned int nch) :
}
EventBuilder::~EventBuilder() {
if(sTstamps)
delete sTstamps;
sTstamps = NULL;
cServer.Finish();
//PrintStat();
}
......@@ -422,6 +427,15 @@ void EventBuilder::CheckEvent_Tstamp()
if(minTstamp == 0xFFFFFFFFFFFFFFFFULL) // no data or all queues have EOD
return;
if(sTstamps) {
for(UInt_t nn = 0; nn < nchains; nn++) {
UInt_t dt = evq[nn].hasData() ? UInt_t(evq[nn].tstFirst-minTstamp) : 0;
sTstamps->add(dt);
}
sTstamps->add(UInt_t(minTstamp&0xFFFFFFFF));
sTstamps->add(UInt_t((minTstamp>>32)&0xFFFFFFFF));
}
// check how many are closer than tsumbus to minTstamp
ULong64_t maxTstamp = minTstamp + tsumbus; // upper margin of time window
for(UInt_t nn = 0; nn < nchains; nn++) {
......@@ -524,6 +538,11 @@ bool EventBuilder::InitBuilder()
EvbSpecTdiff->setFileName(fOdirPrefix+"Evb?"+gActualClass+".spec");
EvbSpecTdiff->setComment("timestamp differences");
hGroup.add(EvbSpecTdiff);
if(details) {
std::ostringstream sfn;
sfn << "Evb__000-" << nchains+2 << "-UI__";
sTstamps = new sAppend<UInt_t>(fOdirPrefix+sfn.str()+gActualClass+".bdat", 1000*(nchains+2) );
}
}
#endif //EVB_MULTIHIST
......@@ -615,6 +634,10 @@ void EventBuilder::GetParameters(UInt_t *error_code)
verbose = true;
ok = true;
}
else if( stringEq(keyw, "Details") ) {
details = true;
ok = true;
}
else {
cout << " --> ignored";
ok = true;
......
......@@ -8,6 +8,7 @@
#ifdef EVB_MULTIHIST
# include "MultiHist.h"
# include "sAppend.h"
#endif
#include "cycleServer.h"
......@@ -56,6 +57,7 @@ public:
ULong64_t tsumbus;
UInt_t minFold;
Bool_t verbose;
Bool_t details;
std::vector<std::string> sKeyIn;
std::vector<unsigned int> uKeyIn;
......@@ -90,6 +92,7 @@ public:
#ifdef EVB_MULTIHIST
MultiHist<unsigned int> *EvbSpecTdiff;
MultiHistGroup hGroup; // used to record the pointers of all defined MultiHist spectra
sAppend<UInt_t> *sTstamps;
#endif //EVB_MULTIHIST
cycleServer cServer; // manager of cyclic operations for this EventBuilder
......
......@@ -52,8 +52,8 @@ const float MAXNORM = 1000.f; // normalization of the signal basis
// We should check this in PSAFilterGridSearch or, maybe, go back to the formulation by
// Roberto Venturelli where the experimental signal is rescaled event-by-event to MAXNORM.
// This define should be managed at the project level (VC or cmake -DUSE_SSE_VERSION=1 or CmakeLists.txt)
// However, during development it is convenient to control it directly to avoid full recompilation if changing the project)
// This define should be managed at the project level (VC++ preprocessor definitions or in CmakeLists.txt for cmake)
// During development it is convenient to control it directly (e.g. to avoid full recompilation when changing the project files)
#if 0
#ifdef HAS_AGAPROCONFIG
#ifdef HAS_SSE
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment