Commit b106f140 authored by dino's avatar dino
Browse files

Default number of Ge global spectra is 20;

Checking short-term pileup now controlled by configuration line:
PileUpCheck slope width

git-svn-id: svn://gal-serv.lnl.infn.it/agata/trunk/narval_emulator@1113 170316e4-aea8-4b27-aad4-0380ec0519c9
parent 5da85a46
......@@ -34,7 +34,7 @@ Frame: Agata data:crystal 4 0 Agata data:crystal 65000 0
Frame: Agata data:ccrystal 4 0 Agata data:ccrystal 65000 0
Frame: Agata data:ranc0 4 0 Agata data:ranc0 65000 0
Frame: Agata data:ranc1 4 0 Agata data:ranc1 65000 0
Frame: Agata data:psa 4 0 Agata data:psa 65000 1
Frame: Agata data:psa 4 0 Agata data:psa 0 0
Frame: Agata data:tracked 4 0 Agata data:tracked 0 0
Frame: Agata event:data 4 0 Agata event:data 4 0
Frame: Agata event:data:psa 4 0 Agata event:data:psa 4 0
......
......@@ -119,7 +119,6 @@ const int defTriggerSample = 10; // 60-10=50 samples passed to the PSA
//////// PreprocessingFilter ////////
/////////////////////////////////////
#define PPF_CHECK_EE_ES // Discard event if CC energy is too different from energy derived from trace amplitude
#define PPF_MULTIHIST // enable MultiHist spectra
//#define PPF_FromGRU // enable GRU/ViGRU
//#define PPF_IMPROVE_TSTAMP // PreprocessingFilter modifies the timestamp adding the T0 (in samples) of the trace
......@@ -160,7 +159,7 @@ const int defTriggerSample = 10; // 60-10=50 samples passed to the PSA
//////////////////////// Global Filters /////////////////////////////
/////////////////////////////////////////////////////////////////////
#define NUMGEDETS 15 // max acceptable value of crystal_id is NUMGEDETS-1 (used to limit the size of internal structures and spectra)
#define NUMGEDETS 20 // max acceptable value of crystal_id is NUMGEDETS-1 (used to limit the size of internal structures and spectra)
//////////////////////////
////// GlobalFilter //////
......
......@@ -56,6 +56,9 @@ PreprocessingFilter::PreprocessingFilter() :
fUnstableFactorS = 1; // 1267.5f/1332.5f; // main diagonal of CC-SumAllSegs if nothing in ATC2-G-A5
fOriginalEnergy = 0;
fPileUpSlope = 0.98f; // default parameters to reject short term
fPileUpDelta = 70.0f; // pile up in high counting rate parameters
fCFD_CC_int = 5;
fCFD_CC_diff = 8;
fCFD_CC_delay = 6;
......@@ -235,6 +238,9 @@ void PreprocessingFilter::GetParameters(UInt_t *error_code)
else if( stringEq(keyw, "SegmentFoldGate") ) {
ok = 2 == sscanf(data.c_str(), "%d %d", &fPrepFoldMin, &fPrepFoldMax);
}
else if( stringEq(keyw, "PileUpCheck") ) {
ok = 2 == sscanf(data.c_str(), "%f %f", &fPileUpSlope, &fPileUpDelta);
}
else if( stringEq(keyw, "CFDparamsCC") ) {
ok = 5 == sscanf(data.c_str(), "%d %d %d %f %f", &fCFD_CC_int, &fCFD_CC_diff, &fCFD_CC_delay, &fCFD_CC_fract, &fCFD_CC_thresh);
}
......
......@@ -76,6 +76,9 @@ protected:
Int_t fPrepFoldMin;
Int_t fPrepFoldMax;
Float_t fPileUpSlope;
Float_t fPileUpDelta;
Int_t fCFD_CC_int, fCFD_CC_diff;
Int_t fCFD_CC_delay;
Float_t fCFD_CC_fract;
......
......@@ -203,6 +203,8 @@ Int_t PreprocessingFilterPSA::AlgoSpecificInitialise()
if(fTFA) delete [] fTFA; fTFA = new float [defTraceLengthRaw]; memset(fTFA, 0, sizeof(float)*defTraceLengthRaw);
if(fCFD) delete [] fCFD; fCFD = new float [defTraceLengthRaw]; memset(fCFD, 0, sizeof(float)*defTraceLengthRaw);
checkPileUp = fPileUpSlope>0 && fPileUpDelta>0;
initPresort(); // local spectra
return 0;
......@@ -470,15 +472,17 @@ bool PreprocessingFilterPSA::initPresort()
#ifdef PPF_MULTIHIST
if(fUseMultiHist) {
PreMatrEeEtrCC = new MultiHist<unsigned short>(2, matPPdim, matPPdim);
PreMatrEeEtrCC->setFileName(fOdirPrefix+"Prep?EeEtrCC.matr");
PreMatrEeEtrCC->setComment("energy vs energy-from-traces for the triggering CC");
hGroup.add(PreMatrEeEtrCC);
//PreMatrEeEtr = new MultiHist<unsigned short>(CC.nSG+CC.nCC, matEEdim, matEEdim);
//PreMatrEeEtr->setFileName(fOdirPrefix+"Prep?EeEtr.matr");
//PreMatrEeEtr->setComment("energy vs energy-from-traces for segments and cores");
//hGroup.add(PreMatrEeEtr);
if(checkPileUp) {
PreMatrEeEtrCC = new MultiHist<unsigned short>(2, matPPdim, matPPdim);
PreMatrEeEtrCC->setFileName(fOdirPrefix+"Prep?EeEtrCC.matr");
PreMatrEeEtrCC->setComment("energy vs energy-from-traces for the triggering CC");
hGroup.add(PreMatrEeEtrCC);
//PreMatrEeEtr = new MultiHist<unsigned short>(CC.nSG+CC.nCC, matEEdim, matEEdim);
//PreMatrEeEtr->setFileName(fOdirPrefix+"Prep?EeEtr.matr");
//PreMatrEeEtr->setComment("energy vs energy-from-traces for segments and cores");
//hGroup.add(PreMatrEeEtr);
}
PreMatrEsEs = new MultiHist<unsigned short>(matSSdim*CC.nSG, matSSdim*CC.nSG);
PreMatrEsEs->setFileName(fOdirPrefix+"Prep?EsEs.matr");
......@@ -587,25 +591,21 @@ bool PreprocessingFilterPSA::ProcessEvent(int &segMult, float &eSumSG1, float
}
}
//// test if the core energy derived from the trace is close enough to the "good" energy of core
#ifdef PPF_CHECK_EE_ES
// This is a kind of pileup rejection, which helps rejecting pile-up events at high singles rate
// THESE LIMITS SHOULD BE REPLACED WITH PROPER CONFIGURATION PARAMETERS <=====================
const float purDelta = 70.0f;
const float purSlope = 0.98f;
float sCore = AverageValue(fTracesCC[iTR] + (nNsamp -2*nNbase), 2*nNbase);
//// Test if the core energy derived from the trace is close enough to the "good" energy of core
//// This is a kind of pileup rejection, which helps rejecting pile-up events at high singles rate
if(checkPileUp) {
float sCore = AverageValue(fTracesCC[iTR] + (nNsamp -2*nNbase), 2*nNbase);
#ifdef PPF_MULTIHIST
if(PreMatrEeEtrCC)
PreMatrEeEtrCC->Incr(0, (int)(matPPgain*eCore), (int)(matPPgain*sCore)); // all events
if(PreMatrEeEtrCC)
PreMatrEeEtrCC->Incr(0, (int)(matPPgain*eCore), (int)(matPPgain*sCore)); // all events
#endif
if(sCore+purDelta < eCore*purSlope) { // This check should be excluded if testing the BuiltinPulser (??)
if(sCore+fPileUpDelta < eCore*fPileUpSlope)
return false;
#ifdef PPF_MULTIHIST
if(PreMatrEeEtrCC)
PreMatrEeEtrCC->Incr(1, (int)(matPPgain*eCore), (int)(matPPgain*sCore)); // rejected events
#endif
return false;
}
#endif
//// calibrate segments and adjust their traces
float eSumSG0 = 0; // total sum, including subthreshold and negative cross-talk components
......
......@@ -55,6 +55,7 @@ private:
int segF2; // gate on segment multiplicity
bool firstEventPP;
bool checkPileUp;
float deadSegFactor; // down-scaling of core trace to consider xTalk correction
......
......@@ -340,7 +340,7 @@ def replaceMacros(ss, cr):
replace macros (as defined in MACROS) in string ss. If cr is a Ge crystal (e.g. 1R), its data
($CRYSTAL_ID and $SIGNAL_BASIS are extracted from GeDataBase and replaced before checking MACRO
"""
if len(cr) == 2: # 2 characters for the ge crystals
if cr[0].isdigit() and (len(cr) == 2 or len(cr)==3): # identifier of ge Crystals
dd = getGeData(cr)
ll = ss.replace("$CRYSTAL_ID", dd[0])
ll = ll.replace("$SIGNAL_BASIS", dd[1])
......
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