Commit 14ed635c authored by dino's avatar dino
Browse files

Modified the Timing section in PreprocessingFilterPSA

Added the possibility to use the differentiated net-charge signals the grid search

git-svn-id: svn://gal-serv.lnl.infn.it/agata/trunk/narval_emulator@844 170316e4-aea8-4b27-aad4-0380ec0519c9
parent 4cee2d10
......@@ -103,7 +103,7 @@ EventBuilder::EventBuilder(int nch) :
verbose = false;
bMerger = false;
Tdiff = NULL;
specTdiff = NULL;
tstKey1 = tstKey2 = 0;
numKey1 = numKey2 = numBad = badKey = 0;
......@@ -309,7 +309,7 @@ void EventBuilder::process_block( int ichain,
// before moving it out, increment the tstamp-diff spectrum
if(nn != minChain) {
int tdiff = int(evq[nn].getTstamp() - minTstamp);
Tdiff->Incr(0, tdiff);
specTdiff->Incr(0, tdiff);
}
// move it to the output buffer
i4fs = evq[nn].moveOut(obuf+opos);
......@@ -362,7 +362,7 @@ void EventBuilder::process_block( int ichain,
tdiff = 1000 - (int)(tstKey1-tstKey2);
else
tdiff = 1000 + (int)(tstKey2-tstKey1);
Tdiff->Incr(1, tdiff);
specTdiff->Incr(1, tdiff);
}
}
......@@ -676,10 +676,10 @@ void EventBuilder::process_initialise (UInt_t *error_code)
}
hGroup.remove();
Tdiff = new nDhist<unsigned int>(2, 2000);
Tdiff->setFileName(fOdirPrefix+"Evb?Tdiff.spec");
Tdiff->setComment("timestamp differences");
hGroup.add(Tdiff);
specTdiff = new nDhist<unsigned int>(2, 2000);
specTdiff->setFileName(fOdirPrefix+"Evb?specTdiff.spec");
specTdiff->setComment("timestamp differences");
hGroup.add(specTdiff);
cServer.SetCommandFile(fConfPath+gMotherClass+".live");
cServer.Start(&hGroup, gMotherClass);
......
......@@ -110,7 +110,7 @@ public:
cycleServer cServer; // manager of cyclic operations for event builder
cycleServer cServer2; // manager of cyclic operations for event merger
nDhist<unsigned int> *Tdiff;
nDhist<unsigned int> *specTdiff;
ULong64_t tstKey1, tstKey2;
......
......@@ -123,6 +123,7 @@ const int defTriggerSample = 10; // 60-10 useful samples passed to the PS
#define USEADAPTIVE // to use adaptive search
//#define USESUBSAMPLE // to enable the search on the time axis
// don't have yet the boost library on WIN64
#ifdef WIN64
# ifdef TCOUNT
......
......@@ -27,8 +27,8 @@ fTrigger("data:crystal")
{
fTraceLengthRaw = defTraceLengthRaw;
SpecAll = NULL;
MatrAll = NULL;
AncSpec_All = NULL;
AncMatr_All = NULL;
Converter = NULL;
......@@ -259,8 +259,8 @@ void AncillaryFilterATCA::MakeSpectra()
for(UInt_t indChan = 0; indChan < outDataLen; indChan++) {
int value = (int)outData[indChan];
if(value) {
if(SpecAll)
SpecAll->Incr(indChan, value);
if(AncSpec_All)
AncSpec_All->Incr(indChan, value);
#ifdef _FromGRU_
AllChan->Fill(value+4096*indChan);
#endif
......@@ -271,8 +271,8 @@ void AncillaryFilterATCA::MakeSpectra()
TxTy_Dante->Fill(DantePos[0], DantePos[1]);
#endif
if(MatrAll) {
float splen = (float)MatrAll->getLenSpec();
if(AncMatr_All) {
float splen = (float)AncMatr_All->getLenSpec();
float scale = 1.f; // adjust manually as needed
for(unsigned int n1 = 0; n1 < numSegs; n1++) {
Float_t xval1 = scale*outData[n1];
......@@ -281,7 +281,7 @@ void AncillaryFilterATCA::MakeSpectra()
if(n2==n1) continue;
Float_t xval2 = scale*outData[n2];
if(xval2<0 || xval2>=splen) continue;
MatrAll->incr(n1, n2, (int)xval1, (int)xval2);
AncMatr_All->incr(n1, n2, (int)xval1, (int)xval2);
}
}
}
......@@ -289,17 +289,17 @@ void AncillaryFilterATCA::MakeSpectra()
bool AncillaryFilterATCA::initPresort()
{
if(SpecAll) delete SpecAll;
SpecAll = new nDhist<unsigned int>(outDataLen, 4096);
SpecAll->setFileName(fOdirPrefix+"Spec?All.spec");
SpecAll->setComment("Projection of all parameters");
hGroup.add(SpecAll);
if(MatrAll) delete MatrAll;
//MatrAll = new nDhist<unsigned short>(numSegs, numSegs, 1000, 1000);
//MatrAll->setFileName(fOdirPrefix+"Matr?All.matr");
//MatrAll->setComment("Matrix of all pairs");
//hGroup.add(MatrAll);
if(AncSpec_All) delete AncSpec_All;
AncSpec_All = new nDhist<unsigned int>(outDataLen, 4096);
AncSpec_All->setFileName(fOdirPrefix+"Anc?All.spec");
AncSpec_All->setComment("Projection of all parameters");
hGroup.add(AncSpec_All);
if(AncMatr_All) delete AncMatr_All;
//AncMatr_All = new nDhist<unsigned short>(numSegs, numSegs, 1000, 1000);
//AncMatr_All->setFileName(fOdirPrefix+"Anc?All.matr");
//AncMatr_All->setComment("Matrix of all pairs");
//hGroup.add(AncMatr_All);
#ifdef _FromGRU_
TxTy_Dante = new TH2F("RawTimeX-RawTimeY_Dante", "RawTimeX-RawTimeY_Dante", 256,0,4096,256,0,4096);
......
......@@ -73,8 +73,8 @@ protected:
public:
nDhist<unsigned int >*SpecAll;
nDhist<unsigned short>*MatrAll;
nDhist<unsigned int >*AncSpec_All;
nDhist<unsigned short>*AncMatr_All;
Dante RotDante;
float DantePos[3]; // position in its frame
......
......@@ -29,7 +29,7 @@ const int pS = 4; //4 Side sections:A,B,C,D
AncillaryFilterVME::AncillaryFilterVME()
{
SpecAll = NULL;
AncSpec_All = NULL;
MatrAll_PRISMA = NULL;
MatrAll_DANTE = NULL;
fAllPairsMat = true;
......@@ -198,8 +198,8 @@ void AncillaryFilterVME::Projections()
for(UInt_t indChan = 0; indChan < numChan; indChan++) {
int value = (Int_t)cv->Value[indChan]; // should check what to do for scalers
if(value) {
if(SpecAll)
SpecAll->Incr(indMod, indChan, value);
if(AncSpec_All)
AncSpec_All->Incr(indMod, indChan, value);
#ifdef _FromGRU_
AllChan->Fill(value+indMod*4096*32+4096*indChan);
#endif
......@@ -292,17 +292,17 @@ void AncillaryFilterVME::Analysis()
bool AncillaryFilterVME::initPresort()
{
if(SpecAll) delete SpecAll;
SpecAll = new nDhist<unsigned int>(TotNumMod, 32, 4096);
SpecAll->setFileName(fOdirPrefix+"Spec?All.spec");
SpecAll->setComment("Projection of all parameters");
hGroup.add(SpecAll);
if(AncSpec_All) delete AncSpec_All;
AncSpec_All = new nDhist<unsigned int>(TotNumMod, 32, 4096);
AncSpec_All->setFileName(fOdirPrefix+"Spec?All.spec");
AncSpec_All->setComment("Projection of all parameters");
hGroup.add(AncSpec_All);
#ifdef AF_PRISMA
// if(MatrAll_PRISMA) delete MatrAll_PRISMA; MatrAll_PRISMA = NULL;
// if(fAllPairsMat && TotNumMod >= 3) {
// MatrAll_PRISMA = new nDhist<unsigned short>(3*32, 3*32, mtAllSize, mtAllSize);
// MatrAll_PRISMA->setFileName(fOdirPrefix+"Matr?All_PRISMA.matr");
// MatrAll_PRISMA->setFileName(fOdirPrefix+"Anc?All_PRISMA.matr");
// MatrAll_PRISMA->setComment("Matrix of all pairs");
// hGroup.add(MatrAll_PRISMA);
}
......@@ -312,7 +312,7 @@ bool AncillaryFilterVME::initPresort()
// if(fAllPairsMat && TotNumMod >= 5) {
// if(MatrAll_DANTE) delete MatrAll_DANTE; MatrAll_DANTE = NULL;
// MatrAll_DANTE = new nDhist<unsigned short>(2*32, 2*32, mtAllSize, mtAllSize);
// MatrAll_DANTE->setFileName(fOdirPrefix+"Matr?All_DANTE.matr");
// MatrAll_DANTE->setFileName(fOdirPrefix+"Anc?All_DANTE.matr");
// MatrAll_DANTE->setComment("Matrix of all pairs");
// hGroup.add(MatrAll_DANTE);
// }
......
......@@ -64,7 +64,7 @@ protected:
void Analysis();
public:
nDhist<unsigned int >*SpecAll;
nDhist<unsigned int >*AncSpec_All;
nDhist<unsigned short>*MatrAll_PRISMA;
nDhist<unsigned short>*MatrAll_DANTE;
......
......@@ -23,15 +23,6 @@
#include <ctime>
// riportato qui temporaneamente per non dover ricompilare tutto ogni volta
//#define TCOUNT 2 // number of threads to use to decompose signals
//#define TMODULO 100 // how many events are distributed to each thread
////#define WRITE_PSA_HITS // to write input hits in Francesco's imaging format
////#define USENETCHARGES // to use the net charge signals in the grid search
////#define USECORETRACE // to use also the core signal in the grid search
//#define USEADAPTIVE // to use adaptive search
////#define USESUBSAMPLE // to enable the search on the time axis
#ifndef TCOUNT // this must be defined
# define TCOUNT 1
#endif
......
......@@ -62,10 +62,17 @@ const int specLenT = 2*1000;
const int matLen = 100;
const int matOff = 50;
#ifdef USENETCHARGES
const int diffLag = 0; // use the net-charge signals as they are
#else
const int diffLag = 0; // use them with a delayed-differentiation (in units of signal samples) if !=0
//# define SHOWDIFFERENTIATED // in the saved traces show the differentiated version of the net-charge segments
#endif
PSAFilterGridSearch::PSAFilterGridSearch() :
fpPsaTraces(NULL), fpPsaHits(NULL),
specEner(NULL), tZero(NULL), sigma(NULL),
matPos(NULL), matSeg(NULL)
specEner(NULL), specTzero(NULL), specSigma(NULL),
matrXYZR(NULL), matrSeg(NULL)
{
bDoSpec = false;
bDoMats = false;
......@@ -157,33 +164,38 @@ Int_t PSAFilterGridSearch::AlgoSpecificInitialise()
}
}
if(diffLag > 0) {
// Modify the signal basis because the grid-search uses the differentiated net-charge signals
fBasis.DifferentiateNetChargeSignals(diffLag);
}
//specEner = new nDhist<unsigned int>(40, specLenE);
//specEner->setFileName(fOdirPrefix+"Psa?Ener.spec");
//specEner->setComment("Energy spectrum of segments and core");
//hGroup.add(specEner);
//tZero = new nDhist<unsigned int>(NCHAN, specLenT);
//tZero->setFileName(fOdirPrefix+"Psa?tZero.spec");
//tZero->setComment ("T90 and best dt (if relevant)");
//hGroup.add(tZero);
//specTzero = new nDhist<unsigned int>(NCHAN, specLenT);
//specTzero->setFileName(fOdirPrefix+"Psa?Tzero.spec");
//specTzero->setComment ("T90 and best dt (if relevant)");
//hGroup.add(specTzero);
//sigma = new nDhist<unsigned int>(NCHAN, specLenT);
//sigma->setFileName(fOdirPrefix+"Psa?sigma.spec");
//sigma->setComment ("chisquare");
//hGroup.add(sigma);
//specSigma = new nDhist<unsigned int>(NCHAN, specLenT);
//specSigma->setFileName(fOdirPrefix+"Psa?Sigma.spec");
//specSigma->setComment ("chisquare");
//hGroup.add(specSigma);
matPos = new nDhist<unsigned int>(2,10, matLen, matLen);
matPos->setFileName(fOdirPrefix+"Psa?XYZR.matr");
matPos->setComment("XY, XZ, YZ, rZ hits and XY hits as a function of Z");
hGroup.add(matPos);
matrXYZR = new nDhist<unsigned int>(2,10, matLen, matLen);
matrXYZR->setFileName(fOdirPrefix+"Psa?XYZR.matr");
matrXYZR->setComment("XY, XZ, YZ, rZ hits and XY hits as a function of Z");
hGroup.add(matrXYZR);
//matSeg = new nDhist<unsigned int>(NSEGS, 4, matLen, matLen);
//matSeg->setFileName(fOdirPrefix+"Psa?Seg.matr");
//matSeg->setComment("hits in the segments");
//hGroup.add(matSeg);
matrSeg = new nDhist<unsigned int>(NSEGS, 4, matLen, matLen);
matrSeg->setFileName(fOdirPrefix+"Psa?Seg.matr");
matrSeg->setComment("hits in the segments");
hGroup.add(matrSeg);
bDoSpec = specEner || tZero || sigma;
bDoMats = matPos || matSeg;
bDoSpec = specEner || specTzero || specSigma;
bDoMats = matrXYZR || matrSeg;
#ifdef WRITE_PSA_HITS
cout << "Opening PSA hits file " << "Psa_Hits.txt" << endl;
......@@ -202,7 +214,7 @@ Int_t PSAFilterGridSearch::AlgoSpecificInitialise()
if(fWriteNumTraces > 0) {
std::ostringstream filename;
filename << "Psa__" << fWriteNumTraces << "-2-37-" << fTraceLengthPSA << "-S__Traces.samp";
filename << "Psa__" << fWriteNumTraces << "-2-" << WCHAN << "-" << WSAMP << "-S__Traces.samp";
fnPsaTraces = fOdirPrefix+filename.str();
cout << "Opening PSA traces file " << fnPsaTraces << endl;
fpPsaTraces = fopen(fnPsaTraces.c_str(), "wb");
......@@ -210,8 +222,8 @@ Int_t PSAFilterGridSearch::AlgoSpecificInitialise()
cout << "Error: could not open " << fnPsaTraces << endl;
return 1;
}
memset(slot_fAmplitude, 0, sizeof(slot_fAmplitude)); // locally saved trace
memset(slot_rAmplitude, 0, sizeof(slot_rAmplitude)); // locally saved trace
memset(slot_fAmplitude, 0, sizeof(slot_fAmplitude)); // locally saved experimental trace
memset(slot_rAmplitude, 0, sizeof(slot_rAmplitude)); // locally saved "fitted" trace
}
return 0;
......@@ -253,8 +265,12 @@ Int_t PSAFilterGridSearch::Process(int slot)
if(fWriteNumTraces > 0)
memset(pS.rAmplitude, 0, sizeof(pS.rAmplitude));
// each net-charge segment is analysed independently
////////////////////////////////////////////////////////////////
// the loop on the independently-analysed net-charge segments //
////////////////////////////////////////////////////////////////
for(int snum = 0; snum < sMult; snum++) {
int netChSeg = pS.netChargeSegnum[snum];
float netChEner = pS.netChargeEnergy[snum];
......@@ -272,10 +288,21 @@ Int_t PSAFilterGridSearch::Process(int slot)
localMask[NCHAN-1] = '0';
#endif
if(diffLag > 0)
localMask[netChSeg] = '1'; // (ri)enable the segment-of-interest
// normalize the traces of this segment to the "standard" base amplitude MAXNORM
float fact = MAXNORM / netChEner;
pS.Normalize(fact, localMask);
if(diffLag > 0) {
// apply a delayed differentiation of diffLag samples
short *ptdata = pS.sAmplitude[netChSeg];
for(int nn = NTIME-1; nn >= diffLag; nn--) {
ptdata[nn] -= ptdata[nn - diffLag];
}
}
pS.chi2min = 2000000000.f;
pS.bestdt = 0;
pS.bestPt = -1;
......@@ -315,10 +342,22 @@ Int_t PSAFilterGridSearch::Process(int slot)
// traces
// The trace of the best point is normalized to the experimental amplitude and accumulated
if(fWriteNumTraces > 0) {
short netcharge[NTIME]; // to reconstruct the netcharge if grid-search is done using the differentiated net-charge signals.
fact = eScale/fact;
for(int segm = 0; segm < NCHAN; segm++) {
float * realTrace = pS.rAmplitude[segm];
short * baseTrace = fBasis.Pts[netChSeg][pS.bestPt].amplitude[segm];
#ifndef SHOWDIFFERENTIATED
// A complication when the grid-search is done using the differentiated net-charge signals.
// To simplify the implementation we have modified (differentiated )the net-charge signal in the basis.
// If, as here, the original trace is needed we reproduce it here by deconvolution of the differentiated one
if(diffLag > 0 && segm == netChSeg ) {
memcpy(netcharge, baseTrace, sizeof(netcharge));
for(int nn = 2*diffLag; nn < NTIME; nn++)
netcharge[nn] += netcharge[nn-2*diffLag];
baseTrace = netcharge;
}
#endif
int iTime0 = TSHIFT + pS.bestdt;
int iTime1 = NTIME-1; // plot using the whole signal
int iSamp = samp_first;// + iTime0/(SAMP_STEP/TIME_STEP);
......@@ -330,7 +369,7 @@ Int_t PSAFilterGridSearch::Process(int slot)
}
} // end of loop over the net charge segments
// store fAmplitude and sAmplitude to be able to write them in PostProcess
// store fAmplitude and rAmplitude to be able to write them in PostProcess
if(fWriteNumTraces > 0) {
short *sdata;
sdata = slot_fAmplitude[slot];
......@@ -345,6 +384,18 @@ Int_t PSAFilterGridSearch::Process(int slot)
for(int samp = 0; samp < NTIME; samp++)
*sdata++ = (short)( fdata[samp]); // escale already considered in the production
}
if(diffLag > 0) {
#ifdef SHOWDIFFERENTIATED
// reapply the delayed differentiation to the experimental net-charge segments
for(int snum = 0; snum < sMult; snum++) {
int netChSeg = pS.netChargeSegnum[snum];
short *ptd = slot_fAmplitude[slot] + NTIME*netChSeg;
for(int nn = NTIME-1; nn >= diffLag; nn--) {
ptd[nn] -= ptd[nn - diffLag];
}
}
#endif
}
}
return 0;
......@@ -422,32 +473,62 @@ void PSAFilterGridSearch::SetToSegCenter(PsaData *pD, pointExp *pS)
int PSAFilterGridSearch::WriteTraces(int slot)
{
// Twice NCHAN(=37) traces NTIME(=100) channels each: total event length is 7400 cannels
// Twice WCHAN traces SAMP channels each
if(!fpPsaTraces)
return 0;
short wbuf[WSAMP];
int rstat = 0;
size_t toWrite = NTIME;
if(NSAMP < toWrite) toWrite = NSAMP;
for(int ns = 0; ns < NCHAN; ns++) {
size_t nwritten = fwrite(&slot_fAmplitude[slot][ns*NTIME], sizeof(short), toWrite, fpPsaTraces);
int chanToCopy = NCHAN < WCHAN ? NCHAN : WCHAN;
int sampToCopy = NTIME < WSAMP ? NTIME : WSAMP;
size_t toWrite = WSAMP;
for(int ns = 0; ns < chanToCopy; ns++) {
memset(wbuf, 0, sizeof(wbuf));
memcpy(wbuf, &slot_fAmplitude[slot][ns*sampToCopy], sizeof(short)*sampToCopy);
size_t nwritten = fwrite(wbuf, sizeof(short), toWrite, fpPsaTraces);
if(nwritten != toWrite) {
rstat = 1;
fWriteNumTraces = 1;
goto finish;
}
}
if(chanToCopy < WCHAN) {
memset(wbuf, 0, sizeof(wbuf));
for(int ns = chanToCopy; ns < WCHAN; ns++) {
size_t nwritten = fwrite(wbuf, sizeof(short), toWrite, fpPsaTraces);
if(nwritten != toWrite) {
rstat = 1;
fWriteNumTraces = 1;
goto finish;
}
}
}
for(int ns = 0; ns < NCHAN; ns++) {
size_t nwritten = fwrite(&slot_rAmplitude[slot][ns*NTIME], sizeof(short), toWrite, fpPsaTraces);
for(int ns = 0; ns < chanToCopy; ns++) {
memset(wbuf, 0, sizeof(wbuf));
memcpy(wbuf, &slot_rAmplitude[slot][ns*sampToCopy], sizeof(short)*sampToCopy);
size_t nwritten = fwrite(wbuf, sizeof(short), toWrite, fpPsaTraces);
if(nwritten != toWrite) {
rstat = 1;
fWriteNumTraces = 1;
goto finish;
}
}
if(chanToCopy < WCHAN) {
memset(wbuf, 0, sizeof(wbuf));
for(int ns = chanToCopy; ns < WCHAN; ns++) {
size_t nwritten = fwrite(wbuf, sizeof(short), toWrite, fpPsaTraces);
if(nwritten != toWrite) {
rstat = 1;
fWriteNumTraces = 1;
goto finish;
}
}
}
finish:
fWriteNumTraces--;
......@@ -679,19 +760,21 @@ Int_t PSAFilterGridSearch::PostProcess(int slot)
if(bDoMats) {
// positions inside the crystal
float rr = sqrt(fx*fx + fy*fy);
int nz = (int)(fz/10);
if(matPos) {
matPos->Incr(0, 0, int(fx+matOff), int(fy+matOff));
matPos->Incr(0, 1, int(fx+matOff), int(fz ));
matPos->Incr(0, 2, int(fy+matOff), int(fz ));
matPos->Incr(0, 3, int(rr+matOff), int(fz ));
matPos->Incr(1, nz, int(fx+matOff), int(fy+matOff));
if(matrXYZR) {
int nz = (int)(fz/10);
int sz = netChSeg%6 + 4;
matrXYZR->Incr(0, 0, int(fx+matOff), int(fy+matOff));
matrXYZR->Incr(0, 1, int(fx+matOff), int(fz ));
matrXYZR->Incr(0, 2, int(fy+matOff), int(fz ));
matrXYZR->Incr(0, 3, int(rr+matOff), int(fz ));
matrXYZR->Incr(0, sz, int(fx+matOff), int(fy+matOff));
matrXYZR->Incr(1, nz, int(fx+matOff), int(fy+matOff));
}
if(matSeg) {
matSeg->Incr(netChSeg, 0, int(fx+matOff), int(fy+matOff));
matSeg->Incr(netChSeg, 1, int(fx+matOff), int(fz ));
matSeg->Incr(netChSeg, 2, int(fy+matOff), int(fz ));
matSeg->Incr(netChSeg, 3, int(rr+matOff), int(fz ));
if(matrSeg) {
matrSeg->Incr(netChSeg, 0, int(fx+matOff), int(fy+matOff));
matrSeg->Incr(netChSeg, 1, int(fx+matOff), int(fz ));
matrSeg->Incr(netChSeg, 2, int(fy+matOff), int(fz ));
matrSeg->Incr(netChSeg, 3, int(rr+matOff), int(fz ));
}
}
if(bDoSpec) {
......@@ -700,16 +783,16 @@ Int_t PSAFilterGridSearch::PostProcess(int slot)
specEner->Incr(netChSeg, (int)(netChEner*eScale));
specEner->Incr(39, netChSeg);
}
if(tZero) {
if(specTzero) {
// t0 after grid-search (possibly not up to date)
int bestdt = (int)(pD->theHits[nh].GetT()/TIME_STEP);
tZero->incr(netChSeg, bestdt+specLenT/2);
specTzero->incr(netChSeg, bestdt+specLenT/2);
}
if(sigma) {
if(specSigma) {
// chisquare of search
int chi2min = (int)(pD->theHits[nh].GetDT());
sigma->Incr(netChSeg, chi2min);
sigma->Incr(NCHAN-1, chi2min); // OR of all
specSigma->Incr(netChSeg, chi2min);
specSigma->Incr(NCHAN-1, chi2min); // OR of all
}
}
} // end of loop over hits
......@@ -724,12 +807,12 @@ Int_t PSAFilterGridSearch::PostProcess(int slot)
// to use this fragment of old code, maxItime, which calculated in
// the actual grid search method, must be declared at class level
//
//if(sigma && maxItime>0) {
//if(specSigma && maxItime>0) {
// //overall chi2 (needs room in the spectrum)
// float chi2 = pS.ChiSquare(maxItime);
// int isigma = (int)sqrt(chi2);
// sigma->incr(0, isigma);
// sigma->incr(sMult, isigma);
// specSigma->incr(0, isigma);
// specSigma->incr(sMult, isigma);
//}
cServer.Exec(pD->timestamp);
......
......@@ -30,8 +30,12 @@
/**
Coded by Roberto Venturelli
Ported first to Narval by Joa Ljungvall
*/
const int WCHAN = 42; // number of channels to write in the output waves
const int WSAMP = 100; // number of samples per channel
class PSAFilterGridSearch : public PSAFilter
{
private:
......@@ -43,10 +47,10 @@ private:
float fMetrics[NMETRIC];
nDhist<unsigned int> *specEner;
nDhist<unsigned int> *tZero;
nDhist<unsigned int> *sigma;
nDhist<unsigned int> *matPos;
nDhist<unsigned int> *matSeg;
nDhist<unsigned int> *specTzero;
nDhist<unsigned int> *specSigma;
nDhist<unsigned int> *matrXYZR;
nDhist<unsigned int> *matrSeg;
std::string fnPsaTraces;
FILE *fpPsaTraces;
......@@ -85,8 +89,8 @@ public:
private:
// this is needed to have the possibility to write the traces in a thread-safe mode
short slot_fAmplitude[TCOUNT*TMODULO][NCHAN*NTIME]; // locally saved trace
short slot_rAmplitude[TCOUNT*TMODULO][NCHAN*NTIME]; // locally saved "fitted" trace
short slot_fAmplitude[TCOUNT*TMODULO][NCHAN*NTIME]; // locally saved experimental trace
short slot_rAmplitude[TCOUNT*TMODULO][NCHAN*NTIME]; // locally saved "fitted" trace
};
......
......@@ -17,7 +17,7 @@ const int MAXNORM = 30000; // normalization of the traces for the sea
const int SAMP_STEP = 10; // (ns) time step of the experimental data
const int BASE_STEP = 2; // (mm) grid step of the signal basis
const int TIME_STEP = 5; // (ns) time step of the signal basis
const int TIME_STEP = 5; // (ns) time step of the signal basis ==> should be a divisor of SAMP_STEP !!
const int NTIME = 100; // number of points of the basis signals (100*5ns = 500ns)
const int TSHIFT = 5; // the "T0" (samples) of the calculated traces
......
......@@ -791,7 +791,7 @@ bool SignalBasis::AssignIt(float px, float py, float pz, float cx, float cy, flo
float dz = pz - cz; if(dz < 0) dz = -dz;
bool inside = (dx < cstep && dy < cstep && dz < cstep);
#else
// all points inside the sphere of radius cstep centered on this coarse grid poing
// all points inside the sphere of radius cstep centered on this coarse grid point</