Subversion Repositories f9daq

Compare Revisions

Ignore whitespace Rev 180 → Rev 181

/lab/sipmscan/trunk/src/analysis.cpp
59,7 → 59,6
else if(analTab->GetCurrent() == 1) // Relative PDE
{
relPde->widgetChBox[0]->SetState(kButtonDown);
relPde->widgetChBox[1]->SetState(kButtonUp);
midPeak->widgetChBox[0]->SetState(kButtonUp);
zeroAngle->widgetNE[0]->SetNumber(0.00);
}
695,7 → 694,7
gVirtualX->Update(1);
 
// Check if the checkbox for no peaks is selected - TODO: Still need the situation when we do not have a peaked ADC spectrum
if(relPde->widgetChBox[1]->IsDown())
/* if(relPde->widgetChBox[1]->IsDown())
{
printf("PhotonMu(): ADC spectrum has no peak structure.\n");
nopeaks = 1;
712,7 → 711,7
return;
}
 
}
}*/
 
// Start if we select at least one file
if(nrfiles > 0)
1196,6 → 1195,7
// Get next point values (if zero value -> need to add the dark hist value again)
pointest[10] = angle[i];
pointest[11] = muval[i];
// printf("Last point = [%lf,%lf]\n", pointest[10], pointest[11]);
 
// Check if next point has larger error than acceptable (if yes, set exclude signal to true), reuse meansel[0]
meansel[0] = PointEstimate(5, pointest); // PointEstimate only works with very small step size
1205,6 → 1205,12
exclude = true;
}
 
if(isinf(meansel[0]))
{
printf("PhotonMu(): Point (%lf, %lf) excluded due to being infinite: %lf\n", pointest[10], pointest[11], meansel[0]);
exclude = true;
}
 
// Value with 0 angle and dark histogram are always needed, so should not be excluded
if(i == darkhist)
exclude = false;
1231,6 → 1237,8
pointest[2*m+1] = muval[i];
}
 
printf("Exclude signal = %d\n", (int)exclude);
 
// Run only if we have a dark run histogram and middle pedestal peak estimation
if( (darkhist != -1) && midPeak->widgetChBox[0]->IsDown() )
{
/lab/sipmscan/trunk/src/separate_functions.cpp
222,17 → 222,22
double A, B;
double esty;
 
// printf("PointEstimate points: ");
for(int i = 0; i < nrp; i++)
{
// printf("[%lf,%lf], ", points[2*i], points[2*i+1]);
accx += points[2*i];
accy += points[2*i+1];
accxy += points[2*i]*points[2*i+1];
accx2 += points[2*i]*points[2*i];
}
// printf("\n");
 
A = (accx2*accy - accx*accxy)/(nrp*accx2 - accx*accx);
B = (nrp*accxy - accx*accy)/(nrp*accx2 - accx*accx);
 
// printf("Fiting function = %lf + %lf*x\n", A, B);
 
esty = A + B*points[2*nrp];
 
if(DBGSIG) printf("PointEstimate(): A = %lf, B = %lf, estimate = %lf, real = %lf, error = %lf\n", A, B, esty, points[2*nrp+1], abs(esty - points[2*nrp+1])/points[2*nrp+1]);
/lab/sipmscan/trunk/src/sipmscan.cpp
924,7 → 924,7
fV1 = new TGCompositeFrame(fT1, subgroup[0], subgroup[1], kVerticalFrame | kFixedWidth | kFixedHeight);
 
// Check button to toggle normalization
if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *relPde -> 2 check buttons (relative pde, normalization)\n");
if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *relPde -> 1 check buttons (normalization)\n");
relPde = new TSubStructure();
checksel = new int;
*checksel = 1;