Commit 75085f34 authored by Jérémie Dudouet's avatar Jérémie Dudouet
Browse files

Merge branch 'PPSA_LowEPatch' into 'preprod'

Apply the low energy path on smearing from E. Clement

See merge request IPNL_GAMMA/narval_emulator!80
parents 1b070c98 005f7a16
......@@ -3,6 +3,9 @@
* D.Mengoni
* D.Bazzacco
* F.Recchia
*
* ---- February 2021 --- Patch for Low energy in PostPsa
* E. Clement (GANIL)
*/
#include <iostream>
......@@ -353,7 +356,7 @@ UInt_t PostPSAFilter::GetParameters(const std::string& confFile, Bool_t doList)
, &fDetX, &fDetY, &fDetZ);
conf.Add("PackHits", "packing hits closer than this (0 == nopack)"
, &fPackDist);
conf.Add("SmearPos", "xyz uniform smearing of hits (usually the size of the PSA fine-grid"
conf.Add("SmearPos", "xyz uniform smearing of hits (usually the size of the PSA fine-grid), if negative, use the low energy patch"
, &fSmearPosHit);
conf.Add("RecalCC", "offset and gain adjustment for core"
, &fRecalEnerCCoffs, &fRecalEnerCCgain);
......@@ -742,6 +745,28 @@ Int_t PostPSAFilter::Process()
}
}
}
else if(fSmearPosHit < 0){// Specific treatment of the low energy -5Feb2021 - E.C (GANIL)
//printf("In the low energy patch \n");
int imod = max(int(fSmearPosHit*100.f), 2);
if(imod > 1) {
int ival = imod/2;
float fval = 1.f/ival;
for(UInt_t nh = 0; nh < number_of_hits; nh++) {
locHit_t *pLoc = locHit + nh;
if(!pLoc->valid)
continue;
pLoc->fx += (rand()%imod - ival)*fval; //
pLoc->fy += (rand()%imod - ival)*fval;
pLoc->fz += (rand()%imod - ival)*fval;
if(number_of_hits==1&&pLoc->eSGcorr<30&&pLoc->fz<10){
pLoc->fz=0.1; //force the position to 100 um - tested with 113Sn, 203Hg, 152Eu, 141Ce source
}
else if(number_of_hits==1&&pLoc->eSGcorr<100&&pLoc->fz<10){
pLoc->fz=0.5; //force the position to 500 um - tested with 113Sn, 203Hg, 152Eu, 141Ce source
}
}
}
}
// 5) apply timestamp-mask and calculate timestamp difference re previous event
timestamp &= tStampMask;
......
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