Commit 41680307 authored by Guillaume Baulieu's avatar Guillaume Baulieu
Browse files

Removing unused variables or useless assignement

parent 3d44a605
......@@ -183,7 +183,6 @@ void EventBuilder::PrintStat()
cout << endl;
}
double faver = double(totMult)/double(sumMult);
cout << " <mult> = ";
cout << fixed << setprecision(2) << setw(6) << double(totMult)/double(sumMult) << endl;
......@@ -697,7 +696,6 @@ bool EventBuilder::InitBuilder()
UInt_t EventBuilder::GetParameters(const std::string& confFile, Bool_t doList)
{
int btV1(0), btV2(0);
string inpKey;
string MandatoryinpKey;
UInt_t ind1(0); int val1(0);
......
......@@ -112,7 +112,6 @@ void TstampFilter::NextTstamp()
else {
// id timestamp
int id = -1;
int nr = 0;
while(true) {
while(true) {
int nn = fscanf(fTstampFILE, "%d %lld", &id, &fTimestamp);
......@@ -121,7 +120,6 @@ void TstampFilter::NextTstamp()
fTimestamp = 0xFFFFFFFFFFFFFFFFULL;
return;
}
nr++;
if(id != fMyId)
continue;
if(fTimestamp != tstOld) { // ignore repeated timestamps
......
......@@ -92,8 +92,8 @@ bool adetParams::ReadCalibCoeffs(std::string setupFile, bool verbose)
}
//int nn_segm = Reader.CountLines(keySegm);
keyTrig = Reader.LocateKey("trig"); // optional key
keyTntf = Reader.LocateKey("tntf"); // optional key
//keyTrig = Reader.LocateKey("trig"); // optional key
//keyTntf = Reader.LocateKey("tntf"); // optional key
//nn_trig = (keyTrig>=0) ? Reader.CountLines(keyTrig) : 0;
//nn_tntf = (keyTntf>=0) ? Reader.CountLines(keyTntf) : 0;
......@@ -309,14 +309,12 @@ bool adetParams::ReadRecalCoeffs(std::string setupFile, bool verbose)
cout << "Missing definition of \"core\" key for file " << setupFile << endl;
return false;
}
int nn_core = Reader.CountLines(keyCore);
int keySegm = Reader.LocateKey("segm"); // mandatory key
if(keySegm < 0) {
cout << "Missing definition of \"segm\" key for file " << setupFile << endl;
return false;
}
int nn_segm = Reader.CountLines(keySegm);
bool readOK = GetCalibCoeffs(verbose);
......
......@@ -673,7 +673,6 @@ void MWD::MWtimingCFD(float *fww, unsigned int& tsamp, float& fract)
tsamp = 0;
fract = 0;
float corr = 0; // correction to crossover if the signal is a constant slope
const float tZCmin = 10.f;
// TFA shaping
if(!nSmooth) {
......
......@@ -921,7 +921,7 @@ void PsaThread::operator()()
}
#else
// only once, exploiting its internal event loop
int retval = pPsa->Process(pBlock->First, pBlock->Count, thrn);
pPsa->Process(pBlock->First, pBlock->Count, thrn);
#endif
{
......
......@@ -609,7 +609,7 @@ int PSAFilterGridSearch::MakeChi2Metric()
if(iv<RMETRIC) mappedMetric[RMETRIC+iv] = fv;
if(fv > largest) largest = fv;
}
largest++; // this line is just to be able to set a breakpoint
//largest++; // this line is just to be able to set a breakpoint
}
#else // #if 0
// 1-exp(-d^2), which looks (to me) more natural than the biweight
......@@ -628,7 +628,7 @@ int PSAFilterGridSearch::MakeChi2Metric()
if(iv<RMETRIC) mappedMetric[RMETRIC+iv] = fv;
if(fv > largest) largest = fv;
}
largest++; // this line is just to be able to set a breakpoint
//largest++; // this line is just to be able to set a breakpoint
#endif // #else // #if 0
}
......@@ -720,7 +720,6 @@ void PSAFilterGridSearch::ProcessOneEvent(pointFull &PF, PsaSlot *pSlot)
pSlot->loopsTZero = 0;
pSlot->retValue = 0; // used to report fatal errors
int nCalled = 0;
int chiDone = 0;
bool lastLoop = (gTZeroLoops < 1) ? true : false; // only the final loop if no T0 adjustment
......@@ -763,7 +762,6 @@ void PSAFilterGridSearch::ProcessOneEvent(pointFull &PF, PsaSlot *pSlot)
int rv = ProcessTheEvent(PF /*, (rpt!=0)*/ );
chiDone += abs(rv);
nCalled++;
WRITEWORKINGWAVE((float *)PF.rAmplitude);
if(lastLoop)
......@@ -794,7 +792,6 @@ void PSAFilterGridSearch::ProcessOneEvent(pointFull &PF, PsaSlot *pSlot)
if(gTryTwoHits && gUseAdaptive) { // the second condition should be already in gTryTwoHits
int rv = ProcessTwoHits(PF);
chiDone += abs(rv);
nCalled++;
WRITEWORKINGWAVE((float *)PF.rAmplitude);
pSlot->chi2Best2h = PF.TotalResidualChi2();
pSlot->chi2Final = std::min(pSlot->chi2Best1h, pSlot->chi2Best2h);
......@@ -851,7 +848,7 @@ int PSAFilterGridSearch::ProcessTheEvent(pointFull &PF /*, bool doPartial*/ )
PF.bestPt1 = -1;
bool onlyCoarse = gCoarseOnly;
bool simplified = false;
bool simplified;
#ifdef SIMPLIFY_SMALL_ENERGIES
if(snum>1 && netChEner<lowSegEnergy) { // if mult>1 and the energy of this point is small, make only the coarse search
onlyCoarse = true; // the condition should be refined but this saves a lot of useless calculations
......@@ -950,13 +947,12 @@ int PSAFilterGridSearch::ProcessTwoHits(pointFull &PF)
// BE AWARE THAT THESE VALUES DEPEND ON THE METRICS !!!
// (in fact, they are not used anymore but kept in the code (commented) as a reminder)
const float chi2MinSeg = 100.f;
const float chi2MinTot = 2000.f;
//const float chi2MinSeg = 100.f;
//const float chi2MinTot = 2000.f;
// don't do it for low energies
const float segMinEner = 100.f;
int nCalled = 0;
int chiDone = 0;
//// global analysis (now a fake one)
......@@ -969,7 +965,7 @@ int PSAFilterGridSearch::ProcessTwoHits(pointFull &PF)
// will be recalculated after accepting 2 hits in a segment
float ch2Initial = CalcChi2Residue(PF);
float ch2Running = ch2Initial;
//float ch2Running = ch2Initial;
//if(ch2Initial < chi2MinTot)
// return chiDone;
......@@ -1040,7 +1036,6 @@ int PSAFilterGridSearch::ProcessTwoHits(pointFull &PF)
int rv = SearchAdaptive2(PF, netChSeg, onlyCoarse);
chiDone += abs(rv);
nCalled++;
// Here we should make further tests to decide if the 2-hit solution is better enough than the 1-hit
// e.g. check if the improvement of this segment results also in a global improvement ??
......@@ -1090,7 +1085,7 @@ int PSAFilterGridSearch::ProcessTwoHits(pointFull &PF)
if(PF.bestPt2 >= 0) {
// recalculate only for valid two-hits solutions
float ch2final = CalcChi2Residue(PF);
ch2Running = ch2final;
//ch2Running = ch2final;
numSegTwoHits++;
}
......@@ -1285,7 +1280,7 @@ float PSAFilterGridSearch::CalcChi2GridPts(int segNum, int ptNum, pointFull &PF)
{
char *lMask = PF.localMask;
pointPsa *pPtSeg = fBasis.segPts[segNum]; // the points of this segment
SignalBasis::cfgrid &sgrid = fBasis.cflist[segNum]; // the coarse-fine structure of this segment
//SignalBasis::cfgrid &sgrid = fBasis.cflist[segNum]; // the coarse-fine structure of this segment
float baseScale = PF.baseScale*RESCALE;
float chi2 = 0;
......@@ -2033,11 +2028,6 @@ int PSAFilterGridSearch::SearchAdaptive2(pointFull &PF, int netChSeg, bool bCoar
//const float ddMin = 13.f; // mm
//const float ffMin = 7.f; // mm
char *lMask = PF.localMask;
// the base points of this segment
pointPsa *pPtSeg = fBasis.segPts[netChSeg];
// the coarse-fine structure of this segment
SignalBasis::cfgrid &sgrid = fBasis.cflist[netChSeg];
......@@ -2046,7 +2036,6 @@ int PSAFilterGridSearch::SearchAdaptive2(pointFull &PF, int netChSeg, bool bCoar
float chi2min = h1_chi2min*h2Chi2Start; // Inital limit for chi2, respect to the 1-hit solution
int nInner = 0;
int chiDone = 0;
float chi2 = 0;
......@@ -2395,18 +2384,20 @@ void PSAFilterGridSearch::PreSearchCoarse(pointFull &PF)
WRITEWORKINGWAVE((float *)PF.wAmplitude);
// prepare sAmplitude from the subset of active segments
int nActive = MakeSearchWave(PF, 1.f, netChEner);
MakeSearchWave(PF, 1.f, netChEner);
WRITEPARTIALWAVE((float *)PF.sAmplitude, scaleFact);
PF.chi2min = float(1.e30);
PF.bestPt1 = -1;
/*
bool onlyCenter = false;
#ifdef SIMPLIFY_SMALL_ENERGIES
if(snum>1 && netChEner<lowSegEnergy) // if mult>1 and the energy of this point is small, make only the coarse search
onlyCenter = true; // the condition should be refined but this saves a lot of useless calculations
#endif
int ChiDone = SearchAdaptive1(PF, netChSeg, true, gPsaCenter);
*/
SearchAdaptive1(PF, netChSeg, true, gPsaCenter);
PF.resPt1[snum] = PF.bestPt1; // replace with new best point
PF.resPt2[snum] = -1; // no second point
......@@ -2803,7 +2794,6 @@ bool PSAFilterGridSearch::WriteBasisFull(const std::string& ext)
MultiHist<short> *baseXYZ = new MultiHist<short>((2*detRadius)/fineStep, (2*detRadius)/fineStep, detLength/fineStep, numTraces, BSIZE);
baseXYZ->setFileName(fOdirPrefix+"Psa?BaseXYZ.spec"+ext);
baseXYZ->setComment("the whole PSA signal basis");
int errcount = 0;
float bb[TCHAN][BSIZE];
float fact = 30000.f/MAXNORM;
for(int ns = 0; ns < NSEGS; ns++) {
......@@ -2830,8 +2820,6 @@ bool PSAFilterGridSearch::WriteBasisFull(const std::string& ext)
}
}
}
else
errcount++;
}
}
baseXYZ->write();
......@@ -2854,7 +2842,6 @@ bool PSAFilterGridSearch::WriteBasisSegments(int firstSeg, int lastSeg)
MultiHist<float> *baseXYZ = new MultiHist<float>(numPts, numTraces, BSIZE);
baseXYZ->setFileName(fOdirPrefix+"Psa?BaseXYZ.spec_"+std::string(chsnum));
baseXYZ->setComment("the PSA base of segment "+std::string(chsnum));
int errcount = 0;
float bb[TCHAN][BSIZE];
float fact = 1000.f/MAXNORM;
int indSpe = 0;
......@@ -2884,8 +2871,6 @@ bool PSAFilterGridSearch::WriteBasisSegments(int firstSeg, int lastSeg)
pd[-2] = bpt->y;
pd[-1] = bpt->z;
}
else
errcount++;
}
}
baseXYZ->write();
......
......@@ -265,7 +265,6 @@ void PostPSAFilter::process_initialise (UInt_t *error_code)
if(fSegCenterFile.length()) {
// read center of segments
string fname = fSegCenterFile;
bool readOK = ReadSegmentCenters();
if(!readOK) {
*error_code = 220;
......@@ -967,7 +966,6 @@ Int_t PostPSAFilter::Process()
pLoc->eSGcorr *= cFract;
sForce += pLoc->eSGcorr;
}
float sDelta = sForce - rSumSegs;
}
// 14) place hits at at the center of their segment
......@@ -1066,7 +1064,6 @@ Int_t PostPSAFilter::Process()
float fx = pLoc->fx; int ix = xAddrU(fx);
float fy = pLoc->fy; int iy = yAddrU(fy);
float fz = pLoc->fz; int iz = zAddrU(fz);
int slice90 = 91 + (pLoc->Sg%6);
PostMatrXYZ->Incr(0, matLen-1, ix, iy); // total projection
PostMatrXYZ->Incr(1, matLen-1, ix, iz); // total projection
PostMatrXYZ->Incr(2, matLen-1, iy, iz); // total projection
......
......@@ -208,7 +208,6 @@ UInt_t GRETINA::GT2ADF::ProcessBlock_sync(ADF::FrameBlock &oblock)
GRETINA::ConverterInfo result = theconverter->Run();
if ( oblock.GetSize() == 0 || result.eof ) {
int osize = oblock.GetSize();
if ( NewFile() == false )
GetFrameIO().SetStatus(ADF::BaseFrameIO::kFinished);
}
......@@ -219,8 +218,6 @@ UInt_t GRETINA::GT2ADF::ProcessBlock_sync(ADF::FrameBlock &oblock)
UInt_t GRETINA::GT2ADF::ProcessBlock_async(ADF::FrameBlock &oblock)
{
std::thread::id this_id = std::this_thread::get_id();
Log.ClearMessage(); Log.SetProcessMethod("ProcessBlock_async"); GRETINA::ConverterInfo result;
if (GetFrameIO().GetStatus() == ADF::BaseFrameIO::kFinished) {
......
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