Commit fb0aabe1 authored by dino's avatar dino
Browse files

New classes common/ConfREader and common/TextReader to manage configuration and calibration files

git-svn-id: svn://gal-serv.lnl.infn.it/agata/trunk/narval_emulator@1187 170316e4-aea8-4b27-aad4-0380ec0519c9
parent 4f66b278
......@@ -72,8 +72,7 @@ void CGaspBuffer::BeginOfRun(int number)
OpenFile();
RecordHeader();
//RecordHeader();
FlushBuffer();
//FlushBuffer(); // why should it write an empty buffer ??
}
void CGaspBuffer::OpenFile()
......@@ -139,6 +138,7 @@ void CGaspBuffer::AddToBuffer( unsigned short int* event, int size )
//for(int ii=0; ii<size; ii++ )
// pData[bufferPosition+ii] = event[ii];
// will overflow if bufferPosition+size >= BUFLENGTH
memcpy( pData+bufferPosition, event, size*sizeof(short int) );
bufferPosition += size;
......
......@@ -39,7 +39,7 @@ ${ACTORS}/WinCtest
${ACTORS}/common
${ACTORS}/producers/Crystal ${ACTORS}/producers/Crystal/includeATCA
${ACTORS}/producers/AncillaryTCP
${ACTORS}/filters/Preprocessing
${ACTORS}/filters/Preprocessing ${ACTORS}/filters/Preprocessing/includePreprocessing
${ACTORS}/filters/Ancillary ${ACTORS}/filters/Ancillary/includeVME
${ACTORS}/filters/PSA ${ACTORS}/filters/PSA/includePSA
${ACTORS}/filters/PostPSA
......@@ -59,6 +59,8 @@ ${ACTORS}/common/misc.cpp
${ACTORS}/common/mwdlib.cpp
${ACTORS}/common/adetParams.cpp
${ACTORS}/common/TstampFilter.cpp
${ACTORS}/common/TextReader.cpp
${ACTORS}/common/ConfReader.cpp
${ACTORS}/common/MixFFT.cpp
${ACTORS}/producers/Crystal/CrystalProducer.cpp
${ACTORS}/producers/Crystal/CrystalProducerATCA.cpp
......
......@@ -17,7 +17,6 @@ SET(ROOT_CONFIG_SEARCHPATH
$ENV{ROOTSYS}/bin
/usr/bin
/agata/tools/root/bin
/home/daniele/Programs/root.5.27.06/bin
)
SET(ROOT_DEFINITIONS "")
......
......@@ -4,7 +4,7 @@
//
// The development started in ~2008, inspired by Joa's C_Test.c (which uses the .so libraries via dlopen, dlsym,...)
// and has evolved towards an almost complete emulation of the Narval environment.
// The main difference/limitation with the Narval implementation is the use of one process on a single computer.
// The main difference/limitation with the Narval implementation is the use of a single process on a single computer.
// To speed-up execution in multi-core computers it is possible to run parallel threads (from the Boost C++ Libraries)
// - in the PSAFilter library (#define PSA_THREADED in commonDefs.h, also when running in Narval) and/or
// - in the driver program (#define WCT_THREADED in ChainLocker.h).
......@@ -16,7 +16,7 @@
//
// The program is supposed to be multi-platform and has been tested in Windows, [Cygwin??] and GNU/Linux.
//
// Dino Bazzacco 2008-2012
// Dino Bazzacco 2008-2014
//
#include <cstdlib>
......@@ -28,6 +28,10 @@
#include <fstream>
#include <vector>
#if OS_TYPE != OS_WINDOWS
# include <unistd.h>
#endif
#define FEMBUF_MINSIZE 1024 // Minimum size (bytes) of the data buffers connecting the actors
#define FEMBUF_DEFSIZE (10*1024*1024) // Default size (bytes) of the data buffers connecting the actors
#define FEMBUF_MAXSIZE (30*1024*1024) // Maximum size (bytes) of the data buffers connecting the actors
......@@ -158,6 +162,7 @@ struct builder_t {
};
vector<builder_t *> theBuilders;
void showWhat();
void getparams(int, char **);
void numparams(char *, int);
void listKeysAndExit(); // call GetParameters(doList=true) and exit
......@@ -194,15 +199,13 @@ int main(int argc, char **argv)
cout << "# Using Narval actors without Narval #" << endl;
cout << "######################################" << endl;
showWhat();
getparams(argc, argv);
if(listKeys)
listKeysAndExit();
#ifdef WCT_THREADED
cout << "\nBoost C++ Library Version " << BOOST_VERSION/100000 << "_" << (BOOST_VERSION/100)%1000 << "_" << BOOST_VERSION%100 << endl;
#endif
bool ok;
ok = checkADFpath();
......@@ -322,6 +325,26 @@ AGAIN_LOOP:
return 1;
}
void showWhat()
{
cout << endl;
#if defined(WCT_THREADED) || defined (PSA_THREADED)
cout << "Using boost " << BOOST_VERSION/100000 << "_" << (BOOST_VERSION/100)%1000 << "_" << BOOST_VERSION%100 << endl;
#endif
#if defined(TRF_ROOTTREE) || defined(GLF_ROOTTREE) || defined(ANF_ROOTTREE)
cout << "Using root " << ROOT_RELEASE << endl;
#endif
#if OS_TYPE == OS_WINDOWS
cout << "OS is Windows " << endl;
#elif OS_TYPE == OS_LINUX
cout << "OS is Linux " << endl;
#elif OS_TYPE == OS_APPLE
cout << "OS is Apple " << endl;
#elif OS_TYPE == OS_CYGWIN
cout << "OS is Cygwin " << endl;
#endif
}
void getparams(int argc, char *argv[])
{
char *cmd = NULL;
......@@ -333,7 +356,7 @@ void getparams(int argc, char *argv[])
else if(!strcmp(argv[1], "-h")|| !strcmp(argv[1], "--help")) {
ok = -1;
}
else if(!strcmp(argv[1], "-k") || !strcmp(argv[1], "-keys")) {
else if(!strcmp(argv[1], "-k") || !strcmp(argv[1], "--keys")) {
listKeys = true;
return;
}
......@@ -346,9 +369,13 @@ void getparams(int argc, char *argv[])
while(ok == 1 && argn < argc) {
cmd = argv[argn++];
ok = 1;
if(!strcmp(cmd, "-h")) {
if (!strcmp(cmd, "-h") || !strcmp(cmd, "--help")) {
ok = -1;
}
else if(!strcmp(cmd, "-k") || !strcmp(cmd, "--keys")) {
listKeys = true;
return;
}
else if(!strcmp(cmd, "-conf")) {
numparams(cmd, argc-argn-1);
confPrefix = argv[argn++];
......@@ -365,10 +392,6 @@ void getparams(int argc, char *argv[])
numparams(cmd, argc-argn-1);
adfVerbose = abs(atoi(argv[argn++]));
}
else if(!strcmp(cmd, "-k") || !strcmp(cmd, "-keys")) {
listKeys = true;
return;
}
else {
ok = 0;
}
......
......@@ -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"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;NRV_TYPE=NRV_OFFLINE;TRF_ROOTTREE"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
......@@ -69,8 +69,9 @@
<Tool
Name="VCLinkerTool"
UseLibraryDependencyInputs="true"
AdditionalDependencies="libCore.lib libTree.lib libRIO.lib"
LinkIncremental="2"
AdditionalLibraryDirectories="&quot;C:\Boost\boost_1_55_0\lib32-msvc-9.0&quot;"
AdditionalLibraryDirectories="&quot;C:\Boost\boost_1_55_0\lib32-msvc-9.0&quot;;C:\root\lib"
GenerateDebugInformation="true"
SubSystem="1"
TargetMachine="1"
......@@ -123,7 +124,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\PRISMA\src\lib_prisma\include;&quot;C:\Program Files (x86)\boost\boost_1_40&quot;;..\myADF0.2;..\..\agaprodep\adf\standalone;..\common;..\producers\Crystal;..\producers\Crystal\includeATCA;..\producers\AncillaryTCP;..\filters\Preprocessing;..\filters\Preprocessing\includePrePSA;..\filters\Ancillary;..\filters\Ancillary\includeVME;..\filters\PSA;..\filters\PSA\includePSA;..\filters\Tracking;..\filters\Tracking\includeOFT;..\filters\Tracking\includeMGT;..\builders;C:\root\include"
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="WIN64;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;NRV_TYPE=NRV_OFFLINE"
MinimalRebuild="true"
BasicRuntimeChecks="3"
......@@ -291,7 +292,7 @@
DisableLanguageExtensions="false"
UsePrecompiledHeader="0"
WarningLevel="3"
WarnAsError="true"
WarnAsError="false"
DebugInformationFormat="3"
/>
<Tool
......@@ -841,6 +842,14 @@
RelativePath="..\common\commonDefs.h"
>
</File>
<File
RelativePath="..\common\ConfReader.cpp"
>
</File>
<File
RelativePath="..\common\ConfReader.h"
>
</File>
<File
RelativePath="..\common\cycleServer.cpp"
>
......@@ -881,6 +890,14 @@
RelativePath="..\common\sAppend.h"
>
</File>
<File
RelativePath="..\common\TextReader.cpp"
>
</File>
<File
RelativePath="..\common\TextReader.h"
>
</File>
<File
RelativePath="..\common\TstampFilter.cpp"
>
......
......@@ -4,6 +4,9 @@
#include <algorithm>
#include <memory.h>
#include "misc.h"
#include "ConfReader.h"
using namespace std;
std::string EventBuilder::gMotherClass = "EventBuilder";
......@@ -11,6 +14,8 @@ std::string EventBuilder::gActualClass; // as no daughter foreseen, used to lab
std::string EventBuilder::gConfPath;
const int specTacSize = 2000;
EventBuilder::EventBuilder(std::string name, unsigned int nque) :
nQueues(0), nevCount(0), oevCount(0),
evQue(NULL), evQueEvts(NULL), isGood(NULL), minEvnum(0), minTstamp(0), minChain(0),
......@@ -24,15 +29,17 @@ EventBuilder::EventBuilder(std::string name, unsigned int nque) :
sumbusL = 0;
sumbusR = 100;
minFold = 1;
verbose = false;
details = 0;
fVerbose = false;
fDetails = 0;
fActualClass = gActualClass = name;
fUseMultiHist = true;
#ifdef EVB_MULTIHIST
EvbSpecTdiff = NULL;
sTstamps = NULL;
EvbSpecTAC = NULL;
EvbTqueue = NULL;
sTstamps = NULL;
#endif //EVB_MULTIHIST
minTstamp = 0;
......@@ -45,7 +52,7 @@ EventBuilder::EventBuilder(std::string name, unsigned int nque) :
}
EventBuilder::~EventBuilder() {
if(details&2) {
if(fDetails&2) {
for(unsigned int nn = 0; nn < nQueues; nn++) {
if(evQue[nn].sTstDiff)
delete evQue[nn].sTstDiff;
......@@ -81,10 +88,10 @@ bool EventBuilder::Reset(int nque, int wminfold, int wsumbus, int zsumbus)
evQue[nn].inpKey = uKeyIn[nn];
else
evQue[nn].inpKey = 0;
if(details&2) {
if(fDetails&2) {
std::ostringstream sfn;
sfn << "EvB_tstdiff__000-UI__"+gActualClass+"_" << setfill('0') << setw(2) << nn << setfill(' ') << ".bdat";
evQue[nn].sTstDiff = new sAppend<UInt_t>(fOdirPrefix+sfn.str(), 2048);
sfn << "EvB_tstdiff__0-10000-I__"+gActualClass+"_" << setfill('0') << setw(2) << nn << setfill(' ') << ".bdat";
evQue[nn].sTstDiff = new sAppend<Int_t>(fOdirPrefix+sfn.str(), 10000);
evQue[nn].tstOld = 0;
}
}
......@@ -179,7 +186,7 @@ void EventBuilder::Process(void *obuffer, unsigned int osize, unsigned int *used
if(!goAhead)
return;
if(verbose) {
if(fVerbose) {
for(UInt_t nn = 0; nn < nQueues; nn++) {
evQueEvts[nn] = evQue[nn].numEvts; // number of events in queues before processing
}
......@@ -234,6 +241,7 @@ void EventBuilder::Process(void *obuffer, unsigned int osize, unsigned int *used
// Remove valid event-fragments from their input queue
// Send them to the output buffer if multiplicity condition is matched; discard otherwise
int qnum = 0;
for(UInt_t nn = 0; nn < nQueues; nn++) {
if(!isGood[nn])
continue;
......@@ -246,9 +254,13 @@ void EventBuilder::Process(void *obuffer, unsigned int osize, unsigned int *used
else {
#ifdef EVB_MULTIHIST
// before moving it out, increment the tstamp-diff spectrum
if(EvbSpecTdiff/* && nn != minChain*/) {
int tdiff = int(evQue[nn].getTstamp() - minTstamp);
EvbSpecTdiff->Incr(0, tdiff);
{
int tq = int(evQue[nn].getTstamp() - minTstamp);
if(EvbSpecTdiff && nn != minChain)
EvbSpecTdiff->Incr(tq);
EvbTqueue[qnum].first = nn; // savi ID and timestamp for EvbSpecTAC
EvbTqueue[qnum].second = tq;
qnum++;
}
#endif //EVB_MULTIHIST
// move it to the output buffer
......@@ -283,6 +295,23 @@ void EventBuilder::Process(void *obuffer, unsigned int osize, unsigned int *used
}
}
#ifdef EVB_MULTIHIST
// increment the TAC spectrum for all pairs in the event
if(EvbSpecTAC && qnum>1) {
for(int q1 = 0; q1 < qnum-1; q1++) {
int i1 = EvbTqueue[q1].first;
int t1 = EvbTqueue[q1].second;
for(int q2 = q1+1; q2 < qnum; q2++) {
int i2 = EvbTqueue[q2].first;
int t2 = EvbTqueue[q2].second;
EvbSpecTAC->Incr(i1, i2, t2-t1 + specTacSize/2);
EvbSpecTAC->Incr(i2, i1, t1-t2 + specTacSize/2);
}
}
}
#endif //EVB_MULTIHIST
// if event is good, update statistics and output buffer
if(numKeys >= minFold) {
nevCount++;
......@@ -323,7 +352,7 @@ void EventBuilder::Process(void *obuffer, unsigned int osize, unsigned int *used
cServer.Prompt(-1, oevCount, *used_osize, false);
cout << " tst = " << fixed << setprecision(1) << setw(8) << firstTstamp/double(tst1second);
const int chainsInPromptLine = 6;
if(verbose) {
if(fVerbose) {
if(nQueues > chainsInPromptLine) cout << endl << " ";
cout << " {";
for(UInt_t nn = 0; nn < nQueues; nn++) {
......@@ -453,6 +482,14 @@ void EventBuilder::CheckEvent_Tstamp()
minEvnum = 0xFFFFFFFF;
minTstamp = 0xFFFFFFFFFFFFFFFFULL;
minChain = 0xFFFFFFFF;
#if 0
// check timestamp order of head against next; swap the two events if out of order
for(UInt_t nn = 0; nn < nQueues; nn++) {
evQue[nn].checkOrder2();
}
#endif
for(UInt_t nn = 0; nn < nQueues; nn++) {
if(evQue[nn].hasData() && evQue[nn].tstFirst < minTstamp) {
minTstamp = evQue[nn].tstFirst;
......@@ -467,6 +504,7 @@ void EventBuilder::CheckEvent_Tstamp()
UInt_t dt = evQue[nn].hasData() ? UInt_t(evQue[nn].tstFirst-minTstamp) : 0;
sTstamps->add(dt);
}
//sTstamps->add(minTstamp);
sTstamps->add(UInt_t(minTstamp&0xFFFFFFFF));
sTstamps->add(UInt_t((minTstamp>>32)&0xFFFFFFFF));
}
......@@ -590,15 +628,27 @@ bool EventBuilder::InitBuilder()
#ifdef EVB_MULTIHIST
if(fUseMultiHist) {
hGroup.remove();
EvbSpecTdiff = new MultiHist<unsigned int>(1, 2000);
EvbSpecTdiff = new MultiHist<unsigned int>(2000);
EvbSpecTdiff->setFileName(fOdirPrefix+"Evb?"+gActualClass+".spec");
EvbSpecTdiff->setComment("timestamp differences");
hGroup.add(EvbSpecTdiff);
if(details&1) {
if(fDetails&1) {
std::ostringstream sfn;
sfn << "Evb__000-" << nQueues+2 << "-UI__";
sTstamps = new sAppend<UInt_t>(fOdirPrefix+sfn.str()+gActualClass+".bdat", 1000*(nQueues+2) );
sfn << "Evb_tqueues__0-" << nQueues+2 << "-UI__";
sTstamps = new sAppend<UInt_t>(fOdirPrefix+sfn.str()+gActualClass+".bdat", 10000*nQueues );
}
if(fDetails&4) {
EvbSpecTAC = new MultiHist<unsigned int>(nQueues, nQueues, specTacSize);
EvbSpecTAC->setFileName(fOdirPrefix+"Evb?TS.spec");
EvbSpecTAC->setComment("timestamp differences, pairwise");
hGroup.add(EvbSpecTAC);
}
EvbTqueue = new std::pair<int, int> [nQueues+2]; // some guard
}
#endif //EVB_MULTIHIST
......@@ -614,99 +664,92 @@ bool EventBuilder::InitBuilder()
UInt_t EventBuilder::GetParameters(Bool_t doList)
{
string className("EventBuilder");
GP_START(fActualClass, doList); // open setup file
GP_LOOP(); // line reading loop
GP_CONFPARAMS(); // parameters of this class
//GP_ALGOPARAMS(); // parameters of the daughter class
GP_ENDLOOP(); // end of loop actions
return 0;
}
void EventBuilder::ConfParameters(std::string keyw, std::string data, Bool_t &ok, Bool_t &found, Bool_t doList)
{
GP_PAR("ActualClass", "%s", "name of daughter class");
ok = data.size() > 0;
gActualClass = data;
//fActualClass = gActualClass = data;
GP_END;
GP_PAR("SaveDataDir", "%s", "where to write data and spectra");
ok = data.size() > 0;
fOdirPrefix = data;
forceTailSlash(fOdirPrefix);
GP_END;
GP_PAR("BuilderType", "%s %d [%d]", "builder type(TimeStamp | EventNumber) coincidence_window start_from(default = 0)");
string value;
stringSplit(data, keyw, value);
if( stringEq(keyw, "TimeStamp") ) {
string bType; int btV1(0), btV2(0);
string inpKey;
UInt_t ind1(0); int val1(0);
UInt_t ind2(0);
ConfReader conf;
conf.Add("ActualClass", "name of daughter class", &gActualClass);
conf.Add("SaveDataDir", "where to write data and spectra", &fOdirPrefix);
conf.Add("BuilderType", "builder type(TimeStamp | EventNumber) coincidence_window start_from(default = 0)", &bType, &btV1, &btV2);
conf.Add("KeyIn", "symbolic_name (e.g. data:psa)", &inpKey);
conf.Add("KeyOut", "symbolic_name (e.g. event:data:psa). 'None' to not have the surrounding frame", &sKeyOut);
conf.Add("MinFold", "minimum number of detectors for valid events", &minFold);
conf.Add("TimestampCorrect", "Queue Value", &ind1, &val1);
conf.Add("TimestampFixBug24", "Queue", &ind2);
conf.Add("Details", "bit1=tstamp_snapshot bit2=tstamp_diff for all input queues, bit3=TAC for all pairs", &fDetails);
conf.Add("NoMultiHist", "exclude flat binary spectra", &fUseMultiHist);
conf.Add("Verbose", "verbosity of printouts", &fVerbose);
// refine behaviour
//conf.SetCall("SaveDataDir", 0, forceTailSlash);
conf.Require("BuilderType", 2);
conf.Default("Details", 0, "1");
// decode the command file
string className = "EventBuilder";
if(doList) {conf.Show(className); return 0;}
string confFile = GetConfPath() + gMotherClass + ".conf";
int rv = conf.Read(className, confFile);
if(rv)
return rv; // Read() error
// check parameters
if(conf.Seen("BuilderType")) {
if( stringEq(bType, "TimeStamp") ) {
useEventNumber = false;
if(value.size() > 0) {
int v1, v2;
int nn = sscanf(value.c_str(), "%d %d", &v1, &v2);
if(nn > 0)
sumbusR = v1;
if(nn > 1)
sumbusL = v2;
}
ok = true;
if(conf.Count("BuilderType") > 1)
sumbusR = btV1;
if(conf.Count("BuilderType") > 2)
sumbusR = btV1;
}
else if( stringEq(keyw, "EventNumber") ) {
else if( stringEq(bType, "EventNumber") ) {
useEventNumber = true;
ok = true;
}
else {
ok = false;
cout << "BuilderType unknown " << bType << endl;
rv = 200;;
}
GP_END;
GP_PAR("KeyIn", "%s", "symbolic_name (e.g. data:psa)");
ok = (data.length() > 1);
sKeyIn.push_back(data);
GP_END;
GP_PAR("KeyOut", "%s", "symbolic_name (e.g. event:data:psa). 'None' to not have the surrounding frame");
ok = (data.length() > 1);
sKeyOut = data;
GP_END;
GP_PAR("MinFold", "%d", "minimum number of detectors for valid events");
ok = 1 == sscanf(data.c_str(), "%d", &minFold);
GP_END;
GP_PAR("TimestampCorrect", "%d %d", "Queue Value");
UInt_t ind(nQueues);
Int_t val(0);
ok = 2 == sscanf(data.c_str(), "%d %d", &ind, &val);
if(ok && ind < nQueues) {
vCorrection[ind] = val;
}
if(conf.Seen("KeyIn")) {
int which = conf.Find("KeyIn");
int times = conf.Times(which);
for(int nn = 0; nn < times; nn++) {
conf.Restore(which, nn);
sKeyIn.push_back(inpKey);
}
}
if(conf.Seen("TimestampCorrect")) {
int which = conf.Find("TimestampCorrect");
int times = conf.Times(which);
for(int nn = 0; nn < times; nn++) {
conf.Restore(which, nn);
if(ind1 >=0 && ind1< nQueues) {
vCorrection[ind1] = val1;
}
else {
cout << "TimestampCorrect wrong queue " << val1 << endl;
rv = 200;
}
}
GP_END;
GP_PAR("TimestampFixBug24", "%d", "Queue");
UInt_t ind(nQueues);
Int_t val(0);
ok = 1 == sscanf(data.c_str(), "%d", &ind);
if(ok && ind < nQueues) {
vCorrection[ind] = 0x7FFFFFFF;
}
if(conf.Seen("TimestampFixBug24")) {
int which = conf.Find("TimestampFixBug24");
int times = conf.Times(which);
for(int nn = 0; nn < times; nn++) {
conf.Restore(which, nn);
if(ind2 >=0 && ind2< nQueues) {
vCorrection[ind1] = 0x7FFFFFFF;
}
else {
cout << "TimestampFixBug24 wrong queue " << val1 << endl;
rv = 200;
}
}
GP_END;
GP_PAR("Details", "%d", "bit1=tstamp_snapshot for all events bit2=tstamp_diff for all input queues");
ok = 1 == sscanf(data.c_str(), "%d", &details);
GP_END;
GP_PAR("NoMultiHist", "", "exclude flat binary spectra");
fUseMultiHist = false;
ok = true;
GP_END;
}
GP_PAR("Verbose", "", "verbosity of printouts");
verbose = true;
ok = true;
GP_END;
return rv;
}
void EventBuilder::process_start ( UInt_t *error_code )
......
......@@ -28,6 +28,9 @@
// To allow going back to a self standing class, the simplifications (e.g. stop using separate pointers
// in the class actor and unification of process_start, process_stop, ...) are not done fully.
// The event-number has never been used and it would makes sense to remove it completely from the event builder
#define EVB_INHERITS_FROM_NARVAL_PRODUCER
#ifdef EVB_INHERITS_FROM_NARVAL_PRODUCER
......@@ -57,8 +60,8 @@ public:
ULong64_t sumbusL; // lower value of the time window ( see comments in CheckEvent_Tstamp() )
ULong64_t sumbusR; // upper value of the time window
Int_t minFold;
Int_t details;
Bool_t verbose;
Int_t fDetails;
Bool_t fVerbose;
std::vector<std::string> sKeyIn;
std::vector<unsigned int> uKeyIn;
......@@ -94,10 +97,13 @@ public:
bool fUseMultiHist;
#ifdef EVB_MULTIHIST
MultiHist<unsigned int> *EvbSpecTdiff;
MultiHistGroup hGroup; // used to record the pointers of all defined MultiHist spectra
sAppend<UInt_t> *sTstamps;
MultiHist<unsigned int> *EvbSpecTAC;
MultiHistGroup hGroup; // used to record the pointers of all defined MultiHist spectra
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
#endif //EVB_MULTIHIST
cycleServer cServer; // manager of cyclic operations for this EventBuilder
cycleServer cServer; // manager of cyclic operations for this EventBuilder